@zigrivers/scaffold 2.28.1 → 2.38.1

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 (375) hide show
  1. package/README.md +309 -136
  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 +103 -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 +4 -0
  263. package/knowledge/core/api-design.md +4 -0
  264. package/knowledge/core/automated-review-tooling.md +203 -0
  265. package/knowledge/core/coding-conventions.md +1 -1
  266. package/knowledge/core/database-design.md +4 -0
  267. package/knowledge/core/design-system-tokens.md +4 -0
  268. package/knowledge/core/domain-modeling.md +4 -0
  269. package/knowledge/core/git-workflow-patterns.md +200 -0
  270. package/knowledge/core/operations-runbook.md +5 -1
  271. package/knowledge/core/security-best-practices.md +4 -0
  272. package/knowledge/core/system-architecture.md +5 -1
  273. package/knowledge/core/task-decomposition.md +118 -3
  274. package/knowledge/core/user-story-innovation.md +13 -0
  275. package/knowledge/core/ux-specification.md +13 -0
  276. package/knowledge/execution/enhancement-workflow.md +201 -0
  277. package/knowledge/execution/task-claiming-strategy.md +130 -0
  278. package/knowledge/execution/tdd-execution-loop.md +172 -0
  279. package/knowledge/execution/worktree-management.md +205 -0
  280. package/knowledge/finalization/apply-fixes-and-freeze.md +12 -0
  281. package/knowledge/finalization/developer-onboarding.md +4 -0
  282. package/knowledge/finalization/implementation-playbook.md +83 -5
  283. package/knowledge/product/gap-analysis.md +5 -1
  284. package/knowledge/product/prd-innovation.md +12 -0
  285. package/knowledge/product/vision-craft.md +213 -0
  286. package/knowledge/review/review-adr.md +12 -0
  287. package/knowledge/review/review-api-design.md +13 -0
  288. package/knowledge/review/review-database-design.md +13 -0
  289. package/knowledge/review/review-domain-modeling.md +5 -1
  290. package/knowledge/review/review-implementation-tasks.md +58 -1
  291. package/knowledge/review/review-methodology.md +11 -0
  292. package/knowledge/review/review-operations.md +12 -0
  293. package/knowledge/review/review-prd.md +13 -0
  294. package/knowledge/review/review-security.md +12 -0
  295. package/knowledge/review/review-system-architecture.md +4 -2
  296. package/knowledge/review/review-testing-strategy.md +11 -0
  297. package/knowledge/review/review-user-stories.md +11 -0
  298. package/knowledge/review/review-ux-specification.md +13 -1
  299. package/knowledge/review/review-vision.md +255 -0
  300. package/knowledge/tools/release-management.md +222 -0
  301. package/knowledge/tools/session-analysis.md +215 -0
  302. package/knowledge/tools/version-strategy.md +200 -0
  303. package/knowledge/validation/critical-path-analysis.md +1 -1
  304. package/knowledge/validation/cross-phase-consistency.md +12 -0
  305. package/knowledge/validation/decision-completeness.md +13 -1
  306. package/knowledge/validation/dependency-validation.md +12 -0
  307. package/knowledge/validation/scope-management.md +12 -0
  308. package/knowledge/validation/traceability.md +12 -0
  309. package/methodology/README.md +37 -0
  310. package/methodology/custom-defaults.yml +12 -1
  311. package/methodology/deep.yml +11 -0
  312. package/methodology/mvp.yml +11 -0
  313. package/package.json +3 -3
  314. package/pipeline/architecture/review-architecture.md +18 -7
  315. package/pipeline/architecture/system-architecture.md +11 -8
  316. package/pipeline/build/multi-agent-resume.md +245 -0
  317. package/pipeline/build/multi-agent-start.md +236 -0
  318. package/pipeline/build/new-enhancement.md +456 -0
  319. package/pipeline/build/quick-task.md +381 -0
  320. package/pipeline/build/single-agent-resume.md +210 -0
  321. package/pipeline/build/single-agent-start.md +207 -0
  322. package/pipeline/consolidation/claude-md-optimization.md +11 -8
  323. package/pipeline/consolidation/workflow-audit.md +15 -11
  324. package/pipeline/decisions/adrs.md +7 -5
  325. package/pipeline/decisions/review-adrs.md +14 -6
  326. package/pipeline/environment/ai-memory-setup.md +18 -12
  327. package/pipeline/environment/automated-pr-review.md +10 -4
  328. package/pipeline/environment/design-system.md +9 -7
  329. package/pipeline/environment/dev-env-setup.md +8 -5
  330. package/pipeline/environment/git-workflow.md +3 -1
  331. package/pipeline/finalization/apply-fixes-and-freeze.md +16 -5
  332. package/pipeline/finalization/developer-onboarding-guide.md +22 -8
  333. package/pipeline/finalization/implementation-playbook.md +40 -11
  334. package/pipeline/foundation/beads.md +10 -7
  335. package/pipeline/foundation/coding-standards.md +6 -3
  336. package/pipeline/foundation/project-structure.md +5 -1
  337. package/pipeline/foundation/tdd.md +10 -6
  338. package/pipeline/foundation/tech-stack.md +9 -9
  339. package/pipeline/integration/add-e2e-testing.md +21 -6
  340. package/pipeline/modeling/domain-modeling.md +10 -7
  341. package/pipeline/modeling/review-domain-modeling.md +17 -6
  342. package/pipeline/parity/platform-parity-review.md +31 -11
  343. package/pipeline/planning/implementation-plan-review.md +21 -10
  344. package/pipeline/planning/implementation-plan.md +52 -19
  345. package/pipeline/pre/create-prd.md +22 -7
  346. package/pipeline/pre/innovate-prd.md +10 -8
  347. package/pipeline/pre/innovate-user-stories.md +9 -7
  348. package/pipeline/pre/review-prd.md +11 -2
  349. package/pipeline/pre/review-user-stories.md +12 -3
  350. package/pipeline/pre/user-stories.md +12 -7
  351. package/pipeline/quality/create-evals.md +10 -6
  352. package/pipeline/quality/operations.md +16 -12
  353. package/pipeline/quality/review-operations.md +19 -10
  354. package/pipeline/quality/review-security.md +21 -11
  355. package/pipeline/quality/review-testing.md +23 -12
  356. package/pipeline/quality/security.md +17 -13
  357. package/pipeline/quality/story-tests.md +6 -4
  358. package/pipeline/specification/api-contracts.md +11 -6
  359. package/pipeline/specification/database-schema.md +12 -6
  360. package/pipeline/specification/review-api.md +18 -9
  361. package/pipeline/specification/review-database.md +18 -9
  362. package/pipeline/specification/review-ux.md +20 -10
  363. package/pipeline/specification/ux-spec.md +8 -5
  364. package/pipeline/validation/critical-path-walkthrough.md +14 -7
  365. package/pipeline/validation/cross-phase-consistency.md +14 -7
  366. package/pipeline/validation/decision-completeness.md +14 -7
  367. package/pipeline/validation/dependency-graph-validation.md +15 -7
  368. package/pipeline/validation/implementability-dry-run.md +15 -7
  369. package/pipeline/validation/scope-creep-check.md +15 -7
  370. package/pipeline/validation/traceability-matrix.md +20 -7
  371. package/pipeline/vision/create-vision.md +267 -0
  372. package/pipeline/vision/innovate-vision.md +157 -0
  373. package/pipeline/vision/review-vision.md +149 -0
  374. package/skills/scaffold-pipeline/SKILL.md +33 -18
  375. package/skills/scaffold-runner/SKILL.md +172 -18
@@ -8,6 +8,18 @@ topics: [validation, dependencies, graphs, cycles, ordering, parallelization]
8
8
 
9
9
  Dependency validation extracts all dependency relationships between implementation tasks, builds a graph, checks for correctness, and verifies that the ordering matches architectural constraints. A valid dependency graph ensures that tasks can be executed in an order that never requires unbuilt dependencies.
10
10
 
11
+ ## Summary
12
+
13
+ - Extract dependencies from task declarations, architecture data flows, schema foreign keys, API contract prerequisites, and implicit shared resources.
14
+ - **Cycle detection**: Use Kahn's algorithm to find tasks that can never start; resolve by splitting tasks into "define interface" and "implement interface."
15
+ - **Completeness check**: Every referenced task ID must exist in the task list; orphaned dependencies indicate renames, removals, or typos.
16
+ - **Ordering validation**: Dependencies should follow architectural layer ordering (infrastructure -> schema -> domain -> service -> API -> frontend -> tests).
17
+ - **Parallel independence**: Tasks with no dependency path between them must not share mutable files, tables, or configuration.
18
+ - **Critical path analysis**: Identify the longest sequential chain to determine minimum project duration and focus optimization efforts.
19
+ - **Fan-in/fan-out analysis**: High fan-in tasks are blockers (prioritize and split); high fan-out tasks start late (review whether all dependencies are necessary).
20
+
21
+ ## Deep Guidance
22
+
11
23
  ## What a Dependency Graph Represents
12
24
 
13
25
  Each node in the graph is an implementation task. Each directed edge represents a "must complete before" relationship: if task A depends on task B, then B must be completed before A can start.
@@ -8,6 +8,18 @@ topics: [validation, scope, creep, prd-alignment, gold-plating]
8
8
 
9
9
  Scope management validation compares every specification artifact against the PRD to ensure that the documented system matches what was actually requested. Features that cannot be traced to a PRD requirement are scope creep. Requirements that grew during documentation are scope inflation. Extra polish on non-critical features is gold-plating. This validation catches all three.
10
10
 
11
+ ## Summary
12
+
13
+ - **Feature-to-PRD tracing**: Classify every capability as traced (maps to PRD), supporting (necessary infrastructure), or creep (no PRD justification).
14
+ - **Scope inflation detection**: Compare each PRD requirement's original scope to its implementation scope; flag features that grew beyond what was requested.
15
+ - **Gold-plating detection**: Over-abstraction, premature optimization, excessive error handling, and UI polish beyond requirements. Test: "If removed, would any PRD requirement be unmet?"
16
+ - **Deferred scope leakage**: Verify explicitly deferred items (v2 features) do not appear in specifications, including partial infrastructure for deferred features.
17
+ - **NFR scope alignment**: Implementation targets should match PRD targets, not exceed them (e.g., 99.9% uptime, not 99.99%).
18
+ - **Decision framework**: When in doubt, defer. Scope additions are kept only if required for a PRD feature to work and do not significantly increase effort or operational complexity.
19
+ - Run scope validation after all documentation phases and before implementation begins.
20
+
21
+ ## Deep Guidance
22
+
11
23
  ## Why Scope Grows
12
24
 
13
25
  Scope grows during the documentation pipeline for understandable reasons — but each growth increases implementation effort, risk, and timeline. Common causes:
@@ -8,6 +8,18 @@ topics: [validation, traceability, requirements, coverage]
8
8
 
9
9
  Traceability validation ensures that every requirement flows from its origin in the PRD through domain modeling, architecture decisions, system design, and into implementable tasks. A complete traceability matrix is the strongest evidence that nothing has been lost or invented during the documentation pipeline.
10
10
 
11
+ ## Summary
12
+
13
+ - **Traceability matrix**: A table where each row is a requirement and columns are pipeline artifacts (domain, ADR, architecture, schema, API, UX, tasks, tests). Empty cells are gaps.
14
+ - **Build process**: Extract all PRD requirements (functional, NFR, constraints, deferred), then trace each forward through every downstream artifact.
15
+ - **Gap detection**: Empty cells (not N/A), orphaned artifacts tracing to no requirement, thin traces, and deferred items appearing downstream.
16
+ - **Bidirectional tracing**: Forward (requirement -> implementation) catches gaps; backward (implementation -> requirement) catches scope creep.
17
+ - **NFR tracing**: Performance, security, and accessibility requirements cut across components and need special tracing through architecture, schema, API, testing, and UX.
18
+ - **Common issues**: Orphan features, assumed infrastructure, tested-but-not-specified behaviors, specified-but-not-tested requirements, and split requirements across unlinked tasks.
19
+ - Use consistent identifiers (REQ-001, ADR-003, T-012) so traces are searchable across all artifacts.
20
+
21
+ ## Deep Guidance
22
+
11
23
  ## What a Traceability Matrix Is
12
24
 
13
25
  A traceability matrix is a table where each row represents a requirement and each column represents a pipeline artifact. A complete row means the requirement is fully traced from origin to implementation. A missing cell means a gap — either the requirement was not addressed at that phase, or it was addressed but the connection is not explicit.
@@ -0,0 +1,37 @@
1
+ # Methodology Depth Levels
2
+
3
+ The scaffold pipeline supports 5 depth levels that control the thoroughness of each step's output.
4
+
5
+ | Depth | Name | Description |
6
+ |-------|------|-------------|
7
+ | 1 | Minimal | Bare minimum viable output. Just enough to start building. |
8
+ | 2 | Light | Slightly more detail than minimal. Still focused on speed over completeness. |
9
+ | 3 | Balanced | Recommended for most projects. Good coverage without excessive documentation. |
10
+ | 4 | Thorough | Comprehensive output with external model validation (Codex/Gemini) when available. |
11
+ | 5 | Exhaustive | Maximum detail with multi-model reconciliation. Best for critical or regulated projects. |
12
+
13
+ ## Presets
14
+
15
+ | Preset | Default Depth | Philosophy |
16
+ |--------|---------------|------------|
17
+ | `mvp.yml` | 1 | Ship fast. Only essential steps enabled. No review cycles beyond PRD/stories. |
18
+ | `custom-defaults.yml` | 3 | Balanced. Most steps enabled. Innovation and automated review disabled by default. |
19
+ | `deep.yml` | 5 | Maximum quality. All steps enabled. External model dispatch at depth 4+. |
20
+
21
+ ## How Depth Affects Steps
22
+
23
+ Each pipeline step defines a `## Methodology Scaling` section with behavior at each depth:
24
+ - **mvp** bullet: What the step produces at depth 1-2
25
+ - **deep** bullet: What the step produces at depth 4-5
26
+ - **custom:depth(1-5)** bullet: Explicit per-level breakdown
27
+
28
+ Depth 3 is typically the inflection point where steps add structure, cross-references, and validation beyond the basics.
29
+
30
+ ## Depth Tags in Quality Criteria
31
+
32
+ Quality Criteria items may be tagged:
33
+ - `(mvp)` — applies at all depths (depth 1+)
34
+ - `(deep)` — applies only at depth 4+
35
+ - `(depth N+)` — applies at depth N and above
36
+
37
+ Untagged criteria apply at all depths by default.
@@ -3,8 +3,12 @@ name: Custom
3
3
  description: Choose which steps to include and how deep to go
4
4
  default_depth: 3
5
5
 
6
- # All steps enabled by default at depth 3 — user overrides individual steps
6
+ # Most steps enabled by default at depth 3 — innovation and automated-pr-review disabled by default, user overrides individual steps
7
7
  steps:
8
+ # Phase 0 — Product Vision (vision)
9
+ create-vision: { enabled: true }
10
+ review-vision: { enabled: true }
11
+ innovate-vision: { enabled: false }
8
12
  # Phase 1 — Product Definition (pre)
9
13
  create-prd: { enabled: true }
10
14
  review-prd: { enabled: true }
@@ -70,3 +74,10 @@ steps:
70
74
  apply-fixes-and-freeze: { enabled: true }
71
75
  developer-onboarding-guide: { enabled: true }
72
76
  implementation-playbook: { enabled: true }
77
+ # Phase 15 — Build (build) — stateless, on-demand execution steps
78
+ single-agent-start: { enabled: true }
79
+ single-agent-resume: { enabled: true }
80
+ multi-agent-start: { enabled: true }
81
+ multi-agent-resume: { enabled: true }
82
+ quick-task: { enabled: true }
83
+ new-enhancement: { enabled: true }
@@ -4,6 +4,10 @@ description: Comprehensive documentation for complex systems — full analysis a
4
4
  default_depth: 5
5
5
 
6
6
  steps:
7
+ # Phase 0 — Product Vision (vision)
8
+ create-vision: { enabled: true }
9
+ review-vision: { enabled: true }
10
+ innovate-vision: { enabled: true, conditional: "if-needed" }
7
11
  # Phase 1 — Product Definition (pre)
8
12
  create-prd: { enabled: true }
9
13
  review-prd: { enabled: true }
@@ -69,3 +73,10 @@ steps:
69
73
  apply-fixes-and-freeze: { enabled: true }
70
74
  developer-onboarding-guide: { enabled: true }
71
75
  implementation-playbook: { enabled: true }
76
+ # Phase 15 — Build (build) — stateless, on-demand execution steps
77
+ single-agent-start: { enabled: true }
78
+ single-agent-resume: { enabled: true }
79
+ multi-agent-start: { enabled: true }
80
+ multi-agent-resume: { enabled: true }
81
+ quick-task: { enabled: true }
82
+ new-enhancement: { enabled: true }
@@ -4,6 +4,10 @@ description: Get to code fast with minimal ceremony
4
4
  default_depth: 1
5
5
 
6
6
  steps:
7
+ # Phase 0 — Product Vision (vision)
8
+ create-vision: { enabled: true }
9
+ review-vision: { enabled: true }
10
+ innovate-vision: { enabled: false }
7
11
  # Phase 1 — Product Definition (pre)
8
12
  create-prd: { enabled: true }
9
13
  review-prd: { enabled: true }
@@ -69,3 +73,10 @@ steps:
69
73
  apply-fixes-and-freeze: { enabled: false }
70
74
  developer-onboarding-guide: { enabled: false }
71
75
  implementation-playbook: { enabled: true }
76
+ # Phase 15 — Build (build) — stateless, on-demand execution steps
77
+ single-agent-start: { enabled: true }
78
+ single-agent-resume: { enabled: true }
79
+ multi-agent-start: { enabled: true }
80
+ multi-agent-resume: { enabled: true }
81
+ quick-task: { enabled: true }
82
+ new-enhancement: { enabled: true }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zigrivers/scaffold",
3
- "version": "2.28.1",
3
+ "version": "2.38.1",
4
4
  "description": "AI-powered software project scaffolding pipeline",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -41,11 +41,11 @@
41
41
  "test": "vitest run",
42
42
  "test:coverage": "vitest run --coverage",
43
43
  "test:e2e": "vitest run --config vitest.e2e.config.ts",
44
- "test:bench": "vitest bench",
44
+ "test:perf": "vitest run tests/performance/",
45
45
  "lint": "eslint src/ tests/",
46
46
  "type-check": "tsc --noEmit",
47
47
  "check": "npm run lint && npm run type-check && npm test",
48
- "prepublish": "bash scripts/prepublish.sh"
48
+ "prepublishOnly": "bash scripts/prepublish.sh"
49
49
  },
50
50
  "dependencies": {
51
51
  "@inquirer/prompts": "^7.4.0",
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  name: review-architecture
3
3
  description: Review system architecture for completeness and downstream readiness
4
+ summary: "Verifies every domain concept lands in a component, every decision constraint is respected, no components are orphaned from data flows, and the module structure minimizes merge conflicts."
4
5
  phase: "architecture"
5
6
  order: 720
6
7
  dependencies: [system-architecture]
7
8
  outputs: [docs/reviews/review-architecture.md, docs/reviews/architecture/review-summary.md, docs/reviews/architecture/codex-review.json, docs/reviews/architecture/gemini-review.json]
9
+ reads: [domain-modeling]
8
10
  conditional: null
9
- knowledge-base: [review-methodology, review-system-architecture]
11
+ knowledge-base: [review-methodology, review-system-architecture, multi-model-review-dispatch, review-step-template]
10
12
  ---
11
13
 
12
14
  ## Purpose
@@ -32,12 +34,14 @@ independent review validation.
32
34
  - docs/reviews/architecture/gemini-review.json (depth 4+, if available) — raw Gemini findings
33
35
 
34
36
  ## Quality Criteria
35
- - All architecture-specific review passes executed
36
- - Domain model coverage verified (every model maps to a component)
37
- - ADR constraint compliance verified
38
- - Data flow completeness verified (no orphaned components)
39
- - Module structure validated for practical concerns
40
- - Downstream readiness confirmed (specification, quality, and planning steps can proceed)
37
+ - (mvp) Domain model coverage verified (every model maps to a component)
38
+ - (mvp) ADR constraint compliance verified
39
+ - (deep) All architecture-specific review passes executed
40
+ - (deep) Data flow completeness verified (no orphaned components)
41
+ - (deep) Module structure assessed for merge conflict risk, circular dependency risk, and import depth
42
+ - (mvp) Downstream readiness confirmed (specification, quality, and planning steps can proceed)
43
+ - (mvp) Every finding categorized P0-P3 with specific component, section, and issue
44
+ - (mvp) Fix plan documented for all P0/P1 findings; fixes applied to system-architecture.md and re-validated
41
45
  - (depth 4+) Multi-model findings synthesized with consensus/disagreement analysis
42
46
 
43
47
  ## Methodology Scaling
@@ -54,3 +58,10 @@ independent review validation.
54
58
  ## Mode Detection
55
59
  Re-review mode if previous review exists. If multi-model review artifacts exist
56
60
  under docs/reviews/architecture/, preserve prior findings still valid.
61
+
62
+ ## Update Mode Specifics
63
+
64
+ - **Detect**: `docs/reviews/review-architecture.md` exists with tracking comment
65
+ - **Preserve**: Prior findings still valid, resolution decisions, multi-model review artifacts
66
+ - **Triggers**: Upstream artifact changed since last review (compare tracking comment dates)
67
+ - **Conflict resolution**: Previously resolved findings reappearing = regression; flag and re-evaluate
@@ -1,19 +1,22 @@
1
1
  ---
2
2
  name: system-architecture
3
3
  description: Design and document system architecture
4
+ summary: "Designs the system blueprint — which components exist, how data flows between them, where each module lives in the directory tree, and where extension points allow custom behavior."
4
5
  phase: "architecture"
5
6
  order: 710
6
7
  dependencies: [review-adrs]
7
8
  outputs: [docs/system-architecture.md]
8
- reads: [create-prd]
9
+ reads: [create-prd, domain-modeling, adrs]
9
10
  conditional: null
10
- knowledge-base: [system-architecture]
11
+ knowledge-base: [system-architecture, domain-modeling]
11
12
  ---
12
13
 
13
14
  ## Purpose
14
15
  Design and document the system architecture, translating domain models and ADR
15
16
  decisions into a concrete component structure, data flows, and module
16
- organization. Project directory structure and module organization are defined here.
17
+ organization. Project directory structure and module organization are defined
18
+ here. This is the blueprint that agents reference when deciding where code
19
+ lives and how components communicate.
17
20
 
18
21
  ## Inputs
19
22
  - docs/domain-models/ (required) — domain models from modeling phase
@@ -25,11 +28,11 @@ organization. Project directory structure and module organization are defined he
25
28
  data flows, module structure, and extension points
26
29
 
27
30
  ## Quality Criteria
28
- - Every domain model lands in a component or module
29
- - Every ADR constraint is respected in the architecture
30
- - All components appear in at least one data flow diagram
31
- - Extension points are both documented and designed (not just listed)
32
- - Project directory structure is defined with file-level granularity
31
+ - (mvp) Every domain model lands in a component or module
32
+ - (mvp) Every ADR constraint is respected in the architecture
33
+ - (mvp) All components appear in at least one data flow diagram
34
+ - (deep) Each extension point has interface definition, example usage scenario, and constraints on what can/cannot be extended
35
+ - (mvp) Project directory structure is defined with file-level granularity
33
36
 
34
37
  ## Methodology Scaling
35
38
  - **deep**: Full architecture document. Component diagrams, data flow diagrams,
@@ -0,0 +1,245 @@
1
+ ---
2
+ name: multi-agent-resume
3
+ description: Resume multi-agent work after a break
4
+ summary: "Verifies the worktree, syncs with main, reconciles completed tasks, and resumes the agent's TDD loop from the previous session."
5
+ phase: "build"
6
+ order: 1540
7
+ dependencies: [implementation-playbook]
8
+ outputs: []
9
+ conditional: null
10
+ stateless: true
11
+ category: pipeline
12
+ knowledge-base: [tdd-execution-loop, task-claiming-strategy, worktree-management]
13
+ reads: [coding-standards, tdd, git-workflow]
14
+ argument-hint: "<agent-name>"
15
+ ---
16
+
17
+ ## Purpose
18
+ Resume a named agent's implementation work in its worktree after a break.
19
+ Recovers session context by verifying the worktree environment, syncing with
20
+ main, reconciling task status and open PRs, then continuing the TDD execution
21
+ loop from where the agent left off.
22
+
23
+ ## Inputs
24
+ - $ARGUMENTS (required) — the agent name (e.g., "alpha", "beta", "agent-1")
25
+ - CLAUDE.md (required) — project conventions, key commands, workflow
26
+ - docs/implementation-playbook.md (required if exists) — primary task execution reference
27
+ - docs/implementation-plan.md (fallback) — task list when no playbook exists
28
+ - docs/onboarding-guide.md (optional) — project context for orientation
29
+ - docs/coding-standards.md (required) — code conventions, naming, patterns
30
+ - docs/tdd-standards.md (required) — test categories, mocking strategy
31
+ - docs/project-structure.md (required) — where files live
32
+ - tests/acceptance/ (optional) — TDD test skeletons
33
+ - tests/evals/ (optional) — project eval checks for quality gates
34
+ - tasks/lessons.md (optional) — previous lessons learned
35
+ - .beads/ (conditional) — Beads task tracking if configured
36
+
37
+ ## Expected Outputs
38
+ - Completed in-progress work from previous session
39
+ - Continued task implementation with passing tests
40
+ - Pull requests for each completed task
41
+ - Updated task status in playbook/plan or Beads
42
+
43
+ ## Quality Criteria
44
+ - (mvp) Worktree environment is verified before resuming
45
+ - (mvp) In-progress work is identified and completed before starting new tasks
46
+ - (mvp) Merged PRs are reconciled with task status
47
+ - (mvp) Each task follows red-green-refactor TDD cycle
48
+ - (deep) Full sync with origin/main before resuming
49
+ - (deep) Beads actor identity is verified and task states are reconciled
50
+ - (deep) Between-task cleanup ensures no state leakage
51
+
52
+ ## Methodology Scaling
53
+ - **deep**: Full worktree verification, Beads actor check, rebase on latest
54
+ main, reconcile all open PRs, review onboarding guide, consult lessons.md,
55
+ eval gates, detailed PR descriptions, between-task cleanup.
56
+ - **mvp**: Verify worktree, check branch state, finish in-progress work or
57
+ pick next task, TDD loop, make check, create PR.
58
+ - **custom:depth(1-5)**: Depth 1-2: check branch and continue. Depth 3: add
59
+ PR reconciliation, lessons.md review, sync with origin. Depth 4: add
60
+ rebase, eval gates, between-task cleanup. Depth 5: full state audit with
61
+ actor verification and branch cleanup.
62
+
63
+ ## Mode Detection
64
+ This is a stateless execution command. No document is created or updated.
65
+ - Always operates in RESUME MODE.
66
+ - If there is no prior work for this agent (no feature branches, no task
67
+ progress), redirect to `/scaffold:multi-agent-start $ARGUMENTS` instead.
68
+
69
+ ## Update Mode Specifics
70
+ Not applicable — this is a stateless execution command that does not produce
71
+ a persistent document.
72
+
73
+ ## Instructions
74
+
75
+ You are **$ARGUMENTS**.
76
+
77
+ ### Worktree Verification
78
+
79
+ Before doing anything else, confirm the environment:
80
+
81
+ 1. **Worktree confirmation**
82
+ - `git rev-parse --git-dir` — output should contain `/worktrees/` (confirms you are in a worktree)
83
+ - If NOT in a worktree, stop and instruct the user to set one up or navigate to the correct directory
84
+
85
+ 2. **Beads identity** (if `.beads/` exists)
86
+ - `echo $BD_ACTOR` — should show `$ARGUMENTS`
87
+ - If not set, the worktree setup may be incomplete
88
+
89
+ ### State Recovery
90
+
91
+ Recover your context by checking the current state of work:
92
+
93
+ 1. **Read project context**
94
+ - Read `CLAUDE.md` for project conventions and key commands
95
+ - Read `docs/onboarding-guide.md` if it exists (refresh project context)
96
+ - Read `tasks/lessons.md` for relevant anti-patterns
97
+
98
+ 2. **Git state assessment**
99
+ - `git branch --show-current` — determine if you are on a feature branch (in-progress work) or a workspace branch
100
+ - `git status` — check for uncommitted changes or staged files
101
+ - `git stash list` — check for stashed work
102
+ - `git log --oneline -5` — review recent commits for context
103
+
104
+ 3. **PR reconciliation**
105
+ - `gh pr list --author="@me"` — check for open PRs from this agent
106
+ - For each open PR, check if it has been merged: `gh pr view <number> --json state`
107
+ - If a PR was merged while you were away, reconcile the task status (see below)
108
+
109
+ 4. **Sync with remote**
110
+ - `git fetch origin --prune` — get latest remote state and clean stale references
111
+
112
+ ### Beads Recovery
113
+
114
+ **If Beads is configured** (`.beads/` exists):
115
+ - `bd list --actor $ARGUMENTS` — check for tasks with `in_progress` status owned by this agent
116
+ - If a PR shows as merged, close the corresponding task: `bd close <id> && bd sync`
117
+ - If there is in-progress work, finish it (see "Resume In-Progress Work" below)
118
+ - Otherwise, clean up and start fresh:
119
+ - `git fetch origin --prune && git clean -fd`
120
+ - Run the install command from CLAUDE.md Key Commands
121
+ - `bd ready` to find the next available task
122
+ - Continue working until `bd ready` shows no available tasks
123
+
124
+ **Without Beads:**
125
+ - Read `docs/implementation-playbook.md` as the primary task reference.
126
+ Fall back to `docs/implementation-plan.md` when no playbook is present.
127
+ - If a PR shows as merged, mark the corresponding task as complete in the plan/playbook
128
+ - If there is in-progress work on your current branch, finish it
129
+ - Otherwise, clean up and pick the next task:
130
+ - `git fetch origin --prune && git clean -fd`
131
+ - Run the install command from CLAUDE.md Key Commands
132
+ - Pick the next uncompleted task with no unfinished dependencies
133
+
134
+ ### Resume In-Progress Work
135
+
136
+ If you are on a feature branch with changes:
137
+
138
+ 1. **Assess the state**
139
+ - `git diff --stat` — what files have been changed?
140
+ - `git log --oneline origin/main..HEAD` — what commits exist on this branch?
141
+ - Read the task description to understand what was being worked on
142
+
143
+ 2. **Rebase on latest main**
144
+ - `git fetch origin && git rebase origin/main`
145
+ - Resolve any conflicts, re-run tests
146
+
147
+ 3. **Check test state**
148
+ - Run the project's test suite
149
+ - If tests pass: you may be in the refactor phase or ready for PR
150
+ - If tests fail: determine if these are your in-progress test cases (red phase) or regressions
151
+
152
+ 4. **Continue the TDD loop**
153
+ - Pick up where the previous session left off
154
+ - Follow the same Red-Green-Refactor cycle as in `/scaffold:multi-agent-start`
155
+
156
+ ### Continue to Next Task
157
+
158
+ Once in-progress work is complete (or if there was none):
159
+
160
+ 1. **Quality gates**
161
+ - Run `make check` (or equivalent from CLAUDE.md Key Commands)
162
+ - If `tests/evals/` exists, run `make eval` (or equivalent eval command)
163
+
164
+ 2. **Create PR** (if not already created for in-progress work)
165
+ - Push the branch: `git push -u origin HEAD`
166
+ - Create a pull request: `gh pr create`
167
+ - Include agent name in PR description for traceability
168
+
169
+ 3. **Between-task cleanup**
170
+ - `git fetch origin --prune && git clean -fd`
171
+ - Run the install command from CLAUDE.md Key Commands
172
+
173
+ 4. **Claim next task**
174
+ - Branch from remote: `git fetch origin && git checkout -b <branch-name> origin/main`
175
+ - Pick the next task following the same process as `/scaffold:multi-agent-start`
176
+ - Continue the TDD execution loop
177
+
178
+ ### Recovery Procedures
179
+
180
+ **Worktree not found or corrupted:**
181
+ - Check `git worktree list` from the main repo to see if the worktree exists
182
+ - If missing: `scripts/setup-agent-worktree.sh $ARGUMENTS` to recreate
183
+ - If corrupted: `git worktree remove <path>` then recreate
184
+
185
+ **Uncommitted changes on a feature branch:**
186
+ - Review the changes: `git diff`
187
+ - If the changes look intentional, stage and continue implementation
188
+ - If the changes look broken or experimental, stash them: `git stash`
189
+
190
+ **Stale feature branch (main has diverged significantly):**
191
+ - `git fetch origin && git rebase origin/main`
192
+ - If conflicts are extensive, consider starting the task fresh from origin/main
193
+ - Re-run full test suite after rebase
194
+
195
+ **PR was rejected or has requested changes:**
196
+ - `gh pr view <number>` — read the review comments
197
+ - Address the feedback on the existing branch
198
+ - Push updates and re-request review
199
+
200
+ **Task was completed by another agent:**
201
+ - If Beads: `bd sync` will show updated task states
202
+ - Without Beads: check the plan/playbook for recently completed tasks and open PRs
203
+ - Skip to the next available task
204
+
205
+ **`git checkout main` fails:**
206
+ - This is expected in a worktree. Use `git fetch origin && git checkout -b <branch> origin/main` instead.
207
+
208
+ **Dependency install fails after cleanup:**
209
+ - `git clean -fd` may have removed generated files — re-run the full install sequence
210
+ - If persistent, check if another agent's merge changed the dependency file
211
+
212
+ ### Process Rules
213
+
214
+ 1. **Verify worktree first** — Never resume work without confirming the worktree environment.
215
+ 2. **Recover state before new work** — Check for in-progress tasks and merged PRs first.
216
+ 3. **Branch from remote, not local** — Always use `origin/main` as the branch point.
217
+ 4. **Clean between tasks** — Run cleanup after each task to prevent state leakage.
218
+ 5. **TDD is not optional** — Continue the red-green-refactor cycle for any in-progress work.
219
+ 6. **Quality gates before PR** — Never create a PR with failing checks.
220
+ 7. **Follow CLAUDE.md** — It is the authority on project conventions and commands.
221
+
222
+ ---
223
+
224
+ ## After This Step
225
+
226
+ When this step is complete (all tasks done or session ending), tell the user:
227
+
228
+ ---
229
+ **Agent $ARGUMENTS resume session complete.**
230
+
231
+ **Session summary:**
232
+ - Recovered state: [in-progress task or "clean start"]
233
+ - Tasks completed this session: [list task IDs/titles]
234
+ - PRs created: [list PR numbers]
235
+ - Remaining tasks: [count or "none"]
236
+
237
+ **If resuming again later:** Run `/scaffold:multi-agent-resume $ARGUMENTS` again.
238
+
239
+ **If all tasks are done:**
240
+ - Review `tasks/lessons.md` and add any patterns learned during implementation.
241
+ - Consider running `/scaffold:version-bump` for a release.
242
+
243
+ **Pipeline reference:** `/scaffold:prompt-pipeline`
244
+
245
+ ---