@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,136 @@
1
+ ---
2
+ name: http-semantics
3
+ description: "Use when designing or reviewing HTTP-based systems where method semantics, status codes, idempotency, safe methods, conditional requests, content negotiation, caching headers, or representation metadata are load-bearing. Covers the RFC 9110/9111/9112 contract layer below any specific framework. Do NOT use for API surface shape and route taxonomy (use api-design), for WebSocket or SSE bidirectional streams (use streaming-architecture skill when available), for vendor-specific webhook signing (use webhook-integration), or for transport-level concerns like TLS or QUIC (use platform-level documentation)."
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/protocol\",\"scope\":\"reference\",\"owner\":\"skill-graph-maintainer\",\"freshness\":\"2026-05-15\",\"drift_check\":\"{\\\\\\\"last_verified\\\\\\\":\\\\\\\"2026-05-15\\\\\\\"}\",\"eval_artifacts\":\"planned\",\"eval_state\":\"unverified\",\"routing_eval\":\"absent\",\"comprehension_state\":\"present\",\"stability\":\"experimental\",\"keywords\":\"[\\\\\\\"HTTP semantics\\\\\\\",\\\\\\\"RFC 9110\\\\\\\",\\\\\\\"idempotent methods\\\\\\\",\\\\\\\"safe methods\\\\\\\",\\\\\\\"HTTP status codes\\\\\\\",\\\\\\\"conditional requests\\\\\\\",\\\\\\\"content negotiation\\\\\\\",\\\\\\\"cache control\\\\\\\",\\\\\\\"HTTP caching\\\\\\\",\\\\\\\"representation metadata\\\\\\\"]\",\"triggers\":\"[\\\\\\\"what status code should this return\\\\\\\",\\\\\\\"is this method idempotent\\\\\\\",\\\\\\\"RFC 9110\\\\\\\",\\\\\\\"conditional request\\\\\\\",\\\\\\\"cache control header\\\\\\\"]\",\"examples\":\"[\\\\\\\"decide whether bulk-update should be PUT or PATCH\\\\\\\",\\\\\\\"explain why this endpoint should return 409 instead of 400\\\\\\\",\\\\\\\"review whether this DELETE handler is truly idempotent\\\\\\\",\\\\\\\"design the Vary header for this endpoint that varies on Accept-Language\\\\\\\"]\",\"anti_examples\":\"[\\\\\\\"design the JSON shape of the request and response bodies (use api-design)\\\\\\\",\\\\\\\"verify a Stripe webhook signature (use webhook-integration)\\\\\\\",\\\\\\\"decide between WebSocket and SSE for live updates (use streaming-architecture)\\\\\\\"]\",\"relations\":\"{\\\\\\\"related\\\\\\\":[\\\\\\\"api-design\\\\\\\",\\\\\\\"webhook-integration\\\\\\\",\\\\\\\"system-interface-contracts\\\\\\\"],\\\\\\\"boundary\\\\\\\":[{\\\\\\\"skill\\\\\\\":\\\\\\\"api-design\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"api-design owns the surface shape (routes, request/response schemas, pagination); http-semantics owns the protocol-level method/status/header contract that any HTTP API builds on.\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"webhook-integration\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"webhook-integration owns inbound provider mechanics (signing, retry, vendor-specific topics); http-semantics owns vendor-neutral HTTP method and status semantics.\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"system-interface-contracts\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"system-interface-contracts owns cross-boundary contract shapes regardless of transport; http-semantics is HTTP-specific.\\\\\\\"}],\\\\\\\"verify_with\\\\\\\":[\\\\\\\"api-design\\\\\\\",\\\\\\\"code-review\\\\\\\"]}\",\"mental_model\":\"|\",\"purpose\":\"|\",\"boundary\":\"|\",\"analogy\":\"HTTP semantics is to web APIs what the rules of grammar are to written language — the framework provides the dictionary (routes, handlers, middleware) but the grammar is non-negotiable, and a sentence that follows the dictionary while violating the grammar is technically intelligible but causes downstream tooling (CDNs, proxies, client libraries) to misinterpret it.\",\"misconception\":\"|\",\"concept\":\"{\\\\\\\"definition\\\\\\\":\\\\\\\"HTTP semantics is the IETF-standardized contract layer (RFC 9110, 9111, 9112) that defines method meanings, status code families, request/response metadata, conditional requests, content negotiation, and caching — independent of any specific framework or language. It is the wire-level meaning that every HTTP API inherits.\\\\\\\",\\\\\\\"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/http-semantics/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/http-semantics/SKILL.md
12
+ ---
13
+
14
+ # HTTP Semantics
15
+
16
+ ## Coverage
17
+
18
+ The IETF contract layer for HTTP-based systems: method semantics (RFC 9110 § 9), status code families (§ 15), request/response metadata (§ 6-8, 12), conditional requests (§ 13), content negotiation (§ 12), and the caching model (RFC 9111). Applies to any system using HTTP as a transport: REST APIs, GraphQL endpoints, webhook receivers, browser fetches, proxy behavior, CDN configuration.
19
+
20
+ ## Philosophy
21
+
22
+ HTTP is older and more carefully specified than most of the frameworks running on top of it. RFC 9110 is the consolidated semantics reference (June 2022, obsoletes RFC 7230-7235); it represents 25+ years of distilled experience from browsers, proxies, CDNs, and load balancers. Most "weird HTTP behavior" stories come down to a framework default that doesn't match the spec.
23
+
24
+ The discipline is to ground HTTP decisions in the RFC, not the framework. When the framework default conflicts with the spec, the spec wins for portability: anything outside your codebase (a CDN, a corporate proxy, a client library in a different language) will follow the RFC, not your framework's documentation.
25
+
26
+ ## Method Semantics (RFC 9110 § 9)
27
+
28
+ | Method | Safe | Idempotent | Cacheable | Typical use |
29
+ |---|---|---|---|---|
30
+ | GET | yes | yes | yes | Retrieve a representation |
31
+ | HEAD | yes | yes | yes | Retrieve metadata only |
32
+ | POST | no | no | only with explicit freshness | Submit data; catch-all for non-fitting operations |
33
+ | PUT | no | yes | no | Replace target resource with payload |
34
+ | DELETE | no | yes | no | Remove target resource |
35
+ | PATCH | no | not by default | no | Apply a partial modification (RFC 5789) |
36
+ | OPTIONS | yes | yes | no | Discover capabilities |
37
+ | TRACE | yes | yes | no | Loop-back diagnostic |
38
+ | CONNECT | no | no | no | Establish a tunnel |
39
+
40
+ **Idempotency rule (RFC 9110 § 9.2.2):** repeated requests have the same effect on resource state as a single request. The response code may differ across invocations (204 → 404 for DELETE); idempotency is about the post-condition, not the post-response.
41
+
42
+ **Safe-method rule (§ 9.2.1):** safe methods do not modify resource state. Servers MUST NOT depend on side effects of safe methods (e.g., logging counters that affect business logic are not "side effects" in the sense of the spec).
43
+
44
+ ## Status Code Selection
45
+
46
+ Use the **first digit** as the contract; use the **last two digits** as refinement. A proxy that doesn't understand a specific 4xx will treat it as a generic 4xx.
47
+
48
+ | Family | When to use | Common errors |
49
+ |---|---|---|
50
+ | 2xx | Request fulfilled. 200 default; 201 for creation with Location header; 202 for async accepted; 204 for success with no body | Returning 200 with `{ error: ... }` body — wrong family |
51
+ | 3xx | Client must take further action. 301/308 for permanent; 302/307 for temporary; 303 after a POST to direct to the result; 304 for cache validation hit | Returning 302 to authentication when 401 is correct |
52
+ | 4xx | Client error. 400 for malformed request; 401 for missing/invalid credentials; 403 for valid credentials but insufficient authorization; 404 for not-found (or hidden); 405 for wrong method on valid target; 409 for state conflict; 410 for permanently gone; 412 for failed precondition; 415 for unsupported media type; 422 for valid syntax but unprocessable; 428 for required precondition; 429 for rate limit | Using 400 for everything; conflating 401 (who) with 403 (what allowed) |
53
+ | 5xx | Server error. 500 default; 501 for not-implemented method; 502 for upstream bad response; 503 for temporary unavailability (with Retry-After); 504 for upstream timeout | Returning 500 when the cause is client input (should be 4xx) |
54
+
55
+ ## Conditional Requests (RFC 9110 § 13)
56
+
57
+ Use conditional requests to make non-idempotent operations safe under retry and to enable cache validation.
58
+
59
+ | Header | Pairs with | Semantic |
60
+ |---|---|---|
61
+ | If-Match | ETag | "Only apply if the resource still matches this version" — protects against lost-update on PUT/PATCH/DELETE |
62
+ | If-None-Match | ETag | "Apply only if the resource has changed" — primary cache validation |
63
+ | If-Modified-Since | Last-Modified | Date-based cache validation (lower precision than ETag) |
64
+ | If-Unmodified-Since | Last-Modified | Date-based lost-update protection |
65
+
66
+ A non-idempotent operation made conditional with If-Match becomes safe to retry: the server applies it once if the precondition holds, and returns 412 Precondition Failed every subsequent time.
67
+
68
+ ## Caching (RFC 9111)
69
+
70
+ The freshness model has three orthogonal questions:
71
+
72
+ 1. **Is this response cacheable at all?** Default yes for safe + 2xx + no explicit no-store. Cache-Control: no-store opts out.
73
+ 2. **For how long is it fresh?** Cache-Control: max-age=N (seconds) is authoritative. Expires is the older alternative.
74
+ 3. **What request headers participate in cache-key construction?** Vary lists them. A response without Vary on an endpoint that varies by Accept-Language will be served to all languages from one cached entry.
75
+
76
+ **Cache-Control directive cheat sheet:**
77
+
78
+ | Directive | Where | Meaning |
79
+ |---|---|---|
80
+ | max-age=N | response | Fresh for N seconds |
81
+ | s-maxage=N | response | Fresh in shared caches for N seconds (overrides max-age) |
82
+ | no-cache | response | Must revalidate before reuse (still cacheable) |
83
+ | no-store | response | Do not cache at all |
84
+ | private | response | Cacheable only in single-user caches (browser, not CDN) |
85
+ | public | response | Cacheable in shared caches even if normally not |
86
+ | must-revalidate | response | Stale entries must be revalidated, not served |
87
+ | stale-while-revalidate=N | response | Serve stale for N seconds while async revalidating |
88
+ | stale-if-error=N | response | Serve stale for N seconds on origin error |
89
+
90
+ ## Content Negotiation (RFC 9110 § 12)
91
+
92
+ Server-driven negotiation uses request Accept-* headers and response Vary header. Pattern:
93
+
94
+ ```
95
+ Request:
96
+ Accept: application/json, text/html;q=0.9
97
+ Accept-Language: en, fr;q=0.8
98
+
99
+ Response:
100
+ Content-Type: application/json
101
+ Content-Language: en
102
+ Vary: Accept, Accept-Language
103
+ ```
104
+
105
+ The Vary response header is the contract for downstream caches: it lists the request headers the cache must match on. Forgetting Vary causes language-A users to see language-B responses cached by a CDN.
106
+
107
+ ## Verification
108
+
109
+ After applying this skill, verify:
110
+ - [ ] Method choice (GET/POST/PUT/PATCH/DELETE) is justified by the operation's safe/idempotent properties, not by convention.
111
+ - [ ] Status codes use the correct family; first digit semantically matches the outcome.
112
+ - [ ] Non-idempotent operations that need retry safety use If-Match + ETag (or an idempotency-key pattern).
113
+ - [ ] Cached responses include Cache-Control with explicit max-age or no-store.
114
+ - [ ] Responses that vary on request headers declare Vary correctly.
115
+ - [ ] 401 is used for "who are you" failures; 403 for "you can't do that" failures; the two are not interchangeable.
116
+ - [ ] DELETE handlers are spec-idempotent: server state is the same after one invocation as after many, regardless of the response code returned.
117
+
118
+ ## Do NOT Use When
119
+
120
+ | Instead of this skill | Use | Why |
121
+ |---|---|---|
122
+ | Designing the JSON request/response shape | `api-design` | api-design owns the surface; this skill owns the protocol layer below it |
123
+ | Verifying a vendor webhook signature | `webhook-integration` | webhook-integration owns inbound provider mechanics |
124
+ | Designing a WebSocket or SSE stream | `real-time-updates` or a streaming-architecture skill | Those skills own bidirectional / streaming patterns above HTTP |
125
+ | Designing the cross-boundary contract regardless of transport | `system-interface-contracts` | system-interface-contracts owns the contract layer that may or may not be HTTP |
126
+ | Designing a GraphQL schema or resolver chain | `api-design` or a graphql skill | This skill applies to HTTP semantics under any payload format, but schema design is api-design's surface |
127
+ | Configuring TLS, HTTP/2, HTTP/3 transport | platform documentation | Transport syntax (RFC 9112/9113/9114) is below the semantics layer |
128
+
129
+ ## Key Sources
130
+
131
+ - Fielding, R., & Reschke, J. (Eds.) (2022). [RFC 9110: HTTP Semantics](https://datatracker.ietf.org/doc/html/rfc9110). IETF. The consolidated semantics reference; obsoletes RFC 7230-7235.
132
+ - Fielding, R., Nottingham, M., & Reschke, J. (Eds.) (2022). [RFC 9111: HTTP Caching](https://datatracker.ietf.org/doc/html/rfc9111). IETF. The caching model.
133
+ - Fielding, R., Nottingham, M., & Reschke, J. (Eds.) (2022). [RFC 9112: HTTP/1.1](https://datatracker.ietf.org/doc/html/rfc9112). IETF. The HTTP/1.1 wire syntax.
134
+ - Dusseault, L., & Snell, J. (Eds.) (2010). [RFC 5789: PATCH Method for HTTP](https://datatracker.ietf.org/doc/html/rfc5789). IETF. The PATCH method specification.
135
+ - Fielding, R. T. (2000). [Architectural Styles and the Design of Network-based Software Architectures](https://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm). Ph.D. dissertation, UC Irvine. The original REST definition.
136
+ - MDN Web Docs. [HTTP](https://developer.mozilla.org/en-US/docs/Web/HTTP). Practical reference complementing the RFCs.
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: ideation
3
+ description: "Use when generating a wide range of solution concepts before converging on a direction, running structured idea-generation sessions, breaking out of solution fixation, or moving from divergent to convergent selection with explicit criteria. Do NOT use for collaborative engineering domain discovery (event-storming), solo deep technical design, or making final go/no-go investment decisions — those require different methods."
4
+ license: CC-BY-4.0
5
+ metadata:
6
+ metadata: "{\"schema_version\":6,\"version\":\"1.0.0\",\"type\":\"capability\",\"category\":\"design\",\"scope\":\"portable\",\"owner\":\"skill-graph-maintainer\",\"freshness\":\"2026-05-12\",\"drift_check\":\"{\\\\\\\"last_verified\\\\\\\":\\\\\\\"2026-05-12\\\\\\\"}\",\"eval_artifacts\":\"planned\",\"eval_state\":\"unverified\",\"routing_eval\":\"absent\",\"stability\":\"experimental\",\"keywords\":\"[\\\\\\\"crazy 8s\\\\\\\",\\\\\\\"brainstorming\\\\\\\",\\\\\\\"SCAMPER\\\\\\\",\\\\\\\"worst possible idea\\\\\\\",\\\\\\\"headlines from the future\\\\\\\",\\\\\\\"dot voting\\\\\\\",\\\\\\\"NUF test\\\\\\\",\\\\\\\"divergent thinking\\\\\\\",\\\\\\\"convergent thinking\\\\\\\",\\\\\\\"ideation workshop\\\\\\\",\\\\\\\"impact effort matrix\\\\\\\",\\\\\\\"weighted decision matrix\\\\\\\",\\\\\\\"suspended judgment\\\\\\\",\\\\\\\"design sprint sketch\\\\\\\"]\",\"triggers\":\"[\\\\\\\"brainstorm\\\\\\\",\\\\\\\"ideation session\\\\\\\",\\\\\\\"crazy 8s\\\\\\\",\\\\\\\"generate concepts\\\\\\\",\\\\\\\"narrow down ideas\\\\\\\"]\",\"examples\":\"[\\\\\\\"Run a crazy-8s round on this how-might-we statement and produce a divergent set.\\\\\\\",\\\\\\\"Apply SCAMPER to this existing feature to generate variant concepts.\\\\\\\",\\\\\\\"Use dot voting and an impact/effort matrix to converge on three concepts to prototype.\\\\\\\",\\\\\\\"Help me set up a worst-possible-idea round to break the team out of solution fixation.\\\\\\\"]\",\"anti_examples\":\"[\\\\\\\"Decide whether to invest in this feature for the next quarter.\\\\\\\",\\\\\\\"Model the bounded contexts for the order-fulfillment domain.\\\\\\\",\\\\\\\"Write the production code for the selected concept.\\\\\\\"]\",\"relations\":\"{\\\\\\\"related\\\\\\\":[\\\\\\\"problem-framing\\\\\\\",\\\\\\\"prototyping\\\\\\\",\\\\\\\"design-thinking\\\\\\\"],\\\\\\\"boundary\\\\\\\":[{\\\\\\\"skill\\\\\\\":\\\\\\\"event-storming\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"event-storming is a collaborative engineering discovery practice for mapping domain events and aggregates. ideation generates user-facing concept variants and applies divergent/convergent selection — different purpose, different output, different participants.\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"conceptual-modeling\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"conceptual-modeling produces a single best model of a domain. ideation deliberately produces many alternatives before selecting — opposite epistemic stance.\\\\\\\"}]}\",\"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/ideation/SKILL.md\"}"
7
+ skill_graph_source_repo: "https://github.com/jacob-balslev/skill-graph"
8
+ skill_graph_protocol: Skill Metadata Protocol v4
9
+ skill_graph_project: Skill Graph
10
+ skill_graph_canonical_skill: skills/ideation/SKILL.md
11
+ ---
12
+
13
+ # Ideation
14
+
15
+ ## Coverage
16
+ Ideation covers the techniques that produce many concept variants in response to a well-framed problem, then converge on a subset worth pursuing. The practice has two distinct halves and treats them as separable activities. **Divergent techniques** include **Crazy 8s** (eight sketches in eight minutes, popularized by Google Ventures' Design Sprint), **brainwriting** (silent written generation that bypasses dominant voices), **SCAMPER** (Substitute / Combine / Adapt / Modify / Put-to-another-use / Eliminate / Reverse — Bob Eberle's adaptation of Alex Osborn's checklist), **worst-possible-idea** (deliberately bad concepts to disinhibit and reveal hidden assumptions), **headlines-from-the-future** (write the press release for the launched product), and **analogous inspiration** (how do other domains solve adjacent problems).
17
+
18
+ **Convergent techniques** include **dot voting** (each participant gets N stickers to place on concepts they would invest in), the **NUF test** (Is it New, Useful, Feasible?), **impact / effort 2×2** plotting, **weighted decision matrices** for multi-criteria selection, and **assumption-testing prioritization** (which concepts, if true, would teach the team the most). Convergent methods make the selection criteria explicit before voting begins, so the choice is defensible rather than political.
19
+
20
+ The skill includes the **facilitation mechanics** that keep the two halves separate: enforcing silence during divergent rounds so no idea is judged before it lands, time-boxing strictly so quantity is prioritized over polish, withholding feedback ("yes-and" rather than "yes-but"), and only opening evaluative discussion in the convergent phase. This separation is the single most-cited determinant of brainstorming productivity in the literature (going back to Osborn 1953, with the criticism / refinements from Diehl & Stroebe and others incorporated via brainwriting variants).
21
+
22
+ ## Philosophy
23
+ Ideation is built on a counterintuitive claim: that quantity precedes quality. The case is empirical and structural — judging an idea costs cognitive effort, and judgment running in parallel with generation suppresses generation. Teams that judge as they ideate produce fewer ideas, and the ideas they produce skew toward the safe middle of the distribution. By splitting the modes, divergent rounds produce a wider range, and convergent rounds can then prune intelligently because the field is large enough that pruning is meaningful.
24
+
25
+ The discipline is sceptical of "good enough" early ideas. The first three ideas a team generates are usually the obvious ones — the ones any competitor has also considered. The interesting ideas live in the second half of a forced-quantity round, where the obvious is exhausted and the team is pushed into less-trodden territory. Worst-possible-idea exercises serve the same function from the other direction: by deliberately violating norms, they expose which norms were holding the design back.
26
+
27
+ ## Verification
28
+ - A divergent round produced at least 20 concept variants (or 8 per participant in a Crazy 8s round) before any convergence began.
29
+ - The selection criteria for convergence were named in writing *before* voting started — not retrofitted to justify the popular choice.
30
+ - The selected concepts are materially different from each other; if the three "winners" are variations on the same idea, the divergent round failed to spread.
31
+ - At least one selected concept is uncomfortable or unfamiliar to the team — pure consensus often signals the convergent phase compressed the range.
32
+ - The team can articulate, for each selected concept, what specific question it would help answer in the next stage (prototyping or testing).
33
+ - Time-boxes were enforced; the session did not drift into open-ended discussion that re-merged the divergent and convergent modes.
34
+
35
+ ## Do NOT Use When
36
+ - The problem has not been framed — return to **problem-framing** first; ideating on a fuzzy brief produces a fuzzy concept set.
37
+ - The team needs to commit to a single direction with budget implications, not just narrow a creative field — pair ideation with a separate investment-decision process.
38
+ - The task is modeling engineering domain events and aggregates — use **event-storming**.
39
+ - The output should be a single best architecture or model — use **conceptual-modeling**, which seeks correctness rather than variety.
40
+ - The decision is between two well-understood, already-specified options — a simple comparison is sufficient; full ideation is overhead.
41
+ - The next step is to make the chosen concept real and learn from it — move to **prototyping**.
@@ -0,0 +1,108 @@
1
+ ---
2
+ name: indexing-strategy
3
+ description: "Use when designing indexes for a relational or NoSQL database: the index-as-precomputed-search-structure mental model, the catalog of structures (B-tree, hash, bitmap, GIN/GiST, BRIN, LSM-tree), the matching of structures to access patterns (equality, range, prefix, contains, geospatial), composite indexes and column order, covering indexes, partial / filtered indexes, the maintenance cost of every index (write amplification, storage, lock impact), and the rules for when to add an index, when not to, and when to drop one. Do NOT use for tuning a slow query (use query-optimization), choosing isolation levels (use transaction-isolation), schema design (use data-modeling), or distributed-data partitioning (use sharding-strategy)."
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/data\",\"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\":\"[\\\\\\\"indexing\\\\\\\",\\\\\\\"index\\\\\\\",\\\\\\\"B-tree\\\\\\\",\\\\\\\"hash index\\\\\\\",\\\\\\\"bitmap index\\\\\\\",\\\\\\\"GIN\\\\\\\",\\\\\\\"GiST\\\\\\\",\\\\\\\"BRIN\\\\\\\",\\\\\\\"LSM\\\\\\\",\\\\\\\"composite index\\\\\\\",\\\\\\\"covering index\\\\\\\",\\\\\\\"partial index\\\\\\\",\\\\\\\"filtered index\\\\\\\",\\\\\\\"index selectivity\\\\\\\"]\",\"triggers\":\"[\\\\\\\"should I add an index\\\\\\\",\\\\\\\"which columns to index\\\\\\\",\\\\\\\"B-tree vs hash\\\\\\\",\\\\\\\"is this index being used\\\\\\\",\\\\\\\"composite index column order\\\\\\\"]\",\"examples\":\"[\\\\\\\"design indexes for a table with high-volume reads on user_id and date-range queries\\\\\\\",\\\\\\\"decide between a B-tree index and a partial index for a small subset of rows\\\\\\\",\\\\\\\"diagnose a query that ignores an existing index — likely a selectivity or type-coercion issue\\\\\\\",\\\\\\\"explain why adding a sixth index to a write-heavy table is usually wrong\\\\\\\"]\",\"anti_examples\":\"[\\\\\\\"diagnose why this specific query is slow (use query-optimization)\\\\\\\",\\\\\\\"choose a database schema (use data-modeling)\\\\\\\",\\\\\\\"decide how to partition data across nodes (use sharding-strategy)\\\\\\\"]\",\"relations\":\"{\\\\\\\"related\\\\\\\":[\\\\\\\"query-optimization\\\\\\\",\\\\\\\"data-modeling\\\\\\\",\\\\\\\"schema-evolution\\\\\\\",\\\\\\\"transaction-isolation\\\\\\\"],\\\\\\\"boundary\\\\\\\":[{\\\\\\\"skill\\\\\\\":\\\\\\\"query-optimization\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"query-optimization owns the diagnosis and tuning of specific slow queries; this skill owns the *design* of which indexes the database has. The two compose: query-optimization diagnoses; this skill is one of the responses.\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"data-modeling\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"data-modeling owns the schema and access patterns; this skill owns the auxiliary search structures that make access patterns efficient. The schema determines what indexes can exist; the access patterns determine which should.\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"schema-evolution\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"schema-evolution owns how the database changes shape over time; this skill owns the indexes that must change with it. Adding or removing an index is itself a schema change.\\\\\\\"}],\\\\\\\"verify_with\\\\\\\":[\\\\\\\"query-optimization\\\\\\\",\\\\\\\"data-modeling\\\\\\\"]}\",\"mental_model\":\"|\",\"purpose\":\"|\",\"boundary\":\"|\",\"analogy\":\"An index is to a database what the back-of-the-book index is to a reference manual — you do not flip through every page to find every mention of 'Postgres'; you go to the I section, find the page numbers, and jump. Adding an index for every word in the book is technically possible and obviously wrong; the printer would still have to update every index every time the text changed, and the book would now spend most of its pages on indexes rather than content.\",\"misconception\":\"|\",\"concept\":\"{\\\\\\\"definition\\\\\\\":\\\\\\\"Indexing strategy is the discipline of designing auxiliary data structures that let the database find rows quickly without scanning every row. An index is a precomputed lookup structure (B-tree, hash, bitmap, inverted index, LSM-tree, BRIN, GiST, GIN) that maps one or more column values to the rows containing those values. Every index speeds up some queries (those whose WHERE / JOIN / ORDER BY clauses match the index's structure) and slows down every write (the index must be updated on every INSERT, UPDATE that touches indexed columns, and DELETE). The strategic question is not 'which columns deserve an index' considered in isolation; it is the *whole-database* trade-off between read speed and write cost, given the actual access patterns the workload produces.\\\\\\\",\\\\\\\"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/indexing-strategy/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/indexing-strategy/SKILL.md
12
+ ---
13
+
14
+ # Indexing Strategy
15
+
16
+ ## Coverage
17
+
18
+ The discipline of designing auxiliary data structures that let the database find rows quickly without scanning every row. Covers the structure catalog (B-tree, hash, bitmap, GIN, GiST, BRIN, LSM-tree) and the access patterns each matches, composite indexes and column-order rules, covering indexes and INCLUDE clauses, partial / filtered indexes, expression indexes, the maintenance cost of every index (storage, write amplification, lock impact, planner overhead), and the strategic question of treating the index set as an optimized portfolio rather than a per-column checklist.
19
+
20
+ ## Philosophy
21
+
22
+ Indexes are a write/read trade. Every index speeds up some queries and slows down every write. The strategic discipline is not "which columns deserve an index" considered in isolation; it is the whole-database trade-off between read speed and write cost, given the workload's actual access patterns.
23
+
24
+ The wrong default is "add an index for every column ever filtered on." The wrong response to a slow query is always "add an index." The right discipline is to count the queries that would benefit, count the writes that would pay the cost, and check whether the index is actually used by the planner before keeping it.
25
+
26
+ The structure catalog matters. A B-tree is the right default for the vast majority of access patterns. Specialized structures (GIN for arrays/JSON/full-text, BRIN for naturally-ordered large columns, R-tree/GiST for geospatial) serve specific patterns far better than B-tree. Knowing which structure matches which pattern is the design vocabulary.
27
+
28
+ ## Structure → Access Pattern Matrix
29
+
30
+ | Pattern | Best structure | Why |
31
+ |---|---|---|
32
+ | Equality lookup (`col = x`) | B-tree, hash | Both serve; B-tree is more flexible |
33
+ | Range (`col BETWEEN x AND y`) | B-tree | Hash doesn't support range |
34
+ | Prefix match (`col LIKE 'foo%'`) | B-tree | Range over a prefix |
35
+ | Contains (`'foo' = ANY(col)`, JSON contains) | GIN | Inverted index for many-keys-per-row |
36
+ | Full-text search | GIN or specialized (Elasticsearch) | Inverted index |
37
+ | Geospatial proximity | GiST / R-tree / PostGIS | Spatial structures |
38
+ | Range types / `&&` overlap | GiST | Range-aware structure |
39
+ | Naturally-ordered append-only (timestamps) | BRIN | Small summary index |
40
+ | Write-optimized point-write workload | LSM-tree | Write throughput primary |
41
+ | Low-cardinality AND-combination (data warehouse) | Bitmap | AND across columns efficient |
42
+ | Low-cardinality high-update workload | None (use partial or skip) | Bitmap updates poorly |
43
+
44
+ ## Composite Index Column Order Rule
45
+
46
+ For an index on (A, B, C), the index serves queries with leading-column prefixes:
47
+
48
+ | Query | Uses index? |
49
+ |---|---|
50
+ | `WHERE A = x` | Yes |
51
+ | `WHERE A = x AND B = y` | Yes |
52
+ | `WHERE A = x AND B = y AND C = z` | Yes |
53
+ | `WHERE A = x AND C = z` | Yes (A prefix), but skips B in scan |
54
+ | `WHERE B = y` | No (no leading A) |
55
+ | `WHERE C = z` | No |
56
+ | `ORDER BY A, B, C` | Yes (sort avoided) |
57
+ | `ORDER BY A DESC, B DESC` | Yes (Postgres can reverse scan) |
58
+ | `ORDER BY B` | No |
59
+
60
+ Column order rule: put the most-selective and most-filtered column first.
61
+
62
+ ## When To Add, Drop, Never Add
63
+
64
+ | Situation | Decision |
65
+ |---|---|
66
+ | Query is frequent, slow, and matches no current index | Add an index |
67
+ | Query is rare (monthly report); table is otherwise hot | Don't add — query can scan |
68
+ | Index exists but is reported as unused by `pg_stat_user_indexes` for 3+ months | Drop it |
69
+ | Column has low selectivity (boolean, status enum with two common values) | Use a partial index on the rarer value, or skip |
70
+ | Column is part of a composite key with leading columns covered by another index | Skip; the existing index serves |
71
+ | Column is a foreign key, joined frequently | Add an index (FK joins are common; the planner uses it) |
72
+ | Column is a foreign key, never joined | Optional; some teams add for CASCADE operations |
73
+ | Write-heavy table (audit log, event stream) | Minimal indexes — primary key only, occasionally one more |
74
+
75
+ ## Verification
76
+
77
+ After applying this skill, verify:
78
+ - [ ] Index structure matches the access pattern (B-tree for ordered queries; GIN for contains; BRIN for naturally-ordered large columns; etc.). Default B-tree everywhere is not necessarily correct.
79
+ - [ ] Composite indexes have intentional column order. Most-selective and most-filtered column first.
80
+ - [ ] Index usage is monitored (`pg_stat_user_indexes` for Postgres, equivalents elsewhere). Unused indexes are dropped on a regular cadence.
81
+ - [ ] Write-heavy tables have minimal indexes. The number of indexes is justified against the table's write rate.
82
+ - [ ] Partial indexes are used where access patterns target a small subset of rows (e.g., `WHERE status = 'pending'`).
83
+ - [ ] Covering indexes (INCLUDE clause or composite with projected columns) are used for read-hot queries where row fetch is the bottleneck.
84
+ - [ ] EXPLAIN ANALYZE is used to verify the planner uses the added index. An index that exists but is ignored by the planner is pure cost.
85
+ - [ ] Index creation in production uses CONCURRENTLY (Postgres) or equivalent non-blocking patterns. Production deployment is part of the design.
86
+
87
+ ## Do NOT Use When
88
+
89
+ | Instead of this skill | Use | Why |
90
+ |---|---|---|
91
+ | Diagnosing a specific slow query | `query-optimization` | query-optimization owns diagnosis; this skill is one of the responses |
92
+ | Designing the table schema and entity relationships | `data-modeling` | data-modeling owns design; this skill owns the auxiliary structures |
93
+ | Reasoning about how the schema changes over time | `schema-evolution` | schema-evolution owns versioning; this skill owns one type of schema element |
94
+ | Choosing an isolation level | `transaction-isolation` | transaction-isolation owns concurrency; this skill owns retrieval |
95
+ | Reasoning about horizontal partitioning | `sharding-strategy` | sharding owns partition; this owns within-shard retrieval |
96
+ | Tuning OS / storage-layer performance | infrastructure / storage skills | storage I/O is a layer below indexing |
97
+
98
+ ## Key Sources
99
+
100
+ - Winand, M. (2012, ongoing). [*Use The Index, Luke!*](https://use-the-index-luke.com/). The canonical practitioner guide to SQL indexing, with deep treatment of B-tree internals, composite indexes, and the planner's interaction with indexes.
101
+ - PostgreSQL Global Development Group. ["PostgreSQL Documentation — Indexes"](https://www.postgresql.org/docs/current/indexes.html). Reference for Postgres's full index-type catalog including GIN, GiST, BRIN, hash, and the planner's interaction with each.
102
+ - Petrov, A. (2019). *Database Internals: A Deep Dive into How Distributed Data Systems Work*. O'Reilly. Chapters on B-tree variants, LSM-trees, and storage structures; the modern reference on the structures underneath indexes.
103
+ - Ramakrishnan, R., & Gehrke, J. (2002, 3rd ed.). *Database Management Systems*. McGraw-Hill. Classic textbook treatment of indexing structures, query execution, and the planner.
104
+ - Garcia-Molina, H., Ullman, J. D., & Widom, J. (2008, 2nd ed.). *Database Systems: The Complete Book*. Pearson. Comprehensive reference on indexing theory and practice.
105
+ - Microsoft. ["SQL Server Index Architecture and Design Guide"](https://learn.microsoft.com/en-us/sql/relational-databases/sql-server-index-design-guide). Reference for SQL Server's index design including covering, filtered, and columnstore indexes.
106
+ - Oracle. ["Oracle Database Concepts — Indexes and Index-Organized Tables"](https://docs.oracle.com/database/121/CNCPT/indexiot.htm). Reference for Oracle's index structures including bitmap, function-based, and index-organized tables.
107
+ - Lehman, P. L., & Yao, S. B. (1981). ["Efficient Locking for Concurrent Operations on B-Trees"](https://dl.acm.org/doi/10.1145/319628.319663). *ACM TODS*, 6(4). Foundational paper on concurrent B-tree operations; basis of modern B-tree implementations.
108
+ - O'Neil, P., Cheng, E., Gawlick, D., & O'Neil, E. (1996). ["The Log-Structured Merge-Tree (LSM-tree)"](https://dl.acm.org/doi/10.1145/240858.240861). *Acta Informatica*. The foundational paper on LSM-trees, the structure underlying Cassandra, RocksDB, and many modern write-optimized stores.
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: information-architecture
3
+ description: "Use when structuring information for findability: navigation, page hierarchy, docs architecture, sitemap shape, labeling systems, wayfinding, and content grouping. Do NOT use for formal category-governance work (use `taxonomy-design`), responsive page composition (use `layout-composition`), component/token architecture (use `design-system-architecture`), or sentence-level UI text (use `microcopy`)."
4
+ license: MIT
5
+ compatibility: "Portable IA guidance for apps, documentation, dashboards, admin tools, and skill libraries."
6
+ allowed-tools: Read Grep
7
+ metadata:
8
+ metadata: "{\"schema_version\":6,\"version\":\"1.0.0\",\"type\":\"capability\",\"category\":\"design\",\"domain\":\"design/information-architecture\",\"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\":\"[\\\\\\\"information architecture\\\\\\\",\\\\\\\"navigation structure\\\\\\\",\\\\\\\"sitemap\\\\\\\",\\\\\\\"wayfinding\\\\\\\",\\\\\\\"page hierarchy\\\\\\\",\\\\\\\"docs architecture\\\\\\\",\\\\\\\"labeling system\\\\\\\",\\\\\\\"content grouping\\\\\\\",\\\\\\\"findability\\\\\\\",\\\\\\\"content model\\\\\\\"]\",\"examples\":\"[\\\\\\\"our docs have good content but nobody can find the setup instructions - how should the IA change?\\\\\\\",\\\\\\\"design the navigation and page hierarchy for this admin app\\\\\\\",\\\\\\\"these dashboard sections overlap and users do not know where to look first\\\\\\\",\\\\\\\"should this be a top-level nav item, a tab, a filter, or a page section?\\\\\\\"]\",\"anti_examples\":\"[\\\\\\\"make the category taxonomy and assignment rules for this skill library\\\\\\\",\\\\\\\"define design tokens, component APIs, and theming rules\\\\\\\",\\\\\\\"rewrite this tooltip and empty-state copy\\\\\\\",\\\\\\\"audit keyboard accessibility and ARIA semantics\\\\\\\"]\",\"relations\":\"{\\\\\\\"boundary\\\\\\\":[{\\\\\\\"skill\\\\\\\":\\\\\\\"taxonomy-design\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"taxonomy-design governs classification systems; information-architecture arranges user-facing information paths\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"design-system-architecture\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"design-system-architecture owns component and token systems; information-architecture owns navigation and content structure\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"layout-composition\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"layout-composition owns structure inside a page or screen; information-architecture owns cross-page organization and wayfinding\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"microcopy\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"microcopy owns sentence-level UI text; information-architecture owns placement and hierarchy\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"a11y\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"a11y owns accessibility compliance; information-architecture can create structures that a11y later verifies\\\\\\\"}],\\\\\\\"related\\\\\\\":[\\\\\\\"taxonomy-design\\\\\\\",\\\\\\\"task-analysis\\\\\\\",\\\\\\\"design-system-architecture\\\\\\\",\\\\\\\"layout-composition\\\\\\\"],\\\\\\\"verify_with\\\\\\\":[\\\\\\\"task-analysis\\\\\\\",\\\\\\\"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/information-architecture/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/information-architecture/SKILL.md
13
+ ---
14
+
15
+ # Information Architecture
16
+
17
+ ## Coverage
18
+
19
+ Structure information so users and agents can find, understand, and move through it. Covers navigation, sitemaps, hierarchy, page grouping, labeling systems, docs structure, cross-links, wayfinding cues, content models, and IA validation through real user tasks.
20
+
21
+ ## Philosophy
22
+
23
+ Information architecture is not decoration. It is the contract between a user's goal and the system's structure. If the IA is wrong, good content and good components still feel confusing because the path to them is unclear.
24
+
25
+ Good IA starts from tasks, then chooses structure. Do not promote every important thing to top-level navigation. Do not bury frequently used workflows under technically accurate but user-invisible categories.
26
+
27
+ ## Method
28
+
29
+ 1. Name the top user tasks and entry points.
30
+ 2. Inventory current content or screens.
31
+ 3. Group by user goal first, implementation detail second.
32
+ 4. Decide structure: nav item, page, tab, section, filter, or cross-link.
33
+ 5. Apply label discipline: recognizable user language, stable nouns, no internal jargon.
34
+ 6. Add wayfinding: current location, sibling options, next action, and escape path.
35
+ 7. Test against task scenarios and no-prior-knowledge discovery.
36
+
37
+ ## Evals
38
+
39
+ This skill ships a comprehension-eval artifact at [`examples/evals/information-architecture.json`](https://github.com/jacob-balslev/skill-graph/blob/main/examples/evals/information-architecture.json). The checklist below is the authoring gate for findability and structure decisions; the eval file is the grader surface.
40
+
41
+ ## Verification
42
+
43
+ - [ ] Top tasks have obvious entry points
44
+ - [ ] Labels use user language rather than implementation terms
45
+ - [ ] Navigation levels are limited and predictable
46
+ - [ ] Similar content has one canonical home plus cross-links where needed
47
+ - [ ] Users can recover from a wrong turn without restarting
48
+ - [ ] Empty states and low-data states still preserve structure
49
+ - [ ] IA was tested against real task prompts
50
+
51
+ ## Do NOT Use When
52
+
53
+ | Use instead | When |
54
+ |---|---|
55
+ | `taxonomy-design` | You need classification governance, facets, or category assignment rules. |
56
+ | `layout-composition` | You need responsive section order, grid/flex structure, or page-level scan pattern. |
57
+ | `design-system-architecture` | You need token, theme, component API, or design-system governance. |
58
+ | `microcopy` | The structure is settled and you need wording for labels, errors, or empty states. |
59
+ | `a11y` | The primary task is accessibility compliance or assistive-technology behavior. |
@@ -0,0 +1,111 @@
1
+ ---
2
+ name: integration-test-design
3
+ description: "Use when designing tests that verify the interaction between two or more units of a system — modules, services, layers, processes: the scope-and-boundary primitives that distinguish integration from unit and e2e tests, the test-pyramid (Cohn 2009) and test-trophy (Dodds) frameworks for how much integration testing belongs in the suite, the real-vs-faked-collaborator decision per dependency, the test-data lifecycle (per-test setup, transaction rollback, container reset), the difference between sociable-unit tests, integration tests, and contract tests, and the failure modes (over-broad scope that mimics e2e, over-narrow scope that mimics unit, shared mutable state that produces flakes). Do NOT use for testing one unit in isolation (use testing-strategy + test-doubles-design), full user-journey testing (use e2e-test-design), consumer-driven contract verification (use contract-testing), or test-suite quality measurement (use mutation-testing)."
4
+ license: MIT
5
+ allowed-tools: Read Grep
6
+ metadata:
7
+ metadata: "{\"schema_version\":6,\"version\":\"1.0.0\",\"type\":\"capability\",\"category\":\"quality\",\"domain\":\"quality/testing\",\"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\":\"[\\\\\\\"integration test\\\\\\\",\\\\\\\"integration testing\\\\\\\",\\\\\\\"test pyramid\\\\\\\",\\\\\\\"test trophy\\\\\\\",\\\\\\\"sociable test\\\\\\\",\\\\\\\"test data setup\\\\\\\",\\\\\\\"test transaction rollback\\\\\\\",\\\\\\\"test containers\\\\\\\",\\\\\\\"testcontainers\\\\\\\",\\\\\\\"boundary test\\\\\\\"]\",\"triggers\":\"[\\\\\\\"should this be a unit or integration test\\\\\\\",\\\\\\\"the integration test is flaky\\\\\\\",\\\\\\\"test pyramid vs test trophy\\\\\\\",\\\\\\\"real database in tests\\\\\\\",\\\\\\\"test data setup is taking over\\\\\\\"]\",\"examples\":\"[\\\\\\\"design an integration test for the order service that exercises real database and real message bus\\\\\\\",\\\\\\\"decide which dependencies to fake and which to use real in an integration test\\\\\\\",\\\\\\\"diagnose a flaky integration test — likely shared mutable state across tests\\\\\\\",\\\\\\\"explain why the test pyramid and test trophy disagree on integration test count\\\\\\\"]\",\"anti_examples\":\"[\\\\\\\"test a single function in isolation (use testing-strategy + test-doubles-design)\\\\\\\",\\\\\\\"test a full user journey through the UI (use e2e-test-design)\\\\\\\",\\\\\\\"verify a consumer-driven contract against a provider (use contract-testing)\\\\\\\"]\",\"relations\":\"{\\\\\\\"related\\\\\\\":[\\\\\\\"testing-strategy\\\\\\\",\\\\\\\"test-doubles-design\\\\\\\",\\\\\\\"test-driven-development\\\\\\\",\\\\\\\"e2e-test-design\\\\\\\",\\\\\\\"contract-testing\\\\\\\"],\\\\\\\"boundary\\\\\\\":[{\\\\\\\"skill\\\\\\\":\\\\\\\"testing-strategy\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"testing-strategy owns the strategic question of how much of each test level to invest in; this skill owns the design of integration-level tests specifically.\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"test-doubles-design\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"test-doubles-design owns the construction of mocks/stubs/fakes; this skill owns the per-dependency real-vs-faked decision in integration scope. Integration tests use real collaborators where practical and fakes only at true external boundaries.\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"e2e-test-design\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"e2e-test-design owns user-journey-scope tests that exercise the full stack including UI; this skill owns scope below that — interaction of units inside the system, often without UI.\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"contract-testing\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"contract-testing owns consumer-driven contract verification between services; this skill owns the in-system interaction of modules. Contract tests verify the *interface*; integration tests verify the *implementation through* the interface.\\\\\\\"}],\\\\\\\"verify_with\\\\\\\":[\\\\\\\"testing-strategy\\\\\\\",\\\\\\\"e2e-test-design\\\\\\\"]}\",\"mental_model\":\"|\",\"purpose\":\"|\",\"boundary\":\"|\",\"analogy\":\"An integration test is to a software system what a fire-suppression drill in a specific corridor is to the whole building's safety plan — you are not testing whether each sprinkler head works in isolation (unit), nor whether everyone evacuates the entire building in fifteen minutes (e2e), you are testing whether the smoke detector in *this corridor* triggers the alarm panel which triggers the sprinkler which actually wets *that carpet*; the test's identity is the named boundary, and changing the named boundary changes the test's identity.\",\"misconception\":\"|\",\"concept\":\"{\\\\\\\"definition\\\\\\\":\\\\\\\"Integration test design is the discipline of designing tests that verify the interaction of two or more units of a system — modules within a process, services across processes, layers within an architecture — to catch defects that emerge only at the boundaries between those units. The unit of judgment is the *boundary*: whether type-mapped, serialized, transactional, contract-bound, or simply called across a function boundary, the integration test's value is exercising the *real* interaction between the parts rather than the *mocked* interaction a unit test would exercise. The scope choice — which units are real, which are faked, which are out of scope — is the central design decision and the source of most fragile integration test suites: too narrow and the test is a unit test in disguise; too broad and the test is an end-to-end test in disguise; in between, the test is what its name says.\\\\\\\",\\\\\\\"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/integration-test-design/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/integration-test-design/SKILL.md
12
+ ---
13
+
14
+ # Integration-Test Design
15
+
16
+ ## Coverage
17
+
18
+ The discipline of designing tests that verify the interaction between two or more units of a system — modules within a process, services across processes, layers within an architecture, services across organizational boundaries — to catch defects that emerge only at the boundaries. Covers the five primitives (boundary, scope, real-vs-faked-collaborator, test-data lifecycle, pyramid-or-trophy framing), the boundary-type taxonomy (module-to-module, layer-to-layer, service-to-database, service-to-message-bus, service-to-third-party, service-to-service), the test-data lifecycle patterns (full reset, transaction rollback, container reset, shared snapshot), and the pyramid (Cohn 2009) vs trophy (Dodds 2018) framings for how much integration testing the suite should contain. Includes Testcontainers and similar infrastructure as the modern enabler that makes integration testing cheap enough to do well.
19
+
20
+ ## Philosophy
21
+
22
+ Integration tests verify the parts of a system that no individual unit can verify alone. The bugs they catch — type misalignment, serialization edge cases, transaction boundary errors, configuration mismatches, contract drift, ordering and concurrency issues — live at the boundaries between units. A test suite of comprehensive unit tests and zero integration tests has verified each unit and not the system; the seams are unverified.
23
+
24
+ The discipline's central design decision is *scope*: for each test, which collaborators are real (exercised in their integration-bug-finding form) and which are faked (replaced because their realness adds cost without proportional defect-detection). The scope determines the test's identity. Too narrow (mocks at the boundary): the "integration test" is a unit test in disguise and misses the integration bugs. Too broad (real everything, including UI): the "integration test" is an e2e test in disguise and pays the e2e cost.
25
+
26
+ Modern testing infrastructure — Testcontainers for containerized real dependencies, transaction rollback for fast isolation, parallel execution within and across CI jobs, recorded fakes for third parties — has shifted the cost of integration testing down enough that the test trophy framing (integration-heavy suite) has gained ground on the pyramid (unit-heavy suite). The right ratio for a given codebase depends on which suite costs are real and which are surmountable with infrastructure.
27
+
28
+ ## The Pyramid vs The Trophy
29
+
30
+ | Framing | Suite shape | Year | Cost assumption | Best fit |
31
+ |---|---|---|---|---|
32
+ | Test Pyramid (Cohn) | Many unit / fewer integration / fewest e2e | 2009 | Integration tests expensive, slow, flaky | Codebases where integration infra is missing or costly |
33
+ | Test Trophy (Dodds) | Many integration / fewer unit / fewer e2e / static-analysis stem | 2018 | Integration tests cheap with modern tooling; unit tests pin implementation details | Codebases with strong integration-test infrastructure |
34
+ | Diamond | Many integration / few unit / few e2e | — | Same as trophy minus the static-analysis stem | Codebases where unit tests have lost most value vs the maintenance cost |
35
+
36
+ Both pyramid and trophy agree on: unit tests for fast feedback on implementation logic, integration tests for boundary verification, e2e tests sparingly for full-stack confidence. The disagreement is about the ratio between unit and integration, which depends on what each costs in a given codebase.
37
+
38
+ ## Scope Choice — The Defining Decision
39
+
40
+ For each test, name the scope explicitly. For each dependency in scope, decide real or faked.
41
+
42
+ | Dependency | Real cost | Faked cost | Typical choice |
43
+ |---|---|---|---|
44
+ | In-process other modules | Free | Loses integration coverage | Real always |
45
+ | Database | Containerized: low (Testcontainers reuse) | In-memory variant: low; loses some real-DB bugs | Real (containerized or in-memory variant) |
46
+ | Message bus | Containerized: low | In-memory variant: loses delivery semantics | Real (containerized) for production-confidence tests |
47
+ | Cache (Redis) | Containerized: low | In-memory fake: loses eviction/TTL bugs | Real (containerized) |
48
+ | Third-party API (paid) | Per-call cost; rate limit | Recorded fake: free, may drift | Recorded fake for PR tests; real sandbox for nightly |
49
+ | Third-party API (free, stable) | Network latency; availability | Recorded fake: free | Real for nightly; recorded for PR |
50
+ | Email / SMS providers | Sends real messages — usually wrong | Capture fake: verifies the call was made | Capture fake; never real in tests |
51
+ | Authentication / OAuth | Real provider often unavailable in test | Issued-token fake | Token fake |
52
+
53
+ The decision rule: use real where the boundary's specific failure modes are integration-bug-finders (database, message bus); use fake where the dependency's realness adds cost (paid APIs) or unacceptable side effects (emails) without proportional defect-detection.
54
+
55
+ ## Test Data Lifecycle Patterns
56
+
57
+ | Pattern | Speed | Isolation | When to use |
58
+ |---|---|---|---|
59
+ | Per-test full reset (drop / recreate) | Slowest (~seconds per test) | Strongest | Tests with destructive schema changes |
60
+ | Per-test transaction rollback | Fast (milliseconds) | Strong (for transactional DBs) | Most database integration tests |
61
+ | Per-suite seed + per-test mutation isolation | Fast | Medium | Read-heavy test suites with limited mutation |
62
+ | Shared snapshot + no-mutation discipline | Fastest | Relies on team discipline | Pure read tests |
63
+ | Container reset per test (Testcontainers) | Medium (container startup) | Strongest cross-process | Tests where transaction rollback isn't viable |
64
+
65
+ The standard production setup is transaction rollback for the bulk of database integration tests, with container reset reserved for the minority where transaction rollback doesn't work (cross-database tests, tests that exercise the transaction system itself).
66
+
67
+ ## When To Use Real Dependencies vs Faked
68
+
69
+ Quick decision table:
70
+
71
+ | Question | If yes | If no |
72
+ |---|---|---|
73
+ | Is the bug class you want to catch at this boundary specific to the real dependency? | Use real | Consider faked |
74
+ | Is the real dependency available in test environment? | Use real or sandbox | Use recorded fake |
75
+ | Is the real dependency's per-test cost acceptable? | Use real | Use recorded fake |
76
+ | Does the real dependency have unacceptable side effects (real emails, real charges)? | Use capture fake | n/a |
77
+ | Does the team have infrastructure for the real dependency (Testcontainers, etc.)? | Use real | Build the infra or use recorded fake |
78
+
79
+ ## Verification
80
+
81
+ After applying this skill, verify:
82
+ - [ ] Every integration test's scope is explicit: which collaborators are real, which are faked, what boundary the test exercises. Tests without explicit scope drift between unit and e2e.
83
+ - [ ] Real database, real message bus, real cache are used where their failure modes are integration-bug-finders. Mocking these dependencies usually means the test is unit-scope.
84
+ - [ ] Third-party APIs are faked (recorded responses) for fast PR tests and exercised real in scheduled (nightly/weekly) integration runs.
85
+ - [ ] Test data lifecycle is one of the named patterns (transaction rollback / container reset / per-suite seed / shared no-mutation), not ad-hoc. Test independence is a property of the lifecycle, not a hope.
86
+ - [ ] Flaky integration tests are diagnosed (shared mutable state, ordering dependency, time-of-day dependency, race condition), not accepted. A persistent flake is a bug in the test design.
87
+ - [ ] The pyramid-or-trophy ratio is intentional and reviewed against the codebase's actual integration-test cost and integration-bug rate.
88
+ - [ ] Integration tests are not used where contract tests would be more targeted. The two compose; one does not replace the other.
89
+ - [ ] Integration tests run in CI on every PR (with appropriate scope), not relegated to "nightly only" except for the slowest tier (sandbox third parties, multi-service e2e).
90
+
91
+ ## Do NOT Use When
92
+
93
+ | Instead of this skill | Use | Why |
94
+ |---|---|---|
95
+ | Testing a single function in isolation with all collaborators mocked | `testing-strategy` + `test-doubles-design` | unit-scope test; this skill is for inter-unit scope |
96
+ | Testing a full user journey through the UI | `e2e-test-design` | user-journey scope; this skill is for internal seams |
97
+ | Verifying that a service's external interface matches the consumer's expectations | `contract-testing` | contract scope; this skill verifies implementation through the interface |
98
+ | Measuring whether the test suite catches defects | `mutation-testing` | quality measurement; this skill is the integration-test design itself |
99
+ | Choosing the overall ratio of test levels | `testing-strategy` | strategy owns ratios; this skill owns integration-test internals |
100
+ | Snapshot-capturing a complex output | `snapshot-testing` | snapshot technique; this skill is integration-test scope |
101
+
102
+ ## Key Sources
103
+
104
+ - Cohn, M. (2009). *Succeeding with Agile: Software Development Using Scrum*. Addison-Wesley. The book that popularized the test pyramid as the standard recommended suite shape.
105
+ - Fowler, M. (2012). ["The Practical Test Pyramid"](https://martinfowler.com/articles/practical-test-pyramid.html). The most-cited practitioner essay on the pyramid framing, with practical advice on integration-test scope and infrastructure.
106
+ - Dodds, K. C. (2018). ["The Testing Trophy and Testing Classifications"](https://kentcdodds.com/blog/the-testing-trophy-and-testing-classifications). The essay introducing the test trophy as an alternative to the pyramid, arguing integration tests are the high-value tier.
107
+ - Testcontainers. ["Testcontainers — Reference"](https://testcontainers.com/). The canonical reference for containerized real-dependency integration testing across many languages and dependency types.
108
+ - Meszaros, G. (2007). *xUnit Test Patterns: Refactoring Test Code*. Addison-Wesley. Catalog of integration-test patterns including the test-data lifecycle patterns (Setup, Teardown, Shared Fixture, Transaction Rollback).
109
+ - Fowler, M. ["UnitTest"](https://martinfowler.com/bliki/UnitTest.html) and ["IntegrationTest"](https://martinfowler.com/bliki/IntegrationTest.html). Reference pages defining the terms practitioners use; both note the hazy line between sociable unit tests and integration tests.
110
+ - Vocke, H. (2018). ["The Practical Test Pyramid — Updated"](https://martinfowler.com/articles/practical-test-pyramid.html). Updated practitioner guidance on test-pyramid implementation, including integration-test infrastructure recommendations.
111
+ - ThoughtWorks. ["Test Doubles" and "Test pyramid" in the Technology Radar](https://www.thoughtworks.com/radar). Industry-practitioner consensus on integration-test patterns evolving over years.