@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,80 @@
1
+ ---
2
+ name: debugging
3
+ description: "Use when behavior is broken, a test is failing, or runtime output contradicts expectations. Covers failure reproduction, scope reduction by bisection, evidence capture at the moment of failure, root-cause isolation (not symptom patching), fix verification against the same evidence path, and regression-test creation. Do NOT use for feature planning, architectural design, or behavior-preserving refactor."
4
+ license: MIT
5
+ compatibility: "Markdown, Git, any codebase"
6
+ allowed-tools: Read Grep Bash
7
+ metadata:
8
+ schema_version: "4"
9
+ version: "1.0.0"
10
+ type: workflow
11
+ category: engineering
12
+ scope: portable
13
+ owner: skill-graph-maintainer
14
+ freshness: "2026-04-18"
15
+ drift_check: "{\"last_verified\":\"2026-04-18\"}"
16
+ eval_artifacts: present
17
+ eval_state: passing
18
+ routing_eval: present
19
+ stability: experimental
20
+ keywords: "[\"debugging\",\"reproduce failure\",\"reproduce bug\",\"failing test\",\"root cause\",\"symptom vs cause\",\"minimum reproduction\",\"bisect\",\"what caused it\",\"my tests are failing\",\"why is this broken\",\"it broke in production\",\"cannot reproduce\",\"test passes locally\",\"stack trace\",\"used to work\",\"worked yesterday\",\"what changed\",\"was working before\",\"agent stuck\",\"stuck in a loop\",\"stuck in loop\",\"blocking my commit\",\"blocking the build\",\"specific error\",\"specific failure\",\"diagnose failure\",\"error blocking\",\"broke the build\",\"broke build\"]"
21
+ triggers: "[\"debugging-skill\"]"
22
+ examples: "[\"my tests pass locally but fail in CI — why?\",\"this function used to work yesterday; what changed?\",\"reproduce this Stripe webhook failure from production logs\",\"I see the symptom but can't find the root cause of this nil panic\"]"
23
+ anti_examples: "[\"plan test coverage for a new feature\",\"document what this function does for future readers\",\"refactor this messy code while the test suite is green\"]"
24
+ relations: "{\"boundary\":[{\"skill\":\"documentation\",\"reason\":\"documentation is durable reference prose; debugging is transient failure-chasing\"},{\"skill\":\"testing-strategy\",\"reason\":\"testing-strategy plans what to test before a failure exists; debugging chases a specific observed failure\"},{\"skill\":\"refactor\",\"reason\":\"refactor is behavior-preserving code change with green tests; debugging is invoked because tests or behavior are NOT green\"}],\"verify_with\":[\"testing-strategy\"]}"
25
+ portability: "{\"readiness\":\"scripted\",\"targets\":[\"skill-md\"]}"
26
+ ---
27
+
28
+ # Debugging
29
+
30
+ ## Coverage
31
+
32
+ - Reproduction: turning a vague bug report into a deterministic failing case
33
+ - Scope reduction: isolating the smallest surface where the failure still reproduces
34
+ - Evidence capture: collecting logs, stack traces, and state snapshots at the moment of failure
35
+ - Root-cause isolation: distinguishing symptoms from causes and resisting the urge to patch symptoms
36
+ - Fix verification: re-running the original failure path to confirm the fix is real
37
+ - Regression prevention: converting the failing case into a permanent test so the same bug cannot return silently
38
+
39
+ ## Philosophy
40
+
41
+ The fastest way to fix a bug is usually the wrong fix. A working reproduction is worth more than a plausible hypothesis; a plausible hypothesis is worth more than a clever fix; a clever fix that skips the reproduction step ships the same bug again under a different name. When pressure is high the temptation to jump from symptom to patch is also high — resist it, because the cost of a wrong fix is paid again by the next person who hits the same failure with less context than you had.
42
+
43
+ ## Workflow
44
+
45
+ Each step asks a question. The answer decides the next step. Do not skip steps to save time; the steps exist because skipping them is how bugs return.
46
+
47
+ | Step | Ask | If yes | If no |
48
+ |---|---|---|---|
49
+ | 1. Reproduce | Do you have a deterministic failing case? | Go to step 2 | Add logging, narrow inputs, or run the failing path in a loop until the failure is reliable |
50
+ | 2. Scope | Can you reproduce it in a surface smaller than the full system? | Go to step 3 | Bisect — halve the code path, data, or config and retry |
51
+ | 3. Evidence | Do you have the state at the moment of failure, not just the symptom after? | Go to step 4 | Add instrumentation at the boundary where state flips wrong |
52
+ | 4. Cause | Does your hypothesis explain ALL of the evidence, not just the visible symptom? | Go to step 5 | Form a better hypothesis — partial explanations hide shared root causes |
53
+ | 5. Verify | Does the same evidence path pass with the fix applied, and fail with it reverted? | Go to step 6 | The fix did not land or the cause was wrong — return to step 4 |
54
+ | 6. Regression test | Does the test you just wrote fail without the fix and pass with it? | Done | Your test is not isolating the cause — rewrite it |
55
+
56
+ ### When to stop and escalate
57
+
58
+ - Step 1 is still unreproducible after ~60 min of narrowing → suspect non-determinism (race, timing, clock, network). This is a design issue, not a debugging issue.
59
+ - Step 3 instrumentation shows contradictory state on the same object → suspect memory corruption, concurrent mutation, or stale cache. Out of scope for a single-file debugger; escalate to architectural review.
60
+ - The same bug returned after a previous fix → the previous fix patched a symptom. Start over at step 1 and find the real cause.
61
+
62
+ ## Evals
63
+
64
+ This skill ships a comprehension-eval artifact at [`examples/evals/debugging.json`](../../examples/evals/debugging.json). The `Verification` checklist below is the authoring gate for a completed debugging pass; the eval file is how this skill is graded by `scripts/skill-audit.js --graded`. Do not conflate them — the checklist is for the debugger, the eval is for the grader.
65
+
66
+ ## Verification
67
+
68
+ - [ ] The original failure was reproduced deterministically, not just described
69
+ - [ ] The hypothesis explains every piece of evidence collected, not a subset
70
+ - [ ] The fix was verified by the same evidence path that revealed the bug
71
+ - [ ] A regression test fails without the fix and passes with it
72
+ - [ ] The next engineer who hits this failure can reach the fix from the regression test alone
73
+
74
+ ## Do NOT Use When
75
+
76
+ | Use instead | When |
77
+ |---|---|
78
+ | `refactor` | The task is structural cleanup, not failure-driven diagnosis |
79
+ | `testing-strategy` | The task is planning what to test, not chasing a known failure |
80
+ | `documentation` | The task is explaining behavior, not fixing broken behavior |
@@ -0,0 +1,78 @@
1
+ ---
2
+ name: refactor
3
+ description: "Use when reorganizing existing code without changing external behavior — extracting functions, reducing duplication, renaming for clarity, splitting modules, or tightening structure. Covers behavior preservation, duplication reduction, decomposition, naming improvements, structural reorganization, and before/after verification. Do NOT use for bug investigation, adding new product behavior, or writing documentation (even when the docs describe the refactored code)."
4
+ license: MIT
5
+ compatibility: "Markdown, Git, any codebase"
6
+ allowed-tools: Read Grep Bash
7
+ metadata:
8
+ schema_version: "4"
9
+ version: "1.0.0"
10
+ type: workflow
11
+ category: engineering
12
+ scope: portable
13
+ owner: skill-graph-maintainer
14
+ freshness: "2026-04-18"
15
+ drift_check: "{\"last_verified\":\"2026-04-18\"}"
16
+ eval_artifacts: present
17
+ eval_state: passing
18
+ routing_eval: present
19
+ stability: experimental
20
+ keywords: "[\"refactor\",\"cleanup\",\"simplify\",\"extract function\",\"reduce duplication\",\"clean this up\",\"simplify this\",\"rename this\",\"split this file\",\"too long function\",\"duplicated logic\",\"decompose function\",\"decompose code\",\"decompose long\",\"split by responsibility\",\"behavior preserving\",\"rename module\",\"rename utils\",\"messy code\",\"messy suite\",\"extract helper\",\"extract duplicated\",\"consolidate logic\",\"tighten structure\"]"
21
+ triggers: "[\"refactor-skill\"]"
22
+ examples: "[\"this 600-line function is hard to reason about — decompose it while keeping tests green\",\"extract the duplicated validation logic from these three handlers into a helper\",\"rename this module from `utils` to something that describes what it actually does\",\"split this file by responsibility; no behavior changes, tests must still pass\"]"
23
+ anti_examples: "[\"the test is failing after my edit — what did I break?\",\"write an architecture note explaining this pattern for new team members\",\"reproduce why this function retries three times on transient network errors\"]"
24
+ relations: "{\"boundary\":[{\"skill\":\"documentation\",\"reason\":\"documentation is prose about the code; refactor is behavior-preserving changes to the code itself\"},{\"skill\":\"debugging\",\"reason\":\"debugging chases an observed failure; refactor runs only with a green test suite and preserves behavior\"}],\"verify_with\":[\"testing-strategy\"],\"depends_on\":[{\"skill\":\"testing-strategy\",\"min_version\":\"^1.0.0\"}]}"
25
+ portability: "{\"readiness\":\"scripted\",\"targets\":[\"skill-md\"]}"
26
+ ---
27
+
28
+ # Refactor
29
+
30
+ ## Coverage
31
+
32
+ - Behavior preservation: identifying the external contract that must remain stable before any change
33
+ - Duplication reduction: consolidating repeated logic without over-abstraction
34
+ - Decomposition: extracting functions, modules, or types to improve readability and reuse
35
+ - Naming improvements: renaming so identifiers carry their real meaning
36
+ - Structure improvements: reorganizing file and module boundaries when the current layout obscures intent
37
+ - Verification before and after: running the same behavioral checks on both sides of the change
38
+
39
+ ## Philosophy
40
+
41
+ Refactoring pays off only when the shape of the code has diverged from the shape of the problem. Before that point it is risk without reward — every move invites a regression, and "cleaner" is a preference, not a justification. The honest test for a legitimate refactor is not "this feels better" but "the next concrete change will be materially easier because of this one." If you cannot name the next change, stop — you are rearranging, not refactoring, and the safest rearrangement is none.
42
+
43
+ ## Workflow
44
+
45
+ Each step decides whether to continue, split, or stop. "Stop" is always a valid answer; speculative refactoring is a failure mode, not a signal of ambition.
46
+
47
+ | Step | Ask | If yes | If no |
48
+ |---|---|---|---|
49
+ | 1. Contract | What externally observable behavior must stay the same? | Write it down as a test suite or explicit checklist | Stop — you cannot refactor what you cannot pin down |
50
+ | 2. Next-change justification | Can you name one concrete pending change that becomes easier because of this refactor? | Go to step 3 | Stop — you are rearranging for taste, not improving the codebase |
51
+ | 3. Smallest useful cut | What is the smallest structural change that moves toward the next-change goal? | Make only that change | Split into sequential cuts; do not change multiple abstraction layers at once |
52
+ | 4. Behavior re-verify | Does the contract from step 1 still hold exactly? | Commit | Revert; the refactor was not behavior-preserving. Start over smaller |
53
+ | 5. Stop condition | Have you made the next change materially easier than it would have been before? | Done | Do not keep going — refactoring beyond the next change is speculative waste |
54
+
55
+ ### When to back out
56
+
57
+ - A green test from before the refactor is now red → revert immediately, then cut smaller.
58
+ - The next-change goal shifted during the refactor → restart at step 2 with the new goal before continuing.
59
+ - The refactor requires touching more than one abstraction layer in a single commit → split into per-layer commits and re-verify each.
60
+
61
+ ## Evals
62
+
63
+ This skill ships a comprehension-eval artifact at [`examples/evals/refactor.json`](../../examples/evals/refactor.json). The `Verification` checklist below is the authoring gate for a completed refactor; the eval file is how this skill is graded by `scripts/skill-audit.js --graded`. Do not conflate them — the checklist is for the engineer, the eval is for the grader.
64
+
65
+ ## Verification
66
+
67
+ - [ ] External behavior is unchanged — same tests green before and after
68
+ - [ ] The named next change is now demonstrably easier, not merely "more possible"
69
+ - [ ] No new abstraction was introduced speculatively (no "future-proofing" without a named consumer)
70
+ - [ ] Each commit is a single structural change, not a bundle of rearrangements
71
+
72
+ ## Do NOT Use When
73
+
74
+ | Use instead | When |
75
+ |---|---|
76
+ | `debugging` | The task starts from a failing behavior, not from structural cleanup |
77
+ | `documentation` | The task is rewriting docs — even docs about the refactored code — it belongs to a separate commit and skill |
78
+ | `testing-strategy` | The task is designing a new test suite; the refactor's own tests should already exist before step 1 |
@@ -0,0 +1,81 @@
1
+ ---
2
+ name: testing-strategy
3
+ description: "Use when planning tests for a bug fix, feature, or refactor — deciding what deserves a test, at which level, with what evidence. Covers test-scope decisions, test-level selection (unit / integration / contract / e2e), effort-to-risk matching, regression targeting, evidence quality, and failure-case coverage. Do NOT use for chasing a known failure (that is `debugging`), for pure doc writing (that is `documentation`), or for conceptual architecture discussion with no verification target (no dedicated skill — treat as strategy, not testing)."
4
+ license: MIT
5
+ compatibility: "Markdown, Git, any codebase"
6
+ allowed-tools: Read Grep Bash
7
+ metadata:
8
+ schema_version: "4"
9
+ version: "1.0.0"
10
+ type: capability
11
+ category: quality
12
+ scope: portable
13
+ owner: skill-graph-maintainer
14
+ freshness: "2026-04-18"
15
+ drift_check: "{\"last_verified\":\"2026-04-18\"}"
16
+ eval_artifacts: present
17
+ eval_state: passing
18
+ routing_eval: present
19
+ stability: experimental
20
+ keywords: "[\"testing strategy\",\"what to test\",\"what not to test\",\"which test level\",\"test scope\",\"effort vs risk\",\"regression target\",\"failure case coverage\",\"test plan\",\"do I need a test\",\"should I test this\",\"unit or integration\",\"test coverage\",\"pin this behavior\",\"plan test coverage\",\"plan coverage\",\"needs an automated test\",\"automated test\",\"manual QA coverage\",\"passes manual QA\",\"test level decision\"]"
21
+ triggers: "[\"testing-skill\"]"
22
+ routing_bundles: "[\"quality\"]"
23
+ examples: "[\"do I need a unit test for this pure formatter or is integration enough?\",\"what's the right test level for a webhook handler that talks to Stripe?\",\"the feature passes manual QA — does it need an automated test?\",\"pin this regression so the same bug can't slip through again\"]"
24
+ anti_examples: "[\"my existing test is failing — why?\",\"write a testing-patterns guide for the contributor docs\",\"clean up this duplicated test setup across three files\"]"
25
+ relations: "{\"boundary\":[{\"skill\":\"documentation\",\"reason\":\"documentation is durable prose; testing-strategy is active verification planning\"},{\"skill\":\"debugging\",\"reason\":\"debugging chases a specific observed failure; testing-strategy decides what to test BEFORE a failure exists\"},{\"skill\":\"refactor\",\"reason\":\"refactor reshapes code (including test setup) while preserving behavior; testing-strategy decides what coverage to author in the first place\"}],\"verify_with\":[\"debugging\"]}"
26
+ portability: "{\"readiness\":\"scripted\",\"targets\":[\"skill-md\"]}"
27
+ ---
28
+
29
+ # Testing Strategy
30
+
31
+ ## Coverage
32
+
33
+ - Test scope: deciding what behavior actually needs a test, and what does not earn the maintenance cost
34
+ - Test level selection: choosing between unit, integration, contract, and end-to-end tests based on risk and coupling
35
+ - Effort-to-risk matching: investing verification effort where regressions are most likely and most damaging
36
+ - Regression targeting: writing tests that pin the specific behavior a change risks breaking, not generic coverage
37
+ - Evidence quality: preferring concrete, reproducible verification over assumed or manual checks
38
+ - Failure-case coverage: ensuring boundary conditions and error paths are tested, not only the happy path
39
+
40
+ ## Philosophy
41
+
42
+ Most test suites fail the effort-to-risk test: they exercise code that will never break and skip code that breaks in production. The correct target is the behavior that ships to users, not the code you happen to have written last. Coverage percentage is a proxy, and every proxy eventually gets gamed — the real signal is regressions caught before release. A test that never fails is noise; a test that fails without isolating the cause is worse than no test at all because it wastes the next engineer's time.
43
+
44
+ ## Test-Level Selection
45
+
46
+ Pick the test level by the risk of the change and the coupling of the behavior, not by the file you happen to be editing. Unit tests are cheap to write and cheap to pass; integration and contract tests are where real production bugs are actually caught.
47
+
48
+ | Situation | Test level | Why |
49
+ |---|---|---|
50
+ | Pure function, single-owner, no I/O | **Unit** | Fast, deterministic, zero setup. If you cannot unit-test it, the function is doing too much |
51
+ | Logic that composes multiple units inside one service | **Integration** (in-process) | Unit tests of each piece will miss composition bugs; integration test catches real wiring |
52
+ | Behavior that crosses a service / process / network boundary | **Contract** | Both sides need a shared verifiable agreement; a unit test on either side misses the real failure mode |
53
+ | User-visible flow end-to-end | **E2E** (one or two per critical path) | Proves the full path works at least once; too expensive to run for every code path |
54
+ | Bug fix for a bug that reached production | **Regression** at the level where the bug slipped through | If it slipped past unit tests, a unit test won't catch it next time; write the test at the level the bug exposed |
55
+ | Behavior that is "obviously correct," unchanged for a year, no external pressure | **No new test** | The test would never fail; it would only add maintenance cost. Every test is a liability until it catches a bug |
56
+
57
+ ### Level-selection anti-patterns
58
+
59
+ - **Unit testing what should be an integration test** — mocking the only thing that could actually break. Fix: test the real integration, or admit the unit test proves nothing.
60
+ - **Integration testing what should be a unit test** — slow setup for a function that has no dependencies. Fix: extract the pure logic and unit-test it.
61
+ - **E2E-testing every code path** — fragile, slow, flaky. Fix: one E2E per critical user journey, unit/integration for the rest.
62
+ - **Adding a test because coverage dropped** — test has no regression target and never fails meaningfully. Fix: either find a real regression to pin, or delete the uncovered code if it has no value.
63
+
64
+ ## Evals
65
+
66
+ This skill ships a comprehension-eval artifact at [`examples/evals/testing-strategy.json`](../../examples/evals/testing-strategy.json). The `Verification` checklist below is the authoring gate for a completed test plan; the eval file is how this skill is graded by `scripts/skill-audit.js --graded`. Do not conflate them — the checklist is for the test author, the eval is for the grader.
67
+
68
+ ## Verification
69
+
70
+ - [ ] The test type matches the change risk
71
+ - [ ] A behavior or regression target is explicit
72
+ - [ ] Verification evidence is concrete, not assumed
73
+ - [ ] Failure cases and boundaries are covered, not only the happy path
74
+
75
+ ## Do NOT Use When
76
+
77
+ | Use instead | When |
78
+ |---|---|
79
+ | `documentation` | The task structures explanation for a reader, not verification for a change |
80
+ | `debugging` | The task is chasing a known failure — strategy is planned before the failure, not after |
81
+ | `refactor` | The task is restructuring code; any test work is to preserve existing behavior, which belongs to the refactor skill's verification step |
@@ -0,0 +1,115 @@
1
+ # Specimen Project — Multi-Tenant Markdown Static Site
2
+
3
+ > **Status:** Specimens, not a maintained starter pack.
4
+ >
5
+ > These five `SKILL.md` files are *illustrative*. They show what the Skill Metadata Protocol contract looks like when applied to a recognizable real-world project (a multi-tenant markdown static site with a build-time image pipeline, a periodic link-rot scan, and a content-source router). They are not production skills — the truth-source paths point at files that exist in a *hypothetical* adopter's project, not in this repository. If you adopt one of these specimens for your own library, copy the `SKILL.md`, replace the truth-source paths with your real ones, and re-record the drift baseline.
6
+ >
7
+ > The stack is deliberately low-stakes: even if a reader template-copies one of these specimens and gets it slightly wrong, no payment, auth, or tenant-isolation boundary is compromised. The contract features (typed relations, grounding, drift detection, project tagging, archetype discipline) work the same against any stack.
8
+
9
+ ## What this directory demonstrates
10
+
11
+ The five specimens cover three Skill Graph archetypes (`capability`, `workflow`, `router`) at both relevant scopes (`codebase`, `portable`) and exercise the most-used contract features. The fourth archetype (`overlay`) is covered by the `lint-overlay` starter in the main `skills/` library.
12
+
13
+ | Specimen | Archetype | Scope | What it uniquely demonstrates |
14
+ |---|---|---|---|
15
+ | [`markdown-post-frontmatter-validation`](skills/markdown-post-frontmatter-validation/SKILL.md) | `capability` | `codebase` | Codebase-grounded capability with full `grounding` block, hierarchical `category` (`content/markdown/frontmatter`), and pushy `description` activation language |
16
+ | [`image-optimization-pipeline-config`](skills/image-optimization-pipeline-config/SKILL.md) | `capability` | `codebase` | Five concrete `failure_modes`, demonstrating the value of enumerable failure categories the eval grader can target (the canonical example of "what does a good `failure_modes` list look like") |
17
+ | [`link-rot-detection`](skills/link-rot-detection/SKILL.md) | `capability` | `portable` | The `portable` scope — repo-agnostic knowledge that does NOT need a `grounding` block (compare to the codebase-scoped specimens) |
18
+ | [`content-source-router`](skills/content-source-router/SKILL.md) | `router` | `codebase` | The `router` archetype with its required `## Routing Rules` section and the anti-default doctrine surfaced in the body |
19
+ | [`migrate-posts-to-v2-frontmatter`](skills/migrate-posts-to-v2-frontmatter/SKILL.md) | `workflow` | `codebase` | The `workflow` archetype with its required `## Workflow` section, plus a `relations.depends_on` declaration |
20
+
21
+ ## The conceptual relationship graph
22
+
23
+ The five specimens form a graph in concept (read this as a domain map, not as their literal `relations` blocks — see the note below):
24
+
25
+ ```
26
+ ┌─────────────────────────────────┐
27
+ │ migrate-posts-to-v2-frontmatter │
28
+ │ (workflow) │
29
+ │ │
30
+ │ depends conceptually on: │
31
+ │ - markdown-post-frontmatter- │
32
+ │ validation (the migration │
33
+ │ re-validates against the │
34
+ │ same schema this capability │
35
+ │ owns; flipping the validator│
36
+ │ is unsafe unless the │
37
+ │ capability's contract is │
38
+ │ authored correctly) │
39
+ └────────────┬────────────────────┘
40
+
41
+ │ (conceptual dependency)
42
+
43
+ ┌───────────────────────────────────────┐
44
+ │ markdown-post-frontmatter-validation │
45
+ │ (capability) │
46
+ │ │
47
+ │ Owns the contract for the YAML │
48
+ │ block at the top of every content │
49
+ │ file — required fields, tag │
50
+ │ vocabulary, slug consistency. │
51
+ └───────────────────────────────────────┘
52
+
53
+ ┌──────────────────────────────────┐ ┌─────────────────────────────────┐
54
+ │ image-optimization-pipeline- │ │ content-source-router │
55
+ │ config (capability) │◀───│ (router) │
56
+ │ │ │ │
57
+ │ Owns the build-time image │ │ Dispatches between markdown, │
58
+ │ pipeline contract — formats, │ │ MDX, and CMS-synced sources by │
59
+ │ srcset breakpoints, quality. │ │ file extension or content-path │
60
+ └──────────────────────────────────┘ │ prefix. Routes a request for a │
61
+ │ post to the right source skill. │
62
+ └─────────────────────────────────┘
63
+
64
+ ┌──────────────────────────────────┐
65
+ │ link-rot-detection │ (portable — applies to any │
66
+ │ (capability) │ markdown-content project; not │
67
+ │ │ coupled to this site's specific │
68
+ │ Periodic external-link scanner. │ file paths or build pipeline) │
69
+ │ Reports broken links nightly. │
70
+ └──────────────────────────────────┘
71
+ ```
72
+
73
+ ## Note on `relations` in these specimens
74
+
75
+ The Skill Graph lint enforces that every target named in `relations.depends_on`, `relations.verify_with`, etc. resolves to a real skill in `<repo>/skills/`. These specimen skills live at `examples/projects/markdown-static-site/skills/`, not in `<repo>/skills/`, so cross-specimen relations would fail lint.
76
+
77
+ To keep the specimens lint-clean, their `relations` blocks point at **real existing starter skills in this Skill Graph repository** (`testing-strategy`, `documentation`, `refactor`, `debugging`, `graph-audit`). The conceptual specimen-to-specimen relationships are documented in the diagram above and in each specimen's body prose. If you copy these specimens into a real adopter library where the sibling specimens are also present as production skills, you can additionally add cross-specimen `depends_on` entries — for example, `migrate-posts-to-v2-frontmatter` `depends_on: markdown-post-frontmatter-validation` — and lint will validate them.
78
+
79
+ ## How to verify a specimen
80
+
81
+ ```bash
82
+ # Lint a single specimen with --strict (zero warnings allowed)
83
+ node scripts/skill-lint.js --strict --skip-generator-parity \
84
+ examples/projects/markdown-static-site/skills/markdown-post-frontmatter-validation/SKILL.md
85
+
86
+ # Lint all five specimens (one command per specimen)
87
+ for spec in markdown-post-frontmatter-validation \
88
+ image-optimization-pipeline-config \
89
+ link-rot-detection \
90
+ content-source-router \
91
+ migrate-posts-to-v2-frontmatter; do
92
+ echo "=== Linting $spec ==="
93
+ node scripts/skill-lint.js --strict --skip-generator-parity \
94
+ "examples/projects/markdown-static-site/skills/$spec/SKILL.md"
95
+ done
96
+ ```
97
+
98
+ `--skip-generator-parity` is needed because the manifest sample at `examples/skills.manifest.sample.json` is generated only from `skills/`, not from this specimen directory. The skip is intentional — these specimens are demonstrations, not production library entries.
99
+
100
+ ## Adopting a specimen for your own library
101
+
102
+ 1. Copy the `SKILL.md` from this specimen directory to your own `skills/<name>/SKILL.md`
103
+ 2. Replace the `truth_sources` paths under `grounding` with the real file paths in your repository
104
+ 3. Replace the `paths:` glob entries with globs that match your real directory layout
105
+ 4. Update `owner` to your team handle
106
+ 5. Re-record the drift baseline: `node scripts/skill-graph-drift.js --record --apply skills/<name>`
107
+ 6. If you want to express cross-specimen dependencies as `relations.depends_on` (e.g., `migrate-posts → markdown-post-frontmatter-validation`), add them once the sibling specimens are also in your `skills/` directory
108
+
109
+ The specimens are MIT-licensed (per each `SKILL.md` frontmatter) so you can adapt them freely.
110
+
111
+ ## Why this stack and not another?
112
+
113
+ This specimen pack was deliberately chosen to be a low-stakes, recognizable, multi-tenant content stack: a markdown static site with a build pipeline, a periodic maintenance job, and a multi-source dispatch. Every working developer has built (or could build) something shaped like this. Critically, the stack involves **no security-critical primitives** — no payment processing, no auth flows, no tenant-isolation boundaries, no cryptographic verification. If a reader template-copies one of these specimens and gets it slightly wrong, the worst outcome is a broken image variant or a 404 on a bad route — not a customer-affecting incident.
114
+
115
+ The Skill Metadata Protocol features the specimens demonstrate (typed relations, grounding, drift detection, project tags, archetype discipline) work identically against any stack. A future specimen pack against a different stack would exercise the same contract; pick one whose worst-case mistake matches your risk tolerance.
@@ -0,0 +1,131 @@
1
+ ---
2
+ # yaml-language-server: $schema=https://skillgraph.dev/schemas/skill.v4.schema.json
3
+ schema_version: 4
4
+ name: content-source-router
5
+ description: "Use when dispatching a content-fetch task across the multiple sources the site reads from — local markdown under `content/`, MDX with React components under `content/mdx/`, and a headless-CMS sync under `lib/cms/`. Activate this skill whenever the task says 'render this content' or 'where does this post come from' without naming a specific source, or when adding a new source to the routing surface. Do NOT use for the actual rendering of one source (use the per-source skill — `markdown-post-frontmatter-validation`, an MDX rendering skill, or a CMS-sync skill) or for chasing a specific routing bug (use debugging)."
6
+ version: 0.1.0
7
+ type: router
8
+ category: content
9
+ domain: content/routing
10
+ scope: codebase
11
+ owner: markdown-static-site-maintainer
12
+ freshness: "2026-05-06"
13
+ drift_check:
14
+ last_verified: "2026-05-06"
15
+ eval_artifacts: none
16
+ eval_state: unverified
17
+ routing_eval: absent
18
+ stability: experimental
19
+ license: MIT
20
+ compatibility:
21
+ runtimes:
22
+ - node
23
+ node: ">=20"
24
+ notes: "Source dispatch by file extension and content-path prefix; assumes a unified content router."
25
+ allowed-tools: Read Grep
26
+ keywords:
27
+ - content source router
28
+ - content dispatch
29
+ - which content source
30
+ - markdown vs mdx
31
+ - cms vs local
32
+ - source dispatch
33
+ - content routing
34
+ - source selection
35
+ - content-fetch routing
36
+ triggers:
37
+ - content-source-router
38
+ paths:
39
+ - "lib/content/router.ts"
40
+ - "lib/content/sources/markdown.ts"
41
+ - "lib/content/sources/mdx.ts"
42
+ - "lib/content/sources/cms.ts"
43
+ examples:
44
+ - "the content fetcher just received a request — which source do I read from?"
45
+ - "add a fourth source (e.g., Notion API) to the routing table"
46
+ - "why did the router pick MDX when the file extension is `.md`?"
47
+ - "design the routing precedence between local files and the CMS sync"
48
+ anti_examples:
49
+ - "render this MDX page with React components"
50
+ - "the CMS sync is producing duplicate posts"
51
+ - "write a guide explaining the content routing"
52
+ relations:
53
+ boundary:
54
+ - skill: documentation
55
+ reason: "documentation writes prose ABOUT routing; this router is the routing logic itself"
56
+ - skill: debugging
57
+ reason: "debugging chases a specific routing mis-dispatch; this skill designs the routing table"
58
+ - skill: refactor
59
+ reason: "refactor restructures code; this skill defines the dispatch contract that any refactor must preserve"
60
+ verify_with:
61
+ - graph-audit
62
+ grounding:
63
+ domain_object: "Content source dispatch — the table that selects between local markdown, local MDX with React components, and headless-CMS-synced content based on file extension, content-path prefix, or explicit source hint"
64
+ grounding_mode: repo_specific
65
+ truth_sources:
66
+ - lib/content/router.ts
67
+ - lib/content/sources/markdown.ts
68
+ - lib/content/sources/mdx.ts
69
+ - lib/content/sources/cms.ts
70
+ failure_modes:
71
+ - silent_fallback_to_default_source
72
+ - file_extension_check_skipped
73
+ - cms_sync_drift_path_to_source_map_stale
74
+ - new_source_added_without_router_update
75
+ - error_response_from_one_source_silently_retried_via_another
76
+ evidence_priority: repo_code_first
77
+ portability:
78
+ readiness: scripted
79
+ targets:
80
+ - skill-md
81
+ workspace_tags:
82
+ - content
83
+ - static-site
84
+ lifecycle:
85
+ stale_after_days: 90
86
+ review_cadence: quarterly
87
+ ---
88
+
89
+ # Content Source Router
90
+
91
+ ## Coverage
92
+
93
+ - File-extension dispatch — `.md` routes to the markdown source, `.mdx` routes to the MDX source, no extension or `.cms.json` routes to the CMS source
94
+ - Content-path prefix dispatch — `content/posts/**` routes to local sources; `content/cms-synced/**` routes to the CMS source even if the file extension is `.md`
95
+ - Explicit source hints — internal callers (preview tools, manual reconciliation) pass an explicit `source` parameter that bypasses inspection
96
+ - Coverage-gap surfacing — when no detection rule matches a request, the router returns a structured "unknown source" result; it never silently picks a default
97
+ - Adding a new source — the workflow for landing a fourth source (Notion API, Sanity, etc.) without breaking the existing three (registration, routing precedence, fixture test, end-to-end content-fetch sanity)
98
+
99
+ ## Philosophy
100
+
101
+ A content router is a dispatch surface that has to be exactly right or the rest of the site reads the wrong content. Every misroute is either a 404 (the user sees nothing) or a wrong-content render (the user sees a different post than the URL implies). The discipline is the same anti-default doctrine the `skill-router` applies to skills: prefer an explicit signal over an inferred one, prefer an unambiguous match over a "best guess," and prefer surfacing a coverage gap loudly over silently routing to a default.
102
+
103
+ ## Routing Rules
104
+
105
+ The router evaluates four signals in priority order. The first signal that produces an unambiguous winner stops the chain.
106
+
107
+ | Priority | Signal | Source | Match rule |
108
+ |---|---|---|---|
109
+ | 1 | Explicit `source` parameter | Internal callers (preview, manual reconciliation) | Exact match against the `Source` enum. Bypasses all subsequent inspection. |
110
+ | 2 | Content-path prefix | Inbound request path | First matching prefix wins: `content/posts/` → markdown; `content/mdx/` → mdx; `content/cms-synced/` → cms. |
111
+ | 3 | File extension | Resolved file path | `.md` → markdown; `.mdx` → mdx; `.cms.json` → cms. |
112
+ | 4 | Explicit `source_hint` in query string | Trusted internal callers | Last-resort hint; surfaced as a warning in the router's audit log. |
113
+
114
+ ### Coverage-gap behavior
115
+
116
+ If no signal produces a match, the router returns `{ ok: false, reason: 'unknown_source', evidence: {...} }`. It does NOT fall back to a default source. The caller must handle the unknown-source case explicitly — typically by responding HTTP 404 and logging the full request shape for human triage.
117
+
118
+ ### Adding a new source
119
+
120
+ 1. Add the new source's path prefix and file extension to the priority-2 and priority-3 detection tables
121
+ 2. Add a source implementation in `lib/content/sources/<source>.ts` that mirrors the markdown source's interface
122
+ 3. Add the new source to the `Source` enum used at priority 1
123
+ 4. Add an end-to-end test that requests a fixture path matched by the new source and asserts the router selects it — without this, the router will silently fall through
124
+
125
+ ## Do NOT Use When
126
+
127
+ | Use instead | When |
128
+ |---|---|
129
+ | `markdown-post-frontmatter-validation` | The task is the actual frontmatter parsing for the markdown source — the router decides which source to read from, the source-specific skill validates and parses |
130
+ | `debugging` | A specific routing decision is wrong in production logs and you need to reproduce |
131
+ | `documentation` | The task is writing a contributor doc about the routing architecture |
@@ -0,0 +1,132 @@
1
+ ---
2
+ # yaml-language-server: $schema=https://skillgraph.dev/schemas/skill.v4.schema.json
3
+ schema_version: 4
4
+ name: image-optimization-pipeline-config
5
+ description: "Use when authoring or reviewing the build-time image pipeline config — defining responsive srcset breakpoints, picking output formats (AVIF / WebP / JPEG fallback), tuning compression quality per format, and ensuring the pipeline never produces a lossy artifact for source PNGs with transparency. Activate this skill whenever the task touches `lib/images/pipeline.config.ts`, `scripts/build-images.ts`, or any code path that resizes or recompresses content images. Do NOT use for runtime image rendering choices (use a frontend skill) or for chasing a specific build failure (use debugging)."
6
+ version: 0.1.0
7
+ type: capability
8
+ category: content
9
+ domain: content/build/images
10
+ scope: codebase
11
+ owner: markdown-static-site-maintainer
12
+ freshness: "2026-05-06"
13
+ drift_check:
14
+ last_verified: "2026-05-06"
15
+ eval_artifacts: none
16
+ eval_state: unverified
17
+ routing_eval: absent
18
+ stability: experimental
19
+ license: MIT
20
+ compatibility:
21
+ runtimes:
22
+ - node
23
+ node: ">=20"
24
+ notes: "sharp ^0.33 or equivalent; output formats AVIF / WebP / JPEG."
25
+ allowed-tools: Read Grep Bash
26
+ keywords:
27
+ - image optimization
28
+ - image pipeline
29
+ - srcset breakpoints
30
+ - responsive images
31
+ - AVIF WebP fallback
32
+ - sharp config
33
+ - PNG transparency
34
+ - compression quality
35
+ - image build pipeline
36
+ - format negotiation
37
+ - image resize
38
+ triggers:
39
+ - image-optimization-pipeline-config
40
+ paths:
41
+ - "lib/images/pipeline.config.ts"
42
+ - "scripts/build-images.ts"
43
+ - "lib/images/format-negotiation.ts"
44
+ - "!**/*.test.ts"
45
+ examples:
46
+ - "configure srcset breakpoints for hero images and thumbnails differently"
47
+ - "review the image pipeline — does it preserve transparency on PNG sources?"
48
+ - "add AVIF output to the pipeline alongside WebP and JPEG"
49
+ - "tune JPEG quality without breaking the AVIF pass"
50
+ anti_examples:
51
+ - "pick the right <picture> element markup at runtime"
52
+ - "the build is OOM-killed on the 10MB hero image"
53
+ - "rewrite the pipeline in a different image library"
54
+ relations:
55
+ boundary:
56
+ - skill: documentation
57
+ reason: "documentation writes prose about the image pipeline; this skill enforces the config contract in code"
58
+ - skill: debugging
59
+ reason: "debugging chases a specific build-time pipeline failure; this skill is the authoring/review primitive applied before failure"
60
+ - skill: refactor
61
+ reason: "refactor changes pipeline code shape; this skill enforces a specific config contract that must survive any refactor"
62
+ verify_with:
63
+ - testing-strategy
64
+ grounding:
65
+ domain_object: "Build-time image pipeline configuration — the resize/compress/format-negotiation rules that turn source images in `content/` into the responsive variants under `public/images/`"
66
+ grounding_mode: repo_specific
67
+ truth_sources:
68
+ - lib/images/pipeline.config.ts
69
+ - scripts/build-images.ts
70
+ - lib/images/format-negotiation.ts
71
+ failure_modes:
72
+ - lossy_compression_on_png_with_transparency
73
+ - missing_avif_fallback_for_unsupported_clients
74
+ - srcset_breakpoints_dont_match_layout_breakpoints
75
+ - quality_setting_too_aggressive_visible_artifacts
76
+ - pipeline_doesnt_skip_already_optimized_outputs
77
+ evidence_priority: repo_code_first
78
+ portability:
79
+ readiness: scripted
80
+ targets:
81
+ - skill-md
82
+ workspace_tags:
83
+ - content
84
+ - static-site
85
+ - build-pipeline
86
+ lifecycle:
87
+ stale_after_days: 90
88
+ review_cadence: quarterly
89
+ ---
90
+
91
+ # Image Optimization Pipeline Config
92
+
93
+ ## Coverage
94
+
95
+ - The format-negotiation table — which output formats the pipeline produces (AVIF + WebP + JPEG fallback is the canonical shape) and the priority order browsers should request
96
+ - Srcset breakpoints — the widths the pipeline emits per image role (hero, content, thumbnail) and how those align with the site's CSS layout breakpoints
97
+ - Per-format compression quality — JPEG at 80, WebP at 75, AVIF at 65 is a defensible default; anything more aggressive needs visual A/B verification
98
+ - Transparency preservation — the pipeline must detect alpha channels in source PNGs and disable lossy formats (or fall back to lossless WebP / AVIF) for those specific images
99
+ - Idempotency — the pipeline must not reprocess already-optimized outputs on every build (cache invalidation by source-file hash, not timestamp)
100
+ - Source-format coverage — what the pipeline accepts as input (PNG, JPEG, WebP source) and what it explicitly rejects (HEIC, RAW, video formats)
101
+
102
+ ## Philosophy
103
+
104
+ A build-time image pipeline is a config-defined contract between the source-of-truth images in `content/` and the bandwidth-optimized variants the browser receives. Bugs here are silent: a misconfigured srcset doesn't crash the build, it just sends a 4MB hero image to a phone. The discipline is to encode every choice — breakpoints, formats, quality, transparency rules — explicitly in the config, with a comment naming the constraint that drove each choice. Pipeline behavior should be derivable from the config without reading the build script.
105
+
106
+ ## Key Files
107
+
108
+ | File | Purpose |
109
+ |---|---|
110
+ | `lib/images/pipeline.config.ts` | The canonical config: breakpoints, formats, quality settings, source-format allowlist |
111
+ | `scripts/build-images.ts` | The build entrypoint that reads the config and walks `content/` — should be a thin runner with no embedded policy |
112
+ | `lib/images/format-negotiation.ts` | The runtime helper that maps a request's `Accept:` header to the right pre-built variant |
113
+
114
+ ## Verification
115
+
116
+ Before merging any change to the pipeline config:
117
+
118
+ - [ ] Every output format has an explicit quality setting; no relying on library defaults
119
+ - [ ] Srcset breakpoints match (or are a documented superset of) the site's CSS layout breakpoints
120
+ - [ ] PNG sources with an alpha channel route to lossless or alpha-preserving lossy formats (WebP-lossless, AVIF) — never to JPEG
121
+ - [ ] The pipeline skips already-optimized outputs by source-hash comparison; running the build twice in a row is a no-op on the second run
122
+ - [ ] An end-to-end test under `__tests__/images/` exercises a fixture image of each accepted format and asserts the expected variant set is produced
123
+ - [ ] The format-negotiation helper has a fallback path for clients that send no `Accept:` header (or one that lists no supported format)
124
+
125
+ ## Do NOT Use When
126
+
127
+ | Use instead | When |
128
+ |---|---|
129
+ | (a frontend image-rendering skill) | The task is choosing the right `<picture>` / `<img srcset=...>` markup at the component level |
130
+ | `debugging` | A specific image is failing to optimize and you need to reproduce from build logs |
131
+ | `documentation` | The task is writing a contributor doc explaining how the pipeline works |
132
+ | `refactor` | The task is restructuring the pipeline code without changing the config contract |