@skill-graph/cli 0.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (330) hide show
  1. package/CHANGELOG.md +247 -0
  2. package/LICENSE +200 -0
  3. package/NOTICE +62 -0
  4. package/README.md +398 -0
  5. package/SKILL_GRAPH.md +443 -0
  6. package/bin/skill-graph.js +374 -0
  7. package/docs/ADOPTION.md +117 -0
  8. package/docs/CONFORMANCE.md +66 -0
  9. package/docs/PRIMER.md +384 -0
  10. package/docs/QUICKSTART-30MIN.md +333 -0
  11. package/docs/ROUTING-METRICS.md +120 -0
  12. package/docs/SKILL-MD-FORMAT-COMPATIBILITY.md +127 -0
  13. package/docs/SKILL_AUDIT_CHECKLIST.md +199 -0
  14. package/docs/SKILL_AUDIT_LOOP.md +195 -0
  15. package/docs/SKILL_METADATA_PROTOCOL.md +609 -0
  16. package/docs/_archived/marketplace-publication-priority-2026-05-18.md +239 -0
  17. package/docs/adr/0001-predicate-set.md +69 -0
  18. package/docs/adr/0002-json-ld-context.md +82 -0
  19. package/docs/adr/0003-ontoclean-rigidity-tags.md +65 -0
  20. package/docs/adr/0004-persistent-identifiers.md +74 -0
  21. package/docs/adr/0005-freshness-consolidation.md +70 -0
  22. package/docs/adr/0006-revise-predicate-rename.md +105 -0
  23. package/docs/adr/0007-audit-loop-cadence.md +99 -0
  24. package/docs/adr/0008-skill-surface-split-and-curation-policy.md +93 -0
  25. package/docs/category-consumers.md +168 -0
  26. package/docs/concept-map.md +194 -0
  27. package/docs/diagrams/drift-states.mmd +21 -0
  28. package/docs/diagrams/manifest-pipeline.mmd +25 -0
  29. package/docs/diagrams/routing-harness.mmd +41 -0
  30. package/docs/diagrams/starter-graph.mmd +53 -0
  31. package/docs/field-decision-guide.md +315 -0
  32. package/docs/field-rationale.md +211 -0
  33. package/docs/field-reference.generated.md +624 -0
  34. package/docs/field-reference.md +1426 -0
  35. package/docs/glossary.md +190 -0
  36. package/docs/head-noun-glossary.md +63 -0
  37. package/docs/images/audit-phases.png +0 -0
  38. package/docs/images/drift-states.png +0 -0
  39. package/docs/images/graded-mode.png +0 -0
  40. package/docs/images/manifest-pipeline.png +0 -0
  41. package/docs/images/routing-harness.png +0 -0
  42. package/docs/images/skill-anatomy.png +0 -0
  43. package/docs/images/starter-graph.png +0 -0
  44. package/docs/images/system-model.png +0 -0
  45. package/docs/integrations/github-actions.md +155 -0
  46. package/docs/manifest-field-mapping.md +443 -0
  47. package/docs/marketplace-publication-queue.generated.md +240 -0
  48. package/docs/marketplace-release-agent-prompt.md +82 -0
  49. package/docs/marketplace-skill-candidate-list.md +272 -0
  50. package/docs/marketplace-syndication.md +222 -0
  51. package/docs/migration-sample-review.md +155 -0
  52. package/docs/migrations/v4-to-v5.md +168 -0
  53. package/docs/migrations/v5-to-v6.md +221 -0
  54. package/docs/name-exceptions.yaml +37 -0
  55. package/docs/plans/marketplace-p1-public-migration-plan.md +41 -0
  56. package/docs/plans/multi-root-workspace.md +148 -0
  57. package/docs/plans/scripts-roadmap.md +107 -0
  58. package/docs/plans/v4-schema-bump.md +160 -0
  59. package/docs/plans/wave-2-extraction.md +122 -0
  60. package/docs/positioning-vs-marketplaces.md +175 -0
  61. package/docs/proposals/skill-audit-loop-positioning.md +160 -0
  62. package/docs/quality-doctrine.md +138 -0
  63. package/docs/recommended-skills.md +150 -0
  64. package/docs/research/skill-comprehension-eval-research.md +1830 -0
  65. package/docs/research/skill-retrieval-evidence.md +66 -0
  66. package/docs/skill-metadata-protocol.md +471 -0
  67. package/docs/skills-sh-maintainer-cleanup-request.md +80 -0
  68. package/examples/audits/a11y/findings.md +52 -0
  69. package/examples/audits/a11y/scorecard.md +21 -0
  70. package/examples/audits/a11y/verdict.md +44 -0
  71. package/examples/audits/debugging/findings.md +59 -0
  72. package/examples/audits/debugging/scorecard.md +22 -0
  73. package/examples/audits/debugging/verdict.md +33 -0
  74. package/examples/audits/documentation/findings.md +59 -0
  75. package/examples/audits/documentation/scorecard.md +22 -0
  76. package/examples/audits/documentation/verdict.md +33 -0
  77. package/examples/evals/a11y.json +140 -0
  78. package/examples/evals/api-design.json +52 -0
  79. package/examples/evals/code-review.json +52 -0
  80. package/examples/evals/data-modeling.json +52 -0
  81. package/examples/evals/database-migration.json +52 -0
  82. package/examples/evals/debugging.json +118 -0
  83. package/examples/evals/dependency-architecture.json +52 -0
  84. package/examples/evals/design-system-architecture.json +52 -0
  85. package/examples/evals/error-tracking.json +52 -0
  86. package/examples/evals/event-contract-design.json +52 -0
  87. package/examples/evals/form-ux-architecture.json +52 -0
  88. package/examples/evals/framework-fit-analysis.json +52 -0
  89. package/examples/evals/graph-audit.json +139 -0
  90. package/examples/evals/information-architecture.json +52 -0
  91. package/examples/evals/interaction-feedback.json +52 -0
  92. package/examples/evals/interaction-patterns.json +52 -0
  93. package/examples/evals/layout-composition.json +52 -0
  94. package/examples/evals/lint-overlay.json +117 -0
  95. package/examples/evals/microcopy.json +52 -0
  96. package/examples/evals/observability-modeling.json +52 -0
  97. package/examples/evals/pattern-recognition.json +96 -0
  98. package/examples/evals/performance-engineering.json +52 -0
  99. package/examples/evals/refactor.json +128 -0
  100. package/examples/evals/semiotics.json +52 -0
  101. package/examples/evals/skill-infrastructure.json +96 -0
  102. package/examples/evals/skill-router.json +140 -0
  103. package/examples/evals/skill-router.routing.json +113 -0
  104. package/examples/evals/system-interface-contracts.json +52 -0
  105. package/examples/evals/task-analysis.json +52 -0
  106. package/examples/evals/testing-strategy.json +118 -0
  107. package/examples/evals/type-safety.json +249 -0
  108. package/examples/evals/visual-design-foundations.json +52 -0
  109. package/examples/evals/webhook-integration.json +52 -0
  110. package/examples/exports/a11y.skill-md.md +80 -0
  111. package/examples/exports/debugging.skill-md.md +80 -0
  112. package/examples/exports/refactor.skill-md.md +78 -0
  113. package/examples/exports/testing-strategy.skill-md.md +81 -0
  114. package/examples/projects/markdown-static-site/README.md +115 -0
  115. package/examples/projects/markdown-static-site/skills/content-source-router/SKILL.md +131 -0
  116. package/examples/projects/markdown-static-site/skills/image-optimization-pipeline-config/SKILL.md +132 -0
  117. package/examples/projects/markdown-static-site/skills/link-rot-detection/SKILL.md +103 -0
  118. package/examples/projects/markdown-static-site/skills/markdown-post-frontmatter-validation/SKILL.md +133 -0
  119. package/examples/projects/markdown-static-site/skills/migrate-posts-to-v2-frontmatter/SKILL.md +140 -0
  120. package/examples/projects/saas-stripe-postgres/README.md +208 -0
  121. package/examples/projects/saas-stripe-postgres/db/migrations/0004_canonicalize_orders.sql +37 -0
  122. package/examples/projects/saas-stripe-postgres/db/schema.sql +112 -0
  123. package/examples/projects/saas-stripe-postgres/skills/migrate-orders-to-canonical-schema/SKILL.md +149 -0
  124. package/examples/projects/saas-stripe-postgres/skills/nextjs-server-action-validation/SKILL.md +154 -0
  125. package/examples/projects/saas-stripe-postgres/skills/payment-provider-router/SKILL.md +153 -0
  126. package/examples/projects/saas-stripe-postgres/skills/postgres-rls-pattern/SKILL.md +163 -0
  127. package/examples/projects/saas-stripe-postgres/skills/stripe-webhook-signature-verification/SKILL.md +137 -0
  128. package/examples/protocol/skill-metadata-template.md +301 -0
  129. package/examples/protocol/skills.manifest.sample.json +13245 -0
  130. package/examples/skill-metadata-template.md +317 -0
  131. package/examples/skills.manifest.sample.json +13519 -0
  132. package/examples/tests/v3-1-skos-fixture/SKILL.md +93 -0
  133. package/marketplace/README.md +17 -0
  134. package/marketplace/skills/a11y/SKILL.md +66 -0
  135. package/marketplace/skills/acid-fundamentals/SKILL.md +106 -0
  136. package/marketplace/skills/agent-engineering/SKILL.md +386 -0
  137. package/marketplace/skills/agent-eval-design/SKILL.md +55 -0
  138. package/marketplace/skills/ai-native-development/SKILL.md +294 -0
  139. package/marketplace/skills/api-design/SKILL.md +60 -0
  140. package/marketplace/skills/architecture-decision-records/SKILL.md +55 -0
  141. package/marketplace/skills/background-jobs/SKILL.md +265 -0
  142. package/marketplace/skills/bounded-context-mapping/SKILL.md +55 -0
  143. package/marketplace/skills/cap-theorem-tradeoffs/SKILL.md +127 -0
  144. package/marketplace/skills/client-server-boundary/SKILL.md +187 -0
  145. package/marketplace/skills/code-review/SKILL.md +120 -0
  146. package/marketplace/skills/color-system-design/SKILL.md +43 -0
  147. package/marketplace/skills/component-architecture/SKILL.md +126 -0
  148. package/marketplace/skills/compression/SKILL.md +112 -0
  149. package/marketplace/skills/conceptual-modeling/SKILL.md +181 -0
  150. package/marketplace/skills/connection-pooling/SKILL.md +105 -0
  151. package/marketplace/skills/constraint-awareness/SKILL.md +287 -0
  152. package/marketplace/skills/content-monitor/SKILL.md +209 -0
  153. package/marketplace/skills/context-engineering/SKILL.md +320 -0
  154. package/marketplace/skills/context-graph/SKILL.md +174 -0
  155. package/marketplace/skills/context-management/SKILL.md +174 -0
  156. package/marketplace/skills/context-window/SKILL.md +239 -0
  157. package/marketplace/skills/contract-testing/SKILL.md +120 -0
  158. package/marketplace/skills/cron-scheduling/SKILL.md +223 -0
  159. package/marketplace/skills/dark-mode-implementation/SKILL.md +47 -0
  160. package/marketplace/skills/data-modeling/SKILL.md +59 -0
  161. package/marketplace/skills/data-modeling-fundamentals/SKILL.md +117 -0
  162. package/marketplace/skills/database-migration/SKILL.md +429 -0
  163. package/marketplace/skills/debugging/SKILL.md +67 -0
  164. package/marketplace/skills/dependency-architecture/SKILL.md +58 -0
  165. package/marketplace/skills/design-module-composition/SKILL.md +43 -0
  166. package/marketplace/skills/design-system-architecture/SKILL.md +61 -0
  167. package/marketplace/skills/design-thinking/SKILL.md +44 -0
  168. package/marketplace/skills/diagnosis/SKILL.md +296 -0
  169. package/marketplace/skills/diff-analysis/SKILL.md +188 -0
  170. package/marketplace/skills/e2e-test-design/SKILL.md +113 -0
  171. package/marketplace/skills/entity-relationship-modeling/SKILL.md +218 -0
  172. package/marketplace/skills/epistemic-grounding/SKILL.md +112 -0
  173. package/marketplace/skills/error-boundary/SKILL.md +235 -0
  174. package/marketplace/skills/error-tracking/SKILL.md +261 -0
  175. package/marketplace/skills/eval-driven-development/SKILL.md +147 -0
  176. package/marketplace/skills/evaluation/SKILL.md +113 -0
  177. package/marketplace/skills/event-contract-design/SKILL.md +60 -0
  178. package/marketplace/skills/event-storming/SKILL.md +56 -0
  179. package/marketplace/skills/form-ux-architecture/SKILL.md +60 -0
  180. package/marketplace/skills/framework-fit-analysis/SKILL.md +59 -0
  181. package/marketplace/skills/frontend-architecture/SKILL.md +43 -0
  182. package/marketplace/skills/generative-ui/SKILL.md +118 -0
  183. package/marketplace/skills/graph-audit/SKILL.md +81 -0
  184. package/marketplace/skills/guardrails/SKILL.md +118 -0
  185. package/marketplace/skills/hooks-patterns/SKILL.md +185 -0
  186. package/marketplace/skills/http-semantics/SKILL.md +136 -0
  187. package/marketplace/skills/ideation/SKILL.md +41 -0
  188. package/marketplace/skills/indexing-strategy/SKILL.md +108 -0
  189. package/marketplace/skills/information-architecture/SKILL.md +59 -0
  190. package/marketplace/skills/integration-test-design/SKILL.md +111 -0
  191. package/marketplace/skills/intent-recognition/SKILL.md +136 -0
  192. package/marketplace/skills/interaction-feedback/SKILL.md +59 -0
  193. package/marketplace/skills/interaction-patterns/SKILL.md +59 -0
  194. package/marketplace/skills/journey-mapping/SKILL.md +41 -0
  195. package/marketplace/skills/keywords/SKILL.md +213 -0
  196. package/marketplace/skills/knowledge-modeling/SKILL.md +232 -0
  197. package/marketplace/skills/layout-composition/SKILL.md +59 -0
  198. package/marketplace/skills/linguistics/SKILL.md +429 -0
  199. package/marketplace/skills/lint-overlay/SKILL.md +76 -0
  200. package/marketplace/skills/mental-models/SKILL.md +126 -0
  201. package/marketplace/skills/merge-queue/SKILL.md +94 -0
  202. package/marketplace/skills/methodology/SKILL.md +317 -0
  203. package/marketplace/skills/microcopy/SKILL.md +232 -0
  204. package/marketplace/skills/middleware-patterns/SKILL.md +363 -0
  205. package/marketplace/skills/mobile-responsive-ux/SKILL.md +287 -0
  206. package/marketplace/skills/mutation-testing/SKILL.md +112 -0
  207. package/marketplace/skills/naming-conventions/SKILL.md +112 -0
  208. package/marketplace/skills/observability-modeling/SKILL.md +59 -0
  209. package/marketplace/skills/ontology-modeling/SKILL.md +67 -0
  210. package/marketplace/skills/owasp-security/SKILL.md +153 -0
  211. package/marketplace/skills/pattern-recognition/SKILL.md +472 -0
  212. package/marketplace/skills/performance-budgets/SKILL.md +185 -0
  213. package/marketplace/skills/performance-engineering/SKILL.md +58 -0
  214. package/marketplace/skills/performance-testing/SKILL.md +125 -0
  215. package/marketplace/skills/printify/SKILL.md +42 -0
  216. package/marketplace/skills/prioritization/SKILL.md +118 -0
  217. package/marketplace/skills/problem-framing/SKILL.md +41 -0
  218. package/marketplace/skills/problem-locating-solving/SKILL.md +203 -0
  219. package/marketplace/skills/project-knowledge-extraction/SKILL.md +54 -0
  220. package/marketplace/skills/prompt-craft/SKILL.md +134 -0
  221. package/marketplace/skills/prompt-injection-defense/SKILL.md +132 -0
  222. package/marketplace/skills/property-based-testing/SKILL.md +100 -0
  223. package/marketplace/skills/prototyping/SKILL.md +43 -0
  224. package/marketplace/skills/query-optimization/SKILL.md +144 -0
  225. package/marketplace/skills/real-time-updates/SKILL.md +324 -0
  226. package/marketplace/skills/ref-patterns/SKILL.md +284 -0
  227. package/marketplace/skills/refactor/SKILL.md +65 -0
  228. package/marketplace/skills/rendering-models/SKILL.md +142 -0
  229. package/marketplace/skills/replication-patterns/SKILL.md +110 -0
  230. package/marketplace/skills/research-synthesis/SKILL.md +41 -0
  231. package/marketplace/skills/route-handler-design/SKILL.md +347 -0
  232. package/marketplace/skills/schema-evolution/SKILL.md +140 -0
  233. package/marketplace/skills/security-fundamentals/SKILL.md +139 -0
  234. package/marketplace/skills/semantic-center/SKILL.md +194 -0
  235. package/marketplace/skills/semantic-relations/SKILL.md +250 -0
  236. package/marketplace/skills/semantics/SKILL.md +366 -0
  237. package/marketplace/skills/semiotics/SKILL.md +230 -0
  238. package/marketplace/skills/seo-strategy/SKILL.md +260 -0
  239. package/marketplace/skills/server-actions-design/SKILL.md +243 -0
  240. package/marketplace/skills/server-components-design/SKILL.md +190 -0
  241. package/marketplace/skills/sharding-strategy/SKILL.md +123 -0
  242. package/marketplace/skills/shopify/SKILL.md +42 -0
  243. package/marketplace/skills/skill-infrastructure/SKILL.md +320 -0
  244. package/marketplace/skills/skill-router/SKILL.md +71 -0
  245. package/marketplace/skills/skill-scaffold/SKILL.md +105 -0
  246. package/marketplace/skills/snapshot-testing/SKILL.md +120 -0
  247. package/marketplace/skills/spec-driven-development/SKILL.md +148 -0
  248. package/marketplace/skills/state-machine-modeling/SKILL.md +56 -0
  249. package/marketplace/skills/state-management/SKILL.md +134 -0
  250. package/marketplace/skills/streaming-architecture/SKILL.md +194 -0
  251. package/marketplace/skills/summarization/SKILL.md +156 -0
  252. package/marketplace/skills/suspense-patterns/SKILL.md +265 -0
  253. package/marketplace/skills/system-interface-contracts/SKILL.md +59 -0
  254. package/marketplace/skills/task-analysis/SKILL.md +201 -0
  255. package/marketplace/skills/taxonomy-design/SKILL.md +66 -0
  256. package/marketplace/skills/test-coverage-strategy/SKILL.md +108 -0
  257. package/marketplace/skills/test-doubles-design/SKILL.md +98 -0
  258. package/marketplace/skills/test-driven-development/SKILL.md +96 -0
  259. package/marketplace/skills/testing-strategy/SKILL.md +67 -0
  260. package/marketplace/skills/theme-system-design/SKILL.md +43 -0
  261. package/marketplace/skills/tool-call-flow/SKILL.md +229 -0
  262. package/marketplace/skills/tool-call-strategy/SKILL.md +292 -0
  263. package/marketplace/skills/transaction-isolation/SKILL.md +98 -0
  264. package/marketplace/skills/type-safety/SKILL.md +177 -0
  265. package/marketplace/skills/typography-system/SKILL.md +43 -0
  266. package/marketplace/skills/usability-testing/SKILL.md +43 -0
  267. package/marketplace/skills/user-research/SKILL.md +43 -0
  268. package/marketplace/skills/vercel-composition-patterns/SKILL.md +157 -0
  269. package/marketplace/skills/version-control/SKILL.md +233 -0
  270. package/marketplace/skills/visual-design-foundations/SKILL.md +59 -0
  271. package/marketplace/skills/visual-hierarchy/SKILL.md +43 -0
  272. package/marketplace/skills/webhook-integration/SKILL.md +331 -0
  273. package/marketplace/skills/writing-humanizer/SKILL.md +380 -0
  274. package/package.json +67 -0
  275. package/schemas/manifest.schema.json +811 -0
  276. package/schemas/manifest.v2.schema.json +164 -0
  277. package/schemas/manifest.v3.schema.json +758 -0
  278. package/schemas/manifest.v4.schema.json +755 -0
  279. package/schemas/manifest.v5.schema.json +755 -0
  280. package/schemas/manifest.v6.schema.json +811 -0
  281. package/schemas/skill.context.jsonld +279 -0
  282. package/schemas/skill.schema.json +919 -0
  283. package/schemas/skill.v2.schema.json +201 -0
  284. package/schemas/skill.v3.schema.json +827 -0
  285. package/schemas/skill.v4.schema.json +822 -0
  286. package/schemas/skill.v5.schema.json +830 -0
  287. package/schemas/skill.v6.schema.json +946 -0
  288. package/schemas/vocabulary/keywords.json +180 -0
  289. package/schemas/vocabulary/workspace_tags.json +23 -0
  290. package/scripts/__tests__/migrate-skill-v2-to-v3.test.js +161 -0
  291. package/scripts/__tests__/migrate-skill-v3-to-v4.test.js +158 -0
  292. package/scripts/__tests__/test-export-parser-drift.js +149 -0
  293. package/scripts/__tests__/test-marketplace-export.js +114 -0
  294. package/scripts/__tests__/test-router-paths.js +82 -0
  295. package/scripts/__tests__/test-stability-promotion.js +244 -0
  296. package/scripts/__tests__/test-v3-1-alias-contract.js +109 -0
  297. package/scripts/__tests__/test-v3-1-skos-runtime.js +116 -0
  298. package/scripts/backfill-schema-version.js +198 -0
  299. package/scripts/build-field-reference.js +160 -0
  300. package/scripts/build-retrieval-baseline.js +511 -0
  301. package/scripts/check-markdown-links.js +211 -0
  302. package/scripts/check-protocol-consistency.js +979 -0
  303. package/scripts/export-marketplace-skills.js +610 -0
  304. package/scripts/export-skill.js +374 -0
  305. package/scripts/generate-manifest.js +787 -0
  306. package/scripts/lib/alias-contract.js +83 -0
  307. package/scripts/lib/audit-prompt-builder.js +771 -0
  308. package/scripts/lib/mock-grader.js +134 -0
  309. package/scripts/lib/parse-frontmatter.js +429 -0
  310. package/scripts/lib/roots.js +119 -0
  311. package/scripts/lint/check-archetype-sections.js +185 -0
  312. package/scripts/lint/check-category-enum.js +83 -0
  313. package/scripts/lint/check-routing-eval.js +146 -0
  314. package/scripts/lint/check-routing-quality.js +211 -0
  315. package/scripts/lint/check-stability-promotion.js +220 -0
  316. package/scripts/lint/format-code-frame.js +206 -0
  317. package/scripts/marketplace-install.js +125 -0
  318. package/scripts/migrate-category-to-enum.js +169 -0
  319. package/scripts/migrate-skill-v2-to-v3.js +424 -0
  320. package/scripts/migrate-skill-v3-to-v4.js +200 -0
  321. package/scripts/migrate-skill-v5-to-v6.js +304 -0
  322. package/scripts/restructure-by-category.js +85 -0
  323. package/scripts/seed-publication-classification.js +282 -0
  324. package/scripts/skill-audit.js +893 -0
  325. package/scripts/skill-graph-drift.js +483 -0
  326. package/scripts/skill-graph-route.js +766 -0
  327. package/scripts/skill-graph-routing-eval.js +393 -0
  328. package/scripts/skill-lint.js +1317 -0
  329. package/scripts/skill-overlap.js +213 -0
  330. package/scripts/verify-skill-md-export.js +201 -0
@@ -0,0 +1,194 @@
1
+ # Skill Graph Concept Map
2
+
3
+ > **Status:** Reality-aligned teaching reference as of **2026-04-20** (schema_version 4).
4
+ > **Source of truth precedence:** `schemas/skill.v4.schema.json` > `docs/field-reference.md` > this file.
5
+ > **Purpose:** Explain the 40-field Skill Metadata Protocol frontmatter at a conceptual level without inventing structure that the schema does not actually enforce. If this file disagrees with the schema, the schema wins — fix this file.
6
+
7
+ ## What kind of graph is this?
8
+
9
+ Skill Graph is a **property graph with a controlled-vocabulary set of typed predicates**, not an RDF knowledge graph. Nodes are skills. Edges are the keys inside `relations.*`. Node attributes are the 40 top-level authored frontmatter fields. A JSON-LD `@context` (`schemas/skill.context.jsonld`) projects the property graph into SKOS / Dublin Core / PROV-O triples for consumers that want RDF semantics, but authoring stays in flat YAML.
10
+
11
+ Skill Graph does **not** promise:
12
+
13
+ - Automated inference (no OWL reasoner runs against the graph)
14
+ - Open-world consistency checking (the schema closes it via `additionalProperties: false`)
15
+ - SPARQL queryability as the primary interface (you get that by applying the JSON-LD `@context` first)
16
+
17
+ What it does promise: deterministic lint, manifest generation, relation-aware routing, drift detection against content-addressable truth sources, and portable export to SKILL.md.
18
+
19
+ ## The 40 authored fields — grouped by role
20
+
21
+ The fields split into nine conceptual groups. This grouping is a teaching aid only — the schema groups by *requiredness* (always required / required-for-archetype / required-for-scope / optional). See `docs/skill-metadata-protocol.md § Requiredness Groups` for the authoritative grouping.
22
+
23
+ The exact field count:
24
+
25
+ - **40 top-level authored fields** — the number authors write in YAML frontmatter, including compatibility aliases.
26
+ - **13 required-for-all fields** — every skill must populate these.
27
+ - **5 conditionally-required fields** — unlocked by `type: overlay`, `scope: codebase`, `stability: deprecated`, `comprehension_state: present`, plus `keywords` for routable skills.
28
+ - **18 optional enrichment fields** — including the full nested sub-fields inside `relations`, `grounding`, `portability`, `compatibility`, `lifecycle`, `runtime_telemetry`, and concept/eval receipts.
29
+
30
+ When you see "possible fields" counted anywhere, that is the count including nested sub-fields and v3.1 aliases individually. The 40 count refers to canonical top-level authored keys only.
31
+
32
+ ### Identity (5 fields, 4 required, 1 optional)
33
+
34
+ The identity of the skill — what it is, who it is, which version of itself.
35
+
36
+ | Field | Cardinality | Role | W3C mapping |
37
+ |---|---|---|---|
38
+ | `name` | one | Stable identifier; the handle other skills point at | `dcterms:identifier` |
39
+ | `urn` | one | Optional globally unique persistent identifier | `dcterms:identifier` |
40
+ | `description` | one | Routing contract — *when* to activate, not *what* the skill covers | `dcterms:description` |
41
+ | `version` | one | Semver of the skill content itself | `dcterms:hasVersion` |
42
+ | `owner` | one | Maintenance accountability | `dcterms:creator` |
43
+
44
+ ### Classification (6 fields, 4 required, 2 optional)
45
+
46
+ The kind of skill and where it lives in the library.
47
+
48
+ | Field | Cardinality | Role | Required? |
49
+ |---|---|---|---|
50
+ | `schema_version` | one | Contract version - currently `4` | always |
51
+ | `type` | one enum | Archetype — `capability`, `workflow`, `router`, `overlay` | always |
52
+ | `scope` | one enum | Locality — `portable`, `reference`, `codebase` | always |
53
+ | `category` | one | Flat browse bucket (e.g. `engineering`, `knowledge`) | always |
54
+ | `domain` | one slash-path | Hierarchical domain path (e.g. `ecommerce/integrations/shopify`) | optional |
55
+ | `stability` | one enum | `experimental`, `stable`, `frozen`, `deprecated` | optional |
56
+ | `superseded_by` | one | Replacement skill when deprecated | required if `stability: deprecated` |
57
+
58
+ ### Health & drift (4 fields, 2 required, 2 optional)
59
+
60
+ Whether the skill is fresh, verified, and monitored. The two required fields (`freshness`, `drift_check`) answer different questions; lifecycle and telemetry add maintenance policy and live feedback when available.
61
+
62
+ | Field | Cardinality | Question it answers | Required? |
63
+ |---|---|---|---|
64
+ | `freshness` | one ISO date | "When was this last editorially reviewed?" | always |
65
+ | `drift_check` | one object (`last_verified` + `truth_source_hashes?`) | "When was this last verified against truth sources, and do the source hashes still match?" | always |
66
+ | `lifecycle` | one object (`stale_after_days?` + `review_cadence?`) | "How fast does this rot, and how often should it be re-verified?" | optional |
67
+ | `runtime_telemetry` | one object (`feedback_source` + `metrics?`) | "What do real-world runs say about whether this works?" | optional |
68
+
69
+ Proposal for v4: collapse `freshness` + `drift_check.last_verified` + `lifecycle.stale_after_days` into two primitives (`asserted_at` + `stale_after`). Tracked in the v4 roadmap.
70
+
71
+ ### Eval health (5 fields, 3 required, 2 optional)
72
+
73
+ Three independent axes of eval status. A skill can be at any point in the 3×3×2 product of these enums.
74
+
75
+ | Field | Axis | Values |
76
+ |---|---|---|
77
+ | `eval_artifacts` | Does an eval file exist on disk? | `none` \| `planned` \| `present` |
78
+ | `eval_state` | Have the evals been run and passed? | `unverified` \| `passing` \| `monitored` |
79
+ | `routing_eval` | Is routing explicitly evaluated? | `absent` \| `present` |
80
+ | `comprehension_state` | Is concept comprehension explicitly evaluated? | `absent` \| `present` |
81
+ | `concept` | What concept model supports comprehension grading? | seven-field teaching block |
82
+ | `eval_last_run` | What concrete run supports the current eval claim? | `{ at, status, receipt? }` |
83
+
84
+ ### Activation & routing (7 fields, 1 conditionally-required, 6 optional)
85
+
86
+ How the skill surfaces to a router. The three trigger fields (`triggers`, `keywords`, `examples`) answer routing at three different specificities.
87
+
88
+ | Field | Cardinality | Role |
89
+ |---|---|---|
90
+ | `triggers` | many | Exact phrase or label triggers |
91
+ | `keywords` | many | Semantic keywords for fuzzy matching — required when skill is routable (`scope: codebase` or non-empty `routing_bundles`) |
92
+ | `examples` | many | Positive-class activation prompts (few-shot retrieval targets) |
93
+ | `anti_examples` | many | Negative-class prompts (hard negatives for boundary discrimination) |
94
+ | `paths` | many glob patterns | File-surface activation |
95
+ | `workspace_tags` | many | Project affiliation (literal handles or semantic tags) |
96
+ | `routing_bundles` | many | Query-time overlapping bundles (`quality`, `integrations`) |
97
+
98
+ ### Relations (one object, up to 8 predicate keys, each optional)
99
+
100
+ Typed edges to sibling skills. Lint verifies every target exists.
101
+
102
+ | Predicate | Cardinality | Semantics | W3C mapping |
103
+ |---|---|---|---|
104
+ | `adjacent` *(deprecated alias)* / `related` | many skill names | Symmetric "co-read" relation | `skos:related` |
105
+ | `depends_on` | many; string or `{skill, min_version}` | Pragmatic prerequisite | `dcterms:requires` |
106
+ | `verify_with` | many | Co-load for verification | `prov:wasInformedBy` |
107
+ | `boundary` | many; string or `{skill, reason}` | Routing-layer anti-ownership handoff | `sg:disjointOwnership` |
108
+ | `disjoint_with` *(v3.1)* | many; string or `{skill, reason}` | Formal class-disjointness assertion | `owl:disjointWith` |
109
+ | `broader` *(v3.1)* | many | Cross-skill generalisation — target is more general | `skos:broader` |
110
+ | `narrower` *(v3.1)* | many | Cross-skill specialisation — target is more specific | `skos:narrower` |
111
+
112
+ `adjacent` remains valid through v3.x as a deprecated alias of `related`; the v4 bump removes it in favour of the SKOS-aligned name. `boundary` remains canonical for routing-layer handoff. ADR 0001 records the `adjacent` rename; ADR 0006 records the `boundary` / `disjoint_with` split.
113
+
114
+ ### Inheritance (1 field, conditionally required)
115
+
116
+ | Field | Cardinality | Role |
117
+ |---|---|---|
118
+ | `extends` | one skill name | Parent skill being specialised — required when `type: overlay` |
119
+
120
+ Skill Graph supports single-parent inheritance only. For an overlay that needs to inherit concepts from two parents, express the secondary axis as `depends_on`. The OntoClean rigidity constraints for overlays are documented in ADR 0003.
121
+
122
+ ### Grounding (1 object, 5 required sub-fields — conditional on `scope: codebase`)
123
+
124
+ Ties the skill to hashable artifacts and documents the trust hierarchy.
125
+
126
+ | Sub-field | Cardinality | Role |
127
+ |---|---|---|
128
+ | `grounding.domain_object` | one | Primary artifact the skill describes |
129
+ | `grounding.grounding_mode` | one enum | `repo_specific` \| `universal` \| `hybrid` |
130
+ | `grounding.truth_sources` | many strings or anchored objects | Authoritative files, line ranges, or anchors |
131
+ | `grounding.failure_modes` | many | Known degradation modes |
132
+ | `grounding.evidence_priority` | one enum | `repo_code_first` \| `general_knowledge_first` \| `equal` |
133
+
134
+ Drift hash semantics: `drift_check.truth_source_hashes` maps each normalized truth-source key to a SHA-256 digest at the time of last verification. Keys are `path` for whole-file sources, `path#Lstart-Lend` for line ranges, and `path#anchor` for anchor-only sources. Directories cannot be hashed; local truth sources must resolve to files, while URL truth sources are valid references but are not fetched by the zero-dependency sentinel. The drift sentinel (`scripts/skill-graph-drift.js`) reports `DRIFT` when live hash differs from recorded, `BROKEN` when a local source is missing, `STALE` when `last_verified + lifecycle.stale_after_days < today`, `NO_BASELINE` when local truth sources are declared but no hashes are recorded, and `EXTERNAL_UNHASHED` for URL truth sources.
135
+
136
+ ### Cross-cutting portability & standards (5 fields, all optional)
137
+
138
+ Artifact-level metadata.
139
+
140
+ | Field | Cardinality | Role |
141
+ |---|---|---|
142
+ | `license` | one | SPDX identifier (e.g. `MIT`, `Apache-2.0`) |
143
+ | `compatibility` | one object (`runtimes?`, `node?`, `notes?`) | Runtime environment |
144
+ | `allowed-tools` | one space-separated string | Pre-approved tool allowlist |
145
+ | `portability.readiness` | one enum | `declared` \| `scripted` \| `verified` — operational export readiness |
146
+ | `portability.targets` | many, currently `["skill-md"]` only | Export destinations |
147
+ | `urn` *(v3.1, optional)* | one | Global persistent identifier — `urn:skill:<repo>:<name>`. Target: required in v4. |
148
+
149
+ ## The four orthogonal classification axes (carefully qualified)
150
+
151
+ Skill Graph classifies along **three strictly-orthogonal axes plus one partially-coupled axis**. The concept map's earlier claim of "four orthogonal axes" overstated the orthogonality of `routing_bundles`.
152
+
153
+ | Axis | Field | Orthogonality | Question |
154
+ |---|---|---|---|
155
+ | Scope | `scope` | Strict — `portable`/`reference`/`codebase` do not overlap | Where does this apply? |
156
+ | Taxonomy | `category` + `category` | Strict — one flat bucket, one tree path | What kind of concern is this? |
157
+ | Project affiliation | `workspace_tags` | Strict — multiple tags allowed, no hierarchy | Which projects use this? |
158
+ | Routing bundle | `routing_bundles` | **Partially coupled to taxonomy** — `quality`, `integrations`, etc. are often functions of *what the skill is*, not *when it fires* | Which query-time bundle does this join? |
159
+
160
+ The taxonomy-vs-routing-group coupling is intentional for ergonomics (a router can say "load all `quality` skills") but means the fourth axis is not a strict Ranganathan facet. Keep the distinction in mind when adding routing groups: if the group is redundant with the skill's category, use the category alone.
161
+
162
+ ## Archetype → body-section requirements
163
+
164
+ The `type` field binds to required H2 sections in the SKILL.md body. This is enforced by `scripts/skill-lint.js`.
165
+
166
+ | Archetype | Required H2 sections | OntoClean rigidity (see ADR 0003) |
167
+ |---|---|---|
168
+ | `capability` | `## Coverage`, `## Philosophy`, `## Verification`, `## Do NOT Use When` | +R +I +U -D |
169
+ | `workflow` | `## Coverage`, `## Philosophy`, `## Workflow`, `## Verification`, `## Do NOT Use When` | +R +I +U -D |
170
+ | `router` | `## Coverage`, `## Routing Rules`, `## Do NOT Use When` | ~R -I ~U +D |
171
+ | `overlay` | `## Coverage`, `## Overlay Rules`, `## Extends`, `## Do NOT Use When` | -R -I -U +D |
172
+
173
+ ## How the concept map differs from earlier drafts (drift log)
174
+
175
+ An earlier concept map (pre-2026-04-20) contained six inaccuracies now corrected here:
176
+
177
+ 1. Claimed "5 metadata layers" as canonical — corrected to "9 conceptual groups" with an explicit note that the schema groups by requiredness.
178
+ 2. Listed 9 identity fields including `schema_version`/`stability`/`superseded_by` — corrected to 4 identity fields (`name`, `description`, `version`, `owner`) with the other fields moved to Classification.
179
+ 3. Described `drift_check` as a scalar date — corrected to object (v3 shape, schema-enforced).
180
+ 4. Called the axes "4 orthogonal" — corrected to "3 strictly orthogonal + 1 partially coupled".
181
+ 5. Stated the field count without distinguishing authored-vs-possible — clarified that the current schema has 36 canonical top-level authored fields, while aliases and nested sub-field counts are separate measures.
182
+ 6. Omitted the 6-field-required-for-all set (`category`, `freshness`, `drift_check`, `eval_artifacts`, `eval_state`, `routing_eval`) — restored and grouped under Health & drift and Eval health.
183
+
184
+ ## References
185
+
186
+ - `schemas/skill.v4.schema.json` — pinned v3 schema (source of truth for types and requiredness)
187
+ - `schemas/skill.context.jsonld` — JSON-LD `@context` for W3C interoperability
188
+ - `docs/skill-metadata-protocol.md` — requiredness groups, archetype section map, schema strictness
189
+ - `docs/field-reference.md` — per-field semantics (authoritative prose)
190
+ - `docs/field-decision-guide.md` — decision tables
191
+ - `docs/adr/0001-predicate-set.md` — predicate evolution decision
192
+ - `docs/adr/0002-json-ld-context.md` — W3C vocabulary mapping decision
193
+ - `docs/adr/0003-ontoclean-rigidity-tags.md` — archetype rigidity semantics
194
+ - `docs/adr/0004-persistent-identifiers.md` — URN scheme for v4
@@ -0,0 +1,21 @@
1
+ stateDiagram-v2
2
+ direction LR
3
+ [*] --> NO_BASELINE: skill declares<br/>grounding.truth_sources<br/>but truth_source_hashes absent
4
+ NO_BASELINE --> OK: --record --apply<br/>writes SHA-256 hashes
5
+ OK --> STALE: today − last_verified<br/>> lifecycle.stale_after_days
6
+ OK --> DRIFT: any live SHA-256<br/>≠ recorded hash
7
+ OK --> BROKEN: truth_source file<br/>missing on disk
8
+ STALE --> OK: author re-verifies<br/>bumps last_verified
9
+ STALE --> DRIFT: detected during re-verify
10
+ DRIFT --> OK: content re-verified<br/>--record --apply rewrites hashes
11
+ BROKEN --> OK: truth source restored<br/>--record --apply rewrites hashes
12
+ DRIFT --> BROKEN: truth source deleted<br/>before re-verify
13
+
14
+ note right of OK
15
+ Hashes match
16
+ within lifecycle window
17
+ end note
18
+ note right of NO_BASELINE
19
+ schema-valid but
20
+ unverifiable — fix first
21
+ end note
@@ -0,0 +1,25 @@
1
+ flowchart LR
2
+ Skills["<b>skills/&#42;/SKILL.md</b><br/>+ examples/skill-metadata-template.md<br/>authored frontmatter"]
3
+ Config[".skill-graph/config.json<br/>workspace roots + projects<br/><i>optional — falls back to skills/</i>"]
4
+ Parse["<b>parse-frontmatter.js</b><br/>YAML → object"]
5
+ Rename["<b>generate-manifest.js</b><br/>apply rename map<br/>group under activation / health"]
6
+ Hash["<b>SHA-256</b><br/>hash each grounding.truth_sources<br/>compute health.drift_detected"]
7
+ Validate{{"<b>ajv + manifest.schema.json</b><br/>additionalProperties: false"}}
8
+ Manifest["<b>skills.manifest.json</b><br/>compiled artifact"]
9
+
10
+ Skills --> Parse
11
+ Config -.-> Rename
12
+ Parse --> Rename --> Hash --> Validate
13
+ Validate -->|pass| Manifest
14
+ Validate -->|fail| Error((("exit 1")))
15
+
16
+ classDef input fill:#dbeafe,stroke:#2563eb,color:#1e3a8a
17
+ classDef tool fill:#ecfdf5,stroke:#047857,color:#064e3b
18
+ classDef gate fill:#fce7f3,stroke:#db2777,color:#831843
19
+ classDef artifact fill:#fef3c7,stroke:#d97706,color:#78350f
20
+ classDef err fill:#fee2e2,stroke:#b91c1c,color:#7f1d1d
21
+ class Skills,Config input
22
+ class Parse,Rename,Hash tool
23
+ class Validate gate
24
+ class Manifest artifact
25
+ class Error err
@@ -0,0 +1,41 @@
1
+ flowchart LR
2
+ Start(["For each skill S<br/>in manifest"])
3
+ HasCases{{"S has examples[]<br/>or anti_examples[]?"}}
4
+ Skip(["SKIP<br/>no cases"])
5
+ Pos["Positive cases<br/>S.examples[]"]
6
+ Neg["Negative cases<br/>S.anti_examples[]"]
7
+ Route1["skill-graph-route<br/>top-1 winner"]
8
+ Route2["skill-graph-route<br/>top-1 winner"]
9
+ WinEq{{"winner === S?"}}
10
+ WinBound{{"winner === S?<br/>winner &isin; S.boundary?<br/>winner === null?"}}
11
+ PosPass(["PASS<br/>positive"])
12
+ PosFail(["FAIL<br/>positive"])
13
+ NegPass(["PASS<br/>negative"])
14
+ NegFail(["FAIL<br/>negative"])
15
+ Gap(["COVERAGE_GAP<br/>informational"])
16
+
17
+ Start --> HasCases
18
+ HasCases -->|no| Skip
19
+ HasCases -->|yes| Pos
20
+ HasCases -->|yes| Neg
21
+ Pos --> Route1 --> WinEq
22
+ Neg --> Route2 --> WinBound
23
+ WinEq -->|yes| PosPass
24
+ WinEq -->|no| PosFail
25
+ WinBound -->|winner === S| NegFail
26
+ WinBound -->|winner &isin; boundary| NegPass
27
+ WinBound -->|winner === null| Gap
28
+ WinBound -->|winner &notin; boundary<br/>and non-null| NegFail
29
+
30
+ classDef start fill:#ecfdf5,stroke:#047857,color:#064e3b
31
+ classDef gate fill:#fce7f3,stroke:#db2777,color:#831843
32
+ classDef work fill:#dbeafe,stroke:#2563eb,color:#1e3a8a
33
+ classDef pass fill:#ecfdf5,stroke:#047857,color:#064e3b,font-weight:bold
34
+ classDef fail fill:#fee2e2,stroke:#b91c1c,color:#7f1d1d,font-weight:bold
35
+ classDef skip fill:#f5f3ff,stroke:#7c3aed,color:#4c1d95,stroke-dasharray:4 2
36
+ class Start,Skip start
37
+ class HasCases,WinEq,WinBound gate
38
+ class Pos,Neg,Route1,Route2 work
39
+ class PosPass,NegPass pass
40
+ class PosFail,NegFail fail
41
+ class Gap skip
@@ -0,0 +1,53 @@
1
+ flowchart LR
2
+ A11Y["a11y<br/><i>capability · portable</i>"]
3
+ DBG["debugging<br/><i>workflow · portable</i>"]
4
+ DOC["documentation<br/><i>capability · portable</i>"]
5
+ GA["graph-audit<br/><i>capability · codebase</i>"]
6
+ LO["lint-overlay<br/><i>overlay · portable</i>"]
7
+ RF["refactor<br/><i>workflow · portable</i>"]
8
+ SR["skill-router<br/><i>router · portable</i>"]
9
+ TS["testing-strategy<br/><i>capability · portable</i>"]
10
+ ST(["skill-metadata-template<br/><i>specimen · reference</i>"])
11
+
12
+ %% depends_on — thick solid, load-bearing
13
+ RF ==>|depends_on<br/>^1.0.0| TS
14
+ LO ==>|extends| TS
15
+
16
+ %% verify_with — dashed, co-load for confidence
17
+ A11Y -.->|verify_with| TS
18
+ DBG -.->|verify_with| TS
19
+ GA -.->|verify_with| TS
20
+ RF -.->|verify_with| TS
21
+ TS -.->|verify_with| DBG
22
+ SR -.->|verify_with| GA
23
+ ST -.->|verify_with| DOC
24
+
25
+ %% adjacent — thin undirected, suggested co-reading
26
+ DBG --- TS
27
+ DBG --- RF
28
+
29
+ %% boundary — red, anti-ownership
30
+ A11Y -. boundary .-x RF
31
+ DBG -. boundary .-x DOC
32
+ DOC -. boundary .-x DBG
33
+ DOC -. boundary .-x A11Y
34
+ DOC -. boundary .-x RF
35
+ GA -. boundary .-x DOC
36
+ LO -. boundary .-x DBG
37
+ RF -. boundary .-x DOC
38
+ SR -. boundary .-x DOC
39
+ ST -. boundary .-x RF
40
+ TS -. boundary .-x DOC
41
+
42
+ classDef capability fill:#dbeafe,stroke:#2563eb,color:#1e3a8a
43
+ classDef workflow fill:#ecfdf5,stroke:#047857,color:#064e3b
44
+ classDef router fill:#fce7f3,stroke:#db2777,color:#831843
45
+ classDef overlay fill:#fef3c7,stroke:#d97706,color:#78350f,stroke-dasharray:4 2
46
+ classDef specimen fill:#f5f3ff,stroke:#7c3aed,color:#4c1d95
47
+ classDef codebase stroke-width:3px
48
+ class A11Y,DOC,GA,TS capability
49
+ class DBG,RF workflow
50
+ class SR router
51
+ class LO overlay
52
+ class ST specimen
53
+ class GA codebase
@@ -0,0 +1,315 @@
1
+ # Skill Graph Field Decision Guide
2
+
3
+ > Decision tables for the three hardest field choices in a `SKILL.md` file.
4
+ > For full field semantics and rules, see `docs/field-reference.md`.
5
+ > For field groups and conditional requiredness, see `docs/skill-metadata-protocol.md`.
6
+
7
+ ---
8
+
9
+ ## 1. Which `scope` do I use?
10
+
11
+ `scope` tells routers and auditors whether your skill is portable, documentation-backed, or grounded in a specific codebase.
12
+
13
+ ### Decision table
14
+
15
+ | Situation | Correct `scope` |
16
+ |---|---|
17
+ | Skill applies across any codebase or team with no repo-specific claims | `portable` |
18
+ | Skill is primarily a reference for a contract, spec, or document (e.g., "Skill Metadata Protocol for this repo") | `reference` |
19
+ | Skill makes concrete claims about files, APIs, or behavior in a specific codebase | `codebase` |
20
+ | Skill is a starter or template that could be copied into any project | `portable` |
21
+ | Skill references specific file paths, function names, or deployment details | `codebase` |
22
+ | Skill documents abstract methodology (testing strategy, refactoring patterns) | `portable` |
23
+
24
+ ### Diagnostic questions
25
+
26
+ **Q: Does my skill say "in `src/integrations/shopify/client.ts`" or similar?**
27
+ → `codebase`
28
+
29
+ **Q: Does my skill say "in the codebase" without naming specific files?**
30
+ → `portable`
31
+
32
+ **Q: Is my skill's primary purpose to be a reference for a contract document (like a schema or this Skill Metadata Protocol)?**
33
+ → `reference`
34
+
35
+ **Q: Would this skill work unchanged if copied into a completely different project?**
36
+ → `portable` (if yes), `codebase` (if no)
37
+
38
+ ### Important constraint
39
+
40
+ `scope: codebase` requires a populated `grounding` block. The schema enforces this — `scripts/skill-lint.js` will reject a codebase-scoped skill without grounding. If you choose `codebase`, populate `grounding` before committing.
41
+
42
+ ### Migration from v1
43
+
44
+ The v1 scope values (`generic`, `operational`) were renamed in schema_version 2 (SH-5784) and are rejected as hard errors by the v2+ schemas. For the full v1 → v2 rename table see [`docs/field-reference.md § scope`](field-reference.md#scope); for the codemod that applies every v2 → v3 change automatically, see [`docs/manifest-field-mapping.md § Migration Note — v2 → v3`](manifest-field-mapping.md#migration-note--v2--v3-v040).
45
+
46
+ ### Examples
47
+
48
+ ```yaml
49
+ # Correct: skill about abstract testing patterns
50
+ scope: portable
51
+
52
+ # Correct: skill that references this repo's protocol documents
53
+ scope: reference
54
+
55
+ # Correct: skill that covers Shopify integration in a specific codebase
56
+ scope: codebase
57
+ grounding:
58
+ domain_object: Shopify integration behavior
59
+ grounding_mode: repo_specific
60
+ # ...
61
+ ```
62
+
63
+ ---
64
+
65
+ ## 2. Which `relations.*` key do I use?
66
+
67
+ The four relation keys serve distinct purposes. Using the wrong key creates misleading graph edges.
68
+
69
+ ### Decision table
70
+
71
+ | Field | Use when | Do NOT use when |
72
+ |---|---|---|
73
+ | `adjacent` | Another skill is useful next reading or common co-loading | You need ordering or verification |
74
+ | `boundary` | Users commonly confuse this skill with another | You only want related reading |
75
+ | `verify_with` | A second skill materially increases confidence on the same task | The other skill is merely adjacent |
76
+ | `depends_on` | This skill cannot be applied correctly before another one | You just want a recommended pairing |
77
+
78
+ ### Concrete examples
79
+
80
+ The distinction between these relation types is best illustrated by existing usage in the library:
81
+
82
+ - **`depends_on`** — `refactor` declares `depends_on: [testing-strategy]` because refactoring without understanding test strategy is unsafe. The concepts are foundational to the skill's correctness.
83
+
84
+ - **`verify_with`** — `graph-audit` declares `verify_with: [testing-strategy]` because running the graph-audit verification alongside testing-strategy evals materially increases confidence in the skill's claims. They are commonly used together in audit pipelines.
85
+
86
+ - **`adjacent`** — `refactor` declares `adjacent: [debugging, testing-strategy]` because readers of the refactor skill would benefit from understanding debugging and testing approaches. These are topically related but not mandatory dependencies.
87
+
88
+ - **`boundary`** — `refactor` declares `boundary: [documentation]` to prevent confusion. Documentation skills are not owned by refactor — they are a separate domain. This guards against incorrect skill activation.
89
+
90
+ When a skill extends another skill's base behavior (e.g., an overlay), use the `extends` field instead of relations.
91
+
92
+ ### Combined example
93
+
94
+ ```yaml
95
+ relations:
96
+ adjacent:
97
+ - webhook-integration # related: reader may want this context
98
+ boundary:
99
+ - fulfillment # not owned here: route to fulfillment skill
100
+ verify_with:
101
+ - test-coverage # co-load during audits
102
+ depends_on:
103
+ - api-key-management # hard dependency: skill builds on this
104
+ ```
105
+
106
+ ### Validation
107
+
108
+ All relation targets must be the `name` of an existing skill in the library. `scripts/skill-lint.js` rejects dangling targets (targets that point to non-existent skills).
109
+
110
+ ---
111
+
112
+ ## 3. What eval-health and `portability` state do I choose?
113
+
114
+ ### Eval-health state: the three orthogonal axes
115
+
116
+ Schema_version 2 (SH-5784) split the v1 `eval_status` enum into three orthogonal fields because the old enum mixed artifact state, runtime state, and routing coverage into a single ordinal. Each axis now has its own value.
117
+
118
+ #### `eval_artifacts` — "does a file exist?"
119
+
120
+ ```
121
+ Does an eval artifact file exist for this skill?
122
+ NO → Is eval work intentionally deferred?
123
+ YES → planned
124
+ NO → none
125
+ YES → present
126
+ ```
127
+
128
+ | Value | Use when |
129
+ |---|---|
130
+ | `none` | No eval planned or authored. Rare — use sparingly. |
131
+ | `planned` | Evals are intended but no artifact exists yet. Temporary state. |
132
+ | `present` | At least one eval artifact exists on disk. `scripts/skill-lint.js` verifies it. |
133
+
134
+ #### `eval_state` — "has it been run and passed?"
135
+
136
+ ```
137
+ Have the evals been run and passed recently?
138
+ NO → unverified
139
+ YES, one-off manual run → passing
140
+ YES, continuously run by a toolchain → monitored
141
+ ```
142
+
143
+ | Value | Use when |
144
+ |---|---|
145
+ | `unverified` | Artifacts exist but no passing run has been recorded (or no artifacts yet). |
146
+ | `passing` | A recent run exists and was green. Needs a concrete receipt. |
147
+ | `monitored` | Actively run on a cadence by a live toolchain. |
148
+
149
+ #### `routing_eval` — "do we check routing coverage?"
150
+
151
+ | Value | Use when |
152
+ |---|---|
153
+ | `absent` | Routing / trigger coverage is not evaluated for this skill. Default for most starters. |
154
+ | `present` | Eval artifacts include routing assertions (does the skill activate for the right prompts?). |
155
+
156
+ **Anti-pattern.** Do not set `eval_state: passing` without an actual passing run. Do not set `eval_artifacts: present` without a real file — the lint script checks. Do not claim `routing_eval: present` when the eval only checks content, not routing.
157
+
158
+ ### Migration from v1
159
+
160
+ The v1 `eval_status` enum collapsed three concerns into one. Map each old value to the new triple:
161
+
162
+ | v1 `eval_status` | `eval_artifacts` | `eval_state` | `routing_eval` |
163
+ |---|---|---|---|
164
+ | `none` | `none` | `unverified` | `absent` |
165
+ | `pending` | `planned` | `unverified` | `absent` |
166
+ | `evals` | `present` | `passing` | `absent` |
167
+ | `passing` | `present` | `passing` | `absent` |
168
+ | `active` | `present` | `monitored` | `absent` |
169
+ | `evals+trigger` | `present` | `passing` | `present` |
170
+
171
+ ### `portability.readiness` decision
172
+
173
+ The `readiness` field is operational, not ordinal. Each value says something concrete about what is true of the skill today.
174
+
175
+ | Readiness | Use when |
176
+ |---|---|
177
+ | `declared` | Portability is claimed in metadata only; no export tooling has run. |
178
+ | `scripted` | Export tooling exists for at least one listed target (e.g., `scripts/export-skill.js` covers `skill-md`). |
179
+ | `verified` | Export tooling exists AND the exported output has been verified in the target runtime with a receipt artifact. |
180
+
181
+ **Quick heuristic:**
182
+ - `scope: portable` with no repo paths AND export script covers at least one target → `readiness: scripted`
183
+ - `scope: codebase` with concrete repo paths AND no export tooling yet → `readiness: declared`
184
+ - Export tooling ran AND the output was loaded into the target runtime AND passed a smoke test → `readiness: verified`
185
+
186
+ ### `portability.targets` decision
187
+
188
+ `targets` declares which runtimes the skill is portable to. (Renamed from `exports` in v2.)
189
+
190
+ | Target | Include when |
191
+ |---|---|
192
+ | `skill-md` | The skill can be transformed to a valid SKILL.md file via `scripts/export-skill.js`. |
193
+
194
+ The enum accepts only `skill-md` today. Other runtimes — `cursor`, `windsurf`, `copilot`, `agents-md` — were removed from the enum in 0.3.0. They previously sat in the enum as compatibility *goals* with no working transform, which violated the contract's `additionalProperties: false` strictness rule. Re-add via a new RFC and the same PR that ships the transform for that runtime.
195
+
196
+ **Rule of thumb:** if the skill can round-trip through `scripts/export-skill.js` today, include `skill-md`. Otherwise omit the `portability` block entirely.
197
+
198
+ ### Migration from v1
199
+
200
+ | v1 `portability.level` | v2 `portability.readiness` |
201
+ |---|---|
202
+ | `high` | `scripted` (if an export script covers at least one target) else `declared` |
203
+ | `medium` | `scripted` (if an export script covers at least one target) else `declared` |
204
+ | `low` | `declared` |
205
+
206
+ `portability.exports` was renamed to `portability.targets`. Values are unchanged.
207
+
208
+ ```yaml
209
+ # Canonical: the only target currently accepted by the schema.
210
+ portability:
211
+ readiness: scripted
212
+ targets:
213
+ - skill-md
214
+ ```
215
+
216
+ ---
217
+
218
+ ## 4. How do I tag a skill for multiple projects?
219
+
220
+ `workspace_tags` is the v3 mechanism for multi-project relevance. It is flat and composable — no hierarchy required. A workspace config at `.skill-graph/config.json` expands literal project handles into semantic tag sets, so one skill tag can match many projects.
221
+
222
+ ### Decision table
223
+
224
+ | Situation | Correct `workspace_tags` |
225
+ |---|---|
226
+ | Skill applies to every project (cross-cutting concern) | Omit `workspace_tags` (ambient) |
227
+ | Skill applies to one specific project and not reusable elsewhere | `[literal-project-handle]` |
228
+ | Skill applies to several projects that share a technology / domain | Semantic tag(s) that the workspace config maps those projects to |
229
+ | Skill applies to one project by literal handle AND to a semantic group | Both: `[literal-handle, semantic-tag]` |
230
+ | Single-project workspace | Omit `workspace_tags` always |
231
+
232
+ ### Literal vs semantic tags
233
+
234
+ | Tag style | Example | When to use |
235
+ |---|---|---|
236
+ | Literal | `<your-project-handle>` (whatever short kebab-case name you give a project in your workspace config) | Precise targeting. Couples the skill to a specific project name. Readable but brittle to renames. |
237
+ | Semantic | `ecommerce`, `saas`, `b2b` | Reusable across projects. The workspace config declares which literal projects expand to which semantic tags, so one tag matches several projects. |
238
+
239
+ **Prefer semantic when possible.** Literal handles work but they bind the skill to a project name. Semantic tags describe the domain and survive project renames.
240
+
241
+ ### Diagnostic questions
242
+
243
+ **Q: Does my workspace have more than one project?**
244
+ → If no, omit `workspace_tags` always.
245
+
246
+ **Q: Is this skill a cross-cutting concern (GDPR, a11y, testing patterns, general coding rules)?**
247
+ → Omit `workspace_tags` — ambient.
248
+
249
+ **Q: Does this skill reference a specific project's files or domain?**
250
+ → Tag with that project's literal handle OR its semantic tags.
251
+
252
+ **Q: Would I want to reuse this skill if I cloned the current project pattern into a new project?**
253
+ → If yes, tag with semantic tags (so the new project can map its handle to those tags). If no, tag with the literal handle.
254
+
255
+ ### Example
256
+
257
+ ```yaml
258
+ # One specific project only — literal targeting
259
+ workspace_tags: [<project-a>]
260
+
261
+ # Cross-ecommerce — semantic, applies to every project whose config maps to `ecommerce`
262
+ workspace_tags: [ecommerce]
263
+
264
+ # Explicit both — literal match on <project-a>, semantic match on any ecommerce project
265
+ workspace_tags: [<project-a>, ecommerce]
266
+ ```
267
+
268
+ With a hypothetical two-project workspace config:
269
+
270
+ ```json
271
+ {
272
+ "workspace": {
273
+ "projects": {
274
+ "<project-a>": { "semantic_tags": ["ecommerce", "saas", "b2b"] },
275
+ "<project-b>": { "semantic_tags": ["ecommerce", "b2c"] }
276
+ }
277
+ }
278
+ }
279
+ ```
280
+
281
+ (`<project-a>` and `<project-b>` are placeholders — adopters use whatever kebab-case handles they choose.) A skill with `workspace_tags: [ecommerce]` routes into both projects. A skill with `workspace_tags: [b2b]` routes only into the first. A skill with no `workspace_tags` routes into all projects (ambient).
282
+
283
+ ---
284
+
285
+ ## 5. Do I use `category`, `category`, `workspace_tags`, or `routing_bundles`?
286
+
287
+ These four fields all group skills, but they answer different questions. Picking the wrong field creates misleading organization that corrodes routing quality. Use this table before adding any skill-grouping field:
288
+
289
+ | Field | Answers the question | Shape | Primary consumer |
290
+ |---|---|---|---|
291
+ | `category` | What flat bucket does this skill live in for quick browsing? | single string (e.g., `integration`) | human browse UI, filter dropdowns |
292
+ | `category` | Where does this skill sit in a hierarchy for tree browsing? | slash-delimited path (e.g., `ecommerce/integrations/shopify`) | folder-tree UI, docs site navigation |
293
+ | `workspace_tags` | Which of my projects is this skill relevant to? | flat array (e.g., `[<project-a>, ecommerce]`) | router filter at routing time |
294
+ | `routing_bundles` | Which batch-activation group does this skill belong to? | flat array (e.g., `[quality, security]`) | router batch-load by group label |
295
+
296
+ ### Three rules that prevent misuse
297
+
298
+ 1. **Never use `category` for routing.** It's a browse index. If you find yourself writing "when the router sees `integration` it should load all X" — you want `routing_bundles`, not `category`.
299
+
300
+ 2. **Never use `workspace_tags` for taxonomy.** It's a routing filter. If you find yourself tagging every skill with every project handle to build a grouping — you want `category` or `category`.
301
+
302
+ 3. **Never use `category` to filter routing.** A hierarchy helps humans find skills. The router doesn't walk it. If you want the router to match `ecommerce/integrations/shopify` at query time, flatten it into `routing_bundles: [integrations]` or `workspace_tags: [ecommerce]`.
303
+
304
+ ### Worked example
305
+
306
+ A Shopify skill in a multi-project, large-library workspace:
307
+
308
+ ```yaml
309
+ category: integration # "Where does it live in a flat browse UI?"
310
+ category: ecommerce/integrations/shopify # "Where in a tree?"
311
+ workspace_tags: [ecommerce] # "Which of my projects?"
312
+ routing_bundles: [integrations] # "Which batch-activation group?"
313
+ ```
314
+
315
+ Each field does a distinct job. None is redundant with the others. A smaller library can omit `category` entirely; a single-project workspace can omit `workspace_tags`; a library with no batch-activation pattern can omit `routing_bundles`. `category` is always present because it is required.