@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,265 @@
1
+ ---
2
+ name: suspense-patterns
3
+ description: "Use when designing or reviewing React Suspense usage: where to place Suspense boundaries to control loading granularity, the difference between Suspense for data fetching and Suspense for code splitting, how Suspense interacts with Server Components for streaming HTML, how error boundaries pair with Suspense (and why they must be distinct components), the relationship between Suspense and React's transition APIs (useTransition, startTransition), and the design rules that prevent waterfall fetches, layout shift, and SEO regressions. Covers React 18+ and 19's `use` hook for unwrapping Promises in Client Components. Do NOT use for general React rendering strategy choice (use rendering-models), for the underlying hook primitives (use hooks-patterns), for streaming protocols beyond Suspense (use streaming-architecture), or for Server Component design (use server-components-design)."
4
+ license: MIT
5
+ allowed-tools: Read Grep
6
+ metadata:
7
+ metadata: "{\"schema_version\":6,\"version\":\"1.0.0\",\"type\":\"capability\",\"category\":\"engineering\",\"domain\":\"engineering/frontend\",\"scope\":\"reference\",\"owner\":\"skill-graph-maintainer\",\"freshness\":\"2026-05-16\",\"drift_check\":\"{\\\\\\\"last_verified\\\\\\\":\\\\\\\"2026-05-16\\\\\\\"}\",\"eval_artifacts\":\"planned\",\"eval_state\":\"unverified\",\"routing_eval\":\"absent\",\"comprehension_state\":\"present\",\"stability\":\"experimental\",\"keywords\":\"[\\\\\\\"React Suspense\\\\\\\",\\\\\\\"Suspense boundary\\\\\\\",\\\\\\\"streaming HTML\\\\\\\",\\\\\\\"loading.tsx Next.js\\\\\\\",\\\\\\\"useTransition\\\\\\\",\\\\\\\"startTransition\\\\\\\",\\\\\\\"use hook React 19\\\\\\\",\\\\\\\"error boundary with Suspense\\\\\\\",\\\\\\\"Suspense waterfall\\\\\\\",\\\\\\\"parallel data fetching\\\\\\\",\\\\\\\"granular loading states\\\\\\\"]\",\"triggers\":\"[\\\\\\\"where should I put the Suspense boundary\\\\\\\",\\\\\\\"why is my page waiting for the slowest query\\\\\\\",\\\\\\\"how do I show partial loading states\\\\\\\",\\\\\\\"Suspense vs loading.tsx\\\\\\\",\\\\\\\"do I need useTransition here\\\\\\\",\\\\\\\"error boundary not catching\\\\\\\",\\\\\\\"data is waterfalling instead of parallel\\\\\\\"]\",\"examples\":\"[\\\\\\\"design a dashboard that streams three independent widgets in as their data resolves, with skeleton fallbacks for each\\\\\\\",\\\\\\\"decide whether a tab switch should use useTransition or a top-level Suspense fallback\\\\\\\",\\\\\\\"diagnose why a Suspense boundary is showing its fallback on every prop change\\\\\\\",\\\\\\\"pair a Suspense boundary with an ErrorBoundary so failed fetches show an error UI while successful ones stream in\\\\\\\"]\",\"anti_examples\":\"[\\\\\\\"choose between Server Components and Client Components (use server-components-design)\\\\\\\",\\\\\\\"design the dependency array for a useEffect that fetches data (use hooks-patterns)\\\\\\\",\\\\\\\"pick the streaming protocol for an LLM response (use streaming-architecture)\\\\\\\",\\\\\\\"decide between SSR and SSG for a marketing page (use rendering-models)\\\\\\\",\\\\\\\"design the streaming protocol itself — SSE, HTTP/2, chunked transfer-encoding (use streaming-architecture)\\\\\\\"]\",\"relations\":\"{\\\\\\\"related\\\\\\\":[\\\\\\\"server-components-design\\\\\\\",\\\\\\\"hooks-patterns\\\\\\\",\\\\\\\"streaming-architecture\\\\\\\",\\\\\\\"rendering-models\\\\\\\"],\\\\\\\"boundary\\\\\\\":[{\\\\\\\"skill\\\\\\\":\\\\\\\"server-components-design\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"server-components-design owns the discipline of which work runs on the server side of the RSC boundary; suspense-patterns owns the orthogonal discipline of where to place Suspense boundaries within a tree (RSC or Client).\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"hooks-patterns\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"hooks-patterns covers state, effects, and the closure model on Client Components; suspense-patterns covers the boundary-level loading-state model that operates on whole subtrees.\\\\\\\"}],\\\\\\\"verify_with\\\\\\\":[\\\\\\\"code-review\\\\\\\",\\\\\\\"rendering-models\\\\\\\"]}\",\"mental_model\":\"|\",\"purpose\":\"|\",\"boundary\":\"|\",\"analogy\":\"Suspense boundaries are to React's component tree what a restaurant's seating policy is to a multi-course meal — the policy decides whether courses arrive together (boundary around the whole meal, everyone waits for the slowest dish) or course-by-course (boundary per dish, each appears when ready). The component (the kitchen) just signals 'this course needs more time'; the boundary (the maître d') decides who waits for what and what placeholder shows in the meantime.\",\"misconception\":\"|\",\"concept\":\"{\\\\\\\"definition\\\\\\\":\\\\\\\"A Suspense boundary is a React component that catches a thrown Promise (or, in RSC, an unresolved async render) from anywhere in its descendant tree and shows a fallback UI until the Promise resolves. It is a declarative loading-state mechanism: the consuming component requests data without knowing whether it is loading, and the ancestor Suspense boundary handles the rendering branch.\\\\\\\",\\\\\\\"mental_model\\\\\\\":\\\\\\\"|\\\\\\\",\\\\\\\"purpose\\\\\\\":\\\\\\\"|\\\\\\\",\\\\\\\"boundary\\\\\\\":\\\\\\\"|\\\\\\\",\\\\\\\"taxonomy\\\\\\\":\\\\\\\"|\\\\\\\",\\\\\\\"analogy\\\\\\\":\\\\\\\"|\\\\\\\",\\\\\\\"misconception\\\\\\\":\\\\\\\"|\\\\\\\"}\",\"skill_graph_source_repo\":\"https://github.com/jacob-balslev/skill-graph\",\"skill_graph_protocol\":\"Skill Metadata Protocol v5\",\"skill_graph_project\":\"Skill Graph\",\"skill_graph_canonical_skill\":\"skills/suspense-patterns/SKILL.md\"}"
8
+ skill_graph_source_repo: "https://github.com/jacob-balslev/skill-graph"
9
+ skill_graph_protocol: Skill Metadata Protocol v4
10
+ skill_graph_project: Skill Graph
11
+ skill_graph_canonical_skill: skills/suspense-patterns/SKILL.md
12
+ ---
13
+
14
+ # Suspense Patterns
15
+
16
+ ## Coverage
17
+
18
+ The discipline of placing and pairing Suspense boundaries: how a Suspense boundary catches a thrown Promise (or unresolved async RSC) and renders a fallback, how boundary *placement* determines what waits for what, how Suspense composes with error boundaries (and why they cannot be the same component), how `useTransition` and `startTransition` change the boundary's behavior on updates, how Suspense for code splitting (`React.lazy`) and Suspense for data fetching share the same mechanism, and how Next.js App Router's `loading.tsx` is a sugar for a route-level Suspense boundary. The skill covers React 18+ semantics throughout and the React 19 `use` hook that lets Client Components unwrap Promises directly.
19
+
20
+ ## Philosophy
21
+
22
+ The classic React loading-state pattern was conditional rendering: each component owned an `isLoading` flag, returned a spinner or skeleton, and re-rendered when its data resolved. That pattern is local and imperative. It puts every component in the position of deciding *how* to communicate "I'm waiting" and *where* in its render output the placeholder goes. It does not compose; two sibling components loading in parallel produce two independent spinners with no coordinated layout.
23
+
24
+ Suspense inverts the responsibility. The component that needs data *throws* a Promise (or, in the case of RSC, the renderer encounters an unresolved `await`). The Suspense boundary catches the throw and renders a fallback for the entire subtree. The component itself only has to declare "I need this data" — never "I might not have it yet." The boundary, declared once, owns the placeholder UI for everything below it. The semantics compose: nested Suspense boundaries let outer fallbacks resolve first while inner sections continue to wait.
25
+
26
+ This is a different mental model than try/catch for asynchronicity. The thrown Promise is not an error — it is a signal that "this render cannot complete until this Promise resolves, please show the nearest Suspense fallback and try again when it does." React reconciles the wait at the boundary; the component code reads as if the data were already there.
27
+
28
+ The design discipline of Suspense is therefore about **boundary placement**, not about loading-state plumbing. The questions are: *what content should appear together?* (one boundary around them all) and *what content should stream in independently?* (separate boundaries around each). The boundary is a hierarchy decision in the UI, not a state machine inside a component.
29
+
30
+ ## Boundary Placement — The Central Design Question
31
+
32
+ A Suspense boundary catches *any* throw from *any* descendant. The boundary's job is to define a *grouping*: "these things appear together, and either they all show or the fallback shows."
33
+
34
+ Three placement strategies, each correct in different contexts:
35
+
36
+ **1. Page-level boundary.** One boundary near the root. The whole page shows a fallback until everything inside resolves.
37
+
38
+ ```tsx
39
+ <Suspense fallback={<PageSkeleton />}>
40
+ <Header />
41
+ <Dashboard />
42
+ <Footer />
43
+ </Suspense>
44
+ ```
45
+
46
+ - **Use when**: the page's value is only meaningful when complete (an onboarding flow, a checkout summary).
47
+ - **Cost**: the slowest part of the page determines the page's perceived load time.
48
+
49
+ **2. Section-level boundaries.** A boundary around each independent section.
50
+
51
+ ```tsx
52
+ <Header />
53
+ <Suspense fallback={<ChartSkeleton />}>
54
+ <Chart /> {/* slow query */}
55
+ </Suspense>
56
+ <Suspense fallback={<TableSkeleton />}>
57
+ <Table /> {/* faster query */}
58
+ </Suspense>
59
+ <Footer />
60
+ ```
61
+
62
+ - **Use when**: each section is independently meaningful and can stream in separately.
63
+ - **Cost**: more visible layout activity as sections pop in.
64
+
65
+ **3. Leaf-level boundaries.** A boundary on each loading-aware component itself.
66
+
67
+ ```tsx
68
+ <UserList>
69
+ {users.map(user => (
70
+ <Suspense key={user.id} fallback={<UserCardSkeleton />}>
71
+ <UserCard userId={user.id} />
72
+ </Suspense>
73
+ ))}
74
+ </UserList>
75
+ ```
76
+
77
+ - **Use when**: you have many parallel slow operations whose orderings don't matter.
78
+ - **Cost**: many small skeletons, potential layout thrash.
79
+
80
+ The wrong placement is usually too coarse: a single boundary near the page root waits for everything, defeating the streaming benefit. Less commonly, a boundary too fine produces a busy "many spinners" UI. The right granularity matches the page's actual visual hierarchy.
81
+
82
+ ## Parallel vs Waterfall Fetching
83
+
84
+ Suspense alone does not prevent waterfalls. A waterfall is when fetch B starts only after fetch A resolves, sequentially, when both could have started together.
85
+
86
+ ```tsx
87
+ // WATERFALL — parent awaits, then child fetches
88
+ async function ParentBad() {
89
+ const a = await fetchA()
90
+ return <ChildBad a={a} /> // ChildBad starts fetch B only after this point
91
+ }
92
+
93
+ // PARALLEL — both fetches kicked off at the same render level
94
+ async function ParentGood() {
95
+ const aPromise = fetchA()
96
+ const bPromise = fetchB()
97
+ const [a, b] = await Promise.all([aPromise, bPromise])
98
+ return <Child a={a} b={b} />
99
+ }
100
+
101
+ // SUSPENSE-PARALLEL — siblings under separate Suspense boundaries
102
+ function ParentStreaming() {
103
+ return (
104
+ <>
105
+ <Suspense fallback={<A_Skeleton />}><A /></Suspense>
106
+ <Suspense fallback={<B_Skeleton />}><B /></Suspense>
107
+ </>
108
+ )
109
+ }
110
+ ```
111
+
112
+ The pattern: kick off all independent fetches at the same level of the tree, then either `await Promise.all` if you need both before rendering, or wrap each child in its own Suspense boundary if they can stream in independently. A child that fetches its own data is fine — *as long as the parent doesn't `await` something the child depends on first*. Tree depth correlates with waterfall risk; flat trees with siblings starting requests in parallel correlate with optimal streaming.
113
+
114
+ ## Suspense and Error Boundaries
115
+
116
+ A Suspense boundary catches *thrown Promises*, not thrown Errors. An error boundary catches *thrown Errors*, not Promises. They are different React mechanisms that solve adjacent problems and **must be different components**, but they almost always pair together.
117
+
118
+ The canonical pair:
119
+
120
+ ```tsx
121
+ <ErrorBoundary fallback={<ErrorUI />}>
122
+ <Suspense fallback={<LoadingUI />}>
123
+ <DataLoadingComponent />
124
+ </Suspense>
125
+ </ErrorBoundary>
126
+ ```
127
+
128
+ Order matters:
129
+
130
+ - ErrorBoundary outside Suspense: the error UI replaces the entire group including any Suspense boundaries inside. A failed fetch shows the error UI; the loading state is no longer visible.
131
+ - Suspense outside ErrorBoundary: while loading, the Suspense fallback shows. If the fetch fails, the Suspense fallback unmounts and the error UI takes its place inside.
132
+
133
+ Most applications want ErrorBoundary on the outside so a failure replaces the loading state cleanly. Putting ErrorBoundary on the inside is appropriate when the loading state should remain visible and only a small portion of the subtree should swap to error UI.
134
+
135
+ React does not ship a built-in `ErrorBoundary` for function components (as of React 19). Use `react-error-boundary` (Kent C. Dodds) or implement a class component. Server Components' errors are caught by Next.js's `error.tsx` file, which is essentially a route-scoped ErrorBoundary.
136
+
137
+ ## `useTransition`, `startTransition`, and "Stale" Boundaries
138
+
139
+ By default, a Suspense boundary unmounts its children and shows the fallback whenever any descendant throws a Promise — even on subsequent updates (e.g., a tab switch that triggers a new fetch). This causes the "spinner flicker" anti-pattern: every interaction shows the loading state.
140
+
141
+ `useTransition` (and `startTransition`) mark an update as non-urgent. React holds the previous render visible while the new render's data is loading, instead of unmounting to the fallback:
142
+
143
+ ```tsx
144
+ function TabPanel({ activeTab }) {
145
+ return <Content tab={activeTab} /> // suspends on tab change
146
+ }
147
+
148
+ function Tabs() {
149
+ const [tab, setTab] = useState('a')
150
+ const [isPending, startTransition] = useTransition()
151
+
152
+ return (
153
+ <>
154
+ <button onClick={() => startTransition(() => setTab('b'))}>
155
+ {isPending ? 'Loading…' : 'Tab B'}
156
+ </button>
157
+ <Suspense fallback={<Skeleton />}>
158
+ <TabPanel activeTab={tab} />
159
+ </Suspense>
160
+ </>
161
+ )
162
+ }
163
+ ```
164
+
165
+ On the *first* render, the Suspense fallback shows (no previous render to keep). On *subsequent* tab changes triggered through `startTransition`, the previous tab's content stays mounted while the new tab loads, and `isPending` indicates the transition is in flight. The fallback only shows when there is no prior committed render to preserve.
166
+
167
+ Design rule: wrap user-initiated updates that may trigger Suspense in `startTransition` to avoid flickering fallbacks. Do not wrap initial-load updates in `startTransition`, since there is no previous content to preserve and the boundary will simply not show the fallback when you want it to.
168
+
169
+ ## Suspense in RSC and Next.js App Router
170
+
171
+ In an RSC tree, Suspense controls streaming HTML granularity. The server flushes everything outside the boundary first, then streams in each boundary's content as it resolves:
172
+
173
+ ```tsx
174
+ // app/dashboard/page.tsx — Server Component
175
+ export default async function Dashboard() {
176
+ return (
177
+ <>
178
+ <Header /> {/* renders and flushes immediately */}
179
+ <Suspense fallback={<Skeleton />}>
180
+ <SlowSection /> {/* streams in when data resolves */}
181
+ </Suspense>
182
+ </>
183
+ )
184
+ }
185
+ ```
186
+
187
+ Next.js App Router provides `loading.tsx` as sugar for a route-level Suspense boundary. A file at `app/dashboard/loading.tsx` is the fallback for an implicit `<Suspense>` wrapping `app/dashboard/page.tsx`. This is convention; identical semantics could be expressed with an explicit `<Suspense>` inside a layout.
188
+
189
+ The interaction between RSC and Suspense is one of the biggest design wins of the App Router: server-rendered content can stream in chunks without giving up server-side rendering for the initial-paint content. The discipline of `server-components-design` (where to draw the server/client boundary) and `suspense-patterns` (where to draw the streaming boundary) compose together — they are orthogonal axes on the same tree.
190
+
191
+ See `server-components-design` for the discipline of *what* runs on the server side of the RSC boundary; this skill covers *how to chunk the streaming output of that server tree*.
192
+
193
+ ## React 19's `use` Hook
194
+
195
+ React 19 adds `use(promise)` — a hook (with relaxed rules: can be called conditionally) that unwraps a Promise during render. Inside a Suspense boundary, `use` is how Client Components participate in data-fetching Suspense without throwing manually:
196
+
197
+ ```tsx
198
+ 'use client'
199
+ import { use } from 'react'
200
+
201
+ function Comments({ commentsPromise }) {
202
+ const comments = use(commentsPromise) // suspends until resolved
203
+ return <ul>{comments.map(c => <li key={c.id}>{c.text}</li>)}</ul>
204
+ }
205
+
206
+ // In a Server Component:
207
+ export default function Post() {
208
+ const commentsPromise = fetchComments() // not awaited — passed as Promise
209
+ return (
210
+ <Suspense fallback={<Spinner />}>
211
+ <Comments commentsPromise={commentsPromise} />
212
+ </Suspense>
213
+ )
214
+ }
215
+ ```
216
+
217
+ The Promise is created in the Server Component (which is free to start the fetch eagerly), passed across the boundary as a serializable Promise, and unwrapped in the Client Component via `use`. The Server Component doesn't block on the fetch; the Suspense boundary in the Server tree streams in the resolved content as soon as the Promise resolves on the client.
218
+
219
+ Before React 19, Client Components could not directly consume Suspense for data fetching without a library that implements the throw-a-Promise convention (React Query's Suspense mode, SWR with `suspense: true`, Relay). `use` makes the pattern first-class.
220
+
221
+ ## Common Anti-Patterns
222
+
223
+ | Anti-pattern | Why it's wrong | Fix |
224
+ |---|---|---|
225
+ | One Suspense boundary near the page root | Fallback replaces the entire page even though most is fast | Move boundaries closer to the slow data, one per independent slow section |
226
+ | ErrorBoundary inside Suspense | Loading state lingers when fetch fails | Put ErrorBoundary outside Suspense (the common case) |
227
+ | Awaiting parent data, then child fetches its own | Sequential waterfall | Kick off both fetches at the same level, pass Promises down or use Promise.all |
228
+ | Suspense fallback shows on every interaction | Fallback flickers on updates | Wrap user-initiated updates in `startTransition` / `useTransition` |
229
+ | Skeleton fallback that doesn't match the real content's layout | Layout shift when content arrives | Match skeleton dimensions to the real content (use same width/height/padding) |
230
+ | Both Suspense and an `isLoading` prop in the same component | Duplicate loading-state plumbing | Pick one — Suspense throws or local state, not both |
231
+ | Suspense around the whole `app/` layout | Every navigation shows the page-level fallback | Place fallback at the route segment level (`loading.tsx` per segment) |
232
+ | Reading `searchParams` in a Server Component without Suspense | Whole route becomes dynamic with no streaming | Wrap the searchParams-reading subtree in Suspense so the rest can stream as static |
233
+
234
+ ## Verification
235
+
236
+ After applying this skill, verify:
237
+
238
+ - [ ] Every slow data dependency is wrapped in a Suspense boundary co-located near the data, not at a far ancestor.
239
+ - [ ] Sibling sections that can stream independently have their own Suspense boundaries.
240
+ - [ ] Each Suspense boundary has a matching ErrorBoundary; their nesting order matches the desired failure-mode UI.
241
+ - [ ] User-initiated updates that may trigger Suspense are wrapped in `startTransition` to prevent fallback flicker.
242
+ - [ ] Skeleton fallbacks match real-content dimensions to avoid layout shift.
243
+ - [ ] No `isLoading` flag duplicates work that the Suspense boundary already handles.
244
+ - [ ] Parallel fetches are kicked off as siblings (not parent/child), avoiding waterfalls.
245
+ - [ ] In Next.js App Router, `loading.tsx` exists at the route segment that owns the slow data — not at a parent segment that includes fast content.
246
+
247
+ ## Grounding Sources
248
+
249
+ - React docs — [`<Suspense>`](https://react.dev/reference/react/Suspense). The official reference for the boundary and its semantics.
250
+ - React docs — [`useTransition`](https://react.dev/reference/react/useTransition) and [`startTransition`](https://react.dev/reference/react/startTransition). The transition APIs that prevent fallback flicker.
251
+ - React docs — [`use`](https://react.dev/reference/react/use). The React 19 Promise-unwrapping hook for Client Components.
252
+ - React 18 working group — [Suspense in React 18 design discussion](https://github.com/reactwg/react-18/discussions/47). The semantics and edge cases of the React 18 Suspense rewrite.
253
+ - Next.js docs — [Loading UI and Streaming](https://nextjs.org/docs/app/building-your-application/routing/loading-ui-and-streaming) and [`loading.tsx`](https://nextjs.org/docs/app/api-reference/file-conventions/loading) conventions. The route-segment Suspense sugar.
254
+ - Dodds, K. C. — [react-error-boundary](https://github.com/bvaughn/react-error-boundary). The de facto error-boundary library for function components.
255
+ - React docs — [Streaming](https://react.dev/reference/react-dom/server/renderToReadableStream). Server-side streaming primitives that Suspense rides on top of.
256
+
257
+ ## Do NOT Use When
258
+
259
+ | Instead of this skill | Use | Why |
260
+ |---|---|---|
261
+ | Choosing between SSR, SSG, ISR, and CSR rendering strategies | `rendering-models` | rendering-models owns the strategic decision; suspense-patterns is an in-tree mechanism that works with several of those strategies. |
262
+ | Designing which work runs as Server Components vs Client Components | `server-components-design` | server-components-design owns the server/client tree split; suspense-patterns is orthogonal — Suspense boundaries can live in either kind of component. |
263
+ | Hook discipline on Client Components (Rules of Hooks, useEffect, useMemo) | `hooks-patterns` | hooks-patterns covers the in-component logic primitives; Suspense operates at the tree level above hooks. |
264
+ | Streaming protocols broader than React Suspense (SSE, WebSocket, AI streaming) | `streaming-architecture` | streaming-architecture is the general protocol concern; React Suspense streaming is one application of the broader streaming toolkit. |
265
+ | Error-handling patterns (try/catch, error boundaries in isolation) | `code-review` and `react-error-boundary` library docs | This skill covers Suspense+ErrorBoundary *pairing*; isolated error-boundary discipline lives elsewhere. |
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: system-interface-contracts
3
+ description: "Use when defining or reviewing contracts between systems, modules, services, agents, jobs, events, APIs, or teams: ownership, inputs, outputs, invariants, compatibility, errors, idempotency, and versioning. Do NOT use for REST resource design alone (use `api-design`), async event contract detail (use `event-contract-design`), database schemas (use `data-modeling`), or post-failure debugging (use `debugging`)."
4
+ license: MIT
5
+ compatibility: "Portable contract-design discipline across code modules, services, queues, APIs, webhooks, jobs, and agent interfaces."
6
+ allowed-tools: Read Grep
7
+ metadata:
8
+ metadata: "{\"schema_version\":6,\"version\":\"1.0.0\",\"type\":\"capability\",\"category\":\"engineering\",\"domain\":\"architecture/contracts\",\"scope\":\"portable\",\"owner\":\"skill-graph-maintainer\",\"freshness\":\"2026-05-11\",\"drift_check\":\"{\\\\\\\"last_verified\\\\\\\":\\\\\\\"2026-05-11\\\\\\\"}\",\"eval_artifacts\":\"present\",\"eval_state\":\"unverified\",\"routing_eval\":\"absent\",\"stability\":\"experimental\",\"keywords\":\"[\\\\\\\"interface contract\\\\\\\",\\\\\\\"system boundary\\\\\\\",\\\\\\\"contract design\\\\\\\",\\\\\\\"compatibility contract\\\\\\\",\\\\\\\"input output invariant\\\\\\\",\\\\\\\"event schema\\\\\\\",\\\\\\\"module boundary\\\\\\\",\\\\\\\"idempotency contract\\\\\\\",\\\\\\\"versioning contract\\\\\\\",\\\\\\\"error contract\\\\\\\"]\",\"examples\":\"[\\\\\\\"define the contract between the ingestion job and the dashboard view layer\\\\\\\",\\\\\\\"what invariants must this event producer and consumer share?\\\\\\\",\\\\\\\"review this module boundary for missing ownership and compatibility rules\\\\\\\",\\\\\\\"we need an interface contract before several agents implement opposite sides of the boundary\\\\\\\"]\",\"anti_examples\":\"[\\\\\\\"design the REST endpoints, status codes, and pagination\\\\\\\",\\\\\\\"create database tables and constraints\\\\\\\",\\\\\\\"investigate why this existing integration is failing in production\\\\\\\",\\\\\\\"write an ADR after the interface decision has already been accepted\\\\\\\"]\",\"relations\":\"{\\\\\\\"boundary\\\\\\\":[{\\\\\\\"skill\\\\\\\":\\\\\\\"api-design\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"api-design owns REST/API surface shape; system-interface-contracts owns the broader boundary contract across any interface type\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"event-contract-design\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"event-contract-design owns asynchronous event envelopes, schemas, topics, and compatibility; system-interface-contracts owns the broader boundary discipline\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"data-modeling\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"data-modeling owns stored data structure; system-interface-contracts owns producer/consumer expectations and compatibility\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"debugging\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"debugging investigates a known failure; system-interface-contracts prevents ambiguous boundary behavior before failure\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"architecture-decision-records\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"architecture-decision-records records the adopted contract decision; this skill designs the contract\\\\\\\"}],\\\\\\\"related\\\\\\\":[\\\\\\\"bounded-context-mapping\\\\\\\",\\\\\\\"api-design\\\\\\\",\\\\\\\"event-storming\\\\\\\",\\\\\\\"event-contract-design\\\\\\\",\\\\\\\"state-machine-modeling\\\\\\\"],\\\\\\\"verify_with\\\\\\\":[\\\\\\\"testing-strategy\\\\\\\",\\\\\\\"code-review\\\\\\\"]}\",\"portability\":\"{\\\\\\\"readiness\\\\\\\":\\\\\\\"scripted\\\\\\\",\\\\\\\"targets\\\\\\\":[\\\\\\\"skill-md\\\\\\\"]}\",\"lifecycle\":\"{\\\\\\\"stale_after_days\\\\\\\":365,\\\\\\\"review_cadence\\\\\\\":\\\\\\\"quarterly\\\\\\\"}\",\"skill_graph_source_repo\":\"https://github.com/jacob-balslev/skill-graph\",\"skill_graph_protocol\":\"Skill Metadata Protocol v5\",\"skill_graph_project\":\"Skill Graph\",\"skill_graph_canonical_skill\":\"skills/system-interface-contracts/SKILL.md\"}"
9
+ skill_graph_source_repo: "https://github.com/jacob-balslev/skill-graph"
10
+ skill_graph_protocol: Skill Metadata Protocol v4
11
+ skill_graph_project: Skill Graph
12
+ skill_graph_canonical_skill: skills/system-interface-contracts/SKILL.md
13
+ ---
14
+
15
+ # System Interface Contracts
16
+
17
+ ## Coverage
18
+
19
+ Design and audit contracts across boundaries: modules, services, event producers/consumers, background jobs, APIs, webhooks, databases, and agents. Covers ownership, data shape, required/optional fields, invariants, preconditions, postconditions, idempotency, ordering, error behavior, retries, compatibility, versioning, and verification.
20
+
21
+ ## Philosophy
22
+
23
+ A boundary without a contract is a rumor. The implementation may work today because both sides accidentally agree, but the first independent change exposes the missing contract.
24
+
25
+ Contracts should be specific enough to protect both sides from drift and small enough that teams can keep them true. The contract is not the implementation. It is the stable promise at the boundary.
26
+
27
+ ## Method
28
+
29
+ 1. Name the producer, consumer, owner, and direction of dependency.
30
+ 2. Define inputs, outputs, and allowed states.
31
+ 3. State invariants and forbidden states.
32
+ 4. Define error, retry, timeout, and idempotency behavior.
33
+ 5. Specify compatibility: additive changes, breaking changes, versioning, and deprecation.
34
+ 6. Identify observability required to prove the contract is being honored.
35
+ 7. Add contract tests or fixtures where possible.
36
+
37
+ ## Evals
38
+
39
+ This skill ships a comprehension-eval artifact at [`examples/evals/system-interface-contracts.json`](https://github.com/jacob-balslev/skill-graph/blob/main/examples/evals/system-interface-contracts.json). The checklist below is the authoring gate for system-boundary contracts; the eval file is the grader surface.
40
+
41
+ ## Verification
42
+
43
+ - [ ] Each side has a named owner
44
+ - [ ] Required and optional fields are explicit
45
+ - [ ] Invariants and forbidden states are stated
46
+ - [ ] Error and retry behavior is deterministic
47
+ - [ ] Idempotency keys or deduplication rules exist where duplicate delivery is possible
48
+ - [ ] Compatibility rules distinguish additive from breaking changes
49
+ - [ ] Contract tests, fixtures, or examples exist for positive and negative cases
50
+
51
+ ## Do NOT Use When
52
+
53
+ | Use instead | When |
54
+ |---|---|
55
+ | `api-design` | You specifically need REST/resource endpoint shape, HTTP semantics, or API envelope design. |
56
+ | `event-contract-design` | You specifically need asynchronous event envelope, schema, topic, replay, or consumer compatibility rules. |
57
+ | `data-modeling` | You need persistence schema, keys, indexes, or data lifecycle. |
58
+ | `debugging` | A boundary has already failed and the task is root-cause analysis. |
59
+ | `architecture-decision-records` | The contract is chosen and needs a durable decision record. |
@@ -0,0 +1,201 @@
1
+ ---
2
+ name: task-analysis
3
+ description: "Use when auditing a route, defining a route contract, reviewing onboarding or setup flows, diagnosing why a page feels confusing, or when the user asks about top tasks, time-to-value, branching, dead ends, or task complexity. Provides goal-driven UX analysis that turns vague critique into explicit goal -> task -> subtask decomposition and a primary / secondary / supporting hierarchy contract for the first viewport. Do NOT use for control-pattern choice (use `interaction-patterns`), visual craft (use `visual-design-foundations`), responsive layout (use `layout-composition`), or accessibility-only QA (use `a11y`)."
4
+ license: MIT
5
+ compatibility: "Stack-agnostic. The actor / scenario / top-task model, the five friction dimensions, the breakpoint taxonomy, and the primary / secondary / supporting hierarchy apply to any UI under review; persona / journey YAML files are illustrative — substitute the equivalents (Notion, Confluence, in-repo Markdown, Figma annotations) of your team."
6
+ allowed-tools: Read Grep
7
+ metadata:
8
+ metadata: "{\"schema_version\":6,\"version\":\"1.0.0\",\"type\":\"workflow\",\"category\":\"foundations\",\"domain\":\"foundations/analysis\",\"scope\":\"portable\",\"owner\":\"skill-graph-maintainer\",\"freshness\":\"2026-05-06\",\"drift_check\":\"{\\\\\\\"last_verified\\\\\\\":\\\\\\\"2026-05-06\\\\\\\"}\",\"eval_artifacts\":\"present\",\"eval_state\":\"unverified\",\"routing_eval\":\"absent\",\"stability\":\"experimental\",\"keywords\":\"[\\\\\\\"top task analysis\\\\\\\",\\\\\\\"goal-driven UX review\\\\\\\",\\\\\\\"route audit workflow\\\\\\\",\\\\\\\"onboarding flow analysis\\\\\\\",\\\\\\\"task friction scoring\\\\\\\",\\\\\\\"five friction dimensions\\\\\\\",\\\\\\\"dead-end detection\\\\\\\",\\\\\\\"hidden next-step diagnosis\\\\\\\",\\\\\\\"hierarchy contract first viewport\\\\\\\",\\\\\\\"actor and scenario identification\\\\\\\",\\\\\\\"subtask sequencing skip paths\\\\\\\",\\\\\\\"flow breakpoint taxonomy\\\\\\\",\\\\\\\"mobile-only friction\\\\\\\",\\\\\\\"role-permission confusion\\\\\\\",\\\\\\\"time-to-value analysis\\\\\\\",\\\\\\\"task vs goal distinction\\\\\\\",\\\\\\\"excessive branching detection\\\\\\\",\\\\\\\"persona-journey route mapping\\\\\\\"]\",\"examples\":\"[\\\\\\\"this onboarding flow feels confusing — analyze the task structure\\\\\\\",\\\\\\\"audit this dashboard route for whether it supports the user's top task\\\\\\\",\\\\\\\"what should be above the fold on this page?\\\\\\\",\\\\\\\"users keep abandoning this wizard at step 3 — find the breakpoint\\\\\\\",\\\\\\\"decide what belongs in the first viewport for this analytics page\\\\\\\",\\\\\\\"diagnose why this multi-step setup has too many decisions\\\\\\\",\\\\\\\"the team disagrees on what the top task is for this route — settle it\\\\\\\"]\",\"anti_examples\":\"[\\\\\\\"review this PR for code quality\\\\\\\",\\\\\\\"audit this UI for WCAG 2.2 violations\\\\\\\",\\\\\\\"decide the CSS grid layout for this hero section\\\\\\\",\\\\\\\"pick the right colors for this status badge\\\\\\\",\\\\\\\"build the navigation taxonomy for the whole product\\\\\\\",\\\\\\\"should we use a dropdown or a stepper here\\\\\\\"]\",\"relations\":\"{\\\\\\\"boundary\\\\\\\":[{\\\\\\\"skill\\\\\\\":\\\\\\\"code-review\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"code-review judges the quality and correctness of a specific change at PR scope; task-analysis judges whether a route's structure supports the user's top task — same 'review this page' prompt routes by whether the lens is code or user goal\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"a11y\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"a11y is accessibility QA against WCAG / ARIA / keyboard / screen-reader contracts on an existing UI; task-analysis is goal-driven decomposition of what the UI must support — same 'review this UI' prompt routes by whether the trigger is accessibility compliance or user-task fit\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"layout-composition\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"layout-composition owns responsive section order, grids, and scan patterns; task-analysis stops at the first-viewport hierarchy contract\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"visual-design-foundations\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"visual-design-foundations owns visual craft; task-analysis owns whether the route supports the user's goal\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"interaction-patterns\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"interaction-patterns owns control-pattern selection; task-analysis identifies the decision or action that the pattern must support\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"interaction-feedback\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"interaction-feedback owns loading, progress, success, error, retry, and undo behavior; task-analysis identifies where feedback is needed\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"information-architecture\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"information-architecture owns navigation and page grouping across a product; task-analysis owns one route or flow\\\\\\\"}],\\\\\\\"related\\\\\\\":[\\\\\\\"diagnosis\\\\\\\",\\\\\\\"pattern-recognition\\\\\\\",\\\\\\\"information-architecture\\\\\\\",\\\\\\\"layout-composition\\\\\\\",\\\\\\\"interaction-patterns\\\\\\\",\\\\\\\"interaction-feedback\\\\\\\"],\\\\\\\"verify_with\\\\\\\":[\\\\\\\"a11y\\\\\\\"]}\",\"portability\":\"{\\\\\\\"readiness\\\\\\\":\\\\\\\"scripted\\\\\\\",\\\\\\\"targets\\\\\\\":[\\\\\\\"skill-md\\\\\\\"]}\",\"lifecycle\":\"{\\\\\\\"stale_after_days\\\\\\\":365,\\\\\\\"review_cadence\\\\\\\":\\\\\\\"quarterly\\\\\\\"}\",\"skill_graph_source_repo\":\"https://github.com/jacob-balslev/skill-graph\",\"skill_graph_protocol\":\"Skill Metadata Protocol v5\",\"skill_graph_project\":\"Skill Graph\",\"skill_graph_canonical_skill\":\"skills/task-analysis/SKILL.md\"}"
9
+ skill_graph_source_repo: "https://github.com/jacob-balslev/skill-graph"
10
+ skill_graph_protocol: Skill Metadata Protocol v4
11
+ skill_graph_project: Skill Graph
12
+ skill_graph_canonical_skill: skills/task-analysis/SKILL.md
13
+ ---
14
+
15
+ # Task Analysis
16
+
17
+ ## Coverage
18
+
19
+ Goal-driven UX analysis for any route or flow: identifying the actor and scenario from persona / journey contracts, extracting the top task for a route, breaking tasks into sequential subtasks with skip paths and blocked states, scoring task friction across five dimensions (discoverability, cognitive load, effort, trust, recovery), identifying breakpoints (dead ends, hidden next steps, excessive branching, unclear success states, misleading value presentation, mobile-only friction, role / permission confusion), and producing the primary / secondary / supporting hierarchy contract for the first viewport that hands off to layout and composition skills. Applies to route audits, onboarding flow reviews, setup wizards, multi-step processes, and any page where "it feels confusing" needs a structured diagnosis. Includes a five-step analysis protocol, a structured output template, an anti-pattern list (Nielsen-first heuristic critique, "rendered correctly" as proof, ignoring skip paths, decorative polish over task completion, fictional persona detail), and a verification checklist that confirms the actor and scenario were named explicitly rather than assumed.
20
+
21
+ ## Philosophy
22
+
23
+ UX quality is not about how a page looks — it is about whether the page supports the user's top task. Without task analysis, agents default to generic heuristic critique ("add more whitespace," "reduce clutter") that sounds professional but changes nothing about task completion.
24
+
25
+ This skill exists because aesthetic-first design reviews produce recommendations that do not address why users abandon flows. Task analysis forces the question: what is the user trying to accomplish, and where does the route break that goal? Once the goal is explicit, every layout, copy, and interaction decision can be measured against task support rather than personal taste — and the conversation moves from subjective debate ("I think this looks better") to falsifiable claim ("this change reduces friction at the discoverability dimension for step 2").
26
+
27
+ ## Workflow
28
+
29
+ Use the ordered phases, checklists, and guardrails in the sections below as the canonical workflow for this skill. When multiple subsections describe steps, follow them in the order presented.
30
+
31
+ > If you cannot state the user's goal, top task, and next step, you are not analyzing the UX yet.
32
+
33
+ ### When to Activate
34
+
35
+ Load this skill when:
36
+
37
+ - auditing a route or flow
38
+ - writing or updating route contracts
39
+ - checking onboarding / setup / multi-step flows
40
+ - diagnosing friction, dead ends, or too many clicks
41
+ - deciding what belongs above the fold on a task-heavy page
42
+
43
+ ### Core Model
44
+
45
+ Separate these concepts clearly:
46
+
47
+ | Term | Meaning | Example |
48
+ | ------------ | ---------------------------------------- | -------------------------------------------------- |
49
+ | **Goal** | Why the user is here | "Know if my marketing campaign performed well" |
50
+ | **Task** | Observable activity that serves the goal | Open the analytics report and read summary metrics |
51
+ | **Subtask** | Smaller step within the task | Navigate to Analytics → select 7D → inspect summary |
52
+ | **Scenario** | The specific situation / route context | Marketing manager checking this week's results on mobile |
53
+
54
+ Never confuse a UI interaction with a goal. Filling a form is not the goal; it is a task in service of the goal.
55
+
56
+ ### Inputs To Read First
57
+
58
+ 1. The route contract or page contract for the target route (if your team maintains one).
59
+ 2. The canonical persona definitions for your product.
60
+ 3. The canonical journey / scenario sequencing for your product.
61
+ 4. Any narrative route-flow documentation (user-journey docs, sitemaps).
62
+
63
+ If these inputs are missing, state the missing source of truth instead of inventing task structure. If the inputs exist but disagree (the persona doc says one thing and the journey doc another), flag the discrepancy in your output rather than picking a winner silently.
64
+
65
+ **Caution:** these sources may have drifted. Trust the most-recently-updated canonical source for the field in question and document any conflicts you encountered.
66
+
67
+ ### Analysis Protocol
68
+
69
+ #### 1. Identify the actor and scenario
70
+
71
+ Output:
72
+
73
+ ```text
74
+ Actor: <persona_id>
75
+ Scenario: <journey_id> — <scenario>
76
+ Business objective: <activation | retention | expansion | operational_efficiency>
77
+ ```
78
+
79
+ #### 2. Extract the top task
80
+
81
+ For the target route, answer:
82
+
83
+ - What is the primary task this route must support?
84
+ - What would success look like in the smallest useful unit of time?
85
+ - What information must be visible before the user can proceed confidently?
86
+
87
+ Also name the hierarchy contract for the first viewport:
88
+
89
+ - **Primary:** what must be seen first.
90
+ - **Secondary:** what must frame or support the primary task.
91
+ - **Supporting:** what can wait until the user asks for more detail.
92
+
93
+ If you cannot name these three layers, you are not ready to decide what belongs above the fold. Once named, hand off to `layout-composition` to turn the hierarchy into actual section order, scan pattern, and component decisions.
94
+
95
+ #### 3. Break the task into subtasks
96
+
97
+ Represent the flow as ordered steps:
98
+
99
+ ```text
100
+ Goal
101
+ → Task
102
+ → Subtask 1
103
+ → Subtask 2
104
+ → Branch / skip
105
+ → Completion state
106
+ ```
107
+
108
+ Include skip paths, blocked states, and role-limited variants.
109
+
110
+ #### 4. Score task friction
111
+
112
+ For each subtask, evaluate:
113
+
114
+ | Dimension | Questions |
115
+ | ------------------- | ---------------------------------------------------------------- |
116
+ | **Discoverability** | Can the user find the next step quickly? |
117
+ | **Cognitive load** | Does the user need to remember hidden context or jargon? |
118
+ | **Effort** | How many clicks / scrolls / decisions are required? |
119
+ | **Trust** | Is uncertainty, incompleteness, or gating communicated honestly? |
120
+ | **Recovery** | If blocked, is the next step obvious and actionable? |
121
+
122
+ #### 5. Identify the breakpoints
123
+
124
+ Flag the exact point where the journey degrades:
125
+
126
+ - dead end
127
+ - excessive branching
128
+ - hidden next step
129
+ - unclear success state
130
+ - misleading value presentation
131
+ - mobile-only friction
132
+ - role / permission confusion
133
+
134
+ ### Output Template
135
+
136
+ ```markdown
137
+ ## Task Analysis
138
+
139
+ - Actor: <persona>
140
+ - Scenario: <journey>
141
+ - Top task: <single-sentence task>
142
+ - Success metric: <time-to-value or completion target>
143
+
144
+ ### Task Breakdown
145
+
146
+ 1. <subtask>
147
+ 2. <subtask>
148
+ 3. <subtask>
149
+
150
+ ### Friction Points
151
+
152
+ - <point> — why it increases effort or confusion
153
+
154
+ ### Failure Modes
155
+
156
+ - <documented route failure mode>
157
+
158
+ ### UX Implication
159
+
160
+ - What must change in layout, copy, affordance, or state handling to support the task better
161
+ ```
162
+
163
+ ### Anti-Patterns
164
+
165
+ - Starting with Nielsen heuristics before naming the top task.
166
+ - Treating "rendered correctly" as proof the task is supported.
167
+ - Ignoring skip paths or role-limited states.
168
+ - Counting decorative polish as more important than task completion.
169
+ - Using fictional persona detail instead of route / journey evidence.
170
+
171
+ ## Evals
172
+
173
+ This skill ships a comprehension-eval artifact at [`examples/evals/task-analysis.json`](https://github.com/jacob-balslev/skill-graph/blob/main/examples/evals/task-analysis.json). The checklist below is the authoring gate for route and flow analysis; the eval file is the grader surface.
174
+
175
+ ## Verification
176
+
177
+ After applying task analysis, verify:
178
+
179
+ - [ ] Actor and scenario are explicitly named (persona id + journey id), not assumed.
180
+ - [ ] Top task is stated as a single sentence describing what the user is trying to accomplish.
181
+ - [ ] Subtasks are listed in sequential order with skip paths and blocked states noted.
182
+ - [ ] Friction scoring covers all five dimensions (discoverability, cognitive load, effort, trust, recovery).
183
+ - [ ] Breakpoints identify the exact point where the journey degrades, not generic complaints.
184
+ - [ ] Primary / secondary / supporting hierarchy contract is named for the first viewport.
185
+ - [ ] Layout and composition decisions are deferred to `layout-composition`, not attempted here.
186
+ - [ ] Recommendations are framed in terms of task support, not aesthetic preference.
187
+
188
+ ## Do NOT Use When
189
+
190
+ | Instead, use | Why |
191
+ |---|---|
192
+ | `code-review` | Reviewing a specific PR or change for code quality and correctness. Code-review owns the per-change judgment; task-analysis owns the per-route user-goal decomposition. |
193
+ | `a11y` | Auditing an existing UI against WCAG / ARIA / keyboard / screen-reader contracts. A11y owns the accessibility-compliance lens; task-analysis owns the user-goal-fit lens. |
194
+ | `diagnosis` | Triaging an unknown software failure into a problem class before debugging begins. Diagnosis owns the per-incident triage; task-analysis owns the per-route user-task decomposition. |
195
+ | `pattern-recognition` | Detecting recurring UX-friction patterns across many routes. Pattern-recognition owns the cross-route class analysis; task-analysis owns the within-route analysis of one route at a time. |
196
+ | `documentation` | Writing or updating route-contract docs, page-template specs, or sitemap docs. Documentation owns the artifact format; task-analysis produces the content that goes into those artifacts. |
197
+ | `layout-composition` | Deciding CSS grid layout, section ordering, breakpoints, or scan-pattern composition. Task-analysis stops at the hierarchy contract; layout-composition owns the visual structure decisions. |
198
+ | `visual-design-foundations` | Reviewing visual polish (spacing, color, typography). Task-analysis is goal-first; visual-design-foundations owns visual craft. |
199
+ | `interaction-patterns` | Choosing controls such as dropdowns, steppers, tabs, modals, or inline edit. Interaction-patterns owns pattern selection. |
200
+ | `interaction-feedback` | Adding loading skeletons, empty states, progress indicators, retry, or undo behavior. Interaction-feedback owns UI-state patterns; task-analysis identifies where such patterns are needed without specifying which. |
201
+ | `information-architecture` | Building the navigation taxonomy or page-group structure for an entire product. IA owns structural organization across pages; task-analysis owns per-page user-goal analysis. |
@@ -0,0 +1,66 @@
1
+ ---
2
+ name: taxonomy-design
3
+ description: "Use when designing a controlled classification system: category trees, facets, browse taxonomies, SKOS broader/narrower relationships, tagging rules, and duplicate-category cleanup. Do NOT use for formal ontology axioms with reasoning constraints (use `ontology-modeling`), broad knowledge-representation choice (use `knowledge-modeling`), or one-off edge typing (use `semantic-relations`)."
4
+ license: MIT
5
+ compatibility: "Portable taxonomy design discipline for skill libraries, product information architecture, documentation trees, and knowledge graphs."
6
+ allowed-tools: Read Grep
7
+ metadata:
8
+ metadata: "{\"schema_version\":6,\"version\":\"1.1.0\",\"type\":\"capability\",\"category\":\"foundations\",\"domain\":\"foundations/classification\",\"scope\":\"portable\",\"owner\":\"skill-graph-maintainer\",\"freshness\":\"2026-05-16\",\"drift_check\":\"{\\\\\\\"last_verified\\\\\\\":\\\\\\\"2026-05-16\\\\\\\"}\",\"eval_artifacts\":\"planned\",\"eval_state\":\"unverified\",\"routing_eval\":\"absent\",\"comprehension_state\":\"present\",\"stability\":\"experimental\",\"keywords\":\"[\\\\\\\"taxonomy design\\\\\\\",\\\\\\\"controlled vocabulary\\\\\\\",\\\\\\\"browse taxonomy\\\\\\\",\\\\\\\"category hierarchy\\\\\\\",\\\\\\\"facets\\\\\\\",\\\\\\\"tagging rules\\\\\\\",\\\\\\\"broader narrower\\\\\\\",\\\\\\\"SKOS hierarchy\\\\\\\",\\\\\\\"classification cleanup\\\\\\\",\\\\\\\"duplicate categories\\\\\\\",\\\\\\\"taxonomy governance\\\\\\\"]\",\"examples\":\"[\\\\\\\"our skill categories are drifting: some are by domain, some by activity, and some by tool - how should the taxonomy be redesigned?\\\\\\\",\\\\\\\"should these be tags, facets, or child categories?\\\\\\\",\\\\\\\"build a clean category tree for these concepts without making every related term a parent-child relation\\\\\\\",\\\\\\\"we have analytics, observability, telemetry, and monitoring as categories - which should merge and which should stay separate?\\\\\\\"]\",\"anti_examples\":\"[\\\\\\\"define OWL class restrictions and property domains for this knowledge base\\\\\\\",\\\\\\\"decide whether this knowledge should be represented as a graph, frame, rules, or hybrid\\\\\\\",\\\\\\\"type this single relation as meronymy, causality, synonymy, or thematic role\\\\\\\",\\\\\\\"write user-facing labels for this navigation item\\\\\\\"]\",\"relations\":\"{\\\\\\\"boundary\\\\\\\":[{\\\\\\\"skill\\\\\\\":\\\\\\\"ontology-modeling\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"ontology-modeling owns formal axioms and reasoning semantics; taxonomy-design owns human-governed classification\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"knowledge-modeling\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"knowledge-modeling chooses the representation paradigm; taxonomy-design works inside the classification paradigm once chosen\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"semantic-relations\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"semantic-relations types individual concept edges; taxonomy-design governs the category system and assignment rules\\\\\\\"}],\\\\\\\"related\\\\\\\":[\\\\\\\"information-architecture\\\\\\\",\\\\\\\"skill-infrastructure\\\\\\\",\\\\\\\"context-graph\\\\\\\"],\\\\\\\"depends_on\\\\\\\":[\\\\\\\"semantic-relations\\\\\\\"],\\\\\\\"verify_with\\\\\\\":[\\\\\\\"semantic-relations\\\\\\\",\\\\\\\"context-graph\\\\\\\"]}\",\"portability\":\"{\\\\\\\"readiness\\\\\\\":\\\\\\\"scripted\\\\\\\",\\\\\\\"targets\\\\\\\":[\\\\\\\"skill-md\\\\\\\"]}\",\"lifecycle\":\"{\\\\\\\"stale_after_days\\\\\\\":365,\\\\\\\"review_cadence\\\\\\\":\\\\\\\"quarterly\\\\\\\"}\",\"mental_model\":\"|\",\"purpose\":\"|\",\"boundary\":\"|\",\"analogy\":\"Taxonomy design is to a knowledge surface what a public library's call-number system is to its collection — the books haven't changed, but the system determines which books a researcher finds when looking under 'biology' versus 'medicine' versus 'public health.' A library that categorizes by acquisition date (the author's mental map) is unfindable; one that categorizes by subject with cross-references and facet headings (retrieval contract for the navigator) is searchable. Dewey Decimal is a hierarchy with facet-like subdivisions; Library of Congress is more faceted; both are taxonomies, both have explicit retrieval-task analyses behind their structure.\",\"misconception\":\"|\",\"concept\":\"{\\\\\\\"definition\\\\\\\":\\\\\\\"Taxonomy design is the discipline of constructing a controlled classification system — a category tree (possibly augmented by facets) that organizes a set of items so they can be browsed, found, and reasoned about. Drawing from Ranganathan's faceted classification, Aristotelian genus-species hierarchy, and the SKOS data model, it treats classification as a *retrieval contract* between the system that organizes and the readers who navigate, not as a private mental map of the author.\\\\\\\",\\\\\\\"mental_model\\\\\\\":\\\\\\\"|\\\\\\\",\\\\\\\"purpose\\\\\\\":\\\\\\\"|\\\\\\\",\\\\\\\"boundary\\\\\\\":\\\\\\\"|\\\\\\\",\\\\\\\"taxonomy\\\\\\\":\\\\\\\"|\\\\\\\",\\\\\\\"analogy\\\\\\\":\\\\\\\"|\\\\\\\",\\\\\\\"misconception\\\\\\\":\\\\\\\"|\\\\\\\"}\",\"skill_graph_source_repo\":\"https://github.com/jacob-balslev/skill-graph\",\"skill_graph_protocol\":\"Skill Metadata Protocol v5\",\"skill_graph_project\":\"Skill Graph\",\"skill_graph_canonical_skill\":\"skills/taxonomy-design/SKILL.md\"}"
9
+ skill_graph_source_repo: "https://github.com/jacob-balslev/skill-graph"
10
+ skill_graph_protocol: Skill Metadata Protocol v4
11
+ skill_graph_project: Skill Graph
12
+ skill_graph_canonical_skill: skills/taxonomy-design/SKILL.md
13
+ ---
14
+
15
+ # Taxonomy Design
16
+
17
+ ## Coverage
18
+
19
+ Design controlled classification systems for skills, docs, product catalogs, navigation trees, knowledge graphs, and tags. Covers hierarchy shape, facet selection, synonym control, category granularity, assignment rules, governance, and drift cleanup. Use SKOS-grade distinctions: broader/narrower for hierarchy, related for association, preferred labels for canonical terms, alternate labels for aliases.
20
+
21
+ ## Philosophy
22
+
23
+ A taxonomy is a retrieval contract. It should make things findable by the people or agents who browse it, not mirror the author's private mental map. The main failure mode is mixing incompatible organizing principles: by audience, by tool, by lifecycle phase, by domain, and by risk all in the same tree.
24
+
25
+ Prefer shallow, stable, mutually understandable structure. Add facets when one tree cannot express all valid access paths. Do not turn every semantic relation into a hierarchy.
26
+
27
+ ## Method
28
+
29
+ 1. Name the retrieval tasks: what questions must the taxonomy answer?
30
+ 2. Choose one primary organizing principle for the tree: domain, activity, artifact, lifecycle, or risk.
31
+ 3. Move secondary dimensions into facets or tags.
32
+ 4. Apply the substitution test to every parent-child pair: every child must be a kind of the parent.
33
+ 5. Define assignment rules for ambiguous cases.
34
+ 6. Add canonical labels and aliases; never let synonyms become sibling categories.
35
+ 7. Test with real items and real prompts; count "misc", duplicates, and uncertain assignments.
36
+
37
+ ## Verification
38
+
39
+ - [ ] Every child category passes the IS-A substitution test against its parent
40
+ - [ ] Sibling categories share the same organizing principle
41
+ - [ ] Cross-cutting concerns are facets/tags, not duplicated branches
42
+ - [ ] Canonical labels and aliases are explicit
43
+ - [ ] Ambiguous assignment rules are written down
44
+ - [ ] No category exists only because one item needed somewhere to go
45
+ - [ ] Real items can be placed without using a catch-all bucket
46
+
47
+ ## Do NOT Use When
48
+
49
+ | Use instead | When |
50
+ |---|---|
51
+ | `ontology-modeling` | You need formal class/property axioms, RDF/OWL semantics, or automated reasoning. |
52
+ | `knowledge-modeling` | You are still choosing between graph, frame, rule, concept-map, or hybrid representations. |
53
+ | `semantic-relations` | You only need to type the relation between two concepts. |
54
+ | `information-architecture` | You are arranging pages, navigation, labels, and wayfinding for a user-facing experience. |
55
+
56
+ ## Key Sources
57
+
58
+ - Ranganathan, S. R. (1933/1962). *Colon Classification* and *Prolegomena to Library Classification* (3rd ed.). Asia Publishing House. The foundational statement of faceted classification and the PMEST formula (Personality / Matter / Energy / Space / Time); the alternative to strict hierarchical trees that all modern multi-criteria classification descends from.
59
+ - W3C. [SKOS Simple Knowledge Organization System Reference](https://www.w3.org/TR/skos-reference/) (2009). The standard data model for taxonomies and thesauri: broader/narrower/related, prefLabel/altLabel, and the minimal formalism required for transmissible classification.
60
+ - Bowker, G. C., & Star, S. L. (1999). *Sorting Things Out: Classification and Its Consequences*. MIT Press. The canonical critical study of how classifications shape what becomes thinkable; the source of the "boundary infrastructure" framing and the empirical evidence that taxonomies without explicit retrieval-task analysis become abandoned bureaucratic structure.
61
+ - Hjørland, B. (2008). "What is Knowledge Organization (KO)?" *Knowledge Organization*, 35(2-3), 86-101. Authoritative survey of the field; situates taxonomy design within library and information science.
62
+ - Aristotle. *Categories* (c. 350 BCE). The philosophical root of hierarchical classification: genus-species definitions, the predicables, and the structure that two and a half millennia of taxonomy work has built on or against.
63
+ - Vander Wal, T. (2005). ["Folksonomy."](https://vanderwal.net/folksonomy.html) The coinage and definition of folksonomy; the alternative to controlled vocabulary and the trade-offs that come with emergent tagging.
64
+ - Morville, P., & Rosenfeld, L. (2006). *Information Architecture for the World Wide Web* (3rd ed.). O'Reilly. The practitioner reference for taxonomy work in user-facing systems; the bridge from classification to navigation.
65
+ - Glushko, R. J. (Ed.). (2013). *The Discipline of Organizing*. MIT Press. Cross-disciplinary synthesis treating classification as a design activity rather than a domain reflection; explicit attention to facet design and retrieval-task analysis.
66
+ - Schema.org. [Type Hierarchy](https://schema.org/docs/full.html). A pragmatic large-scale web taxonomy; a real-world example of design choices, facet vs hierarchy decisions, and the costs of governance at scale.