@zigrivers/scaffold 2.28.1 → 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 (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 +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 +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
@@ -0,0 +1,236 @@
1
+ ---
2
+ name: multi-agent-start
3
+ description: Start multi-agent execution loop in a worktree
4
+ summary: "Sets up a named agent in an isolated git worktree so multiple agents can implement tasks simultaneously without file conflicts, each following the same TDD loop."
5
+ phase: "build"
6
+ order: 1530
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
+ Start a named agent in a git worktree for parallel multi-agent execution.
19
+ Each agent operates in its own worktree, claims tasks independently, and
20
+ creates PRs that are merged back to main. This enables multiple agents to
21
+ work on different tasks simultaneously without stepping on each other.
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
+ - Implemented features with passing tests from this agent's worktree
39
+ - Pull requests for each completed task
40
+ - Updated task status in playbook/plan or Beads
41
+
42
+ ## Quality Criteria
43
+ - (mvp) Agent identity is established and verified (worktree environment confirmed)
44
+ - (mvp) Each task follows red-green-refactor TDD cycle
45
+ - (mvp) All quality gates pass before PR creation
46
+ - (mvp) Task claiming avoids conflicts with other agents
47
+ - (deep) Pre-flight verification confirms worktree isolation
48
+ - (deep) Between-task cleanup ensures no state leakage across tasks
49
+ - (deep) Beads actor identity is set correctly for task ownership tracking
50
+
51
+ ## Methodology Scaling
52
+ - **deep**: Full pre-flight verification including worktree check, Beads actor
53
+ identity, onboarding guide review, lessons.md per task, eval gates, detailed
54
+ PR descriptions, between-task cleanup with dependency reinstall.
55
+ - **mvp**: Verify worktree, pick next task, TDD loop, make check, create PR.
56
+ Skip onboarding review and between-task reinstalls if not needed.
57
+ - **custom:depth(1-5)**: Depth 1-2: verify worktree, TDD loop, make check.
58
+ Depth 3: add lessons.md review and test skeleton usage. Depth 4: add
59
+ onboarding guide, eval gates, between-task cleanup. Depth 5: full
60
+ pre-flight suite, all quality gates, actor verification.
61
+
62
+ ## Mode Detection
63
+ This is a stateless execution command. No document is created or updated.
64
+ - Always operates in EXECUTE MODE.
65
+ - If this agent already has in-progress work (feature branch with changes),
66
+ redirect to `/scaffold:multi-agent-resume $ARGUMENTS` instead.
67
+
68
+ ## Update Mode Specifics
69
+ Not applicable — this is a stateless execution command that does not produce
70
+ a persistent document.
71
+
72
+ ## Instructions
73
+
74
+ You are **$ARGUMENTS**.
75
+
76
+ ### Pre-Flight Verification
77
+
78
+ Before writing any code, verify the worktree environment:
79
+
80
+ 1. **Worktree confirmation**
81
+ - `git rev-parse --git-dir` — output should contain `/worktrees/` (confirms you are in a worktree, not the main repo)
82
+ - If NOT in a worktree, stop and instruct the user to set one up:
83
+ > Run `scripts/setup-agent-worktree.sh $ARGUMENTS` from the main repo to create a worktree for this agent.
84
+
85
+ 2. **Git state check**
86
+ - `git status` — working tree should be clean
87
+ - `git branch --show-current` — note the current branch
88
+ - If on a feature branch with changes, redirect to `/scaffold:multi-agent-resume $ARGUMENTS`
89
+
90
+ 3. **Beads identity** (if `.beads/` exists)
91
+ - `echo $BD_ACTOR` — should show `$ARGUMENTS`
92
+ - If not set, the worktree setup may be incomplete
93
+
94
+ 4. **Dependency check**
95
+ - Run the install command from CLAUDE.md Key Commands
96
+ - Confirm dependencies are current in this worktree
97
+
98
+ 5. **Test suite health**
99
+ - Run the project's check command from CLAUDE.md Key Commands
100
+ - If tests fail before you start, fix them or flag to the user
101
+
102
+ 6. **Project orientation**
103
+ - Read `CLAUDE.md` for project conventions and key commands
104
+ - Read `docs/onboarding-guide.md` if it exists
105
+ - Read `tasks/lessons.md` for relevant anti-patterns
106
+
107
+ ### Worktree-Specific Rules
108
+
109
+ These rules are critical for multi-agent operation:
110
+
111
+ - **Never run `git checkout main`** — it will fail because main is checked out in the main repo
112
+ - **Always branch from remote**: `git fetch origin && git checkout -b <branch-name> origin/main`
113
+ - **Between tasks, clean up**: `git fetch origin --prune && git clean -fd` then run the install command from CLAUDE.md Key Commands
114
+ - **Use unique branch names** — include the agent name or task ID to avoid conflicts with other agents
115
+
116
+ ### Beads Detection
117
+
118
+ **If Beads is configured** (`.beads/` exists):
119
+ - Branch naming: `bd-<id>/<desc>`
120
+ - Run `bd ready` to see available tasks
121
+ - Pick the lowest-ID unblocked task
122
+ - Implement following the TDD workflow below
123
+ - After PR is merged: `bd close <id> && bd sync`
124
+ - Repeat with `bd ready` until no tasks remain
125
+
126
+ **Without Beads:**
127
+ - Branch naming: `<type>/<desc>` (e.g., `feat/add-auth`)
128
+ 1. Read `docs/implementation-playbook.md` as the primary task execution reference.
129
+ Fall back to `docs/implementation-plan.md` when no playbook is present.
130
+ 2. Pick the first uncompleted task that has no unfinished dependencies and is not being
131
+ worked on by another agent (check for open PRs or in-progress markers).
132
+ 3. Implement following the TDD workflow below.
133
+ 4. Mark the task complete in the plan/playbook.
134
+ 5. Repeat in dependency order until all tasks are done.
135
+
136
+ ### TDD Execution Loop
137
+
138
+ For each task:
139
+
140
+ 1. **Claim the task**
141
+ - Create a feature branch from remote main:
142
+ `git fetch origin && git checkout -b <branch-name> origin/main`
143
+ - If Beads: use `bd-<id>/<desc>` naming
144
+
145
+ 2. **Red phase — write failing tests**
146
+ - Check `tests/acceptance/` for existing test skeletons that correspond to the task
147
+ - If skeletons exist, use them as your starting point
148
+ - Otherwise, write test cases from the task's acceptance criteria
149
+ - Run the test suite — confirm the new tests FAIL (red)
150
+
151
+ 3. **Green phase — implement**
152
+ - Write the minimum code to make the failing tests pass
153
+ - Follow conventions from `docs/coding-standards.md`
154
+ - Follow file placement from `docs/project-structure.md`
155
+ - Run tests after each meaningful change — stop when green
156
+
157
+ 4. **Refactor phase — clean up**
158
+ - Refactor for clarity, DRY, and convention compliance
159
+ - Run the full test suite — confirm everything still passes
160
+
161
+ 5. **Quality gates**
162
+ - Run `make check` (or equivalent from CLAUDE.md Key Commands)
163
+ - If `tests/evals/` exists, run `make eval` (or equivalent eval command)
164
+ - Fix any failures before proceeding
165
+
166
+ 6. **Create PR**
167
+ - Push the branch: `git push -u origin HEAD`
168
+ - Create a pull request: `gh pr create`
169
+ - Include in the PR description: what was implemented, key decisions, files changed, agent name
170
+ - Follow the PR workflow from `docs/git-workflow.md` or CLAUDE.md
171
+
172
+ 7. **Between-task cleanup**
173
+ - `git fetch origin --prune && git clean -fd`
174
+ - Run the install command from CLAUDE.md Key Commands
175
+ - This ensures a clean state before the next task
176
+
177
+ ### Recovery Procedures
178
+
179
+ **Worktree not set up:**
180
+ - Instruct the user to run: `scripts/setup-agent-worktree.sh $ARGUMENTS`
181
+ - Or reference `docs/git-workflow.md` section 7 for manual worktree setup
182
+
183
+ **`git checkout main` fails:**
184
+ - This is expected in a worktree. Use `git fetch origin && git checkout -b <branch> origin/main` instead.
185
+
186
+ **Merge conflicts on PR:**
187
+ - `git fetch origin && git rebase origin/main`
188
+ - Resolve conflicts, re-run tests, force-push the branch
189
+
190
+ **Another agent claimed the same task:**
191
+ - If Beads: `bd sync` will reveal the conflict — pick a different task
192
+ - Without Beads: check open PRs (`gh pr list`) for overlapping work
193
+ - Move to the next available unblocked task
194
+
195
+ **Dependency install fails after cleanup:**
196
+ - `git clean -fd` may have removed generated files — re-run the full install sequence
197
+ - If persistent, check if another agent's merge changed the dependency file
198
+
199
+ **Tests fail after fetching latest origin:**
200
+ - Determine if failure is from your changes or recently merged work
201
+ - If from merged work: fix or flag before continuing
202
+ - If from your changes: debug and fix
203
+
204
+ ### Process Rules
205
+
206
+ 1. **Verify worktree first** — Never start implementation without confirming you are in a worktree.
207
+ 2. **Branch from remote, not local** — Always use `origin/main` as the branch point.
208
+ 3. **Clean between tasks** — Run cleanup after each task to prevent state leakage.
209
+ 4. **TDD is not optional** — Write failing tests before implementation. No exceptions.
210
+ 5. **Quality gates before PR** — Never create a PR with failing checks.
211
+ 6. **Avoid task conflicts** — Check what other agents are working on before claiming.
212
+ 7. **Follow CLAUDE.md** — It is the authority on project conventions and commands.
213
+
214
+ ---
215
+
216
+ ## After This Step
217
+
218
+ When this step is complete (all tasks done or session ending), tell the user:
219
+
220
+ ---
221
+ **Agent $ARGUMENTS execution session complete.**
222
+
223
+ **Session summary:**
224
+ - Tasks completed: [list task IDs/titles]
225
+ - PRs created: [list PR numbers]
226
+ - Remaining tasks: [count or "none"]
227
+
228
+ **If resuming later:** Run `/scaffold:multi-agent-resume $ARGUMENTS` to pick up where this agent left off.
229
+
230
+ **If all tasks are done:**
231
+ - Review `tasks/lessons.md` and add any patterns learned during implementation.
232
+ - Consider running `/scaffold:version-bump` for a release.
233
+
234
+ **Pipeline reference:** `/scaffold:prompt-pipeline`
235
+
236
+ ---
@@ -0,0 +1,456 @@
1
+ ---
2
+ name: new-enhancement
3
+ description: Add a new feature to an existing project
4
+ summary: "Walks you through adding a feature the right way — updating the PRD, creating new user stories, running an innovation pass, and generating implementation tasks that integrate with your existing plan."
5
+ phase: "build"
6
+ order: 1560
7
+ dependencies: [implementation-playbook]
8
+ outputs: []
9
+ conditional: null
10
+ stateless: true
11
+ category: pipeline
12
+ knowledge-base: [enhancement-workflow, task-claiming-strategy]
13
+ reads: [create-prd, user-stories, coding-standards, tdd, project-structure]
14
+ argument-hint: "<enhancement description>"
15
+ ---
16
+
17
+ ## Purpose
18
+ Guide the addition of a new feature or significant enhancement to an existing
19
+ project. Walks through discovery and impact analysis, updates the PRD and
20
+ user stories, creates implementation tasks, and optionally begins execution.
21
+ This is the full-weight entry point for work that goes beyond a quick fix.
22
+
23
+ ## Inputs
24
+ - $ARGUMENTS (required) — description of the enhancement to add
25
+ - docs/plan.md (required) — current PRD: vision, personas, features, data model
26
+ - docs/user-stories.md (required) — existing stories and epics (note the last story ID used)
27
+ - docs/tech-stack.md (required) — technical constraints and patterns
28
+ - docs/coding-standards.md (required) — code conventions, styling rules, commit format
29
+ - docs/project-structure.md (required) — where new files should go
30
+ - docs/tdd-standards.md (required) — test categories and patterns for task descriptions
31
+ - docs/design-system.md (optional) — design tokens, component patterns (if frontend changes)
32
+ - CLAUDE.md (required) — project conventions, key commands, workflow
33
+ - .beads/ (conditional) — Beads task tracking if configured
34
+ - Relevant source code if needed to understand current implementation
35
+
36
+ ## Expected Outputs
37
+ - Updated `docs/plan.md` with new feature requirements
38
+ - Updated `docs/user-stories.md` with new stories and acceptance criteria
39
+ - Implementation tasks created via Beads or documented in implementation plan
40
+ - Enhancement summary with implementation order
41
+
42
+ ## Quality Criteria
43
+ - (mvp) Impact analysis completed before documentation changes
44
+ - (mvp) PRD feature description is thorough enough for an AI agent to build without follow-up questions
45
+ - (mvp) User stories follow INVEST criteria
46
+ - (mvp) Acceptance criteria are testable Given/When/Then scenarios
47
+ - (mvp) Task dependencies are identified and documented
48
+ - (deep) Innovation pass explores competitive landscape and AI-native possibilities
49
+ - (deep) Cross-reference check verifies consistency between PRD and user stories
50
+ - (deep) Frozen artifact handling preserves version history
51
+ - (deep) Follow-up review recommendations based on enhancement scope
52
+
53
+ ## Methodology Scaling
54
+ - **deep**: Full discovery with innovation pass, competitive analysis,
55
+ detailed impact analysis, comprehensive PRD and story updates, dependency
56
+ graph, implementation order, follow-up review recommendations.
57
+ - **mvp**: Streamlined discovery, basic impact analysis, PRD feature addition,
58
+ minimal user stories with acceptance criteria, task list with dependencies.
59
+ Skip innovation pass, competitive analysis, and follow-up recommendations.
60
+ - **custom:depth(1-5)**: Depth 1-2: basic impact check, PRD update, stories,
61
+ task creation. Depth 3: add impact analysis, dependency management, cross-
62
+ reference check. Depth 4: add innovation pass, frozen artifact handling,
63
+ migration considerations. Depth 5: full workflow with competitive analysis,
64
+ AI-native possibilities, and follow-up review recommendations.
65
+
66
+ ## Mode Detection
67
+ This is a stateless execution command. It updates existing documents (plan.md,
68
+ user-stories.md) but does not create a new standalone output document.
69
+ - Always operates in ENHANCEMENT MODE.
70
+ - PRD and user stories are updated in place (append, do not replace).
71
+
72
+ ## Update Mode Specifics
73
+ - **Detect**: `docs/plan.md` and `docs/user-stories.md` exist with content
74
+ - **Preserve**: All existing features, stories, and epics — append only
75
+ - **Triggers**: User requests a new feature or significant change
76
+ - **Conflict resolution**: New features append to existing sections; never remove existing content
77
+ - **Frozen artifacts**: If freeze markers exist, update the amended date rather than removing the marker
78
+
79
+ ## Instructions
80
+
81
+ I want to add an enhancement to this project. Help me evaluate it, document it properly, and create tasks for implementation.
82
+
83
+ ### The Enhancement
84
+
85
+ $ARGUMENTS
86
+
87
+ ---
88
+
89
+ ### Phase 1: Discovery & Impact Analysis
90
+
91
+ #### Review Existing Context
92
+ Before asking questions, thoroughly review:
93
+ - `docs/plan.md` — Current PRD: vision, personas, features, data model
94
+ - `docs/user-stories.md` — Existing stories and epics (note the last story ID used)
95
+ - `docs/tech-stack.md` — Technical constraints and patterns
96
+ - `docs/coding-standards.md` — Code conventions, styling rules, commit format
97
+ - `docs/project-structure.md` — Where new files should go
98
+ - `docs/tdd-standards.md` — Test categories and patterns for task descriptions
99
+ - `docs/design-system.md` — Design tokens, component patterns, styling approach (if frontend changes)
100
+ - `CLAUDE.md` — Project conventions, Key Commands, workflow
101
+ - Relevant source code if needed to understand current implementation
102
+
103
+ #### Understand the Enhancement
104
+ Use AskUserQuestionTool to batch these questions:
105
+ - What problem does this solve? Who benefits? (Which persona?)
106
+ - What is the user flow? Walk me through it step by step.
107
+ - What triggers this feature? (User action, system event, time-based?)
108
+ - What does success look like? How will we measure it?
109
+
110
+ #### Challenge and Refine
111
+ Push back where appropriate:
112
+ - Is this the simplest solution? Propose alternatives if you see a better way.
113
+ - Should the scope be smaller for a v1 of this enhancement?
114
+ - Are there edge cases or error states not mentioned?
115
+ - Does this conflict with or duplicate existing functionality?
116
+ - What are the riskiest assumptions?
117
+
118
+ #### Innovation Pass
119
+
120
+ Before finalizing the enhancement scope, research and consider:
121
+
122
+ **Competitive Analysis** (use subagents for research):
123
+ - How do similar apps handle this feature?
124
+ - What do they do well? Where do they fall short?
125
+ - Is there a standard UX pattern users will expect?
126
+
127
+ **Enhancement Opportunities**:
128
+ - What would make this feature "delightful" vs just "functional"?
129
+ - Are there adjacent features that would multiply the value? (e.g., if adding notifications, should we add notification preferences too?)
130
+ - What would a user complain about if we ship the minimal version?
131
+
132
+ **AI-Native Possibilities**:
133
+ - Could AI make this smarter? (smart defaults, predictions, natural language)
134
+ - Is there manual work we could automate?
135
+
136
+ **Present innovation ideas with**:
137
+ - **What**: The enhancement to the enhancement
138
+ - **Why**: User benefit
139
+ - **Cost**: Trivial / Moderate / Significant effort
140
+ - **Recommendation**: Include in this enhancement, or backlog for later
141
+
142
+ Use AskUserQuestionTool to present innovation ideas for approval BEFORE proceeding.
143
+
144
+ #### Impact Analysis
145
+ Report what this enhancement affects:
146
+
147
+ 1. **Fit Check**
148
+ - Does this align with the product vision in the PRD?
149
+ - Which persona(s) does this serve?
150
+ - Does it conflict with any existing features or design decisions?
151
+
152
+ 2. **Scope Assessment**
153
+ - Is this a v1 feature or should it be deferred?
154
+ - Complexity estimate: Small (1-2 tasks), Medium (3-5 tasks), Large (6+ tasks)
155
+ - Dependencies on existing features or new infrastructure?
156
+
157
+ 3. **Technical Impact**
158
+ - **Data Model**: New entities? Changes to existing ones? Migrations needed?
159
+ - **UI Changes**: New screens? Modifications to existing ones?
160
+ - **API Changes**: New endpoints? Changes to existing ones?
161
+ - **External Integrations**: New third-party services?
162
+
163
+ 4. **Recommendation**
164
+ - Proceed as described
165
+ - Proceed with modifications (explain)
166
+ - Defer to a future version (explain why)
167
+ - Reconsider (if it conflicts with product vision)
168
+
169
+ **Wait for user approval before proceeding to Phase 2.**
170
+
171
+ ---
172
+
173
+ ### Phase 2: Documentation Updates
174
+
175
+ After approval, update the relevant documentation.
176
+
177
+ #### Update `docs/plan.md`
178
+
179
+ Add the enhancement to the PRD (do NOT remove or significantly alter existing content):
180
+
181
+ 1. **Feature Requirements section** — Add the new feature with:
182
+ - Clear description of what it does
183
+ - Why it exists (tied to user need/persona)
184
+ - Priority: Must-have / Should-have / Future
185
+ - Business rules or logic that are not obvious
186
+ - Concrete examples where behavior might be misinterpreted
187
+ - Mark with: `[Enhancement added YYYY-MM-DD]` for traceability
188
+
189
+ 2. **Data Model Overview** (if applicable):
190
+ - New entities with their key attributes
191
+ - Changes to existing entities
192
+ - New relationships between entities
193
+
194
+ 3. **Core User Flows** (if applicable):
195
+ - New flow, or modifications to existing flows
196
+ - Include happy path AND error/edge cases
197
+ - Be specific: "when X happens, the user sees Y" not "handle errors gracefully"
198
+
199
+ 4. **External Integrations** (if applicable):
200
+ - New third-party services or APIs
201
+ - What data flows in/out
202
+
203
+ 5. **Non-Functional Requirements** (if applicable):
204
+ - Performance implications
205
+ - Security considerations
206
+ - Accessibility needs
207
+
208
+ #### Update `docs/user-stories.md`
209
+
210
+ Add new user stories following the existing document structure and the User Stories prompt format:
211
+
212
+ 1. **Determine Epic Placement**
213
+ - Does this fit under an existing epic?
214
+ - Or does it need a new epic? (Only if it is a significant new area — match existing naming patterns)
215
+
216
+ 2. **Create User Stories** — Each story MUST include ALL of these fields:
217
+ - **ID**: Continue the existing numbering sequence (check the last ID in the file)
218
+ - **Title**: Short, scannable summary
219
+ - **Story**: "As a [persona], I want [action], so that [outcome]"
220
+ - **Acceptance Criteria**: Written as testable Given/When/Then scenarios
221
+ - These become TDD test cases — be explicit
222
+ - Cover happy path AND edge cases
223
+ - Include error states
224
+ - **Scope Boundary**: What this story does NOT include (prevents scope creep)
225
+ - **Data/State Requirements**: What data models, state, or dependencies are implied
226
+ - **UI/UX Notes**: What the user sees, key interactions, error states, loading states
227
+ - **Priority**: MoSCoW (Must/Should/Could/Won't)
228
+ - **Enhancement Reference**: `[Enhancement added YYYY-MM-DD]`
229
+
230
+ 3. **Story Quality Checks** — Before finalizing, verify:
231
+ - Stories follow INVEST criteria (Independent, Negotiable, Valuable, Estimable, Small, Testable)
232
+ - No story is so large it could not be implemented in 1-3 focused Claude Code sessions
233
+ - Acceptance criteria are specific enough that pass/fail is unambiguous
234
+ - Edge cases and error states are covered explicitly
235
+
236
+ #### Cross-Reference Check
237
+
238
+ After updating both documents:
239
+ - Verify every new PRD feature maps to at least one user story
240
+ - Verify terminology is consistent with existing documentation
241
+ - Verify no contradictions were introduced with existing features
242
+ - Check that personas referenced exist in the PRD
243
+
244
+ #### Frozen Artifact Handling
245
+
246
+ If documents have a freeze marker (`<!-- FROZEN: ... -->` or `<!-- scaffold:freeze ... -->`), this is an authorized post-freeze change. Note the amendment date and update the freeze marker (e.g., `<!-- FROZEN: original-date, amended YYYY-MM-DD for enhancement -->`).
247
+
248
+ Freeze marker format: `<!-- scaffold:step-name vN YYYY-MM-DD, amended YYYY-MM-DD -->`
249
+ When updating a frozen document, change the "amended" date to today's date. Do not remove the original version date.
250
+
251
+ ---
252
+
253
+ ### Phase 3: Task Creation
254
+
255
+ Create tasks for implementation.
256
+
257
+ #### Task Creation Guidelines
258
+
259
+ For each user story (or logical grouping of small stories):
260
+
261
+ **If Beads:**
262
+ ```bash
263
+ bd create "US-XXX: <imperative title>" -p <priority>
264
+ # Priority: 0=blocking release, 1=must-have, 2=should-have, 3=nice-to-have
265
+ ```
266
+
267
+ **Without Beads:** Document tasks as a structured list in `docs/implementation-plan.md` with title, priority, dependencies, and description.
268
+
269
+ #### Task Titles and Descriptions
270
+
271
+ - **Title format**: `US-XXX: <imperative action>` (e.g., "US-048: Add streak notification settings")
272
+ - **Description should include**:
273
+ - Reference to user story: `Implements US-XXX`
274
+ - Key acceptance criteria summary
275
+ - Technical notes or gotchas from analysis
276
+ - Migration notes if data model changes
277
+
278
+ #### Task Sizing
279
+
280
+ - **One task per story** for small/medium stories
281
+ - **Multiple tasks per story** for large stories — break down by:
282
+ - Data model/migrations first
283
+ - Backend API second
284
+ - Frontend/UI third
285
+ - Edge cases and polish last
286
+
287
+ #### Dependency Management
288
+
289
+ **If Beads:**
290
+ ```bash
291
+ # Set up dependencies (child is blocked by parent)
292
+ bd dep add <child-task-id> <parent-task-id>
293
+
294
+ # Verify the dependency graph
295
+ bd dep tree <task-id>
296
+ ```
297
+
298
+ **Without Beads:** Note dependencies inline (e.g., "depends on: US-045 migration task").
299
+
300
+ Common dependency patterns:
301
+ - Migrations before features that use new models
302
+ - Backend before frontend
303
+ - Core functionality before edge cases
304
+ - Shared components before features that use them
305
+
306
+ #### Migration Considerations
307
+
308
+ If the enhancement requires data model changes:
309
+ - Create a dedicated migration task as the first dependency
310
+ - Note if existing data needs transformation
311
+ - Consider: can this be deployed incrementally or does it require coordination?
312
+ - Document rollback strategy if the migration is risky
313
+
314
+ ---
315
+
316
+ ### Phase 4: Summary & Approval
317
+
318
+ After completing all updates, provide a clear summary:
319
+
320
+ #### 1. Enhancement Summary
321
+ One paragraph: what this adds and why it matters.
322
+
323
+ #### 2. Documentation Changes
324
+ - **docs/plan.md**: What sections were added/modified
325
+ - **docs/user-stories.md**: List new story IDs with titles
326
+
327
+ #### 3. Tasks Created
328
+ ```
329
+ | Task ID | Title | Priority | Depends On |
330
+ |---------|-------|----------|------------|
331
+ | xxx-abc | US-048: Add notification settings | 1 | - |
332
+ | xxx-def | US-049: Send streak reminders | 1 | xxx-abc |
333
+ ```
334
+
335
+ #### 4. Implementation Order
336
+ Recommended sequence based on dependencies:
337
+ 1. First: [task(s)]
338
+ 2. Then: [task(s)] (can be parallelized)
339
+ 3. Finally: [task(s)]
340
+
341
+ #### 5. Ready to Implement
342
+ ```bash
343
+ bd ready # Show what's available to work on now
344
+ ```
345
+
346
+ #### 6. Open Questions (if any)
347
+ - Decisions deferred to implementation time
348
+ - Areas that may need refinement during development
349
+ - Risks to monitor
350
+
351
+ #### 7. Consider Follow-Up Reviews
352
+
353
+ Depending on the enhancement scope, you may want to re-run these prompts:
354
+ - **Implementation Plan Review**: If you created 5+ tasks, run it to verify sizing, dependencies, and coverage
355
+ - **Platform Parity Review**: If the enhancement has platform-specific behavior (web vs. mobile differences), re-run to check platform coverage
356
+ - **Workflow Audit**: Only if the enhancement changed project infrastructure or conventions (rare)
357
+
358
+ ---
359
+
360
+ ### Process Rules
361
+
362
+ - **Do not skip discovery** — Even if the enhancement seems simple, do the impact analysis
363
+ - **Use subagents for research** — Competitive analysis and UX best practices can run in parallel with other work
364
+ - **Batch questions** — Use AskUserQuestionTool to group related questions — do not ask one at a time
365
+ - **Present innovations before documenting** — Get approval on scope expansions before writing them up
366
+ - **Challenge assumptions** — If something seems overengineered or could be simpler, say so
367
+ - **Maintain consistency** — Match terminology, format, and style of existing docs exactly
368
+ - **Add traceability** — Mark enhancements with dates so we know when features were added
369
+ - **Right-size the scope** — Push back if the enhancement is too large — suggest phasing
370
+ - **Check for conflicts** — If Beads, review `bd list` for in-progress work that might be affected
371
+
372
+ ---
373
+
374
+ ### When to Use This Prompt
375
+
376
+ - Adding a new feature to an existing product
377
+ - Expanding an existing feature with new capabilities
378
+ - Adding a new user flow or journey
379
+ - Any change that requires updating the PRD or user stories
380
+
381
+ ### When NOT to Use This Prompt
382
+
383
+ - **Bug fixes**: Use `/scaffold:quick-task` instead — it creates focused, well-defined tasks
384
+ - **Refactoring**: Use `/scaffold:quick-task` instead — no doc updates needed, just a task with clear acceptance criteria
385
+ - **Performance improvements**: Use `/scaffold:quick-task` instead — targeted fixes do not need full discovery
386
+ - **Initial product creation**: Use the PRD prompt instead
387
+ - **Major pivots**: If this changes the core product direction, revisit the full PRD first
388
+ - **Exploratory ideas**: If you are not sure you want this, discuss before documenting
389
+
390
+ ### Optional: Skip Innovation Pass
391
+
392
+ If you just want to document a well-defined enhancement without competitive research and innovation brainstorming, add this to your request:
393
+
394
+ > Skip the innovation pass — just document and create tasks for what I described.
395
+
396
+ This is appropriate when:
397
+ - The enhancement is already well-researched
398
+ - You are porting a feature from a competitor you have already analyzed
399
+ - Time pressure requires moving fast
400
+ - The enhancement is truly trivial (but consider: does it even need this prompt?)
401
+
402
+ ---
403
+
404
+ ### Quality Standards
405
+
406
+ #### From the PRD prompt — apply these to enhancement documentation:
407
+ - Every feature must be described thoroughly enough that an AI agent can build it without asking follow-up questions
408
+ - Avoid ambiguity: specify what errors can occur and what the user sees for each
409
+ - Include concrete examples where behavior might be misinterpreted
410
+ - Use consistent terminology throughout
411
+ - Non-functional requirements are specific and measurable (not "fast" — how fast?)
412
+
413
+ #### From the User Stories prompt — apply these to new stories:
414
+ - Stories follow INVEST criteria (Independent, Negotiable, Valuable, Estimable, Small, Testable)
415
+ - Acceptance criteria are specific enough that pass/fail is unambiguous
416
+ - No story is so large it could not be implemented in 1-3 focused sessions
417
+ - Every story has scope boundaries to prevent creep during implementation
418
+
419
+ #### From the Gap Analysis prompts — verify before finishing:
420
+ - Every new PRD feature maps to at least one user story
421
+ - Happy paths AND error/edge cases are covered in acceptance criteria
422
+ - No vague language that could be misinterpreted ("intuitive," "user-friendly," "seamless," "handles gracefully")
423
+ - Dependencies between stories are identified (they become Beads dependencies)
424
+ - Priority assignments make sense relative to existing features
425
+
426
+ ### Phase 5: Version Release
427
+
428
+ After all changes are applied and verified:
429
+
430
+ 1. Determine release type based on change scope:
431
+ - **patch**: Bug fix or minor documentation update
432
+ - **minor**: New feature, new user story, or significant enhancement
433
+ - **major**: Breaking change to existing behavior or architecture
434
+ 2. Run `/scaffold:version-bump` to increment the version
435
+ 3. Create a release with changelog entry documenting the enhancement
436
+
437
+ ---
438
+
439
+ ## After This Step
440
+
441
+ When this step is complete, tell the user:
442
+
443
+ ---
444
+ **Enhancement documented** — PRD updated, user stories created, tasks ready.
445
+
446
+ **Next (if applicable):**
447
+ - If `docs/implementation-playbook.md` exists: Run `/scaffold:implementation-playbook` — Update wave assignments and add per-task context blocks for new tasks.
448
+ - If you created **5+ tasks**: Run `/scaffold:implementation-plan-review` — Review task quality, coverage, and dependencies.
449
+ - If the enhancement has **platform-specific behavior**: Run `/scaffold:platform-parity-review` — Check platform coverage.
450
+ - If user stories were added or changed: Run `/scaffold:story-tests` — Regenerate test skeletons for new user stories.
451
+ - If scope changed materially: Run `/scaffold:create-evals` — Update eval checks for new scope.
452
+ - Otherwise: Run `/scaffold:single-agent-start` or `/scaffold:single-agent-resume` to begin implementation (or `/scaffold:multi-agent-start <agent-name>` / `/scaffold:multi-agent-resume <agent-name>` for worktree agents).
453
+
454
+ **Pipeline reference:** `/scaffold:prompt-pipeline`
455
+
456
+ ---