@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,172 @@
1
+ ---
2
+ name: tdd-execution-loop
3
+ description: Red-green-refactor execution cycle for AI agents
4
+ topics: [tdd, execution, testing, workflow]
5
+ ---
6
+
7
+ # TDD Execution Loop
8
+
9
+ Expert knowledge for the core TDD execution loop that AI agents follow during implementation. This defines the disciplined red-green-refactor cycle, commit timing, and test-first practices that ensure every change is verified before it ships.
10
+
11
+ ## Summary
12
+
13
+ ### Red-Green-Refactor Cycle
14
+
15
+ ```
16
+ RED GREEN REFACTOR
17
+ Write a → Write the → Clean up
18
+ failing minimal without
19
+ test code to changing
20
+ pass it behavior
21
+ ```
22
+
23
+ Each cycle produces one small, verified increment of functionality.
24
+
25
+ ### Commit Timing
26
+
27
+ - **Commit after green** — every passing test is a safe checkpoint
28
+ - **Commit after refactor** — clean code locked in before the next feature
29
+ - **Never commit red** — a failing test in history breaks bisect and reverts
30
+
31
+ ### Test-First Discipline
32
+
33
+ - Always write the test before the implementation
34
+ - Verify the test actually fails (red) before writing production code
35
+ - A test that never failed might not be testing anything meaningful
36
+
37
+ ## Deep Guidance
38
+
39
+ ### Red-Green-Refactor Cycle — Extended
40
+
41
+ #### Red Phase: Write a Failing Test
42
+
43
+ Write a test that describes the next small piece of behavior you want to add. Run it and confirm it fails. The failure message should clearly indicate what is missing.
44
+
45
+ **Key rules:**
46
+ - The test must fail for the right reason (missing function, wrong return value — not a syntax error or import failure)
47
+ - Write only one test at a time — don't batch multiple behaviors into a single red phase
48
+ - The test name should describe the expected behavior: `returns 404 when user not found`, not `test user endpoint`
49
+
50
+ #### Green Phase: Minimal Implementation
51
+
52
+ Write the smallest amount of production code that makes the failing test pass. Do not add logic for future tests, handle edge cases you haven't tested yet, or optimize.
53
+
54
+ **Key rules:**
55
+ - If you can make the test pass by returning a hard-coded value, that's valid — the next test will force generalization
56
+ - Don't refactor during the green phase — just make it pass
57
+ - Run the full relevant test suite (not just the new test) to confirm you haven't broken anything
58
+
59
+ #### Refactor Phase: Clean Up
60
+
61
+ With all tests green, improve the code's structure, readability, and design without changing its behavior. The tests are your safety net.
62
+
63
+ **Common refactors:**
64
+ - Extract duplicate code into helper functions
65
+ - Rename variables and functions for clarity
66
+ - Simplify conditionals
67
+ - Move code to better locations (closer to where it's used)
68
+
69
+ **Key rules:**
70
+ - All tests must remain green throughout refactoring
71
+ - If a refactor breaks a test, undo and take a smaller step
72
+ - Commit after a successful refactor before starting the next red phase
73
+
74
+ ### When to Commit
75
+
76
+ | Event | Commit? | Why |
77
+ |-------|---------|-----|
78
+ | Test goes green | Yes | Safe checkpoint with verified behavior |
79
+ | Refactor complete, tests still green | Yes | Lock in clean code |
80
+ | Test is red (failing) | No | Broken state in history breaks bisect |
81
+ | Mid-implementation, nothing passes yet | No | Partial work has no verified value |
82
+ | Multiple tests green at once | Yes | But prefer smaller commits |
83
+
84
+ Ideal commit cadence: every 5-15 minutes during active TDD. If you haven't committed in 30 minutes, you're taking too large a step.
85
+
86
+ ### PR Creation Patterns
87
+
88
+ - **One PR per task** — a PR should map to a single task, story, or unit of work
89
+ - **Descriptive titles** — `feat(auth): add password reset flow` not `auth changes`
90
+ - **Test evidence in description** — include which tests were added, what they cover, and that they pass
91
+ - **Link to task ID** — reference the task, story, or issue that motivated the work
92
+ - **Small PRs** — prefer 50-200 lines changed; split larger work into sequential PRs
93
+
94
+ ### Test-First Discipline — Extended
95
+
96
+ **Why test-first matters:**
97
+ - Forces you to think about the interface before the implementation
98
+ - Prevents writing untestable code (if you can't test it first, the design needs work)
99
+ - Creates a failing test that proves your test actually exercises the code path
100
+ - Produces a test suite where every test has been observed to fail — higher confidence
101
+
102
+ **Common violations to avoid:**
103
+ - Writing implementation first, then adding tests after (tests may not cover the actual behavior)
104
+ - Writing a test that passes immediately (it might be testing the wrong thing)
105
+ - Skipping the red step "because you know the implementation is correct" (hubris)
106
+
107
+ ### Handling Flaky Tests
108
+
109
+ Flaky tests — tests that pass sometimes and fail other times — are bugs. Treat them with urgency.
110
+
111
+ **Investigation steps:**
112
+ 1. Run the test in isolation 10 times to confirm flakiness
113
+ 2. Check for common causes: time-dependent logic, race conditions, shared mutable state, network calls, random data
114
+ 3. Fix the root cause, don't add retries
115
+
116
+ **Never:**
117
+ - Add `retry(3)` to make a flaky test pass — this hides the bug
118
+ - Mark as `skip` without filing a tracking issue
119
+ - Ignore flaky tests in CI — they erode trust in the entire suite
120
+
121
+ ### Slow Test Suites
122
+
123
+ When the full test suite takes too long for rapid TDD:
124
+
125
+ **During development:**
126
+ - Run only the focused subset (tests for the module you're changing)
127
+ - Use test runner watch mode to re-run on file change
128
+ - Tag tests by level (unit, integration, e2e) and run only unit during red-green-refactor
129
+
130
+ **Before PR creation:**
131
+ - Run the full test suite locally
132
+ - Confirm CI will run the complete suite
133
+ - Don't submit a PR if you haven't verified the full suite passes
134
+
135
+ **Reducing suite time:**
136
+ - Move logic tests from integration/e2e to unit level
137
+ - Parallelize test execution
138
+ - Use transaction rollback instead of database recreation
139
+ - Profile the slowest tests and optimize or split them
140
+
141
+ ### Test Isolation
142
+
143
+ Each test must be independent — it should pass or fail regardless of what other tests run before it, after it, or alongside it.
144
+
145
+ **Rules:**
146
+ - No shared mutable state between tests (global variables, class-level state, database rows from a previous test)
147
+ - Each test sets up its own preconditions and cleans up after itself
148
+ - Tests should pass when run individually, in any order, or in parallel
149
+ - Use `beforeEach`/`setUp` for common setup, not test-to-test data flow
150
+ - Avoid `beforeAll`/`setUpClass` unless the shared resource is truly read-only
151
+
152
+ **Detecting isolation violations:**
153
+ - Run tests in random order — if they fail, they have hidden dependencies
154
+ - Run a single test in isolation — if it fails only when run alone, it depends on setup from another test
155
+
156
+ ### When to Stop and Ask
157
+
158
+ TDD assumes clear requirements. When requirements are unclear, continuing to write tests is wasteful. Stop and ask when:
159
+
160
+ - **Unclear requirements** — the acceptance criteria are ambiguous or contradictory
161
+ - **Architectural ambiguity** — you're unsure which module should own the behavior
162
+ - **Conflicting documentation** — the PRD says one thing, the user stories say another
163
+ - **Scope creep** — the task is growing beyond what was originally planned
164
+ - **Blocked by another task** — you need output from a task that hasn't been completed yet
165
+ - **Unfamiliar domain** — you don't understand the business rules well enough to write a meaningful test
166
+
167
+ Document what you know, what you don't, and what decision you need — then ask.
168
+
169
+ ## See Also
170
+
171
+ - [testing-strategy](../core/testing-strategy.md) — Test pyramid, coverage strategy, quality gates
172
+ - [task-claiming-strategy](./task-claiming-strategy.md) — Task selection and dependency awareness
@@ -0,0 +1,205 @@
1
+ ---
2
+ name: worktree-management
3
+ description: Git worktree patterns for parallel multi-agent execution
4
+ topics: [git, worktrees, multi-agent, branching]
5
+ ---
6
+
7
+ # Worktree Management
8
+
9
+ Expert knowledge for managing git worktrees to enable parallel multi-agent execution. Covers setup, branching conventions, inter-task cleanup, and safe teardown procedures.
10
+
11
+ ## Summary
12
+
13
+ ### Setup
14
+
15
+ Use `scripts/setup-agent-worktree.sh <agent-name>` to create a worktree at `../<project>-<agent-name>/`. Each agent gets its own isolated working directory and workspace branch.
16
+
17
+ ### Branching Conventions
18
+
19
+ - Each agent operates on a workspace branch (e.g., `agent-1-workspace`)
20
+ - Feature branches are created from `origin/main` — never from local `main`
21
+ - Never run `git checkout main` inside a worktree — it will fail because `main` is checked out in the primary repo
22
+
23
+ ### Cleanup
24
+
25
+ After all agents finish, remove worktrees and prune stale references. Delete merged feature branches in batch to keep the repository clean.
26
+
27
+ ## Deep Guidance
28
+
29
+ ### Setup — Extended
30
+
31
+ **Creating a worktree:**
32
+
33
+ ```bash
34
+ # From the main repository
35
+ scripts/setup-agent-worktree.sh agent-1
36
+
37
+ # This creates:
38
+ # ../<project>-agent-1/ (working directory)
39
+ # Branch: agent-1-workspace (workspace branch)
40
+ ```
41
+
42
+ **What the setup script does:**
43
+ 1. Creates a new worktree directory adjacent to the main repo
44
+ 2. Creates a workspace branch for the agent
45
+ 3. Sets up the working directory with a clean state
46
+ 4. Installs dependencies if a package manager is detected
47
+
48
+ **Multiple agents:**
49
+
50
+ ```bash
51
+ scripts/setup-agent-worktree.sh agent-1
52
+ scripts/setup-agent-worktree.sh agent-2
53
+ scripts/setup-agent-worktree.sh agent-3
54
+ ```
55
+
56
+ Each agent has a completely isolated working directory. They share the same `.git` object store but have separate working trees, index files, and HEAD pointers.
57
+
58
+ ### Workspace Branch Conventions
59
+
60
+ Each agent gets a persistent workspace branch that serves as its "home base":
61
+
62
+ - `agent-1-workspace`, `agent-2-workspace`, etc.
63
+ - The workspace branch is where the agent returns between tasks
64
+ - Feature branches for individual tasks are created from `origin/main`, not from the workspace branch
65
+
66
+ **Why workspace branches exist:**
67
+ - A worktree requires a branch that isn't checked out elsewhere
68
+ - The workspace branch prevents conflicts with `main` (which is checked out in the primary repo)
69
+ - It provides a stable base for the agent to return to between tasks
70
+
71
+ ### Branching — Extended
72
+
73
+ **Creating a feature branch for a task:**
74
+
75
+ ```bash
76
+ # Inside the agent's worktree
77
+ git fetch origin
78
+ git checkout -b bd-42/add-user-endpoint origin/main
79
+ ```
80
+
81
+ **Critical rules:**
82
+ - Always branch from `origin/main` — never from local `main` (it may be stale) and never from the workspace branch
83
+ - Branch naming: `bd-<id>/<short-desc>` when using Beads, or `feat/<task-id>-<slug>` otherwise
84
+ - One branch per task — never combine multiple tasks on a single branch
85
+
86
+ **Never run `git checkout main` in a worktree:**
87
+ - The `main` branch is checked out in the primary repo
88
+ - Git does not allow the same branch to be checked out in multiple worktrees
89
+ - This command will fail with an error; if you need main's content, use `origin/main`
90
+
91
+ ### Between Tasks
92
+
93
+ After completing a task (PR created and CI passing), prepare for the next one:
94
+
95
+ ```bash
96
+ # Fetch latest state from remote
97
+ git fetch origin --prune
98
+
99
+ # Switch back to workspace branch
100
+ git checkout agent-1-workspace
101
+
102
+ # Clean up untracked files and directories
103
+ git clean -fd
104
+
105
+ # Reinstall dependencies (important if package files changed on main)
106
+ # npm install / pip install -r requirements.txt / etc.
107
+ ```
108
+
109
+ **Why this matters:**
110
+ - `git fetch --prune` ensures you see newly merged branches and removed remote branches
111
+ - `git clean -fd` removes artifacts from the previous task
112
+ - Dependency reinstallation catches changes merged by other agents
113
+
114
+ ### Rebase Strategy
115
+
116
+ Before creating a PR, rebase your feature branch onto the latest `origin/main`:
117
+
118
+ ```bash
119
+ git fetch origin
120
+ git rebase origin/main
121
+ ```
122
+
123
+ **Why rebase instead of merge:**
124
+ - Produces a linear history on the feature branch
125
+ - Makes the PR diff cleaner (only your changes, no merge commits)
126
+ - Squash-merge to main produces a single clean commit
127
+
128
+ **If rebase conflicts arise:**
129
+ 1. Read the conflict carefully — understand which agent's changes conflict with yours
130
+ 2. If the conflict is in files you modified, resolve it preserving both changes where possible
131
+ 3. If the conflict is in files you didn't modify, investigate — you may have an undetected dependency on another task
132
+ 4. After resolving, run the full test suite to verify nothing broke
133
+ 5. If the conflict is too complex, ask for help rather than guessing
134
+
135
+ ### Conflict Resolution
136
+
137
+ **Common conflict scenarios in multi-agent work:**
138
+
139
+ | Scenario | Resolution |
140
+ |----------|------------|
141
+ | Two agents add to the same file (e.g., new exports) | Merge both additions |
142
+ | Two agents modify the same function | Deeper analysis needed — may indicate a missing dependency |
143
+ | Schema migration conflicts | Renumber the later migration |
144
+ | Lock file conflicts | Delete lock file, reinstall, commit new lock file |
145
+
146
+ ### Cleanup — Extended
147
+
148
+ **Removing a single worktree:**
149
+
150
+ ```bash
151
+ # From the main repository (not from inside the worktree)
152
+ git worktree remove ../<project>-agent-1
153
+ ```
154
+
155
+ **Pruning stale worktree references:**
156
+
157
+ ```bash
158
+ git worktree prune
159
+ ```
160
+
161
+ Run this after removing worktrees or if a worktree directory was deleted manually.
162
+
163
+ **Batch cleanup of merged feature branches:**
164
+
165
+ ```bash
166
+ git fetch origin --prune
167
+ git branch --merged origin/main | grep "bd-" | xargs -r git branch -d
168
+ ```
169
+
170
+ This deletes all local branches that have been merged to `origin/main` and match the `bd-` prefix. Safe because `--merged` ensures only fully-merged branches are deleted, and `-d` (not `-D`) refuses to delete unmerged branches.
171
+
172
+ **Cleanup of workspace branches:**
173
+
174
+ After all agents are done and their worktrees are removed:
175
+
176
+ ```bash
177
+ git branch | grep "workspace" | xargs -r git branch -D
178
+ ```
179
+
180
+ Use `-D` here because workspace branches are not merged — they're disposable.
181
+
182
+ ### BD_ACTOR Environment Variable
183
+
184
+ When using Beads for task tracking, set `BD_ACTOR` per agent for attribution:
185
+
186
+ ```bash
187
+ export BD_ACTOR="agent-1"
188
+ ```
189
+
190
+ This ensures that task claims, completions, and other Beads operations are attributed to the correct agent. Set it in the agent's shell environment before starting work.
191
+
192
+ ### Listing Active Worktrees
193
+
194
+ To see all active worktrees and their branches:
195
+
196
+ ```bash
197
+ git worktree list
198
+ ```
199
+
200
+ Output shows the path, HEAD commit, and branch for each worktree. Use this to verify agent setup and identify stale worktrees.
201
+
202
+ ## See Also
203
+
204
+ - [git-workflow-patterns](../core/git-workflow-patterns.md) — Branching strategy, commit conventions, PR workflow
205
+ - [task-claiming-strategy](./task-claiming-strategy.md) — Task selection and multi-agent coordination
@@ -8,6 +8,18 @@ topics: [finalization, fixes, freeze, validation, documentation-quality]
8
8
 
9
9
  The apply-fixes-and-freeze step is the last gate before implementation begins. Its purpose is to resolve all actionable validation findings, verify the fixes don't introduce new issues, and mark the documentation as frozen. After this step, documents change only if implementation reveals a genuine gap.
10
10
 
11
+ ## Summary
12
+
13
+ - **Fix prioritization**: P0 (blocking, must fix), P1 (significant gap, should fix), P2 (improvement, defer with rationale). Decision rule: would an agent produce incorrect code? (P0), have to guess? (P1), neither? (P2).
14
+ - **Fix process**: Build fix plan (deduplicate, group by document, order by priority), apply minimal targeted fixes, re-validate affected checks, loop until zero new findings.
15
+ - **Fix execution rules**: One finding per commit, fix forward not around, preserve document structure, cross-document fixes must be atomic.
16
+ - **Re-validation**: Re-run the specific validation passes that flagged each fix. Spot-check adjacent sections. Verify counts and cross-references. Grep for old terms after renames.
17
+ - **Documentation freeze**: All P0 and P1 resolved, re-validation clean. Add `<!-- FROZEN -->` marker to each artifact. No further content changes unless implementation reveals a genuine gap.
18
+ - **Post-freeze rules**: Typo fixes allowed. Implementation-discovered gaps go through P0/P1 prioritization. No scope additions. No "nice to have" improvements.
19
+ - **Common pitfalls**: Fixing symptoms instead of root causes, introducing new inconsistencies, over-fixing beyond implementation readiness, skipping re-validation, premature freeze.
20
+
21
+ ## Deep Guidance
22
+
11
23
  ## Fix Prioritization
12
24
 
13
25
  Validation phases produce findings at three priority levels. Address them in strict order:
@@ -30,44 +42,148 @@ Minor polish, documentation gaps that don't affect implementation correctness, a
30
42
 
31
43
  **Examples**: Missing UX specs for secondary flows, incomplete examples in knowledge base entries, editorial inconsistencies in prose.
32
44
 
45
+ ### Categorization Methodology
46
+
47
+ When collecting findings from multiple validation reports, assign each finding to exactly one category using these decision rules:
48
+
49
+ 1. **Would an agent produce incorrect code if this is not fixed?** -> P0
50
+ 2. **Would an agent have to guess or make assumptions?** -> P1
51
+ 3. **Is the issue real but unlikely to affect implementation correctness?** -> P2
52
+
53
+ When a finding spans multiple categories (e.g., a stale count that is also ambiguous), assign it to the highest applicable priority. Do not duplicate findings across priority levels.
54
+
33
55
  ## Fix Application Process
34
56
 
35
57
  ### Step 1: Build the Fix Plan
36
58
 
37
59
  1. Collect all findings from validation phase outputs (cross-phase-consistency, traceability-matrix, decision-completeness, critical-path-walkthrough, implementability-dry-run, dependency-graph-validation, scope-creep-check).
38
- 2. Deduplicate — the same root cause often appears in multiple validation reports.
60
+ 2. Deduplicate — the same root cause often appears in multiple validation reports. When a single root cause appears in 3+ reports, mark it as a **systemic issue** and track it separately.
39
61
  3. Group by affected document — batch fixes to minimize file churn.
40
62
  4. Order by priority (P0 first), then by document (reduce context switching).
63
+ 5. Estimate impact radius for each fix — how many other documents does this fix touch?
64
+
65
+ #### Fix Plan Output Format
66
+
67
+ The fix plan is a working document that guides fix execution. Structure it as follows:
68
+
69
+ ```markdown
70
+ ## Fix Plan
71
+
72
+ ### Systemic Issues (multi-document root causes)
73
+ | ID | Root Cause | Affected Documents | Priority | Est. Impact |
74
+ |----|------------|-------------------|----------|-------------|
75
+ | SYS-1 | Pipeline expanded from 32→36 steps, counts not propagated | architecture, state-schema, cli-contract, 12 others | P0 | 15 files |
76
+
77
+ ### Individual Fixes
78
+ | ID | Finding Source | Finding | Priority | Target Document | Dependencies |
79
+ |----|--------------|---------|----------|-----------------|--------------|
80
+ | FIX-1 | CPC-007 | Terminology drift: "prompts" vs "steps" | P0 | state-json-schema.md | FIX-2 |
81
+ | FIX-2 | CPC-007 | Terminology drift: "prompts" vs "steps" | P0 | cli-contract.md | — |
82
+ ```
41
83
 
42
84
  ### Step 2: Apply Fixes
43
85
 
44
86
  For each fix:
45
87
  1. Read the finding and the affected document section.
46
- 2. Make the minimal change that resolves the finding.
47
- 3. Check whether the fix affects other documents (e.g., changing a field name in the schema requires updating API contracts and state documentation).
88
+ 2. Make the minimal change that resolves the finding. Do not refactor, improve prose, or add features — fix only what the finding identifies.
89
+ 3. Check whether the fix affects other documents (e.g., changing a field name in the schema requires updating API contracts and state documentation). Use project-wide search to find all references before changing any term.
48
90
  4. Log the fix in `docs/validation/fix-log.md` with: finding ID, affected files, what changed, why.
91
+ 5. For systemic issues, fix the source of truth first, then sweep all downstream references in a single pass.
92
+
93
+ #### Fix Execution Rules
94
+
95
+ - **One finding per commit** (or one systemic issue per commit). This makes rollback possible if a fix introduces a regression.
96
+ - **Fix forward, not around.** If a finding reveals a design mistake, fix the design — do not patch the symptom.
97
+ - **Preserve document structure.** Fixes should not reorganize sections, add new headings, or change formatting conventions. Content changes only.
98
+ - **Cross-document fixes must be atomic.** If a terminology change spans 5 files, update all 5 in the same commit. A half-applied rename is worse than the original inconsistency.
99
+
100
+ ### Step 3: Re-validation
49
101
 
50
- ### Step 3: Verify No Regressions
102
+ After all fixes are applied, re-validate to confirm fixes resolved the findings without introducing new issues:
51
103
 
52
- After all fixes are applied:
53
- 1. Re-run cross-phase consistency checks on modified documents.
54
- 2. Verify traceability links still resolve (no broken references introduced by renames).
55
- 3. Spot-check that counts, terminology, and cross-references are internally consistent.
56
- 4. If a fix introduced a new issue, treat it as a P0 and resolve before proceeding.
104
+ 1. **Re-run affected validation checks.** For each fix, identify which validation pass originally flagged it and re-run that specific check against the modified document(s). At minimum, re-run:
105
+ - Cross-phase consistency checks on all modified documents
106
+ - Traceability link resolution (no broken references introduced by renames)
107
+ - Scope-creep check (fixes did not add new requirements)
108
+ 2. **Spot-check adjacent sections.** When a fix modifies a section, read the surrounding sections in the same document to verify internal consistency was not broken.
109
+ 3. **Verify counts and cross-references.** Any fix that changes a quantity (step count, story count, task count) requires verifying every other document that cites that quantity.
110
+ 4. **Regression test systemic fixes.** For systemic issues that touched many files, grep for the old term/value across the entire docs directory to confirm no instances were missed.
111
+ 5. **If re-validation finds new issues**, treat them as P0 findings and loop back to Step 2. The fix→revalidate cycle continues until re-validation produces zero new findings.
112
+
113
+ #### Re-validation Output
114
+
115
+ Record re-validation results alongside the fix log:
116
+
117
+ ```markdown
118
+ ## Re-validation Results
119
+
120
+ | Fix ID | Re-validation Check | Result | Notes |
121
+ |--------|-------------------|--------|-------|
122
+ | FIX-1 | CPC re-run | PASS | All "step" references consistent |
123
+ | FIX-3 | Traceability links | FAIL | New broken ref in tasks.md line 47 |
124
+ ```
57
125
 
58
126
  ## Documentation Freeze
59
127
 
60
- Once all P0 and P1 findings are resolved:
128
+ Once all P0 and P1 findings are resolved and re-validation produces zero new findings:
61
129
 
62
130
  1. Add a freeze marker (tracking comment) to each phase artifact indicating the document is implementation-ready.
63
131
  2. Record the freeze timestamp and the validation findings that were addressed.
64
132
  3. P2 deferrals are logged in the fix log with rationale — these become backlog items for post-implementation polish.
65
133
 
134
+ ### Freeze Criteria Checklist
135
+
136
+ Before declaring freeze, verify all of the following:
137
+
138
+ - [ ] All P0 findings resolved and re-validated
139
+ - [ ] All P1 findings resolved (or explicitly risk-accepted with documented rationale)
140
+ - [ ] Re-validation produced zero new findings on the final pass
141
+ - [ ] Fix log is complete with all changes documented
142
+ - [ ] P2 deferrals are logged with rationale
143
+ - [ ] Cross-document counts are internally consistent (final count sweep)
144
+ - [ ] All traceability links resolve (no dangling references)
145
+ - [ ] Terminology is consistent across all documents (final terminology sweep)
146
+
66
147
  ### What Freeze Means
67
148
 
68
149
  - **No further content changes** unless implementation reveals a genuine gap (not a preference).
69
150
  - **Formatting and typo fixes** are allowed — they don't affect implementation.
70
151
  - **If a gap is found during implementation**, the fix goes through the same prioritization process: update the document, log the change, re-verify consistency.
152
+ - **Freeze does NOT mean the documents are perfect.** P2 deferrals exist. The standard is implementation readiness — an implementing agent can produce correct code from these documents without guessing.
153
+
154
+ ### What Is Allowed After Freeze
155
+
156
+ | Change Type | Allowed? | Process |
157
+ |------------|----------|---------|
158
+ | Typo fixes, formatting | Yes | Direct edit, no re-validation needed |
159
+ | Gap discovered during implementation | Yes | Prioritize as P0/P1, apply fix, re-validate affected section, log in fix log |
160
+ | "Nice to have" improvements | No | Log as P2 deferral for post-implementation |
161
+ | Scope additions | No | Out of scope — must go through PRD amendment process |
162
+ | Terminology alignment (missed in freeze) | Yes | Treat as P0 fix, apply and re-validate |
163
+
164
+ ### Freeze Marker Format
165
+
166
+ Add the following marker to the top of each frozen document, immediately after the frontmatter:
167
+
168
+ ```markdown
169
+ <!-- FROZEN: Implementation-ready as of YYYY-MM-DD. Changes require fix-log entry. -->
170
+ ```
171
+
172
+ ### Frozen Artifact Set
173
+
174
+ The complete set of frozen artifacts should be documented in the fix log as a manifest:
175
+
176
+ ```markdown
177
+ ## Frozen Artifact Manifest
178
+
179
+ | Document | Freeze Date | P0 Fixes | P1 Fixes | P2 Deferred |
180
+ |----------|------------|----------|----------|-------------|
181
+ | docs/plan.md | 2025-01-15 | 0 | 2 | 1 |
182
+ | docs/system-architecture.md | 2025-01-15 | 3 | 4 | 2 |
183
+ | docs/api-contracts.md | 2025-01-15 | 1 | 1 | 0 |
184
+ | docs/database-schema.md | 2025-01-15 | 2 | 3 | 1 |
185
+ | ... | ... | ... | ... | ... |
186
+ ```
71
187
 
72
188
  ## Fix Log Format
73
189
 
@@ -85,9 +201,56 @@ Once all P0 and P1 findings are resolved:
85
201
  | 1 | IR-012: Missing adopt-flow UX spec | Low implementation impact; adopt is secondary flow |
86
202
  ```
87
203
 
204
+ ## The Fix-Revalidate-Freeze Cycle
205
+
206
+ The full process follows a strict cycle:
207
+
208
+ ```
209
+ Collect findings
210
+
211
+
212
+ Build fix plan (categorize, prioritize, estimate impact)
213
+
214
+
215
+ ┌─> Apply fixes (one finding or systemic issue per commit)
216
+ │ │
217
+ │ ▼
218
+ │ Re-validate (re-run affected checks, spot-check adjacent sections)
219
+ │ │
220
+ │ ▼
221
+ │ New findings? ──Yes──┐
222
+ │ │ │
223
+ │ No │
224
+ │ │ │
225
+ │ ▼ │
226
+ │ Freeze criteria met? │
227
+ │ │ │
228
+ │ No │
229
+ │ │ │
230
+ └───────┘ ◄──────────────┘
231
+
232
+ Yes
233
+
234
+
235
+ Declare freeze (add markers, create manifest, log deferrals)
236
+ ```
237
+
238
+ Each iteration through the cycle should produce strictly fewer findings than the previous iteration. If the count of findings is not decreasing, stop and investigate — you may be fixing symptoms while the root cause persists.
239
+
88
240
  ## Common Pitfalls
89
241
 
90
- 1. **Fixing symptoms instead of root causes.** If the same stale count appears in 15 files, the root cause is a single pipeline change that wasn't propagated. Fix the source and sweep all references.
91
- 2. **Introducing new inconsistencies.** Renaming a field in one document but missing it in another. Always search for all references before changing a term.
92
- 3. **Over-fixing.** The goal is implementation readiness, not perfection. If a P2 finding doesn't affect an implementing agent's ability to produce correct code, defer it.
93
- 4. **Skipping verification.** A fix that breaks a cross-reference is worse than the original finding. Always re-verify after applying fixes.
242
+ 1. **Fixing symptoms instead of root causes.** If the same stale count appears in 15 files, the root cause is a single pipeline change that wasn't propagated. Fix the source and sweep all references. A good diagnostic: if your fix plan has 10+ individual fixes that all trace to the same upstream change, consolidate them into one systemic fix.
243
+
244
+ 2. **Introducing new inconsistencies.** Renaming a field in one document but missing it in another. Always search for all references before changing a term. Run a project-wide grep for the old term after every rename.
245
+
246
+ 3. **Over-fixing.** The goal is implementation readiness, not perfection. If a P2 finding doesn't affect an implementing agent's ability to produce correct code, defer it. A common trap: improving prose clarity during the fix phase. This is not fixing — it is editing, and it risks introducing new inconsistencies.
247
+
248
+ 4. **Skipping re-validation.** A fix that breaks a cross-reference is worse than the original finding. Always re-validate after applying fixes. The most dangerous fixes are the ones that "obviously" don't need re-validation — those are the ones that introduce silent regressions.
249
+
250
+ 5. **Premature freeze.** Declaring freeze before all P0 and P1 findings are resolved because of time pressure. A premature freeze sends agents into implementation with known issues, guaranteeing rework. If time is short, reduce scope (defer entire features) rather than freezing with known P0 issues.
251
+
252
+ 6. **Scope creep during the fix phase.** A finding says "the error format is unspecified" and the fix adds a complete error taxonomy, error codes, error localization strategy, and retry semantics. The fix should specify the minimum error format needed for implementation. Everything else is new scope.
253
+
254
+ 7. **Infinite fix loops.** Each fix introduces a new finding, which requires another fix, which introduces another finding. This happens when fixes are too broad (changing things beyond what the finding requires) or when the underlying documents have systemic structural problems. Break the loop by: (a) making smaller, more targeted fixes, or (b) stepping back to identify the structural issue and fixing that instead.
255
+
256
+ 8. **Incomplete fix log.** Applying fixes without logging them. The fix log is not bureaucracy — it is the audit trail that proves the freeze is valid. If an implementation agent later questions a design choice, the fix log explains why the document says what it says.
@@ -10,6 +10,8 @@ A developer onboarding guide is the first document a new developer (human or AI
10
10
 
11
11
  This document covers what an effective onboarding guide should contain, how to structure it, and what to avoid.
12
12
 
13
+ ## Summary
14
+
13
15
  ## Guide Structure
14
16
 
15
17
  The onboarding guide follows a deliberate progression from purpose to productivity:
@@ -54,6 +56,8 @@ data automatically and highlights discrepancies for review.
54
56
  - Business metrics or revenue goals (irrelevant to contributors)
55
57
  - History of the project (unless it explains current technical decisions)
56
58
 
59
+ ## Deep Guidance
60
+
57
61
  ## 2. Architecture Overview
58
62
 
59
63
  ### What to Include