@zigrivers/scaffold 2.1.2 → 2.38.0

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 (391) hide show
  1. package/README.md +505 -119
  2. package/dist/cli/commands/build.d.ts.map +1 -1
  3. package/dist/cli/commands/build.js +94 -14
  4. package/dist/cli/commands/build.js.map +1 -1
  5. package/dist/cli/commands/build.test.js +30 -5
  6. package/dist/cli/commands/build.test.js.map +1 -1
  7. package/dist/cli/commands/check.d.ts +12 -0
  8. package/dist/cli/commands/check.d.ts.map +1 -0
  9. package/dist/cli/commands/check.js +311 -0
  10. package/dist/cli/commands/check.js.map +1 -0
  11. package/dist/cli/commands/check.test.d.ts +2 -0
  12. package/dist/cli/commands/check.test.d.ts.map +1 -0
  13. package/dist/cli/commands/check.test.js +412 -0
  14. package/dist/cli/commands/check.test.js.map +1 -0
  15. package/dist/cli/commands/complete.d.ts +12 -0
  16. package/dist/cli/commands/complete.d.ts.map +1 -0
  17. package/dist/cli/commands/complete.js +101 -0
  18. package/dist/cli/commands/complete.js.map +1 -0
  19. package/dist/cli/commands/complete.test.d.ts +2 -0
  20. package/dist/cli/commands/complete.test.d.ts.map +1 -0
  21. package/dist/cli/commands/complete.test.js +133 -0
  22. package/dist/cli/commands/complete.test.js.map +1 -0
  23. package/dist/cli/commands/dashboard.d.ts.map +1 -1
  24. package/dist/cli/commands/dashboard.js +12 -8
  25. package/dist/cli/commands/dashboard.js.map +1 -1
  26. package/dist/cli/commands/info.d.ts.map +1 -1
  27. package/dist/cli/commands/info.js +4 -0
  28. package/dist/cli/commands/info.js.map +1 -1
  29. package/dist/cli/commands/knowledge.d.ts.map +1 -1
  30. package/dist/cli/commands/knowledge.js +6 -2
  31. package/dist/cli/commands/knowledge.js.map +1 -1
  32. package/dist/cli/commands/knowledge.test.js +16 -11
  33. package/dist/cli/commands/knowledge.test.js.map +1 -1
  34. package/dist/cli/commands/next.d.ts.map +1 -1
  35. package/dist/cli/commands/next.js +41 -13
  36. package/dist/cli/commands/next.js.map +1 -1
  37. package/dist/cli/commands/next.test.js +3 -0
  38. package/dist/cli/commands/next.test.js.map +1 -1
  39. package/dist/cli/commands/reset.d.ts +1 -0
  40. package/dist/cli/commands/reset.d.ts.map +1 -1
  41. package/dist/cli/commands/reset.js +179 -67
  42. package/dist/cli/commands/reset.js.map +1 -1
  43. package/dist/cli/commands/reset.test.js +360 -0
  44. package/dist/cli/commands/reset.test.js.map +1 -1
  45. package/dist/cli/commands/rework.d.ts +20 -0
  46. package/dist/cli/commands/rework.d.ts.map +1 -0
  47. package/dist/cli/commands/rework.js +332 -0
  48. package/dist/cli/commands/rework.js.map +1 -0
  49. package/dist/cli/commands/rework.test.d.ts +2 -0
  50. package/dist/cli/commands/rework.test.d.ts.map +1 -0
  51. package/dist/cli/commands/rework.test.js +297 -0
  52. package/dist/cli/commands/rework.test.js.map +1 -0
  53. package/dist/cli/commands/run.d.ts.map +1 -1
  54. package/dist/cli/commands/run.js +59 -31
  55. package/dist/cli/commands/run.js.map +1 -1
  56. package/dist/cli/commands/run.test.js +288 -6
  57. package/dist/cli/commands/run.test.js.map +1 -1
  58. package/dist/cli/commands/skill.d.ts +12 -0
  59. package/dist/cli/commands/skill.d.ts.map +1 -0
  60. package/dist/cli/commands/skill.js +123 -0
  61. package/dist/cli/commands/skill.js.map +1 -0
  62. package/dist/cli/commands/skill.test.d.ts +2 -0
  63. package/dist/cli/commands/skill.test.d.ts.map +1 -0
  64. package/dist/cli/commands/skill.test.js +297 -0
  65. package/dist/cli/commands/skill.test.js.map +1 -0
  66. package/dist/cli/commands/skip.d.ts +1 -1
  67. package/dist/cli/commands/skip.d.ts.map +1 -1
  68. package/dist/cli/commands/skip.js +123 -57
  69. package/dist/cli/commands/skip.js.map +1 -1
  70. package/dist/cli/commands/skip.test.js +91 -0
  71. package/dist/cli/commands/skip.test.js.map +1 -1
  72. package/dist/cli/commands/status.d.ts +1 -0
  73. package/dist/cli/commands/status.d.ts.map +1 -1
  74. package/dist/cli/commands/status.js +57 -10
  75. package/dist/cli/commands/status.js.map +1 -1
  76. package/dist/cli/commands/status.test.js +81 -0
  77. package/dist/cli/commands/status.test.js.map +1 -1
  78. package/dist/cli/commands/update.test.js +252 -0
  79. package/dist/cli/commands/update.test.js.map +1 -1
  80. package/dist/cli/commands/version.test.js +171 -1
  81. package/dist/cli/commands/version.test.js.map +1 -1
  82. package/dist/cli/index.d.ts.map +1 -1
  83. package/dist/cli/index.js +8 -0
  84. package/dist/cli/index.js.map +1 -1
  85. package/dist/core/adapters/adapter.d.ts +14 -0
  86. package/dist/core/adapters/adapter.d.ts.map +1 -1
  87. package/dist/core/adapters/adapter.js.map +1 -1
  88. package/dist/core/adapters/adapter.test.js +10 -0
  89. package/dist/core/adapters/adapter.test.js.map +1 -1
  90. package/dist/core/adapters/claude-code.d.ts.map +1 -1
  91. package/dist/core/adapters/claude-code.js +47 -10
  92. package/dist/core/adapters/claude-code.js.map +1 -1
  93. package/dist/core/adapters/claude-code.test.js +41 -20
  94. package/dist/core/adapters/claude-code.test.js.map +1 -1
  95. package/dist/core/adapters/codex.d.ts.map +1 -1
  96. package/dist/core/adapters/codex.js +5 -1
  97. package/dist/core/adapters/codex.js.map +1 -1
  98. package/dist/core/adapters/codex.test.js +5 -0
  99. package/dist/core/adapters/codex.test.js.map +1 -1
  100. package/dist/core/adapters/universal.d.ts.map +1 -1
  101. package/dist/core/adapters/universal.js +0 -1
  102. package/dist/core/adapters/universal.js.map +1 -1
  103. package/dist/core/adapters/universal.test.js +5 -0
  104. package/dist/core/adapters/universal.test.js.map +1 -1
  105. package/dist/core/assembly/context-gatherer.d.ts.map +1 -1
  106. package/dist/core/assembly/context-gatherer.js +5 -2
  107. package/dist/core/assembly/context-gatherer.js.map +1 -1
  108. package/dist/core/assembly/engine.d.ts.map +1 -1
  109. package/dist/core/assembly/engine.js +10 -2
  110. package/dist/core/assembly/engine.js.map +1 -1
  111. package/dist/core/assembly/engine.test.js +19 -0
  112. package/dist/core/assembly/engine.test.js.map +1 -1
  113. package/dist/core/assembly/knowledge-loader.d.ts +25 -0
  114. package/dist/core/assembly/knowledge-loader.d.ts.map +1 -1
  115. package/dist/core/assembly/knowledge-loader.js +75 -2
  116. package/dist/core/assembly/knowledge-loader.js.map +1 -1
  117. package/dist/core/assembly/knowledge-loader.test.js +388 -1
  118. package/dist/core/assembly/knowledge-loader.test.js.map +1 -1
  119. package/dist/core/assembly/meta-prompt-loader.d.ts +6 -0
  120. package/dist/core/assembly/meta-prompt-loader.d.ts.map +1 -1
  121. package/dist/core/assembly/meta-prompt-loader.js +41 -25
  122. package/dist/core/assembly/meta-prompt-loader.js.map +1 -1
  123. package/dist/core/assembly/preset-loader.d.ts +10 -0
  124. package/dist/core/assembly/preset-loader.d.ts.map +1 -1
  125. package/dist/core/assembly/preset-loader.js +26 -1
  126. package/dist/core/assembly/preset-loader.js.map +1 -1
  127. package/dist/core/assembly/preset-loader.test.js +65 -1
  128. package/dist/core/assembly/preset-loader.test.js.map +1 -1
  129. package/dist/core/assembly/update-mode.d.ts.map +1 -1
  130. package/dist/core/assembly/update-mode.js +10 -4
  131. package/dist/core/assembly/update-mode.js.map +1 -1
  132. package/dist/core/assembly/update-mode.test.js +47 -0
  133. package/dist/core/assembly/update-mode.test.js.map +1 -1
  134. package/dist/core/dependency/dependency.d.ts.map +1 -1
  135. package/dist/core/dependency/dependency.js +3 -2
  136. package/dist/core/dependency/dependency.js.map +1 -1
  137. package/dist/core/dependency/dependency.test.js +2 -0
  138. package/dist/core/dependency/dependency.test.js.map +1 -1
  139. package/dist/core/dependency/eligibility.js +3 -3
  140. package/dist/core/dependency/eligibility.js.map +1 -1
  141. package/dist/core/dependency/eligibility.test.js +2 -0
  142. package/dist/core/dependency/eligibility.test.js.map +1 -1
  143. package/dist/core/dependency/graph.d.ts.map +1 -1
  144. package/dist/core/dependency/graph.js +4 -0
  145. package/dist/core/dependency/graph.js.map +1 -1
  146. package/dist/core/dependency/graph.test.d.ts +2 -0
  147. package/dist/core/dependency/graph.test.d.ts.map +1 -0
  148. package/dist/core/dependency/graph.test.js +262 -0
  149. package/dist/core/dependency/graph.test.js.map +1 -0
  150. package/dist/core/rework/phase-selector.d.ts +24 -0
  151. package/dist/core/rework/phase-selector.d.ts.map +1 -0
  152. package/dist/core/rework/phase-selector.js +98 -0
  153. package/dist/core/rework/phase-selector.js.map +1 -0
  154. package/dist/core/rework/phase-selector.test.d.ts +2 -0
  155. package/dist/core/rework/phase-selector.test.d.ts.map +1 -0
  156. package/dist/core/rework/phase-selector.test.js +138 -0
  157. package/dist/core/rework/phase-selector.test.js.map +1 -0
  158. package/dist/dashboard/generator.d.ts +48 -17
  159. package/dist/dashboard/generator.d.ts.map +1 -1
  160. package/dist/dashboard/generator.js +75 -5
  161. package/dist/dashboard/generator.js.map +1 -1
  162. package/dist/dashboard/generator.test.js +213 -5
  163. package/dist/dashboard/generator.test.js.map +1 -1
  164. package/dist/dashboard/template.d.ts +1 -1
  165. package/dist/dashboard/template.d.ts.map +1 -1
  166. package/dist/dashboard/template.js +755 -114
  167. package/dist/dashboard/template.js.map +1 -1
  168. package/dist/e2e/knowledge.test.js +4 -3
  169. package/dist/e2e/knowledge.test.js.map +1 -1
  170. package/dist/e2e/pipeline.test.js +2 -0
  171. package/dist/e2e/pipeline.test.js.map +1 -1
  172. package/dist/e2e/rework.test.d.ts +6 -0
  173. package/dist/e2e/rework.test.d.ts.map +1 -0
  174. package/dist/e2e/rework.test.js +226 -0
  175. package/dist/e2e/rework.test.js.map +1 -0
  176. package/dist/index.js +0 -0
  177. package/dist/project/adopt.test.js +2 -0
  178. package/dist/project/adopt.test.js.map +1 -1
  179. package/dist/project/claude-md.js +2 -2
  180. package/dist/project/claude-md.js.map +1 -1
  181. package/dist/project/claude-md.test.js +4 -4
  182. package/dist/project/claude-md.test.js.map +1 -1
  183. package/dist/project/detector.d.ts.map +1 -1
  184. package/dist/project/detector.js +4 -1
  185. package/dist/project/detector.js.map +1 -1
  186. package/dist/project/frontmatter.d.ts.map +1 -1
  187. package/dist/project/frontmatter.js +54 -15
  188. package/dist/project/frontmatter.js.map +1 -1
  189. package/dist/project/frontmatter.test.js +2 -2
  190. package/dist/project/frontmatter.test.js.map +1 -1
  191. package/dist/state/rework-manager.d.ts +16 -0
  192. package/dist/state/rework-manager.d.ts.map +1 -0
  193. package/dist/state/rework-manager.js +126 -0
  194. package/dist/state/rework-manager.js.map +1 -0
  195. package/dist/state/rework-manager.test.d.ts +2 -0
  196. package/dist/state/rework-manager.test.d.ts.map +1 -0
  197. package/dist/state/rework-manager.test.js +191 -0
  198. package/dist/state/rework-manager.test.js.map +1 -0
  199. package/dist/state/state-manager.d.ts +13 -0
  200. package/dist/state/state-manager.d.ts.map +1 -1
  201. package/dist/state/state-manager.js +39 -2
  202. package/dist/state/state-manager.js.map +1 -1
  203. package/dist/state/state-manager.test.js +74 -1
  204. package/dist/state/state-manager.test.js.map +1 -1
  205. package/dist/state/state-migration.d.ts +23 -0
  206. package/dist/state/state-migration.d.ts.map +1 -0
  207. package/dist/state/state-migration.js +144 -0
  208. package/dist/state/state-migration.js.map +1 -0
  209. package/dist/state/state-migration.test.d.ts +2 -0
  210. package/dist/state/state-migration.test.d.ts.map +1 -0
  211. package/dist/state/state-migration.test.js +451 -0
  212. package/dist/state/state-migration.test.js.map +1 -0
  213. package/dist/types/assembly.d.ts +2 -0
  214. package/dist/types/assembly.d.ts.map +1 -1
  215. package/dist/types/dependency.d.ts +2 -2
  216. package/dist/types/dependency.d.ts.map +1 -1
  217. package/dist/types/frontmatter.d.ts +100 -7
  218. package/dist/types/frontmatter.d.ts.map +1 -1
  219. package/dist/types/frontmatter.js +89 -1
  220. package/dist/types/frontmatter.js.map +1 -1
  221. package/dist/types/index.d.ts +1 -0
  222. package/dist/types/index.d.ts.map +1 -1
  223. package/dist/types/index.js +1 -0
  224. package/dist/types/index.js.map +1 -1
  225. package/dist/types/lock.d.ts +1 -1
  226. package/dist/types/lock.d.ts.map +1 -1
  227. package/dist/types/rework.d.ts +36 -0
  228. package/dist/types/rework.d.ts.map +1 -0
  229. package/dist/types/rework.js +2 -0
  230. package/dist/types/rework.js.map +1 -0
  231. package/dist/utils/errors.d.ts +1 -0
  232. package/dist/utils/errors.d.ts.map +1 -1
  233. package/dist/utils/errors.js +8 -0
  234. package/dist/utils/errors.js.map +1 -1
  235. package/dist/utils/fs.d.ts +6 -0
  236. package/dist/utils/fs.d.ts.map +1 -1
  237. package/dist/utils/fs.js +13 -0
  238. package/dist/utils/fs.js.map +1 -1
  239. package/dist/validation/config-validator.test.d.ts +2 -0
  240. package/dist/validation/config-validator.test.d.ts.map +1 -0
  241. package/dist/validation/config-validator.test.js +210 -0
  242. package/dist/validation/config-validator.test.js.map +1 -0
  243. package/dist/validation/dependency-validator.test.d.ts +2 -0
  244. package/dist/validation/dependency-validator.test.d.ts.map +1 -0
  245. package/dist/validation/dependency-validator.test.js +215 -0
  246. package/dist/validation/dependency-validator.test.js.map +1 -0
  247. package/dist/validation/frontmatter-validator.test.d.ts +2 -0
  248. package/dist/validation/frontmatter-validator.test.d.ts.map +1 -0
  249. package/dist/validation/frontmatter-validator.test.js +371 -0
  250. package/dist/validation/frontmatter-validator.test.js.map +1 -0
  251. package/dist/validation/state-validator.test.d.ts +2 -0
  252. package/dist/validation/state-validator.test.d.ts.map +1 -0
  253. package/dist/validation/state-validator.test.js +325 -0
  254. package/dist/validation/state-validator.test.js.map +1 -0
  255. package/dist/wizard/suggestion.test.d.ts +2 -0
  256. package/dist/wizard/suggestion.test.d.ts.map +1 -0
  257. package/dist/wizard/suggestion.test.js +115 -0
  258. package/dist/wizard/suggestion.test.js.map +1 -0
  259. package/dist/wizard/wizard.d.ts.map +1 -1
  260. package/dist/wizard/wizard.js +34 -1
  261. package/dist/wizard/wizard.js.map +1 -1
  262. package/knowledge/core/adr-craft.md +57 -0
  263. package/knowledge/core/ai-memory-management.md +246 -0
  264. package/knowledge/core/api-design.md +8 -0
  265. package/knowledge/core/automated-review-tooling.md +203 -0
  266. package/knowledge/core/claude-md-patterns.md +254 -0
  267. package/knowledge/core/coding-conventions.md +246 -0
  268. package/knowledge/core/database-design.md +8 -0
  269. package/knowledge/core/design-system-tokens.md +469 -0
  270. package/knowledge/core/dev-environment.md +223 -0
  271. package/knowledge/core/domain-modeling.md +8 -0
  272. package/knowledge/core/eval-craft.md +1008 -0
  273. package/knowledge/core/git-workflow-patterns.md +200 -0
  274. package/knowledge/core/multi-model-review-dispatch.md +250 -0
  275. package/knowledge/core/operations-runbook.md +40 -225
  276. package/knowledge/core/project-structure-patterns.md +231 -0
  277. package/knowledge/core/review-step-template.md +247 -0
  278. package/knowledge/core/{security-review.md → security-best-practices.md} +9 -1
  279. package/knowledge/core/system-architecture.md +5 -1
  280. package/knowledge/core/task-decomposition.md +174 -36
  281. package/knowledge/core/task-tracking.md +225 -0
  282. package/knowledge/core/tech-stack-selection.md +214 -0
  283. package/knowledge/core/testing-strategy.md +63 -70
  284. package/knowledge/core/user-stories.md +69 -60
  285. package/knowledge/core/user-story-innovation.md +70 -0
  286. package/knowledge/core/ux-specification.md +18 -148
  287. package/knowledge/execution/enhancement-workflow.md +201 -0
  288. package/knowledge/execution/task-claiming-strategy.md +130 -0
  289. package/knowledge/execution/tdd-execution-loop.md +172 -0
  290. package/knowledge/execution/worktree-management.md +205 -0
  291. package/knowledge/finalization/apply-fixes-and-freeze.md +177 -14
  292. package/knowledge/finalization/developer-onboarding.md +4 -0
  293. package/knowledge/finalization/implementation-playbook.md +83 -5
  294. package/knowledge/product/gap-analysis.md +5 -1
  295. package/knowledge/product/prd-craft.md +55 -34
  296. package/knowledge/product/prd-innovation.md +12 -0
  297. package/knowledge/product/vision-craft.md +213 -0
  298. package/knowledge/review/review-adr.md +44 -0
  299. package/knowledge/review/{review-api-contracts.md → review-api-design.md} +47 -1
  300. package/knowledge/review/{review-database-schema.md → review-database-design.md} +40 -1
  301. package/knowledge/review/review-domain-modeling.md +38 -1
  302. package/knowledge/review/review-implementation-tasks.md +108 -1
  303. package/knowledge/review/review-methodology.md +11 -0
  304. package/knowledge/review/review-operations.md +67 -0
  305. package/knowledge/review/review-prd.md +46 -0
  306. package/knowledge/review/review-security.md +65 -0
  307. package/knowledge/review/review-system-architecture.md +32 -2
  308. package/knowledge/review/review-testing-strategy.md +62 -0
  309. package/knowledge/review/review-user-stories.md +65 -0
  310. package/knowledge/review/{review-ux-spec.md → review-ux-specification.md} +50 -2
  311. package/knowledge/review/review-vision.md +255 -0
  312. package/knowledge/tools/release-management.md +222 -0
  313. package/knowledge/tools/session-analysis.md +215 -0
  314. package/knowledge/tools/version-strategy.md +200 -0
  315. package/knowledge/validation/critical-path-analysis.md +1 -1
  316. package/knowledge/validation/cross-phase-consistency.md +12 -0
  317. package/knowledge/validation/decision-completeness.md +13 -1
  318. package/knowledge/validation/dependency-validation.md +12 -0
  319. package/knowledge/validation/scope-management.md +12 -0
  320. package/knowledge/validation/traceability.md +12 -0
  321. package/methodology/README.md +37 -0
  322. package/methodology/custom-defaults.yml +44 -4
  323. package/methodology/deep.yml +43 -3
  324. package/methodology/mvp.yml +43 -3
  325. package/package.json +4 -3
  326. package/pipeline/architecture/review-architecture.md +36 -13
  327. package/pipeline/architecture/system-architecture.md +24 -9
  328. package/pipeline/build/multi-agent-resume.md +245 -0
  329. package/pipeline/build/multi-agent-start.md +236 -0
  330. package/pipeline/build/new-enhancement.md +456 -0
  331. package/pipeline/build/quick-task.md +381 -0
  332. package/pipeline/build/single-agent-resume.md +210 -0
  333. package/pipeline/build/single-agent-start.md +207 -0
  334. package/pipeline/consolidation/claude-md-optimization.md +76 -0
  335. package/pipeline/consolidation/workflow-audit.md +77 -0
  336. package/pipeline/decisions/adrs.md +21 -7
  337. package/pipeline/decisions/review-adrs.md +32 -11
  338. package/pipeline/environment/ai-memory-setup.md +76 -0
  339. package/pipeline/environment/automated-pr-review.md +76 -0
  340. package/pipeline/environment/design-system.md +75 -0
  341. package/pipeline/environment/dev-env-setup.md +68 -0
  342. package/pipeline/environment/git-workflow.md +73 -0
  343. package/pipeline/finalization/apply-fixes-and-freeze.md +17 -6
  344. package/pipeline/finalization/developer-onboarding-guide.md +23 -9
  345. package/pipeline/finalization/implementation-playbook.md +43 -14
  346. package/pipeline/foundation/beads.md +71 -0
  347. package/pipeline/foundation/coding-standards.md +71 -0
  348. package/pipeline/foundation/project-structure.md +73 -0
  349. package/pipeline/foundation/tdd.md +64 -0
  350. package/pipeline/foundation/tech-stack.md +74 -0
  351. package/pipeline/integration/add-e2e-testing.md +80 -0
  352. package/pipeline/modeling/domain-modeling.md +23 -8
  353. package/pipeline/modeling/review-domain-modeling.md +35 -11
  354. package/pipeline/parity/platform-parity-review.md +90 -0
  355. package/pipeline/planning/implementation-plan-review.md +67 -0
  356. package/pipeline/planning/implementation-plan.md +110 -0
  357. package/pipeline/pre/create-prd.md +34 -10
  358. package/pipeline/pre/innovate-prd.md +46 -15
  359. package/pipeline/pre/innovate-user-stories.md +47 -14
  360. package/pipeline/pre/review-prd.md +29 -8
  361. package/pipeline/pre/review-user-stories.md +34 -8
  362. package/pipeline/pre/user-stories.md +23 -8
  363. package/pipeline/quality/create-evals.md +106 -0
  364. package/pipeline/quality/operations.md +46 -17
  365. package/pipeline/quality/review-operations.md +32 -11
  366. package/pipeline/quality/review-security.md +34 -12
  367. package/pipeline/quality/review-testing.md +37 -14
  368. package/pipeline/quality/security.md +36 -10
  369. package/pipeline/quality/story-tests.md +75 -0
  370. package/pipeline/specification/api-contracts.md +28 -8
  371. package/pipeline/specification/database-schema.md +29 -8
  372. package/pipeline/specification/review-api.md +32 -11
  373. package/pipeline/specification/review-database.md +32 -11
  374. package/pipeline/specification/review-ux.md +34 -12
  375. package/pipeline/specification/ux-spec.md +35 -13
  376. package/pipeline/validation/critical-path-walkthrough.md +45 -11
  377. package/pipeline/validation/cross-phase-consistency.md +45 -11
  378. package/pipeline/validation/decision-completeness.md +45 -11
  379. package/pipeline/validation/dependency-graph-validation.md +46 -11
  380. package/pipeline/validation/implementability-dry-run.md +46 -11
  381. package/pipeline/validation/scope-creep-check.md +46 -11
  382. package/pipeline/validation/traceability-matrix.md +51 -11
  383. package/pipeline/vision/create-vision.md +267 -0
  384. package/pipeline/vision/innovate-vision.md +157 -0
  385. package/pipeline/vision/review-vision.md +149 -0
  386. package/skills/multi-model-dispatch/SKILL.md +326 -0
  387. package/skills/scaffold-pipeline/SKILL.md +210 -0
  388. package/skills/scaffold-runner/SKILL.md +619 -0
  389. package/pipeline/planning/implementation-tasks.md +0 -57
  390. package/pipeline/planning/review-tasks.md +0 -38
  391. package/pipeline/quality/testing-strategy.md +0 -42
@@ -0,0 +1,469 @@
1
+ ---
2
+ name: design-system-tokens
3
+ description: Design token definitions, base component visual specs, dark mode patterns, and pattern library for building consistent UIs
4
+ topics: [design-system, tokens, colors, typography, spacing, components, dark-mode, pattern-library]
5
+ ---
6
+
7
+ ## Summary
8
+
9
+ ## Design Tokens
10
+
11
+ Design tokens are the atomic values that define the visual language. They are variables, not hard-coded values. Every visual property in the application references a token.
12
+
13
+ ### Color Tokens
14
+
15
+ **Brand colors:**
16
+
17
+ ```
18
+ --color-primary: #2563EB // Main brand/action color
19
+ --color-primary-hover: #1D4ED8 // Interactive state
20
+ --color-primary-active: #1E40AF // Pressed/active state
21
+ --color-primary-light: #DBEAFE // Backgrounds, subtle highlights
22
+ --color-primary-lighter: #EFF6FF // Very subtle tints
23
+
24
+ --color-secondary: #7C3AED // Supporting brand color
25
+ --color-secondary-hover: #6D28D9 // Interactive state
26
+ --color-secondary-light: #EDE9FE // Backgrounds
27
+ ```
28
+
29
+ **Neutral scale:**
30
+
31
+ ```
32
+ --color-neutral-50: #FAFAFA // Lightest background
33
+ --color-neutral-100: #F5F5F5 // Card backgrounds, zebra stripes
34
+ --color-neutral-200: #E5E5E5 // Borders, dividers
35
+ --color-neutral-300: #D4D4D4 // Disabled borders
36
+ --color-neutral-400: #A3A3A3 // Muted text, placeholders, disabled text
37
+ --color-neutral-500: #737373 // Secondary icons
38
+ --color-neutral-600: #525252 // Tertiary text
39
+ --color-neutral-700: #404040 // Secondary text
40
+ --color-neutral-800: #262626 // Dark backgrounds (dark mode cards)
41
+ --color-neutral-900: #171717 // Primary text, dark mode page background
42
+ ```
43
+
44
+ **Semantic colors:**
45
+
46
+ ```
47
+ --color-success: #16A34A // Success states, positive actions
48
+ --color-success-light: #DCFCE7 // Success backgrounds
49
+ --color-success-dark: #15803D // Success text on light backgrounds
50
+
51
+ --color-warning: #CA8A04 // Warning states, caution
52
+ --color-warning-light: #FEF9C3 // Warning backgrounds
53
+ --color-warning-dark: #A16207 // Warning text on light backgrounds
54
+
55
+ --color-error: #DC2626 // Error states, destructive actions
56
+ --color-error-light: #FEE2E2 // Error backgrounds
57
+ --color-error-dark: #B91C1C // Error text on light backgrounds
58
+
59
+ --color-info: #2563EB // Informational states
60
+ --color-info-light: #DBEAFE // Info backgrounds
61
+ ```
62
+
63
+ **Surface and overlay:**
64
+
65
+ ```
66
+ --color-surface: #FFFFFF // Card/panel surfaces
67
+ --color-overlay: rgba(0,0,0,0.5) // Modal/dialog backdrop
68
+ --color-focus-ring: rgba(37,99,235,0.5) // Focus indicator
69
+ ```
70
+
71
+ ## Deep Guidance
72
+
73
+ ### Typography Tokens
74
+
75
+ **Font families:**
76
+
77
+ ```
78
+ --font-family: 'Inter', system-ui, -apple-system, sans-serif
79
+ --font-family-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace
80
+ ```
81
+
82
+ **Font sizes (modular scale):**
83
+
84
+ ```
85
+ --text-xs: 0.75rem // 12px — fine print, labels, badges
86
+ --text-sm: 0.875rem // 14px — secondary text, table cells, help text
87
+ --text-base: 1rem // 16px — body text (default)
88
+ --text-lg: 1.125rem // 18px — subheadings, emphasis
89
+ --text-xl: 1.25rem // 20px — section titles
90
+ --text-2xl: 1.5rem // 24px — page titles
91
+ --text-3xl: 1.875rem // 30px — hero text, major headings
92
+ --text-4xl: 2.25rem // 36px — display headings (marketing, landing)
93
+ ```
94
+
95
+ **Font weights:**
96
+
97
+ ```
98
+ --font-weight-normal: 400 // Body text
99
+ --font-weight-medium: 500 // Buttons, labels, navigation
100
+ --font-weight-semibold: 600 // Subheadings, emphasis
101
+ --font-weight-bold: 700 // Headings, strong emphasis
102
+ ```
103
+
104
+ **Line heights:**
105
+
106
+ ```
107
+ --line-height-tight: 1.25 // Headings, single-line labels
108
+ --line-height-normal: 1.5 // Body text (default)
109
+ --line-height-relaxed: 1.75 // Long-form content, help text
110
+ ```
111
+
112
+ **Letter spacing:**
113
+
114
+ ```
115
+ --tracking-tight: -0.025em // Large headings
116
+ --tracking-normal: 0 // Body text
117
+ --tracking-wide: 0.025em // Uppercase labels, small caps
118
+ ```
119
+
120
+ ### Spacing Tokens
121
+
122
+ Based on a 4px base unit. Every spacing value in the application uses one of these tokens -- no arbitrary pixel values.
123
+
124
+ ```
125
+ --space-0: 0 // 0px — no spacing
126
+ --space-0.5: 0.125rem // 2px — hairline gaps
127
+ --space-1: 0.25rem // 4px — tight gaps (icon to label)
128
+ --space-1.5: 0.375rem // 6px — compact inline spacing
129
+ --space-2: 0.5rem // 8px — compact spacing (list items, badge padding)
130
+ --space-3: 0.75rem // 12px — default padding (buttons, inputs)
131
+ --space-4: 1rem // 16px — standard spacing (form fields, card padding)
132
+ --space-5: 1.25rem // 20px — medium gaps
133
+ --space-6: 1.5rem // 24px — section padding
134
+ --space-8: 2rem // 32px — large gaps (section spacing)
135
+ --space-10: 2.5rem // 40px — major section gaps
136
+ --space-12: 3rem // 48px — section separators
137
+ --space-16: 4rem // 64px — page-level spacing
138
+ --space-20: 5rem // 80px — hero section padding
139
+ --space-24: 6rem // 96px — page-level vertical rhythm
140
+ ```
141
+
142
+ ### Border and Shadow Tokens
143
+
144
+ **Border radii:**
145
+
146
+ ```
147
+ --radius-none: 0 // Sharp corners
148
+ --radius-sm: 0.25rem // 4px — subtle rounding (tags, badges)
149
+ --radius-md: 0.5rem // 8px — standard rounding (cards, inputs, buttons)
150
+ --radius-lg: 0.75rem // 12px — prominent rounding (modals, panels)
151
+ --radius-xl: 1rem // 16px — large containers, hero cards
152
+ --radius-full: 9999px // Pill shapes, avatars, toggles
153
+ ```
154
+
155
+ **Elevation (box shadows):**
156
+
157
+ ```
158
+ --shadow-sm: 0 1px 2px rgba(0,0,0,0.05) // Subtle lift (buttons, badges)
159
+ --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05) // Cards, dropdowns
160
+ --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.05) // Popovers, floating elements
161
+ --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.04) // Modals, dialogs
162
+ --shadow-inner: inset 0 2px 4px rgba(0,0,0,0.05) // Pressed states, input wells
163
+ ```
164
+
165
+ **Border widths:**
166
+
167
+ ```
168
+ --border-width-thin: 1px // Default borders (inputs, cards, dividers)
169
+ --border-width-medium: 2px // Focus rings, active tab indicators
170
+ --border-width-thick: 4px // Left-border accents on alerts
171
+ ```
172
+
173
+ ### Transition Tokens
174
+
175
+ ```
176
+ --transition-fast: 150ms ease // Hover states, color changes
177
+ --transition-base: 200ms ease // Most interactions
178
+ --transition-slow: 300ms ease // Layout shifts, modals appearing
179
+ --transition-spring: 300ms cubic-bezier(0.34, 1.56, 0.64, 1) // Playful bounces (optional)
180
+ ```
181
+
182
+ ## Dark Mode
183
+
184
+ When dark mode is required, define a parallel set of semantic tokens that switch based on the color scheme. Components reference semantic tokens, never raw color tokens directly.
185
+
186
+ ### Semantic Token Mapping
187
+
188
+ ```css
189
+ :root {
190
+ /* Surfaces */
191
+ --bg-primary: var(--color-neutral-50);
192
+ --bg-secondary: var(--color-neutral-100);
193
+ --bg-card: white;
194
+ --bg-input: white;
195
+ --bg-overlay: rgba(0, 0, 0, 0.5);
196
+
197
+ /* Text */
198
+ --text-primary: var(--color-neutral-900);
199
+ --text-secondary: var(--color-neutral-700);
200
+ --text-muted: var(--color-neutral-400);
201
+ --text-inverse: white;
202
+
203
+ /* Borders */
204
+ --border-default: var(--color-neutral-200);
205
+ --border-strong: var(--color-neutral-300);
206
+ --border-focus: var(--color-primary);
207
+
208
+ /* Shadows */
209
+ --shadow-color: rgba(0, 0, 0, 0.1);
210
+ }
211
+
212
+ @media (prefers-color-scheme: dark) {
213
+ :root {
214
+ /* Surfaces */
215
+ --bg-primary: var(--color-neutral-900);
216
+ --bg-secondary: #1a1a1a;
217
+ --bg-card: var(--color-neutral-800);
218
+ --bg-input: var(--color-neutral-800);
219
+ --bg-overlay: rgba(0, 0, 0, 0.7);
220
+
221
+ /* Text */
222
+ --text-primary: var(--color-neutral-50);
223
+ --text-secondary: var(--color-neutral-400);
224
+ --text-muted: var(--color-neutral-500);
225
+ --text-inverse: var(--color-neutral-900);
226
+
227
+ /* Borders */
228
+ --border-default: var(--color-neutral-700);
229
+ --border-strong: var(--color-neutral-600);
230
+ --border-focus: #60A5FA;
231
+
232
+ /* Shadows — reduced in dark mode, use border emphasis instead */
233
+ --shadow-color: rgba(0, 0, 0, 0.3);
234
+ }
235
+ }
236
+ ```
237
+
238
+ ### Dark Mode Implementation Rules
239
+
240
+ - **Always use semantic tokens** (`--bg-primary`, `--text-primary`) in components, never raw color tokens (`--color-neutral-900`). This makes dark mode automatic.
241
+ - **Test both modes**: Every visual change must be verified in both light and dark mode.
242
+ - **Avoid pure black backgrounds**: Use `--color-neutral-900` (#171717) instead of `#000000` -- pure black creates harsh contrast and eye strain.
243
+ - **Reduce shadow prominence in dark mode**: Shadows are less visible on dark backgrounds. Use border emphasis or subtle glow effects instead.
244
+ - **Adjust semantic color intensity**: Success, warning, and error colors may need lighter variants in dark mode for readability on dark surfaces.
245
+ - **Images and illustrations**: Consider providing dark-mode-optimized versions or applying CSS filters (e.g., `brightness(0.9)`) to prevent overly bright images on dark backgrounds.
246
+
247
+ ## Responsive Breakpoints
248
+
249
+ Define breakpoints as min-width values for mobile-first responsive design:
250
+
251
+ ```
252
+ --breakpoint-sm: 640px // Small devices (landscape phones)
253
+ --breakpoint-md: 768px // Tablets
254
+ --breakpoint-lg: 1024px // Laptops, small desktops
255
+ --breakpoint-xl: 1280px // Large desktops
256
+ --breakpoint-2xl: 1536px // Extra-large screens
257
+ ```
258
+
259
+ ### Breakpoint Usage
260
+
261
+ ```css
262
+ /* Mobile-first: base styles apply to all sizes */
263
+ .container { padding: var(--space-4); }
264
+
265
+ /* Tablet and up */
266
+ @media (min-width: 768px) {
267
+ .container { padding: var(--space-6); max-width: 768px; }
268
+ }
269
+
270
+ /* Desktop and up */
271
+ @media (min-width: 1024px) {
272
+ .container { padding: var(--space-8); max-width: 1024px; }
273
+ }
274
+
275
+ /* Large desktop */
276
+ @media (min-width: 1280px) {
277
+ .container { max-width: 1200px; }
278
+ }
279
+ ```
280
+
281
+ ### Responsive Patterns
282
+
283
+ - **Stack to grid**: Single-column on mobile, multi-column on desktop
284
+ - **Navigation collapse**: Full nav on desktop, hamburger menu below `--breakpoint-md`
285
+ - **Table adaptation**: Full table on desktop, card layout below `--breakpoint-md`
286
+ - **Touch targets**: Minimum 44x44px on touch devices (below `--breakpoint-lg`)
287
+ - **Font scaling**: Base size stays at 16px; heading sizes may reduce on mobile
288
+
289
+ ## Accessibility Requirements
290
+
291
+ ### Color Contrast
292
+
293
+ All text must meet WCAG 2.1 AA contrast requirements:
294
+ - **Normal text (< 18px)**: minimum 4.5:1 contrast ratio against background
295
+ - **Large text (>= 18px bold or >= 24px)**: minimum 3:1 contrast ratio
296
+ - **UI components and graphical objects**: minimum 3:1 against adjacent colors
297
+ - **Focus indicators**: must have 3:1 contrast against both the component and the background
298
+
299
+ ### Focus Indicators
300
+
301
+ Every interactive element must have a visible focus indicator:
302
+
303
+ ```css
304
+ :focus-visible {
305
+ outline: var(--border-width-medium) solid var(--border-focus);
306
+ outline-offset: 2px;
307
+ }
308
+ ```
309
+
310
+ - Do not remove focus outlines (`outline: none`) without providing an alternative
311
+ - Use `:focus-visible` (not `:focus`) to show focus rings only for keyboard navigation
312
+ - Focus ring must be visible in both light and dark mode
313
+
314
+ ### Touch Targets
315
+
316
+ - Minimum interactive element size: 44x44 CSS pixels (WCAG 2.5.5 Target Size)
317
+ - Minimum spacing between adjacent touch targets: 8px
318
+ - Clickable area may be larger than the visual element (use padding, not just visual size)
319
+
320
+ ### Motion and Animation
321
+
322
+ - Respect `prefers-reduced-motion`: disable non-essential animations
323
+ - Essential animations (loading spinners) should still play but with reduced motion
324
+ - Auto-playing animations should have a pause mechanism
325
+
326
+ ```css
327
+ @media (prefers-reduced-motion: reduce) {
328
+ *, *::before, *::after {
329
+ animation-duration: 0.01ms !important;
330
+ transition-duration: 0.01ms !important;
331
+ }
332
+ }
333
+ ```
334
+
335
+ ## Base Components
336
+
337
+ Define the standard appearance and behavior for every common component:
338
+
339
+ ### Buttons
340
+
341
+ **Variants:**
342
+ - **Primary**: Solid fill (`--color-primary` background, white text). Main call-to-action.
343
+ - **Secondary**: Subtle fill (`--color-neutral-100` background, `--text-primary` text). Secondary actions.
344
+ - **Outline**: Border only (`--border-default` border, `--text-primary` text). Tertiary actions.
345
+ - **Ghost**: No background or border. Minimal visual weight. Navigation, icon-only actions.
346
+ - **Destructive**: Red/danger (`--color-error` background, white text). Delete, remove, cancel actions.
347
+
348
+ **Sizes:**
349
+ - **sm**: 28px height, `--text-xs`, `--space-2` horizontal padding
350
+ - **md**: 36px height, `--text-sm`, `--space-3` horizontal padding (default)
351
+ - **lg**: 44px height, `--text-base`, `--space-4` horizontal padding
352
+
353
+ **States:**
354
+ - **Default**: Normal appearance
355
+ - **Hover**: Darker background (e.g., `--color-primary-hover`), cursor pointer
356
+ - **Active**: Even darker background (`--color-primary-active`), slight scale-down
357
+ - **Focused**: Focus ring visible (`--border-focus` outline)
358
+ - **Disabled**: Reduced opacity (0.5), no hover effects, `cursor: not-allowed`
359
+ - **Loading**: Label replaced with spinner, interaction disabled, maintains button width
360
+
361
+ ### Form Elements
362
+
363
+ **Text inputs and textareas:**
364
+ - Border: `--border-default`, `--radius-md`
365
+ - Focus: `--border-focus` with focus ring
366
+ - Error: `--color-error` border + error message below in `--color-error`
367
+ - Disabled: `--color-neutral-100` background, reduced opacity
368
+ - Height: 36px for inputs (matches button md)
369
+
370
+ **Labels:**
371
+ - Always visible (never use placeholder as the only label)
372
+ - Required indicator: asterisk or "(required)" text
373
+ - Associated with input via `for`/`id` or wrapping
374
+
375
+ **Help text:**
376
+ - Below input, `--text-xs`, `--text-muted` color
377
+ - Explains format expectations (e.g., "Must be at least 8 characters")
378
+
379
+ **Error messages:**
380
+ - Below input, `--text-xs`, `--color-error`
381
+ - Describes what went wrong and how to fix it (not just "Invalid")
382
+ - Replaces help text when error is active
383
+
384
+ **Select inputs and dropdowns:**
385
+ - Same dimensions and borders as text inputs
386
+ - Chevron indicator aligned right
387
+ - Option list uses `--shadow-lg` elevation
388
+
389
+ **Checkboxes and radio buttons:**
390
+ - Minimum 20x20px visual size, 44x44px touch target
391
+ - Checked state uses `--color-primary`
392
+ - Labels always to the right, clickable
393
+
394
+ ### Cards
395
+
396
+ - Background: `--bg-card`
397
+ - Border: `--border-default` or `--shadow-sm`
398
+ - Padding: `--space-4` to `--space-6`
399
+ - Border radius: `--radius-md`
400
+ - **Interactive cards**: hover state increases shadow (`--shadow-md`), cursor pointer
401
+ - **Header/footer sections**: separated by `--border-default` divider, visually distinct padding
402
+
403
+ ### Feedback Components
404
+
405
+ **Toast notifications:**
406
+ - Temporary, non-blocking, positioned top-right or bottom-center
407
+ - Auto-dismiss after 5 seconds with manual dismiss (X button)
408
+ - Variants: success (green), error (red), warning (yellow), info (blue)
409
+ - Includes icon + message + optional action link
410
+
411
+ **Alert banners:**
412
+ - Persistent until explicitly dismissed
413
+ - Full-width or contained within a section
414
+ - Left border accent (`--border-width-thick`) with semantic color
415
+ - Variants: info, warning, error, success
416
+
417
+ **Empty states:**
418
+ - Centered illustration or icon
419
+ - Explanatory heading and description text
420
+ - Call-to-action button ("Create your first [item]")
421
+ - Uses `--text-muted` for description
422
+
423
+ **Loading states:**
424
+ - **Skeleton loaders** (preferred for content areas): animated placeholder shapes matching content layout
425
+ - **Spinners** (for actions): 20px for inline, 32px for section, 48px for page-level
426
+ - **Progress bars** (for known-duration operations): determinate with percentage
427
+
428
+ ### Navigation
429
+
430
+ - **Header/navbar**: fixed or sticky, `--shadow-sm` or border-bottom, contains logo + primary nav + user menu
431
+ - **Sidebar**: collapsible on desktop, overlay on mobile, active item highlighted with `--color-primary-light` background
432
+ - **Breadcrumbs**: `--text-sm`, separator chevrons, current page not linked
433
+ - **Tabs**: underline style (active tab has `--color-primary` bottom border, `--border-width-medium`), equal or auto width
434
+ - **Pagination**: prev/next buttons + page numbers, disabled state for first/last, compact mode on mobile (prev/next only)
435
+
436
+ ### Data Display
437
+
438
+ - **Tables**: header row with `--bg-secondary` background, row hover state, sortable column headers with indicator icon, responsive (horizontal scroll or card layout on mobile)
439
+ - **Lists**: consistent item height and spacing (`--space-2` to `--space-3` between items), interactive items have hover state
440
+ - **Badges/tags**: `--radius-full`, `--text-xs`, `--space-1` vertical / `--space-2` horizontal padding, semantic color variants
441
+ - **Avatars**: `--radius-full`, sizes 24/32/40px, fallback shows initials on `--color-primary-light` background
442
+ - **Stats/metrics**: large value (`--text-2xl`, `--font-weight-bold`), label below (`--text-sm`, `--text-secondary`), optional trend indicator (up/down arrow with green/red)
443
+
444
+ ## Pattern Library
445
+
446
+ Document recurring UI patterns with implementation guidance:
447
+
448
+ - **Search with autocomplete**: Debounced input (300ms), dropdown results panel with `--shadow-lg`, keyboard navigation (arrow keys + Enter), "no results" state with suggestion, clear button (X) when input has value
449
+ - **Confirmation dialogs**: Modal with overlay, clearly states what will happen ("Delete 3 items? This cannot be undone."), "Cancel" as default/primary action (preventing accidents), destructive action in `--color-error`
450
+ - **Inline editing**: Click to edit transforms display text into input, Enter to save, Escape to cancel, loading indicator during save, validation feedback
451
+ - **Bulk actions**: Checkbox selection, "Select all" header checkbox, floating action toolbar appears when items selected, count indicator ("3 selected")
452
+ - **Wizard/stepper**: Numbered step indicator, completed steps show checkmark, back/next navigation, save progress between steps, summary step before final submit
453
+ - **Infinite scroll vs. pagination**: Use pagination for data tables and search results (users need to reference positions). Use infinite scroll for feeds and timelines (users scan sequentially).
454
+
455
+ ## Common Pitfalls
456
+
457
+ **Inconsistent spacing and typography.** Five different font sizes that are all "kind of like body text." Spacing that varies randomly between 12px and 17px with no system. Fix: define a spacing scale and type scale in the design system. Only use values from the scale.
458
+
459
+ **Hard-coded color values in components.** Using `#2563EB` directly in a component instead of `var(--color-primary)`. When the brand color changes, you must find-and-replace across the entire codebase. Fix: always reference tokens. Lint for hard-coded color/size values.
460
+
461
+ **Placeholder text as labels.** Using placeholder text instead of labels for form fields. Placeholders disappear when the user starts typing, leaving them with no indication of what the field expects. Fix: always use visible labels. Placeholders are supplementary hints, not replacements for labels.
462
+
463
+ **Ignoring touch targets on mobile.** Tiny links and buttons that require precise finger tapping. Fix: ensure all interactive elements meet minimum 44x44px touch target size on mobile.
464
+
465
+ **Dark mode as an afterthought.** Building the entire UI with hard-coded light colors, then trying to add dark mode later. Fix: use semantic tokens from day one. The cost is near-zero upfront and saves a complete restyle later.
466
+
467
+ **Missing reduced-motion support.** Animations that cause discomfort for users with vestibular disorders. Fix: always wrap non-essential animations in a `prefers-reduced-motion` check.
468
+
469
+ **Inconsistent elevation hierarchy.** A card inside a modal has a higher shadow than the modal itself, breaking the visual stacking order. Fix: define an elevation scale (sm < md < lg < xl) and assign levels consistently: page content (none), cards (sm), dropdowns (lg), modals (xl).
@@ -0,0 +1,223 @@
1
+ ---
2
+ name: dev-environment
3
+ description: Development environment setup patterns including Makefile conventions, live reload, and toolchain configuration
4
+ topics: [dev-environment, makefile, live-reload, env-files, toolchain, ci, git-hooks, scripts]
5
+ ---
6
+
7
+ # Dev Environment
8
+
9
+ A development environment should be reproducible, fast, and invisible. "It works on my machine" is a build system failure, not a developer excuse. This knowledge covers task runners, environment management, git hooks, CI integration, and toolchain patterns that make environments reliable across machines and team members.
10
+
11
+ ## Summary
12
+
13
+ ### Core Components
14
+
15
+ Every project needs four environment pillars:
16
+
17
+ 1. **Build Tool / Task Runner** — A single entry point for all project tasks. Makefile is the universal choice (works everywhere, zero dependencies). Language-specific alternatives: `package.json` scripts, `pyproject.toml`, `go` tool.
18
+ 2. **Environment Management** — `.env` files for local config, `.env.example` committed as documentation, validation at startup, sensible development defaults.
19
+ 3. **Git Hooks** — Pre-commit (fast checks: lint, format, type check). Pre-push (slower checks: full test suite). Installed by `make hooks`.
20
+ 4. **CI/CD Integration** — CI runs the same commands as local development. `make check` in CI, `make check` locally. No divergent CI-specific scripts.
21
+
22
+ ### Makefile as Universal Task Runner
23
+
24
+ Makefile provides: discoverable interface (`make help`), dependency management between targets, idempotent execution, parallel execution (`make -j4`), and universal availability on any Unix system with zero installation. Language-specific task runners complement but do not replace it — `make test` calls `npm test` or `pytest`, keeping the stable interface independent of underlying tools. If the underlying tool changes (e.g., Jest to Vitest), only the Makefile target body changes — not CI or documentation.
25
+
26
+ ### The Setup Contract
27
+
28
+ New developer from clone to green tests in three commands or fewer:
29
+ ```bash
30
+ git clone <repo>
31
+ make setup # Install dependencies, tools, hooks
32
+ make check # Verify everything works
33
+ ```
34
+
35
+ ### Branching Strategy Summary
36
+
37
+ **Trunk-Based**: All commits to main, feature flags for incomplete work. For small teams with strong tests and continuous deployment. **GitHub Flow**: Feature branches, PR review, squash merge. Best for most teams — simple and structured. **GitFlow**: Separate develop/release/hotfix branches. Only for scheduled releases or multi-version support. Most web apps do not need it.
38
+
39
+ ## Deep Guidance
40
+
41
+ ### Makefile Patterns
42
+
43
+ #### The Help Target
44
+
45
+ Every Makefile starts with self-documentation:
46
+
47
+ ```makefile
48
+ .DEFAULT_GOAL := help
49
+
50
+ .PHONY: help
51
+ help: ## Show available commands
52
+ @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
53
+ awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
54
+ ```
55
+
56
+ Every public target gets a `## Description` comment. Internal targets use `_` prefix and no description.
57
+
58
+ #### Standard Target Set
59
+
60
+ ```makefile
61
+ .PHONY: test lint format check setup clean hooks
62
+
63
+ test: ## Run test suite
64
+ npm test
65
+
66
+ lint: ## Run linters
67
+ npm run lint
68
+
69
+ format: ## Format code
70
+ npm run format
71
+
72
+ check: lint test ## Run all quality gates
73
+
74
+ setup: ## Install dependencies and hooks
75
+ npm install
76
+ $(MAKE) hooks
77
+
78
+ clean: ## Remove build artifacts
79
+ rm -rf dist/ node_modules/.cache/
80
+
81
+ hooks: ## Install git hooks
82
+ @mkdir -p .git/hooks
83
+ @cp scripts/pre-commit.sh .git/hooks/pre-commit
84
+ @cp scripts/pre-push.sh .git/hooks/pre-push
85
+ @chmod +x .git/hooks/pre-commit .git/hooks/pre-push
86
+ ```
87
+
88
+ #### Dependency Chains and Parallel Execution
89
+
90
+ Targets depend on other targets: `deploy: check build` runs lint, test, and build before deploying. For CI, parallelize independent targets: `$(MAKE) -j2 lint test`.
91
+
92
+ #### Variables and Platform Compatibility
93
+
94
+ Use `?=` for overridable variables: `TEST_FLAGS ?=` lets users run `make test TEST_FLAGS="--watch"`. Detect OS for platform-specific commands with `UNAME := $(shell uname -s)` and conditional blocks.
95
+
96
+ ### Environment Variable Management
97
+
98
+ #### The .env Pattern
99
+
100
+ ```
101
+ .env.example # Committed — documents all variables with safe placeholders
102
+ .env # Gitignored — local overrides
103
+ .env.test # Gitignored — test environment
104
+ .env.production # Never on disk — injected by deployment platform
105
+ ```
106
+
107
+ `.env.example` is documentation: every variable listed with explanatory comments and placeholder values.
108
+
109
+ #### Startup Validation
110
+
111
+ Validate all environment variables at startup, not at point of use. Fail fast with clear messages:
112
+
113
+ ```typescript
114
+ // src/config/env.ts — centralized env access
115
+ function requireEnv(key: string): string {
116
+ const value = process.env[key];
117
+ if (!value) throw new Error(`Missing required env var: ${key}`);
118
+ return value;
119
+ }
120
+
121
+ export const config = {
122
+ database: { url: requireEnv('DATABASE_URL') },
123
+ auth: { jwtSecret: requireEnv('JWT_SECRET') },
124
+ } as const;
125
+ ```
126
+
127
+ No `process.env.SOMETHING` scattered throughout the codebase. Python equivalent: use `pydantic_settings.BaseSettings` for typed validation with defaults.
128
+
129
+ ### Live Reload by Stack
130
+
131
+ | Stack | Tool | Command |
132
+ |-------|------|---------|
133
+ | Next.js / Vite | Built-in HMR | `next dev` / `vite dev` |
134
+ | Express/Fastify | tsx watch | `tsx watch src/server.ts` |
135
+ | FastAPI | uvicorn | `uvicorn app:app --reload` |
136
+ | Go | air | `air` |
137
+ | Shell | entr | `ls scripts/*.sh \| entr make test` |
138
+
139
+ For full-stack projects, run frontend and backend in parallel via `make dev` using `$(MAKE) -j2 dev-frontend dev-backend` or a process manager like `concurrently`.
140
+
141
+ ### Git Hook Strategies
142
+
143
+ #### Pre-Commit (Fast, Under 10 Seconds)
144
+
145
+ Check only staged files when possible:
146
+ - Formatting (run formatter check, fail if files would change)
147
+ - Linting (staged files only via `lint-staged`)
148
+ - Secrets scanning (detect accidentally committed API keys)
149
+ - File size limits (prevent accidental binary commits)
150
+
151
+ #### Pre-Push (Thorough, Under 60 Seconds)
152
+
153
+ Run the full quality gate:
154
+ - Complete test suite
155
+ - Full lint (all files, not just staged)
156
+ - Build verification
157
+
158
+ #### Installation
159
+
160
+ Single command: `make hooks`. Wrap whichever hook manager the project uses (husky, pre-commit, lefthook, or plain shell scripts).
161
+
162
+ ### CI/CD Integration
163
+
164
+ #### The Mirror Principle
165
+
166
+ CI runs `make check` — the exact same command developers run locally. If it passes locally, it passes in CI. No environment-specific surprises.
167
+
168
+ ```yaml
169
+ # .github/workflows/check.yml
170
+ jobs:
171
+ check:
172
+ runs-on: ubuntu-latest
173
+ steps:
174
+ - uses: actions/checkout@v4
175
+ - uses: actions/setup-node@v4
176
+ with: { node-version: 20, cache: npm }
177
+ - run: npm ci
178
+ - run: make check
179
+ ```
180
+
181
+ #### Caching
182
+
183
+ Cache dependencies keyed on lockfile hashes: `node_modules/` on `package-lock.json`, `.venv/` on `pyproject.toml`, `~/go/pkg/mod/` on `go.sum`.
184
+
185
+ #### Job Structure
186
+
187
+ Parallelize independent checks, gate dependent steps:
188
+ ```yaml
189
+ jobs:
190
+ lint: { steps: [checkout, setup, make lint] }
191
+ test: { steps: [checkout, setup, make test] }
192
+ build: { needs: [lint, test], steps: [checkout, setup, make build] }
193
+ ```
194
+
195
+ ### Branching Strategies — When to Use Each
196
+
197
+ #### Trunk-Based Development
198
+
199
+ All developers commit to `main`. Feature flags gate incomplete work. Releases cut directly from `main`. Requires: strong test suite, feature flag infrastructure, team discipline. Best for: small teams (1-5), continuous deployment. Risk: broken commits affect everyone immediately.
200
+
201
+ #### GitHub Flow
202
+
203
+ Feature branches from `main`, PRs with review, squash merge back. `main` is always deployable. Best for: most teams, most projects. Keep branches short (1-3 days), rebase frequently. Risk: long-lived branches diverge.
204
+
205
+ #### GitFlow
206
+
207
+ Separate `develop`, `release/*`, `hotfix/*`, `main` branches. Formalized release process. Best for: scheduled releases (mobile, enterprise), multiple supported versions. Risk: branch complexity, merge conflicts. Most web apps do not need this.
208
+
209
+ ### Common Anti-Patterns
210
+
211
+ **Scripts That Only Work on One OS**: `setup.sh` uses `apt-get`, breaks on macOS. Fix: detect OS and branch, or use devcontainers. Document OS-specific prerequisites.
212
+
213
+ **Missing Setup Documentation**: New developer spends a day figuring out the build. Fix: `make setup` automates everything possible. `docs/dev-setup.md` covers the rest. Test by having a new team member follow it verbatim.
214
+
215
+ **Hardcoded Paths**: Scripts reference `/Users/alice/projects/myapp/`. Fix: use relative paths or compute from `$(pwd)` / `$(dirname "$0")`. Never commit absolute paths.
216
+
217
+ **No Clean Target**: Build artifacts accumulate, stale caches cause mystery failures. Fix: `make clean` removes generated artifacts. `make pristine` removes everything including `node_modules/` for a full reset.
218
+
219
+ **CI Drift**: CI runs different commands than local dev. Fix: CI calls `make check`. If CI needs extras (artifact upload, deploy), those are separate steps after the quality gate. The gate itself is identical everywhere.
220
+
221
+ ## See Also
222
+
223
+ - [ai-memory-management](../core/ai-memory-management.md) — Environment setup affects memory hooks