@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,223 @@
1
+ ---
2
+ name: cron-scheduling
3
+ description: "This skill provides cron job architecture patterns for web applications: Inngest schedule integration, Vercel Cron configuration, retry logic, monitoring and alerting for failed crons, and idempotency requirements. Load when designing scheduled tasks, configuring cron triggers, debugging missed or duplicate executions, or implementing monitoring for recurring jobs."
4
+ license: MIT
5
+ compatibility: "Markdown, Git, agent-skill runtimes"
6
+ allowed-tools: Read Grep Bash
7
+ metadata:
8
+ metadata: "{\"schema_version\":6,\"version\":\"1.0.0\",\"type\":\"capability\",\"category\":\"engineering\",\"domain\":\"engineering/scheduling\",\"scope\":\"portable\",\"owner\":\"skill-graph-maintainer\",\"freshness\":\"2026-03-29\",\"drift_check\":\"{\\\\\\\"last_verified\\\\\\\":\\\\\\\"2026-03-29\\\\\\\"}\",\"eval_artifacts\":\"planned\",\"eval_state\":\"unverified\",\"routing_eval\":\"absent\",\"stability\":\"experimental\",\"keywords\":\"[\\\\\\\"cron-scheduling\\\\\\\",\\\\\\\"cron\\\\\\\",\\\\\\\"scheduling\\\\\\\"]\",\"triggers\":\"[\\\\\\\"cron-scheduling-skill\\\\\\\",\\\\\\\"cron-job-skill\\\\\\\",\\\\\\\"scheduled-task-skill\\\\\\\",\\\\\\\"vercel-cron-skill\\\\\\\",\\\\\\\"recurring-job-skill\\\\\\\"]\",\"relations\":\"{\\\\\\\"related\\\\\\\":[\\\\\\\"background-jobs\\\\\\\"]}\",\"portability\":\"{\\\\\\\"readiness\\\\\\\":\\\\\\\"scripted\\\\\\\",\\\\\\\"targets\\\\\\\":[\\\\\\\"skill-md\\\\\\\"]}\",\"lifecycle\":\"{\\\\\\\"stale_after_days\\\\\\\":90,\\\\\\\"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/cron-scheduling/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/cron-scheduling/SKILL.md
13
+ ---
14
+ # Cron Scheduling Skill
15
+
16
+ ## Domain Context
17
+
18
+ **What is this skill?** This skill provides cron job architecture patterns for web applications: Inngest schedule integration, Vercel Cron configuration, retry logic, monitoring and alerting for failed crons, and idempotency requirements. Load when designing scheduled tasks, configuring cron triggers, debugging missed or duplicate executions, or implementing monitoring for recurring jobs.
19
+ > A cron that runs twice is worse than a cron that doesn't run. Idempotency is not optional.
20
+
21
+ ## Coverage
22
+
23
+ This skill covers cron expression syntax and scheduling precision, Vercel Cron configuration (`vercel.json` cron routes), Inngest scheduled function patterns (cron triggers vs event-driven), idempotency guarantees for scheduled jobs, retry and failure handling for cron-triggered work, monitoring and alerting for missed or failed cron executions, timezone handling in cron schedules, and the decision framework for choosing between Vercel Cron, Inngest schedules, and external cron services.
24
+
25
+ ## Philosophy
26
+
27
+ Cron jobs are the most deceptively simple infrastructure in web applications. The expression `0 9 * * *` looks trivial, but the implementation must handle: what happens when the job runs twice (deploy overlap), what happens when the job fails silently (no monitoring), what happens when the job takes longer than the interval (overlap), and what happens at DST transitions (timezone drift). Every anti-pattern in this skill was observed in production. The skill exists because agents routinely create cron schedules without idempotency, without monitoring, and without considering the failure modes that only surface under real-world conditions.
28
+
29
+ ## Architecture
30
+
31
+ ### Cron Platform Decision Matrix
32
+
33
+ | Platform | Max Duration | Cold Start | Retry Built-in | Monitoring | Best For |
34
+ |----------|-------------|------------|-----------------|------------|----------|
35
+ | **Vercel Cron** | 60s (Hobby) / 300s (Pro) | Yes | No | Basic (logs) | Lightweight triggers that dispatch to background jobs |
36
+ | **Inngest Cron** | Configurable (step functions) | No (warm) | Yes (built-in) | Dashboard + webhooks | Complex scheduled workflows with retry and state |
37
+ | **External (e.g., cron-job.org)** | N/A (HTTP trigger) | Depends on target | No | External | When the app has no built-in cron capability |
38
+
39
+ **Key architectural rule:** Vercel Cron should trigger work, not perform work. The cron route should dispatch an Inngest event or enqueue a background job, then return 200 immediately. Never put long-running logic directly in a Vercel Cron handler.
40
+
41
+ ### Vercel Cron Configuration
42
+
43
+ ```json
44
+ // vercel.json
45
+ {
46
+ "crons": [
47
+ {
48
+ "path": "/api/cron/daily-digest",
49
+ "schedule": "0 9 * * *"
50
+ },
51
+ {
52
+ "path": "/api/cron/sync-orders",
53
+ "schedule": "*/15 * * * *"
54
+ }
55
+ ]
56
+ }
57
+ ```
58
+
59
+ **Security:** Vercel Cron requests include a `CRON_SECRET` header. Always verify this header in the route handler to prevent unauthorized execution:
60
+
61
+ ```typescript
62
+ // api/cron/daily-digest/route.ts
63
+ import { verifyCronSecret } from "@/lib/auth/verify-cron-secret";
64
+
65
+ export async function GET(request: Request) {
66
+ const authError = verifyCronSecret(request);
67
+ if (authError) return authError;
68
+ // Dispatch work, do not perform work here
69
+ await inngest.send({ name: 'cron/daily-digest.triggered' });
70
+ return new Response('OK', { status: 200 });
71
+ }
72
+ ```
73
+
74
+ ### Inngest Scheduled Functions
75
+
76
+ ```typescript
77
+ // Inngest cron function — preferred for complex scheduled work
78
+ export const dailyDigest = inngest.createFunction(
79
+ {
80
+ id: 'daily-digest',
81
+ retries: 3,
82
+ concurrency: { limit: 1 }, // Prevent overlap
83
+ },
84
+ { cron: '0 9 * * *' }, // Inngest-native cron trigger
85
+ async ({ step }) => {
86
+ const orgs = await step.run('fetch-orgs', async () => {
87
+ return db.query('SELECT id FROM organizations WHERE digest_enabled = true');
88
+ });
89
+ for (const org of orgs) {
90
+ await step.run(`send-digest-${org.id}`, async () => {
91
+ return sendDigestEmail(org.id);
92
+ });
93
+ }
94
+ }
95
+ );
96
+ ```
97
+
98
+ ## Implementation Patterns
99
+
100
+ ### 1. Idempotency for Cron Jobs
101
+
102
+ Every cron job must be idempotent: running it twice with the same inputs produces the same result. This is not defensive programming; it is a hard requirement because:
103
+
104
+ - Vercel may invoke a cron route during overlapping deployments
105
+ - Inngest retries failed steps automatically
106
+ - Manual re-runs during debugging are common
107
+
108
+ **Pattern:** Use an idempotency key based on the scheduled execution window:
109
+
110
+ ```typescript
111
+ const idempotencyKey = `digest-${orgId}-${format(new Date(), 'yyyy-MM-dd')}`;
112
+ const existing = await db.query(
113
+ 'SELECT 1 FROM cron_executions WHERE idempotency_key = $1',
114
+ [idempotencyKey]
115
+ );
116
+ if (existing.rows.length > 0) {
117
+ return { skipped: true, reason: 'already executed' };
118
+ }
119
+ // Execute, then record
120
+ await db.query(
121
+ 'INSERT INTO cron_executions (idempotency_key, executed_at) VALUES ($1, NOW())',
122
+ [idempotencyKey]
123
+ );
124
+ ```
125
+
126
+ ### 2. Cron Expression Reference
127
+
128
+ | Expression | Meaning | Common Use |
129
+ |-----------|---------|------------|
130
+ | `* * * * *` | Every minute | Health checks (use sparingly) |
131
+ | `*/5 * * * *` | Every 5 minutes | Order sync polling |
132
+ | `*/15 * * * *` | Every 15 minutes | Data refresh, cache warm |
133
+ | `0 * * * *` | Every hour, on the hour | Hourly reports |
134
+ | `0 9 * * *` | Daily at 09:00 UTC | Daily digest |
135
+ | `0 9 * * 1` | Monday at 09:00 UTC | Weekly summary |
136
+ | `0 0 1 * *` | First day of month, midnight | Monthly rollup |
137
+
138
+ **Timezone rule:** All cron expressions in Vercel and Inngest execute in UTC. If the user expects "9am Eastern", compute the UTC offset and account for DST transitions. Document the intended local time as a comment next to every cron expression.
139
+
140
+ ### 3. Monitoring and Alerting
141
+
142
+ A cron job that fails silently is worse than no cron job. Implement monitoring at three levels:
143
+
144
+ | Level | What to Monitor | Alert When |
145
+ |-------|----------------|------------|
146
+ | **Execution** | Did the job start? | No execution within expected window + buffer |
147
+ | **Completion** | Did the job finish? | Execution started but no completion within timeout |
148
+ | **Result** | Did the job produce correct output? | Completion with error status or unexpected result count |
149
+
150
+ **Heartbeat pattern:** After each successful cron execution, ping an external heartbeat monitor (e.g., Cronitor, Better Uptime, or a custom endpoint). If the heartbeat is missed, the monitor alerts the team.
151
+
152
+ ```typescript
153
+ // After successful cron execution
154
+ await fetch(`${process.env.HEARTBEAT_URL}/cron-daily-digest`, {
155
+ method: 'POST',
156
+ body: JSON.stringify({ status: 'ok', processedCount: orgs.length }),
157
+ });
158
+ ```
159
+
160
+ ### 4. Overlap Prevention
161
+
162
+ When a cron job takes longer than its interval (e.g., a 15-minute sync that runs every 10 minutes), overlapping executions corrupt data or cause duplicate processing.
163
+
164
+ **Solutions:**
165
+ - **Inngest concurrency limit:** Set `concurrency: { limit: 1 }` on the function
166
+ - **Database lock:** Acquire an advisory lock at the start; skip if already held
167
+ - **Execution record:** Check if a previous run is still in-progress before starting
168
+
169
+ ### 5. Graceful Degradation
170
+
171
+ When a cron job fails, it must:
172
+ 1. Log the failure with structured context (job name, execution window, error)
173
+ 2. Retry with exponential backoff (Inngest does this automatically)
174
+ 3. After max retries, alert the team and record the failure
175
+ 4. Never leave the system in a partial state — use transactions for atomicity
176
+
177
+ ## Anti-Patterns
178
+
179
+ 1. **Long-running logic in Vercel Cron handlers.** Vercel Cron routes have a 60s (Hobby) or 300s (Pro) timeout. Put the work in an Inngest function or background job; the cron route should only trigger.
180
+
181
+ 2. **No idempotency.** A cron that sends duplicate digest emails or double-processes orders because it ran twice during a deploy. Every cron must handle re-execution gracefully.
182
+
183
+ 3. **Silent failures.** A cron that catches all errors and returns 200. Failed crons must surface errors through logging and alerting, not swallow them.
184
+
185
+ 4. **Missing timezone documentation.** A cron expression `0 9 * * *` without a comment explaining the intended local time. When DST shifts, 9am UTC becomes 4am or 5am Eastern, surprising the user.
186
+
187
+ 5. **No overlap protection.** A data sync cron that runs every 5 minutes but occasionally takes 8 minutes, causing two instances to process the same data concurrently.
188
+
189
+ 6. **Cron for real-time needs.** Using a 1-minute cron to poll for new orders instead of using webhooks. Cron is for periodic batch work, not real-time data ingestion.
190
+
191
+ ## Key Files
192
+
193
+ When working in a project with cron scheduling:
194
+
195
+ - `vercel.json` — Vercel Cron route definitions
196
+ - `api/cron/` or `app/api/cron/` — Cron route handlers
197
+ - Inngest function definitions — for cron-triggered step functions
198
+ - `cron_executions` table (if it exists) — idempotency tracking
199
+ - Monitoring service configuration — heartbeat endpoints
200
+
201
+ ## Verification
202
+
203
+ After applying this skill, verify:
204
+ - [ ] Every cron handler verifies the `CRON_SECRET` authorization header
205
+ - [ ] Every cron job is idempotent (safe to run twice)
206
+ - [ ] Vercel Cron routes dispatch work rather than performing long-running operations
207
+ - [ ] Overlap prevention is configured for jobs that could exceed their interval
208
+ - [ ] Monitoring alerts exist for missed or failed executions
209
+ - [ ] Timezone is documented as a comment next to every cron expression
210
+ - [ ] Retry logic exists for transient failures
211
+
212
+ ## Do NOT Use When
213
+
214
+ | Instead of this skill | Use | Why |
215
+ |---|---|---|
216
+ | Event-driven job orchestration (not time-based) | `inngest-orchestration` | Inngest covers event-driven patterns; this skill covers time-based triggers |
217
+ | General background job queue patterns | `background-jobs` | Job queue architecture is broader than cron-specific scheduling |
218
+ | Data synchronization strategies | `data-sync` | Data sync covers webhook ingestion and polling; cron is one trigger mechanism |
219
+ | Alert rule evaluation and dispatch | `alert-dispatch` | Alert dispatch covers when and how to send alerts, not how to schedule the check |
220
+
221
+ ---
222
+
223
+ *Version 1.0.0 -- 2026-03-29. Initial creation.*
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: dark-mode-implementation
3
+ description: "Use when implementing dark mode — prefers-color-scheme detection, theme persistence, flash-of-unstyled-theme prevention, color token mirroring, image and asset variants, and meta theme-color updates. Do NOT use for designing the dark palette itself, designing the token architecture, or generic theme-switching across more than two themes."
4
+ license: CC-BY-4.0
5
+ metadata:
6
+ metadata: "{\"schema_version\":6,\"version\":\"1.0.0\",\"type\":\"capability\",\"category\":\"design\",\"domain\":\"design/visual\",\"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\":\"[\\\\\\\"dark mode\\\\\\\",\\\\\\\"prefers-color-scheme\\\\\\\",\\\\\\\"theme persistence\\\\\\\",\\\\\\\"flash of unstyled theme\\\\\\\",\\\\\\\"flash of incorrect theme\\\\\\\",\\\\\\\"color-scheme css property\\\\\\\",\\\\\\\"meta theme-color\\\\\\\",\\\\\\\"dark mode images\\\\\\\",\\\\\\\"picture source media\\\\\\\",\\\\\\\"system theme detection\\\\\\\",\\\\\\\"light dark css function\\\\\\\"]\",\"triggers\":\"[\\\\\\\"dark mode\\\\\\\",\\\\\\\"prefers-color-scheme\\\\\\\",\\\\\\\"light dark toggle\\\\\\\",\\\\\\\"system theme\\\\\\\",\\\\\\\"FOUC dark mode\\\\\\\"]\",\"examples\":\"[\\\\\\\"Add a dark mode toggle with system / light / dark options and persist the user's choice\\\\\\\",\\\\\\\"Eliminate the white flash that appears for a moment when a dark-mode user loads the page\\\\\\\",\\\\\\\"Provide dark variants of the marketing illustrations and the favicon\\\\\\\"]\",\"anti_examples\":\"[\\\\\\\"Pick the dark mode color palette values\\\\\\\",\\\\\\\"Design the three-tier token architecture\\\\\\\",\\\\\\\"Build a multi-brand theme system with five themes\\\\\\\"]\",\"relations\":\"{\\\\\\\"related\\\\\\\":[\\\\\\\"theme-system-design\\\\\\\",\\\\\\\"color-system-design\\\\\\\",\\\\\\\"a11y\\\\\\\",\\\\\\\"frontend-architecture\\\\\\\"],\\\\\\\"boundary\\\\\\\":[{\\\\\\\"skill\\\\\\\":\\\\\\\"theme-system-design\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"theme-system-design defines the token layering that makes dark mode a token-mapping change; this skill handles the integration mechanics on top of that foundation.\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"color-system-design\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"The dark palette and its contrast pairings are color-system-design's responsibility; this skill consumes them.\\\\\\\"}]}\",\"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/dark-mode-implementation/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/dark-mode-implementation/SKILL.md
11
+ ---
12
+
13
+ # Dark Mode Implementation
14
+
15
+ ## Coverage
16
+ A dark mode implementation handles five concerns: detecting the user's preference (system, explicit choice, persisted choice), applying the right theme before first paint, propagating theme changes at runtime, swapping color-sensitive assets, and updating browser-chrome hints. Each has well-defined web platform primitives.
17
+
18
+ Detection uses the prefers-color-scheme media query (window.matchMedia('(prefers-color-scheme: dark)')), which reflects the operating system or browser-level preference. Most products offer three user choices — System, Light, Dark — where System defers to the media query and the other two override it. The chosen mode is persisted (localStorage or a cookie) and read on every load. The CSS color-scheme property tells the user agent which schemes a page supports, enabling correct rendering of native form controls, scrollbars, and the default page background; declare color-scheme: light dark on :root for sites that support both.
19
+
20
+ Flash-of-incorrect-theme (sometimes called FOUC for theme) occurs when the browser paints the light default before the persisted dark preference is applied. The fix is a small, blocking inline script in <head> that reads the persisted preference and sets a class or data attribute on <html> synchronously before stylesheets resolve. Frameworks with server-side rendering must serialize the resolved theme into the HTML response, often by reading a cookie on the server.
21
+
22
+ The CSS Color Module Level 5 light-dark() function (light-dark(white, black)) lets a property declare both schemes inline and the user agent picks based on color-scheme. This is supported in current browsers and reduces the boilerplate of paired custom properties for simple cases; for token-driven systems, paired :root and [data-theme="dark"] custom property assignments remain the typical approach.
23
+
24
+ Asset handling covers three categories. Raster images that have brand-color elements need dark variants delivered via <picture> with <source media="(prefers-color-scheme: dark)"> (the markup-driven approach) or via CSS background-image swapping. SVG illustrations can use currentColor or CSS custom properties for fill/stroke and update automatically. Favicons can declare a dark variant via <link rel="icon" media="(prefers-color-scheme: dark)" href="...">. Embedded videos and iframes (YouTube, Maps) often have their own theme parameter that needs to be passed via URL.
25
+
26
+ Browser chrome hints include the meta theme-color tag (<meta name="theme-color" content="..." media="(prefers-color-scheme: dark)">), which sets the address bar color on mobile browsers, the Safari toolbar tint, and the PWA splash screen. Pair it with a light variant via media= so the chrome matches the active theme. Apple-specific apple-mobile-web-app-status-bar-style is now overridden by theme-color on supported versions.
27
+
28
+ ## Philosophy
29
+ Dark mode is not a re-skin; it is a parallel design surface. Image contrast, shadow strategy (shadows on dark backgrounds work differently — often replaced with subtle borders or elevated background tints), focus ring visibility, and chart palettes all need attention. Treating dark mode as a CSS-only change produces a dark mode that technically works and feels half-finished.
30
+
31
+ The user's explicit choice overrides the system. A user who has toggled to Dark on your site once expects Dark on the next visit regardless of what their OS is doing. Persistence is not optional, and a System option is a separate, third state from "no preference saved."
32
+
33
+ ## Verification
34
+ - No flash of incorrect theme occurs on cold load for a dark-mode user; verified by throttling network and watching the first paint.
35
+ - The CSS color-scheme property is declared on :root with the schemes the page supports, so native form controls render correctly in dark mode.
36
+ - Brand-color images (illustrations, hero photos with light backgrounds) have dark variants delivered via <picture> source matching or equivalent.
37
+ - The meta theme-color tag has paired light and dark variants and matches the active theme.
38
+ - The favicon has a dark variant where the design needs it (e.g., dark logos on transparent backgrounds become invisible against dark browser tabs).
39
+ - The user's explicit choice (light/dark/system) is persisted and restored across reloads; toggling away from System and back is observable.
40
+ - All interactive states (focus rings, hover, selected) are visible in dark mode and meet contrast requirements; verified visually and via automated contrast testing.
41
+
42
+ ## Do NOT Use When
43
+ - The task is choosing the dark palette values themselves. Use color-system-design.
44
+ - The work is defining the token architecture that makes theming possible. Use theme-system-design.
45
+ - The product requires more than two themes (multi-brand white-label, three or more visual modes). Use theme-system-design for the architecture; this skill covers the dark-specific platform integrations only.
46
+ - You are auditing for WCAG contrast violations specifically. Use a11y for the criteria; the palette decisions come from color-system-design.
47
+ - The bug is a single component looking wrong in dark mode after the system is otherwise complete. That is component-level debugging, not implementation architecture.
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: data-modeling
3
+ description: "Use when designing logical or physical data structures: entities as stored data, keys, constraints, normalization, denormalization, provenance, lifecycle, indexing implications, and schema tradeoffs. Do NOT use for pre-implementation business concept discovery (use `conceptual-modeling`), migrations against an existing database (use `database-migration`), or formal ontology semantics (use `ontology-modeling`)."
4
+ license: MIT
5
+ compatibility: "Portable data-modeling discipline across relational, document, graph, event-sourced, and warehouse-style systems."
6
+ allowed-tools: Read Grep
7
+ metadata:
8
+ metadata: "{\"schema_version\":6,\"version\":\"1.0.0\",\"type\":\"capability\",\"category\":\"engineering\",\"domain\":\"data/modeling\",\"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\":\"[\\\\\\\"data modeling\\\\\\\",\\\\\\\"logical data model\\\\\\\",\\\\\\\"physical data model\\\\\\\",\\\\\\\"entity relationship\\\\\\\",\\\\\\\"normalization\\\\\\\",\\\\\\\"denormalization\\\\\\\",\\\\\\\"primary key\\\\\\\",\\\\\\\"foreign key\\\\\\\",\\\\\\\"schema design\\\\\\\",\\\\\\\"data provenance\\\\\\\",\\\\\\\"indexing implications\\\\\\\"]\",\"examples\":\"[\\\\\\\"turn this conceptual model into a logical schema with keys and constraints\\\\\\\",\\\\\\\"should this be normalized, denormalized, or materialized as a view?\\\\\\\",\\\\\\\"model provenance for revenue, cost, and refund fields\\\\\\\",\\\\\\\"choose identifiers and uniqueness constraints before writing the migration\\\\\\\"]\",\"anti_examples\":\"[\\\\\\\"identify business entities and relationships without implementation details\\\\\\\",\\\\\\\"write and apply the actual migration for an existing database\\\\\\\",\\\\\\\"define OWL/RDF class axioms and reasoning rules\\\\\\\",\\\\\\\"design REST endpoints for these resources\\\\\\\"]\",\"relations\":\"{\\\\\\\"boundary\\\\\\\":[{\\\\\\\"skill\\\\\\\":\\\\\\\"conceptual-modeling\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"conceptual-modeling is implementation-neutral; data-modeling adds logical and physical data constraints\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"database-migration\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"database-migration changes an existing database; data-modeling decides the schema shape before migration\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"ontology-modeling\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"ontology-modeling formalizes meaning; data-modeling structures persisted data\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"api-design\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"api-design exposes resources and operations; data-modeling stores and constrains underlying data\\\\\\\"}],\\\\\\\"related\\\\\\\":[\\\\\\\"conceptual-modeling\\\\\\\",\\\\\\\"database-migration\\\\\\\",\\\\\\\"api-design\\\\\\\",\\\\\\\"state-machine-modeling\\\\\\\"],\\\\\\\"depends_on\\\\\\\":[\\\\\\\"conceptual-modeling\\\\\\\"],\\\\\\\"verify_with\\\\\\\":[\\\\\\\"database-migration\\\\\\\",\\\\\\\"testing-strategy\\\\\\\"]}\",\"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/data-modeling/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/data-modeling/SKILL.md
13
+ ---
14
+
15
+ # Data Modeling
16
+
17
+ ## Coverage
18
+
19
+ Design logical and physical data structures from a validated conceptual model. Covers entities as stored records, identifiers, primary keys, foreign keys, uniqueness, cardinality enforcement, normalization, denormalization, derived data, materialized views, provenance, retention, indexing implications, and schema-change risk.
20
+
21
+ ## Philosophy
22
+
23
+ Data models are long-lived promises. Application code changes quickly; stored data and integrations remember mistakes. A good data model preserves business meaning, supports expected queries, and prevents invalid states without overfitting to today's UI.
24
+
25
+ Do not jump from concept to migration. First decide what must be stored, what can be derived, what must be constrained, and what must remain queryable.
26
+
27
+ ## Method
28
+
29
+ 1. Start from a conceptual model or extract one quickly.
30
+ 2. Define identity and uniqueness for each stored entity.
31
+ 3. Map relationships to keys, junctions, embeddings, or references.
32
+ 4. Decide normalization vs denormalization based on write/read patterns and consistency requirements.
33
+ 5. Mark derived fields and their source of truth.
34
+ 6. Add provenance for data sourced from external systems or calculations.
35
+ 7. Check query patterns and indexing implications.
36
+ 8. Hand off to `database-migration` for implementation changes.
37
+
38
+ ## Evals
39
+
40
+ This skill ships a comprehension-eval artifact at [`examples/evals/data-modeling.json`](https://github.com/jacob-balslev/skill-graph/blob/main/examples/evals/data-modeling.json). The checklist below is the authoring gate for persistence-model decisions; the eval file is the grader surface.
41
+
42
+ ## Verification
43
+
44
+ - [ ] Every stored entity has identity and uniqueness criteria
45
+ - [ ] Relationship cardinality is enforceable or intentionally documented
46
+ - [ ] Derived data names its source and refresh rule
47
+ - [ ] Denormalization has a stated read/write tradeoff
48
+ - [ ] External-source fields carry provenance
49
+ - [ ] Retention and privacy obligations are represented where relevant
50
+ - [ ] Expected queries can be served without accidental full scans at scale
51
+
52
+ ## Do NOT Use When
53
+
54
+ | Use instead | When |
55
+ |---|---|
56
+ | `conceptual-modeling` | You are still discovering business concepts without persistence details. |
57
+ | `database-migration` | You need to write, apply, or verify a concrete migration. |
58
+ | `ontology-modeling` | You need formal semantic axioms or reasoning constraints. |
59
+ | `api-design` | You need endpoint, request, response, error, and versioning design. |
@@ -0,0 +1,117 @@
1
+ ---
2
+ name: data-modeling-fundamentals
3
+ description: "Use when reasoning about the foundational theory beneath data modeling: Codd's relational model (1970) and the algebra it sits on, the normal forms (1NF, 2NF, 3NF, BCNF, 4NF, 5NF) as a precise sequence of constraint-elimination steps, functional dependencies and the closure algorithm, Chen's entity-relationship model (1976) as a higher-abstraction layer above relations, the principled case for and against denormalization, the relational-vs-document tradeoff at the conceptual level, the immutable-data-model alternative (event sourcing, append-only tables), and the historical and theoretical literature that grounds modern database design. Do NOT use for practical persistence design and method (use data-modeling), for safely applying changes to an existing schema (use schema-evolution), for choosing what indexes to maintain (use indexing-strategy), or for the conceptual-modeling layer above the data model (use conceptual-modeling)."
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\":\"[\\\\\\\"relational model\\\\\\\",\\\\\\\"Codd\\\\\\\",\\\\\\\"normalization\\\\\\\",\\\\\\\"normal forms\\\\\\\",\\\\\\\"functional dependency\\\\\\\",\\\\\\\"1NF\\\\\\\",\\\\\\\"2NF\\\\\\\",\\\\\\\"3NF\\\\\\\",\\\\\\\"BCNF\\\\\\\",\\\\\\\"4NF\\\\\\\",\\\\\\\"5NF\\\\\\\",\\\\\\\"entity-relationship model\\\\\\\",\\\\\\\"Chen\\\\\\\",\\\\\\\"relational algebra\\\\\\\",\\\\\\\"denormalization\\\\\\\",\\\\\\\"immutable data model\\\\\\\",\\\\\\\"event sourcing\\\\\\\"]\",\"triggers\":\"[\\\\\\\"what normal form is this\\\\\\\",\\\\\\\"should this be normalized or denormalized\\\\\\\",\\\\\\\"explain functional dependencies\\\\\\\",\\\\\\\"relational vs document model\\\\\\\",\\\\\\\"Codd's rules\\\\\\\"]\",\"examples\":\"[\\\\\\\"explain why a table is in 2NF but not 3NF and what change would bring it to 3NF\\\\\\\",\\\\\\\"decide whether a workload's read pattern justifies denormalization against the theoretical baseline\\\\\\\",\\\\\\\"compare the relational, document, and event-sourced models at the conceptual level for a given domain\\\\\\\",\\\\\\\"trace a functional-dependency closure to find a candidate key\\\\\\\"]\",\"anti_examples\":\"[\\\\\\\"design the practical schema for a new persistence layer (use data-modeling)\\\\\\\",\\\\\\\"apply an expand-contract migration to change an existing schema (use schema-evolution)\\\\\\\",\\\\\\\"choose which indexes to maintain (use indexing-strategy)\\\\\\\",\\\\\\\"discover business entities without implementation details (use conceptual-modeling)\\\\\\\"]\",\"relations\":\"{\\\\\\\"related\\\\\\\":[\\\\\\\"data-modeling\\\\\\\",\\\\\\\"conceptual-modeling\\\\\\\",\\\\\\\"entity-relationship-modeling\\\\\\\",\\\\\\\"schema-evolution\\\\\\\"],\\\\\\\"boundary\\\\\\\":[{\\\\\\\"skill\\\\\\\":\\\\\\\"data-modeling\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"data-modeling owns the practical method of designing persistence — turn a conceptual model into a working schema with keys, constraints, indexing implications. This skill owns the theoretical foundations beneath that method — what normal forms guarantee, what Codd's relational model formally provides, the algebra that makes joins composable, and the principled justification for or against denormalization. They are companion skills: theory and practice.\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"conceptual-modeling\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"conceptual-modeling owns implementation-neutral business-concept discovery (entities, relationships, attributes as business reality). This skill owns the formal data-model layer below conceptual modeling: the relational model, the algebra, the dependency theory. The two compose: conceptual modeling identifies entities; data-modeling-fundamentals formalizes how those entities map to relations.\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"entity-relationship-modeling\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"entity-relationship-modeling owns the ER notation and method (entities, relationships, cardinality, ER diagrams) as developed by Chen and extended by Bachman, Barker, and others. This skill owns the broader theoretical frame including the relational model that ER diagrams typically translate into. The boundary: ER is the diagramming and discovery layer; the relational model is the formal target.\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"schema-evolution\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"schema-evolution owns the migration mechanics — how to change a deployed schema without downtime. This skill owns the static theory of what a good schema is. The decision 'this schema should be in 3NF' is grounded by this skill; the application of that decision to a live database is `schema-evolution`'s domain.\\\\\\\"}],\\\\\\\"verify_with\\\\\\\":[\\\\\\\"data-modeling\\\\\\\",\\\\\\\"entity-relationship-modeling\\\\\\\"]}\",\"mental_model\":\"|\",\"purpose\":\"|\",\"boundary\":\"|\",\"analogy\":\"Data-modeling fundamentals is to schema design what Euclidean geometry is to architecture — the architect does not draw a right-angled wall by intuition each time; they draw it because the geometry guarantees stability and squares lock together. A schema in 3NF is the wall built to plumb, where every dependency is structural and no anomaly is hiding in the carpentry. Denormalization is the deliberate decision to cut a non-load-bearing wall for an open floor plan — defensible when the workload justifies it, indefensible when the cost is invisible.\",\"misconception\":\"|\",\"concept\":\"{\\\\\\\"definition\\\\\\\":\\\\\\\"Data-modeling fundamentals is the body of formal theory beneath practical database design: Codd's relational model (1970), which represents data as relations (sets of tuples) and provides a closed algebra (selection, projection, join, union, intersection, difference, division) for querying them; the normal forms (1NF through 5NF and BCNF), each defined by the elimination of a specific class of dependency anomaly; the theory of functional dependencies and the closure algorithm used to derive normal-form membership and candidate keys; Chen's entity-relationship model (1976), which sits above the relational model as a higher-abstraction modeling layer that translates downward into relations; the principled justifications for normalization (avoid update, insert, delete anomalies) and for denormalization (workload-driven performance trade-offs against the normal-form baseline); and the alternative data models — document, graph, key-value, columnar, event-sourced — each of which can be characterized by what relational primitives it preserves, relaxes, or trades for a different access pattern. The skill is the *theory* a practitioner draws on when deciding what shape data should take and why; the practical application of that theory is `data-modeling`.\\\\\\\",\\\\\\\"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/data-modeling-fundamentals/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/data-modeling-fundamentals/SKILL.md
12
+ ---
13
+
14
+ # Data Modeling Fundamentals
15
+
16
+ ## Coverage
17
+
18
+ The body of formal theory beneath practical database design. Covers Codd's relational model (1970), the closed relational algebra (selection, projection, join, union, difference, division), functional dependencies and the closure algorithm, the normal forms (1NF through 5NF, BCNF, with notes on 6NF and DKNF), Chen's entity-relationship model (1976) and its extensions, the principled framing of normalization vs denormalization as anomaly-elimination vs measured read-performance trade, the alternative data models (document, graph, key-value, columnar, time-series, event-sourced) characterized by which relational primitives they preserve or trade, and the foundational literature from Codd, Chen, Fagin, Date, Garcia-Molina, and Kleppmann that grounds modern database design.
19
+
20
+ ## Philosophy
21
+
22
+ Data outlives application code. Application code is rewritten in years; stored data and integrations persist for decades. A bad data model is the most expensive kind of technical debt — every consumer (application, report, integration, analytical job) depends on it, and changing it requires coordinated migration across all of them. The discipline of getting the model right early pays back over the data's full lifetime.
23
+
24
+ Without the theory, design becomes folklore. Teams normalize because someone said normalization is good; they denormalize because someone said joins are slow. Neither claim is wrong, but without the theory underneath, the decisions are tribal rather than reasoned. The theoretical layer — what normal forms guarantee, what anomalies each form eliminates, what relational algebra closure buys — makes the conversation precise.
25
+
26
+ Normalization is a principled cleanup procedure, not an aesthetic standard. Each normal form eliminates a specific class of anomaly; the question is not "what normal form is this in" but "are the anomalies this form admits operationally relevant to our workload." The discipline is matching the form to the workload.
27
+
28
+ ## The Normal Forms — A Sequence of Anomaly Eliminations
29
+
30
+ | Form | Eliminates | Defined by |
31
+ |---|---|---|
32
+ | 1NF | Repeating groups, non-atomic attributes | Atomic values only |
33
+ | 2NF | Partial-key dependencies | 1NF + every non-key attribute fully depends on the whole key |
34
+ | 3NF | Transitive non-prime dependencies | 2NF + no non-key attribute depends on another non-key attribute |
35
+ | BCNF | Anomalies in overlapping candidate keys | Every non-trivial FD has a superkey on its left |
36
+ | 4NF | Multi-valued-dependency anomalies | BCNF + no non-trivial multi-valued dependencies |
37
+ | 5NF | Join-dependency anomalies | 4NF + every join dependency is implied by candidate keys |
38
+
39
+ **The discipline:** start with FDs, derive closure, find candidate keys, test normal-form membership, decompose to the level where the anomalies that matter for the workload are eliminated.
40
+
41
+ ## The Relational Algebra — Why It Composes
42
+
43
+ | Operator | Notation | What it does |
44
+ |---|---|---|
45
+ | Selection | σ_predicate(R) | Filter rows |
46
+ | Projection | π_columns(R) | Filter columns |
47
+ | Join | R ⋈ S | Combine relations on matching attributes |
48
+ | Union | R ∪ S | Set union of compatible relations |
49
+ | Difference | R − S | Set difference |
50
+ | Intersection | R ∩ S | Set intersection (derivable) |
51
+ | Division | R ÷ S | Tuples in R matching all values in S |
52
+ | Rename | ρ_a→b(R) | Rename attributes |
53
+
54
+ Every operator's input and output are relations. This *closure* is what makes the algebra compose — JOIN of JOIN of JOIN is still a relation, queryable by further algebra. SQL inherits this property; the document, graph, and key-value alternatives give it up in exchange for different access patterns.
55
+
56
+ ## Normalization vs Denormalization — The Principled Tradeoff
57
+
58
+ | Path | Benefit | Cost |
59
+ |---|---|---|
60
+ | Normalize to BCNF | No update, insert, delete anomalies | More tables, more joins, slower reads |
61
+ | Denormalize selectively | Faster reads for measured access patterns | Update anomalies application must manage |
62
+ | Materialized view | Pre-computed aggregations | Refresh complexity; staleness window |
63
+ | Embedded reference (document-style) | Read locality | Update fan-out across embedded copies |
64
+ | Pre-computed aggregate | O(1) reads of sums/counts | Write-time computation; consistency burden |
65
+
66
+ **Principled framing:** normalize to eliminate operationally-relevant anomalies; denormalize specific paths for measured read-performance need; accept the consistency burden explicitly.
67
+
68
+ ## Alternative Models — What They Trade
69
+
70
+ | Model | Preserves | Trades away | Wins for |
71
+ |---|---|---|---|
72
+ | Document (MongoDB) | Per-document atomicity | Cross-document joins, transactional consistency | Aggregate-as-document reads |
73
+ | Graph (Neo4j) | Relationship traversal | Tabular query, aggregation | Many-hop relationship queries |
74
+ | Key-value (Redis) | Point access | Structured query | Caching, simple lookups |
75
+ | Wide-column (Cassandra) | Distributed scale | Joins, ACID transactions | Distributed writes, time-series |
76
+ | Columnar (BigQuery, ClickHouse) | Analytical aggregation | Point access, transactional updates | OLAP workloads |
77
+ | Time-series (TimescaleDB, InfluxDB) | Timestamp-indexed writes | Generic relational query | Metrics, IoT, observability |
78
+ | Event-sourced | Full history | Current-state read complexity, storage | Audit, financial ledger |
79
+
80
+ ## Verification
81
+
82
+ After applying this skill, verify:
83
+ - [ ] The functional dependencies of the schema have been listed explicitly. Normalization claims are grounded in FDs, not in intuition.
84
+ - [ ] The normal form chosen for each table matches the workload's anomaly tolerance. Higher form is not asserted as "better" without justification.
85
+ - [ ] Denormalization decisions have a measured read-performance justification and a documented plan for maintaining the redundant data consistently. Denormalization-by-reflex is not present.
86
+ - [ ] The choice of data model (relational vs document vs graph vs columnar vs event-sourced) has been justified against the workload's dominant access pattern, not chosen by tribal preference.
87
+ - [ ] Integrity constraints (primary keys, foreign keys, NOT NULL, CHECK constraints, UNIQUE indexes) are present where the theory requires them. Entity integrity and referential integrity are enforced at the database layer, not delegated to the application.
88
+ - [ ] The ER model (entities, relationships, cardinality) was drawn before tables were designed. The schema reflects entity structure, not query-shape.
89
+ - [ ] For each non-relational model in use, the team can name what relational primitive is being traded and what the application is doing in exchange. The choice is principled, not unexamined.
90
+ - [ ] Anti-patterns are recognized: EAV (entity-attribute-value) tables for arbitrary metadata, JSON columns used to avoid schema design, missing foreign keys, denormalization without consistency strategy.
91
+
92
+ ## Do NOT Use When
93
+
94
+ | Instead of this skill | Use | Why |
95
+ |---|---|---|
96
+ | Designing the practical schema for a new persistence layer | `data-modeling` | data-modeling owns the method; this owns the theory |
97
+ | Applying a migration to an existing schema | `schema-evolution` | schema-evolution owns the migration mechanics |
98
+ | Choosing which indexes to maintain | `indexing-strategy` | indexing-strategy owns the index design surface |
99
+ | Discovering business entities without implementation details | `conceptual-modeling` | conceptual-modeling sits above this layer at the business-domain level |
100
+ | Drawing an ER diagram for a specific design | `entity-relationship-modeling` | entity-relationship-modeling owns the ER notation and discovery method |
101
+ | Tuning a slow query against the current schema | `query-optimization` | query-optimization owns runtime performance |
102
+
103
+ ## Key Sources
104
+
105
+ - Codd, E. F. (1970). ["A Relational Model of Data for Large Shared Data Banks"](https://dl.acm.org/doi/10.1145/362384.362685). *Communications of the ACM*, 13(6). The founding paper of the relational model. Defines relations, the algebra, and the integrity constraints. Foundational reading.
106
+ - Codd, E. F. (1972). "Further Normalization of the Data Base Relational Model." In *Data Base Systems*, Prentice-Hall. Introduces 2NF and 3NF formally.
107
+ - Codd, E. F., & Boyce, R. F. (1974). Introduces what became Boyce-Codd Normal Form (BCNF), addressing edge cases 3NF doesn't cover.
108
+ - Chen, P. P. (1976). ["The Entity-Relationship Model — Toward a Unified View of Data"](https://dl.acm.org/doi/10.1145/320434.320440). *ACM TODS*, 1(1). The founding paper of the ER model.
109
+ - Fagin, R. (1977). ["Multivalued Dependencies and a New Normal Form for Relational Databases"](https://dl.acm.org/doi/10.1145/320557.320571). *ACM TODS*, 2(3). 4NF.
110
+ - Fagin, R. (1979). ["Normal Forms and Relational Database Operators"](https://dl.acm.org/doi/10.1145/582095.582120). *SIGMOD 1979*. 5NF (project-join normal form).
111
+ - Fagin, R. (1981). ["A Normal Form for Relational Databases That Is Based on Domains and Keys"](https://dl.acm.org/doi/10.1145/319587.319592). *ACM TODS*, 6(3). Domain-Key Normal Form.
112
+ - Date, C. J. *An Introduction to Database Systems*, 8th ed. (2003). Pearson. The canonical textbook treatment of the relational model and normalization; widely used in graduate database courses.
113
+ - Garcia-Molina, H., Ullman, J. D., & Widom, J. (2008). *Database Systems: The Complete Book*, 2nd ed. Pearson. Comprehensive textbook covering relational theory, normalization, query processing, and modern systems.
114
+ - Codd, E. F. (1985). ["Is Your DBMS Really Relational?"](https://www.computerworld.com/article/2522473/codd-on-dbms-rules.html). *Computerworld*. The article introducing Codd's 12 rules (later 13).
115
+ - Kleppmann, M. (2017). *Designing Data-Intensive Applications*. O'Reilly. Chapter 2 (Data Models and Query Languages) is the modern practitioner synthesis of the relational, document, and graph models and their trade-offs.
116
+ - Ambler, S. W., & Sadalage, P. J. (2006). *Refactoring Databases: Evolutionary Database Design*. Addison-Wesley. Bridges normalization theory with the practical concerns of evolving a deployed schema; companion to `schema-evolution`.
117
+ - Hellerstein, J. M., Stonebraker, M., & Hamilton, J. (2007). ["Architecture of a Database System"](https://dsf.berkeley.edu/papers/fntdb07-architecture.pdf). *Foundations and Trends in Databases*, 1(2). Treats the relational model from the systems-architecture perspective.