@zigrivers/scaffold 2.1.2 → 2.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (391) hide show
  1. package/README.md +505 -119
  2. package/dist/cli/commands/build.d.ts.map +1 -1
  3. package/dist/cli/commands/build.js +94 -14
  4. package/dist/cli/commands/build.js.map +1 -1
  5. package/dist/cli/commands/build.test.js +30 -5
  6. package/dist/cli/commands/build.test.js.map +1 -1
  7. package/dist/cli/commands/check.d.ts +12 -0
  8. package/dist/cli/commands/check.d.ts.map +1 -0
  9. package/dist/cli/commands/check.js +311 -0
  10. package/dist/cli/commands/check.js.map +1 -0
  11. package/dist/cli/commands/check.test.d.ts +2 -0
  12. package/dist/cli/commands/check.test.d.ts.map +1 -0
  13. package/dist/cli/commands/check.test.js +412 -0
  14. package/dist/cli/commands/check.test.js.map +1 -0
  15. package/dist/cli/commands/complete.d.ts +12 -0
  16. package/dist/cli/commands/complete.d.ts.map +1 -0
  17. package/dist/cli/commands/complete.js +101 -0
  18. package/dist/cli/commands/complete.js.map +1 -0
  19. package/dist/cli/commands/complete.test.d.ts +2 -0
  20. package/dist/cli/commands/complete.test.d.ts.map +1 -0
  21. package/dist/cli/commands/complete.test.js +133 -0
  22. package/dist/cli/commands/complete.test.js.map +1 -0
  23. package/dist/cli/commands/dashboard.d.ts.map +1 -1
  24. package/dist/cli/commands/dashboard.js +12 -8
  25. package/dist/cli/commands/dashboard.js.map +1 -1
  26. package/dist/cli/commands/info.d.ts.map +1 -1
  27. package/dist/cli/commands/info.js +4 -0
  28. package/dist/cli/commands/info.js.map +1 -1
  29. package/dist/cli/commands/knowledge.d.ts.map +1 -1
  30. package/dist/cli/commands/knowledge.js +6 -2
  31. package/dist/cli/commands/knowledge.js.map +1 -1
  32. package/dist/cli/commands/knowledge.test.js +16 -11
  33. package/dist/cli/commands/knowledge.test.js.map +1 -1
  34. package/dist/cli/commands/next.d.ts.map +1 -1
  35. package/dist/cli/commands/next.js +41 -13
  36. package/dist/cli/commands/next.js.map +1 -1
  37. package/dist/cli/commands/next.test.js +3 -0
  38. package/dist/cli/commands/next.test.js.map +1 -1
  39. package/dist/cli/commands/reset.d.ts +1 -0
  40. package/dist/cli/commands/reset.d.ts.map +1 -1
  41. package/dist/cli/commands/reset.js +179 -67
  42. package/dist/cli/commands/reset.js.map +1 -1
  43. package/dist/cli/commands/reset.test.js +360 -0
  44. package/dist/cli/commands/reset.test.js.map +1 -1
  45. package/dist/cli/commands/rework.d.ts +20 -0
  46. package/dist/cli/commands/rework.d.ts.map +1 -0
  47. package/dist/cli/commands/rework.js +332 -0
  48. package/dist/cli/commands/rework.js.map +1 -0
  49. package/dist/cli/commands/rework.test.d.ts +2 -0
  50. package/dist/cli/commands/rework.test.d.ts.map +1 -0
  51. package/dist/cli/commands/rework.test.js +297 -0
  52. package/dist/cli/commands/rework.test.js.map +1 -0
  53. package/dist/cli/commands/run.d.ts.map +1 -1
  54. package/dist/cli/commands/run.js +59 -31
  55. package/dist/cli/commands/run.js.map +1 -1
  56. package/dist/cli/commands/run.test.js +288 -6
  57. package/dist/cli/commands/run.test.js.map +1 -1
  58. package/dist/cli/commands/skill.d.ts +12 -0
  59. package/dist/cli/commands/skill.d.ts.map +1 -0
  60. package/dist/cli/commands/skill.js +123 -0
  61. package/dist/cli/commands/skill.js.map +1 -0
  62. package/dist/cli/commands/skill.test.d.ts +2 -0
  63. package/dist/cli/commands/skill.test.d.ts.map +1 -0
  64. package/dist/cli/commands/skill.test.js +297 -0
  65. package/dist/cli/commands/skill.test.js.map +1 -0
  66. package/dist/cli/commands/skip.d.ts +1 -1
  67. package/dist/cli/commands/skip.d.ts.map +1 -1
  68. package/dist/cli/commands/skip.js +123 -57
  69. package/dist/cli/commands/skip.js.map +1 -1
  70. package/dist/cli/commands/skip.test.js +91 -0
  71. package/dist/cli/commands/skip.test.js.map +1 -1
  72. package/dist/cli/commands/status.d.ts +1 -0
  73. package/dist/cli/commands/status.d.ts.map +1 -1
  74. package/dist/cli/commands/status.js +57 -10
  75. package/dist/cli/commands/status.js.map +1 -1
  76. package/dist/cli/commands/status.test.js +81 -0
  77. package/dist/cli/commands/status.test.js.map +1 -1
  78. package/dist/cli/commands/update.test.js +252 -0
  79. package/dist/cli/commands/update.test.js.map +1 -1
  80. package/dist/cli/commands/version.test.js +171 -1
  81. package/dist/cli/commands/version.test.js.map +1 -1
  82. package/dist/cli/index.d.ts.map +1 -1
  83. package/dist/cli/index.js +8 -0
  84. package/dist/cli/index.js.map +1 -1
  85. package/dist/core/adapters/adapter.d.ts +14 -0
  86. package/dist/core/adapters/adapter.d.ts.map +1 -1
  87. package/dist/core/adapters/adapter.js.map +1 -1
  88. package/dist/core/adapters/adapter.test.js +10 -0
  89. package/dist/core/adapters/adapter.test.js.map +1 -1
  90. package/dist/core/adapters/claude-code.d.ts.map +1 -1
  91. package/dist/core/adapters/claude-code.js +47 -10
  92. package/dist/core/adapters/claude-code.js.map +1 -1
  93. package/dist/core/adapters/claude-code.test.js +41 -20
  94. package/dist/core/adapters/claude-code.test.js.map +1 -1
  95. package/dist/core/adapters/codex.d.ts.map +1 -1
  96. package/dist/core/adapters/codex.js +5 -1
  97. package/dist/core/adapters/codex.js.map +1 -1
  98. package/dist/core/adapters/codex.test.js +5 -0
  99. package/dist/core/adapters/codex.test.js.map +1 -1
  100. package/dist/core/adapters/universal.d.ts.map +1 -1
  101. package/dist/core/adapters/universal.js +0 -1
  102. package/dist/core/adapters/universal.js.map +1 -1
  103. package/dist/core/adapters/universal.test.js +5 -0
  104. package/dist/core/adapters/universal.test.js.map +1 -1
  105. package/dist/core/assembly/context-gatherer.d.ts.map +1 -1
  106. package/dist/core/assembly/context-gatherer.js +5 -2
  107. package/dist/core/assembly/context-gatherer.js.map +1 -1
  108. package/dist/core/assembly/engine.d.ts.map +1 -1
  109. package/dist/core/assembly/engine.js +10 -2
  110. package/dist/core/assembly/engine.js.map +1 -1
  111. package/dist/core/assembly/engine.test.js +19 -0
  112. package/dist/core/assembly/engine.test.js.map +1 -1
  113. package/dist/core/assembly/knowledge-loader.d.ts +25 -0
  114. package/dist/core/assembly/knowledge-loader.d.ts.map +1 -1
  115. package/dist/core/assembly/knowledge-loader.js +75 -2
  116. package/dist/core/assembly/knowledge-loader.js.map +1 -1
  117. package/dist/core/assembly/knowledge-loader.test.js +388 -1
  118. package/dist/core/assembly/knowledge-loader.test.js.map +1 -1
  119. package/dist/core/assembly/meta-prompt-loader.d.ts +6 -0
  120. package/dist/core/assembly/meta-prompt-loader.d.ts.map +1 -1
  121. package/dist/core/assembly/meta-prompt-loader.js +41 -25
  122. package/dist/core/assembly/meta-prompt-loader.js.map +1 -1
  123. package/dist/core/assembly/preset-loader.d.ts +10 -0
  124. package/dist/core/assembly/preset-loader.d.ts.map +1 -1
  125. package/dist/core/assembly/preset-loader.js +26 -1
  126. package/dist/core/assembly/preset-loader.js.map +1 -1
  127. package/dist/core/assembly/preset-loader.test.js +65 -1
  128. package/dist/core/assembly/preset-loader.test.js.map +1 -1
  129. package/dist/core/assembly/update-mode.d.ts.map +1 -1
  130. package/dist/core/assembly/update-mode.js +10 -4
  131. package/dist/core/assembly/update-mode.js.map +1 -1
  132. package/dist/core/assembly/update-mode.test.js +47 -0
  133. package/dist/core/assembly/update-mode.test.js.map +1 -1
  134. package/dist/core/dependency/dependency.d.ts.map +1 -1
  135. package/dist/core/dependency/dependency.js +3 -2
  136. package/dist/core/dependency/dependency.js.map +1 -1
  137. package/dist/core/dependency/dependency.test.js +2 -0
  138. package/dist/core/dependency/dependency.test.js.map +1 -1
  139. package/dist/core/dependency/eligibility.js +3 -3
  140. package/dist/core/dependency/eligibility.js.map +1 -1
  141. package/dist/core/dependency/eligibility.test.js +2 -0
  142. package/dist/core/dependency/eligibility.test.js.map +1 -1
  143. package/dist/core/dependency/graph.d.ts.map +1 -1
  144. package/dist/core/dependency/graph.js +4 -0
  145. package/dist/core/dependency/graph.js.map +1 -1
  146. package/dist/core/dependency/graph.test.d.ts +2 -0
  147. package/dist/core/dependency/graph.test.d.ts.map +1 -0
  148. package/dist/core/dependency/graph.test.js +262 -0
  149. package/dist/core/dependency/graph.test.js.map +1 -0
  150. package/dist/core/rework/phase-selector.d.ts +24 -0
  151. package/dist/core/rework/phase-selector.d.ts.map +1 -0
  152. package/dist/core/rework/phase-selector.js +98 -0
  153. package/dist/core/rework/phase-selector.js.map +1 -0
  154. package/dist/core/rework/phase-selector.test.d.ts +2 -0
  155. package/dist/core/rework/phase-selector.test.d.ts.map +1 -0
  156. package/dist/core/rework/phase-selector.test.js +138 -0
  157. package/dist/core/rework/phase-selector.test.js.map +1 -0
  158. package/dist/dashboard/generator.d.ts +48 -17
  159. package/dist/dashboard/generator.d.ts.map +1 -1
  160. package/dist/dashboard/generator.js +75 -5
  161. package/dist/dashboard/generator.js.map +1 -1
  162. package/dist/dashboard/generator.test.js +213 -5
  163. package/dist/dashboard/generator.test.js.map +1 -1
  164. package/dist/dashboard/template.d.ts +1 -1
  165. package/dist/dashboard/template.d.ts.map +1 -1
  166. package/dist/dashboard/template.js +755 -114
  167. package/dist/dashboard/template.js.map +1 -1
  168. package/dist/e2e/knowledge.test.js +4 -3
  169. package/dist/e2e/knowledge.test.js.map +1 -1
  170. package/dist/e2e/pipeline.test.js +2 -0
  171. package/dist/e2e/pipeline.test.js.map +1 -1
  172. package/dist/e2e/rework.test.d.ts +6 -0
  173. package/dist/e2e/rework.test.d.ts.map +1 -0
  174. package/dist/e2e/rework.test.js +226 -0
  175. package/dist/e2e/rework.test.js.map +1 -0
  176. package/dist/index.js +0 -0
  177. package/dist/project/adopt.test.js +2 -0
  178. package/dist/project/adopt.test.js.map +1 -1
  179. package/dist/project/claude-md.js +2 -2
  180. package/dist/project/claude-md.js.map +1 -1
  181. package/dist/project/claude-md.test.js +4 -4
  182. package/dist/project/claude-md.test.js.map +1 -1
  183. package/dist/project/detector.d.ts.map +1 -1
  184. package/dist/project/detector.js +4 -1
  185. package/dist/project/detector.js.map +1 -1
  186. package/dist/project/frontmatter.d.ts.map +1 -1
  187. package/dist/project/frontmatter.js +54 -15
  188. package/dist/project/frontmatter.js.map +1 -1
  189. package/dist/project/frontmatter.test.js +2 -2
  190. package/dist/project/frontmatter.test.js.map +1 -1
  191. package/dist/state/rework-manager.d.ts +16 -0
  192. package/dist/state/rework-manager.d.ts.map +1 -0
  193. package/dist/state/rework-manager.js +126 -0
  194. package/dist/state/rework-manager.js.map +1 -0
  195. package/dist/state/rework-manager.test.d.ts +2 -0
  196. package/dist/state/rework-manager.test.d.ts.map +1 -0
  197. package/dist/state/rework-manager.test.js +191 -0
  198. package/dist/state/rework-manager.test.js.map +1 -0
  199. package/dist/state/state-manager.d.ts +13 -0
  200. package/dist/state/state-manager.d.ts.map +1 -1
  201. package/dist/state/state-manager.js +39 -2
  202. package/dist/state/state-manager.js.map +1 -1
  203. package/dist/state/state-manager.test.js +74 -1
  204. package/dist/state/state-manager.test.js.map +1 -1
  205. package/dist/state/state-migration.d.ts +23 -0
  206. package/dist/state/state-migration.d.ts.map +1 -0
  207. package/dist/state/state-migration.js +144 -0
  208. package/dist/state/state-migration.js.map +1 -0
  209. package/dist/state/state-migration.test.d.ts +2 -0
  210. package/dist/state/state-migration.test.d.ts.map +1 -0
  211. package/dist/state/state-migration.test.js +451 -0
  212. package/dist/state/state-migration.test.js.map +1 -0
  213. package/dist/types/assembly.d.ts +2 -0
  214. package/dist/types/assembly.d.ts.map +1 -1
  215. package/dist/types/dependency.d.ts +2 -2
  216. package/dist/types/dependency.d.ts.map +1 -1
  217. package/dist/types/frontmatter.d.ts +100 -7
  218. package/dist/types/frontmatter.d.ts.map +1 -1
  219. package/dist/types/frontmatter.js +89 -1
  220. package/dist/types/frontmatter.js.map +1 -1
  221. package/dist/types/index.d.ts +1 -0
  222. package/dist/types/index.d.ts.map +1 -1
  223. package/dist/types/index.js +1 -0
  224. package/dist/types/index.js.map +1 -1
  225. package/dist/types/lock.d.ts +1 -1
  226. package/dist/types/lock.d.ts.map +1 -1
  227. package/dist/types/rework.d.ts +36 -0
  228. package/dist/types/rework.d.ts.map +1 -0
  229. package/dist/types/rework.js +2 -0
  230. package/dist/types/rework.js.map +1 -0
  231. package/dist/utils/errors.d.ts +1 -0
  232. package/dist/utils/errors.d.ts.map +1 -1
  233. package/dist/utils/errors.js +8 -0
  234. package/dist/utils/errors.js.map +1 -1
  235. package/dist/utils/fs.d.ts +6 -0
  236. package/dist/utils/fs.d.ts.map +1 -1
  237. package/dist/utils/fs.js +13 -0
  238. package/dist/utils/fs.js.map +1 -1
  239. package/dist/validation/config-validator.test.d.ts +2 -0
  240. package/dist/validation/config-validator.test.d.ts.map +1 -0
  241. package/dist/validation/config-validator.test.js +210 -0
  242. package/dist/validation/config-validator.test.js.map +1 -0
  243. package/dist/validation/dependency-validator.test.d.ts +2 -0
  244. package/dist/validation/dependency-validator.test.d.ts.map +1 -0
  245. package/dist/validation/dependency-validator.test.js +215 -0
  246. package/dist/validation/dependency-validator.test.js.map +1 -0
  247. package/dist/validation/frontmatter-validator.test.d.ts +2 -0
  248. package/dist/validation/frontmatter-validator.test.d.ts.map +1 -0
  249. package/dist/validation/frontmatter-validator.test.js +371 -0
  250. package/dist/validation/frontmatter-validator.test.js.map +1 -0
  251. package/dist/validation/state-validator.test.d.ts +2 -0
  252. package/dist/validation/state-validator.test.d.ts.map +1 -0
  253. package/dist/validation/state-validator.test.js +325 -0
  254. package/dist/validation/state-validator.test.js.map +1 -0
  255. package/dist/wizard/suggestion.test.d.ts +2 -0
  256. package/dist/wizard/suggestion.test.d.ts.map +1 -0
  257. package/dist/wizard/suggestion.test.js +115 -0
  258. package/dist/wizard/suggestion.test.js.map +1 -0
  259. package/dist/wizard/wizard.d.ts.map +1 -1
  260. package/dist/wizard/wizard.js +34 -1
  261. package/dist/wizard/wizard.js.map +1 -1
  262. package/knowledge/core/adr-craft.md +57 -0
  263. package/knowledge/core/ai-memory-management.md +246 -0
  264. package/knowledge/core/api-design.md +8 -0
  265. package/knowledge/core/automated-review-tooling.md +203 -0
  266. package/knowledge/core/claude-md-patterns.md +254 -0
  267. package/knowledge/core/coding-conventions.md +246 -0
  268. package/knowledge/core/database-design.md +8 -0
  269. package/knowledge/core/design-system-tokens.md +469 -0
  270. package/knowledge/core/dev-environment.md +223 -0
  271. package/knowledge/core/domain-modeling.md +8 -0
  272. package/knowledge/core/eval-craft.md +1008 -0
  273. package/knowledge/core/git-workflow-patterns.md +200 -0
  274. package/knowledge/core/multi-model-review-dispatch.md +250 -0
  275. package/knowledge/core/operations-runbook.md +40 -225
  276. package/knowledge/core/project-structure-patterns.md +231 -0
  277. package/knowledge/core/review-step-template.md +247 -0
  278. package/knowledge/core/{security-review.md → security-best-practices.md} +9 -1
  279. package/knowledge/core/system-architecture.md +5 -1
  280. package/knowledge/core/task-decomposition.md +174 -36
  281. package/knowledge/core/task-tracking.md +225 -0
  282. package/knowledge/core/tech-stack-selection.md +214 -0
  283. package/knowledge/core/testing-strategy.md +63 -70
  284. package/knowledge/core/user-stories.md +69 -60
  285. package/knowledge/core/user-story-innovation.md +70 -0
  286. package/knowledge/core/ux-specification.md +18 -148
  287. package/knowledge/execution/enhancement-workflow.md +201 -0
  288. package/knowledge/execution/task-claiming-strategy.md +130 -0
  289. package/knowledge/execution/tdd-execution-loop.md +172 -0
  290. package/knowledge/execution/worktree-management.md +205 -0
  291. package/knowledge/finalization/apply-fixes-and-freeze.md +177 -14
  292. package/knowledge/finalization/developer-onboarding.md +4 -0
  293. package/knowledge/finalization/implementation-playbook.md +83 -5
  294. package/knowledge/product/gap-analysis.md +5 -1
  295. package/knowledge/product/prd-craft.md +55 -34
  296. package/knowledge/product/prd-innovation.md +12 -0
  297. package/knowledge/product/vision-craft.md +213 -0
  298. package/knowledge/review/review-adr.md +44 -0
  299. package/knowledge/review/{review-api-contracts.md → review-api-design.md} +47 -1
  300. package/knowledge/review/{review-database-schema.md → review-database-design.md} +40 -1
  301. package/knowledge/review/review-domain-modeling.md +38 -1
  302. package/knowledge/review/review-implementation-tasks.md +108 -1
  303. package/knowledge/review/review-methodology.md +11 -0
  304. package/knowledge/review/review-operations.md +67 -0
  305. package/knowledge/review/review-prd.md +46 -0
  306. package/knowledge/review/review-security.md +65 -0
  307. package/knowledge/review/review-system-architecture.md +32 -2
  308. package/knowledge/review/review-testing-strategy.md +62 -0
  309. package/knowledge/review/review-user-stories.md +65 -0
  310. package/knowledge/review/{review-ux-spec.md → review-ux-specification.md} +50 -2
  311. package/knowledge/review/review-vision.md +255 -0
  312. package/knowledge/tools/release-management.md +222 -0
  313. package/knowledge/tools/session-analysis.md +215 -0
  314. package/knowledge/tools/version-strategy.md +200 -0
  315. package/knowledge/validation/critical-path-analysis.md +1 -1
  316. package/knowledge/validation/cross-phase-consistency.md +12 -0
  317. package/knowledge/validation/decision-completeness.md +13 -1
  318. package/knowledge/validation/dependency-validation.md +12 -0
  319. package/knowledge/validation/scope-management.md +12 -0
  320. package/knowledge/validation/traceability.md +12 -0
  321. package/methodology/README.md +37 -0
  322. package/methodology/custom-defaults.yml +44 -4
  323. package/methodology/deep.yml +43 -3
  324. package/methodology/mvp.yml +43 -3
  325. package/package.json +4 -3
  326. package/pipeline/architecture/review-architecture.md +36 -13
  327. package/pipeline/architecture/system-architecture.md +24 -9
  328. package/pipeline/build/multi-agent-resume.md +245 -0
  329. package/pipeline/build/multi-agent-start.md +236 -0
  330. package/pipeline/build/new-enhancement.md +456 -0
  331. package/pipeline/build/quick-task.md +381 -0
  332. package/pipeline/build/single-agent-resume.md +210 -0
  333. package/pipeline/build/single-agent-start.md +207 -0
  334. package/pipeline/consolidation/claude-md-optimization.md +76 -0
  335. package/pipeline/consolidation/workflow-audit.md +77 -0
  336. package/pipeline/decisions/adrs.md +21 -7
  337. package/pipeline/decisions/review-adrs.md +32 -11
  338. package/pipeline/environment/ai-memory-setup.md +76 -0
  339. package/pipeline/environment/automated-pr-review.md +76 -0
  340. package/pipeline/environment/design-system.md +75 -0
  341. package/pipeline/environment/dev-env-setup.md +68 -0
  342. package/pipeline/environment/git-workflow.md +73 -0
  343. package/pipeline/finalization/apply-fixes-and-freeze.md +17 -6
  344. package/pipeline/finalization/developer-onboarding-guide.md +23 -9
  345. package/pipeline/finalization/implementation-playbook.md +43 -14
  346. package/pipeline/foundation/beads.md +71 -0
  347. package/pipeline/foundation/coding-standards.md +71 -0
  348. package/pipeline/foundation/project-structure.md +73 -0
  349. package/pipeline/foundation/tdd.md +64 -0
  350. package/pipeline/foundation/tech-stack.md +74 -0
  351. package/pipeline/integration/add-e2e-testing.md +80 -0
  352. package/pipeline/modeling/domain-modeling.md +23 -8
  353. package/pipeline/modeling/review-domain-modeling.md +35 -11
  354. package/pipeline/parity/platform-parity-review.md +90 -0
  355. package/pipeline/planning/implementation-plan-review.md +67 -0
  356. package/pipeline/planning/implementation-plan.md +110 -0
  357. package/pipeline/pre/create-prd.md +34 -10
  358. package/pipeline/pre/innovate-prd.md +46 -15
  359. package/pipeline/pre/innovate-user-stories.md +47 -14
  360. package/pipeline/pre/review-prd.md +29 -8
  361. package/pipeline/pre/review-user-stories.md +34 -8
  362. package/pipeline/pre/user-stories.md +23 -8
  363. package/pipeline/quality/create-evals.md +106 -0
  364. package/pipeline/quality/operations.md +46 -17
  365. package/pipeline/quality/review-operations.md +32 -11
  366. package/pipeline/quality/review-security.md +34 -12
  367. package/pipeline/quality/review-testing.md +37 -14
  368. package/pipeline/quality/security.md +36 -10
  369. package/pipeline/quality/story-tests.md +75 -0
  370. package/pipeline/specification/api-contracts.md +28 -8
  371. package/pipeline/specification/database-schema.md +29 -8
  372. package/pipeline/specification/review-api.md +32 -11
  373. package/pipeline/specification/review-database.md +32 -11
  374. package/pipeline/specification/review-ux.md +34 -12
  375. package/pipeline/specification/ux-spec.md +35 -13
  376. package/pipeline/validation/critical-path-walkthrough.md +45 -11
  377. package/pipeline/validation/cross-phase-consistency.md +45 -11
  378. package/pipeline/validation/decision-completeness.md +45 -11
  379. package/pipeline/validation/dependency-graph-validation.md +46 -11
  380. package/pipeline/validation/implementability-dry-run.md +46 -11
  381. package/pipeline/validation/scope-creep-check.md +46 -11
  382. package/pipeline/validation/traceability-matrix.md +51 -11
  383. package/pipeline/vision/create-vision.md +267 -0
  384. package/pipeline/vision/innovate-vision.md +157 -0
  385. package/pipeline/vision/review-vision.md +149 -0
  386. package/skills/multi-model-dispatch/SKILL.md +326 -0
  387. package/skills/scaffold-pipeline/SKILL.md +210 -0
  388. package/skills/scaffold-runner/SKILL.md +619 -0
  389. package/pipeline/planning/implementation-tasks.md +0 -57
  390. package/pipeline/planning/review-tasks.md +0 -38
  391. package/pipeline/quality/testing-strategy.md +0 -42
@@ -4,9 +4,13 @@ description: Test pyramid, testing patterns, coverage strategy, and quality gate
4
4
  topics: [testing, tdd, test-pyramid, quality-gates, coverage, test-data, mocking]
5
5
  ---
6
6
 
7
- ## Test Pyramid
7
+ # Testing Strategy
8
8
 
9
- The test pyramid organizes tests by scope, speed, and confidence:
9
+ Expert knowledge for test pyramid design, testing patterns, coverage strategy, and quality gates across all test levels.
10
+
11
+ ## Summary
12
+
13
+ ### Test Pyramid
10
14
 
11
15
  ```
12
16
  / E2E Tests \ Few, slow, high confidence
@@ -15,7 +19,28 @@ The test pyramid organizes tests by scope, speed, and confidence:
15
19
  ________________________
16
20
  ```
17
21
 
18
- ### Unit Tests
22
+ ### Test Level Definitions
23
+
24
+ - **Unit Tests** — Single function/method/class in isolation. No I/O, deterministic, millisecond execution. Test pure business logic, state machines, edge cases, error handling.
25
+ - **Integration Tests** — Interaction between 2+ components with real infrastructure. Seconds to execute. Test API handlers, DB queries, auth middleware, external service integrations.
26
+ - **E2E Tests** — Complete user flows with real browser/device. Seconds to minutes. Test critical user journeys only (5-15 tests for most apps).
27
+
28
+ ### Basic Patterns
29
+
30
+ - **Arrange/Act/Assert (AAA)** — Set up conditions, perform action, verify result.
31
+ - **Given/When/Then (BDD)** — Behavior-oriented variant for integration and E2E tests.
32
+ - **Test Doubles** — Stubs (return predetermined data), Mocks (verify interactions), Spies (wrap real implementations), Fakes (simplified working implementations).
33
+
34
+ ### What NOT to Mock
35
+
36
+ - The thing you're testing
37
+ - Value objects and simple data transformations
38
+ - The database in integration tests
39
+ - Too many things (if 10 mocks needed, refactor the code)
40
+
41
+ ## Deep Guidance
42
+
43
+ ### Unit Tests — Extended
19
44
 
20
45
  **What they test:** A single function, method, or class in isolation from all external dependencies (database, network, file system, other modules).
21
46
 
@@ -62,7 +87,7 @@ describe('calculateOrderTotal', () => {
62
87
  });
63
88
  ```
64
89
 
65
- ### Integration Tests
90
+ ### Integration Tests — Extended
66
91
 
67
92
  **What they test:** The interaction between two or more components, including real infrastructure (database, API calls between layers, message queues).
68
93
 
@@ -113,7 +138,7 @@ describe('POST /api/v1/users', () => {
113
138
  });
114
139
  ```
115
140
 
116
- ### End-to-End (E2E) Tests
141
+ ### End-to-End (E2E) Tests — Extended
117
142
 
118
143
  **What they test:** Complete user flows from the user's perspective, using a real browser (for web apps) or real device/emulator (for mobile apps).
119
144
 
@@ -139,60 +164,19 @@ describe('POST /api/v1/users', () => {
139
164
  - Each tests a complete user journey, not a single interaction
140
165
  - If an E2E test breaks, it reveals a real user-facing problem
141
166
 
142
- ## Testing Patterns
143
-
144
- ### Arrange / Act / Assert (AAA)
145
-
146
- Every test follows three phases:
147
-
148
- ```typescript
149
- it('calculates discount for premium members', () => {
150
- // Arrange: set up the test conditions
151
- const member = createMember({ tier: 'premium' });
152
- const order = createOrder({ items: [{ price: 10000 }] });
153
-
154
- // Act: perform the action being tested
155
- const discount = calculateDiscount(member, order);
156
-
157
- // Assert: verify the result
158
- expect(discount).toBe(1000); // 10% discount
159
- });
160
- ```
161
-
162
- ### Given / When / Then (BDD)
163
-
164
- Behavior-oriented variant, often used for integration and E2E tests:
165
-
166
- ```typescript
167
- describe('Order submission', () => {
168
- it('sends confirmation email when order is submitted', async () => {
169
- // Given: a draft order with valid items
170
- const order = await createDraftOrder({ customerId, items: validItems });
171
-
172
- // When: the order is submitted
173
- await orderService.submit(order.id);
174
-
175
- // Then: a confirmation email is queued
176
- expect(emailQueue.messages).toContainEqual(
177
- expect.objectContaining({
178
- to: customer.email,
179
- template: 'order-confirmation',
180
- data: { orderId: order.id }
181
- })
182
- );
183
- });
184
- });
185
- ```
167
+ ### Test Doubles — Detailed Patterns
186
168
 
187
- ### Test Doubles
169
+ #### Stubs
188
170
 
189
- **Stubs:** Return predetermined responses. Use when you need to control what a dependency returns.
171
+ Return predetermined responses. Use when you need to control what a dependency returns.
190
172
 
191
173
  ```typescript
192
174
  const userRepo = { findById: jest.fn().mockResolvedValue({ id: '1', name: 'Alice' }) };
193
175
  ```
194
176
 
195
- **Mocks:** Record calls and verify interactions. Use when you need to verify that a dependency was called correctly.
177
+ #### Mocks
178
+
179
+ Record calls and verify interactions. Use when you need to verify that a dependency was called correctly.
196
180
 
197
181
  ```typescript
198
182
  const emailService = { send: jest.fn() };
@@ -203,17 +187,22 @@ expect(emailService.send).toHaveBeenCalledWith({
203
187
  });
204
188
  ```
205
189
 
206
- **Spies:** Wrap real implementations and record calls. Use when you want real behavior but also want to verify calls.
190
+ #### Spies
191
+
192
+ Wrap real implementations and record calls. Use when you want real behavior but also want to verify calls.
193
+
194
+ #### Fakes
207
195
 
208
- **Fakes:** Working implementations with simplified behavior. Use for expensive dependencies in tests (in-memory database instead of real database).
196
+ Working implementations with simplified behavior. Use for expensive dependencies in tests (in-memory database instead of real database).
197
+
198
+ #### When to Use Which
209
199
 
210
- **When to use which:**
211
200
  - Stub external services (HTTP APIs, email, payment)
212
201
  - Mock side-effect-producing dependencies (to verify they're called)
213
202
  - Spy on internal functions (to verify call patterns without changing behavior)
214
203
  - Fake databases in unit tests (in-memory implementations of repository interfaces)
215
204
 
216
- ### What NOT to Mock
205
+ ### What NOT to Mock — Extended
217
206
 
218
207
  - **The thing you're testing.** If you mock the function under test, you're testing the mock, not the code.
219
208
  - **Value objects and simple data transformations.** Use real instances; they're fast and deterministic.
@@ -243,9 +232,9 @@ Verify that a service provider and its consumers agree on the API contract:
243
232
 
244
233
  Best for: microservices, separate frontend/backend teams, or any system where the API producer and consumer are developed independently.
245
234
 
246
- ## Coverage Strategy
235
+ ### Coverage Strategy — In Depth
247
236
 
248
- ### Coverage Targets by Layer
237
+ #### Coverage Targets by Layer
249
238
 
250
239
  Coverage targets should vary by the criticality and testability of each layer:
251
240
 
@@ -257,7 +246,7 @@ Coverage targets should vary by the criticality and testability of each layer:
257
246
  | Infrastructure (adapters, config) | 50-70% line | Low logic density; over-testing adds maintenance burden |
258
247
  | Generated code | 0% | Don't test generated code; test the generator |
259
248
 
260
- ### Meaningful vs. Vanity Coverage
249
+ #### Meaningful vs. Vanity Coverage
261
250
 
262
251
  **Meaningful coverage** tests behavior that could break:
263
252
  - Branch coverage (both sides of every `if` statement)
@@ -283,9 +272,9 @@ Tools: Stryker (JavaScript/TypeScript), mutmut (Python), PITest (Java).
283
272
 
284
273
  Use mutation testing periodically (not on every CI run — it's slow) to assess test suite quality.
285
274
 
286
- ## Quality Gates
275
+ ### Quality Gates — Detailed
287
276
 
288
- ### Pre-Commit Checks
277
+ #### Pre-Commit Checks
289
278
 
290
279
  Run on every commit (should complete in <10 seconds):
291
280
 
@@ -295,7 +284,7 @@ Run on every commit (should complete in <10 seconds):
295
284
 
296
285
  These are fast, catch obvious mistakes, and prevent noisy diffs in PRs.
297
286
 
298
- ### CI Pipeline Checks
287
+ #### CI Pipeline Checks
299
288
 
300
289
  Run on every push and PR (should complete in <5 minutes):
301
290
 
@@ -305,7 +294,7 @@ Run on every push and PR (should complete in <5 minutes):
305
294
  - **Build verification** (the application compiles and builds successfully)
306
295
  - **Security audit** (dependency vulnerability scan)
307
296
 
308
- ### Pre-Merge Requirements
297
+ #### Pre-Merge Requirements
309
298
 
310
299
  Before a PR can be merged:
311
300
 
@@ -314,7 +303,7 @@ Before a PR can be merged:
314
303
  - No merge conflicts
315
304
  - Branch is up-to-date with main (or rebased)
316
305
 
317
- ### Performance Benchmarks (Optional)
306
+ #### Performance Benchmarks (Optional)
318
307
 
319
308
  For performance-critical applications:
320
309
 
@@ -323,9 +312,9 @@ For performance-critical applications:
323
312
  - Significant regressions (>10% degradation) block merge
324
313
  - Baselines updated when intentional changes affect performance
325
314
 
326
- ## Test Data
315
+ ### Test Data Management
327
316
 
328
- ### Fixtures
317
+ #### Fixtures
329
318
 
330
319
  Static test data stored in files or constants. Best for:
331
320
  - Reference data (country lists, category hierarchies, status enums)
@@ -347,7 +336,7 @@ export const adminUser = {
347
336
  };
348
337
  ```
349
338
 
350
- ### Factories
339
+ #### Factories
351
340
 
352
341
  Functions that generate test data with sensible defaults and selective overrides. Best for:
353
342
  - Creating many variations of the same entity
@@ -370,7 +359,7 @@ function createUser(overrides: Partial<User> = {}): User {
370
359
  const suspendedUser = createUser({ status: 'suspended' });
371
360
  ```
372
361
 
373
- ### Seeds
362
+ #### Seeds
374
363
 
375
364
  Initial data loaded into the test database for integration tests. Rules:
376
365
  - Seed data represents realistic scenarios (not just one record per table)
@@ -378,7 +367,7 @@ Initial data loaded into the test database for integration tests. Rules:
378
367
  - Seed data is minimal (only what tests need; don't replicate production)
379
368
  - Seed data includes edge cases (user with no orders, order with many items)
380
369
 
381
- ### Test Database Management
370
+ #### Test Database Management
382
371
 
383
372
  **Transaction rollback pattern:** Each test runs inside a database transaction that is rolled back after the test. Fast, clean, but doesn't test commit behavior.
384
373
 
@@ -388,7 +377,7 @@ Initial data loaded into the test database for integration tests. Rules:
388
377
 
389
378
  **Recommendation:** Use transaction rollback for unit-level database tests. Use truncate-and-seed for integration test suites. Use dedicated databases for CI.
390
379
 
391
- ## Common Pitfalls
380
+ ### Common Pitfalls
392
381
 
393
382
  **Testing implementation details.** "Verify that `_processPayment` was called with exactly these parameters." This test breaks whenever the internal implementation changes, even if the observable behavior is unchanged. Fix: test the observable outcome, not the internal mechanism.
394
383
 
@@ -407,3 +396,7 @@ Initial data loaded into the test database for integration tests. Rules:
407
396
  **Skipped tests accumulate.** Tests marked as `skip` or `xit` that are never re-enabled. They represent either dead code or known bugs that nobody addresses. Fix: skipped tests are technical debt. Set a policy: fix or delete within one sprint.
408
397
 
409
398
  **No test naming convention.** Test descriptions like "test 1," "works correctly," or "handles the thing." Uninformative when tests fail. Fix: test names should describe the scenario and expected outcome: "returns 404 when user does not exist," "applies 10% discount for premium members."
399
+
400
+ ## See Also
401
+
402
+ - [api-design](../core/api-design.md) — Contract testing patterns
@@ -4,16 +4,47 @@ description: Expert knowledge for translating product requirements into well-for
4
4
  topics: [user-stories, personas, acceptance-criteria, story-splitting, INVEST, epics, traceability]
5
5
  ---
6
6
 
7
- ## Story Anatomy
7
+ # User Stories
8
8
 
9
- The standard user story template captures who wants what and why:
9
+ Expert knowledge for translating product requirements into well-formed user stories with acceptance criteria, epic structure, and traceability.
10
+
11
+ ## Summary
12
+
13
+ ### Story Anatomy
10
14
 
11
15
  **"As a [persona], I want [action], so that [outcome]."**
12
16
 
13
- Each part serves a purpose:
14
- - **Persona** — the specific user role, not "a user." Personas come from the PRD.
15
- - **Action** — what the user wants to do, described in their language, not implementation terms.
16
- - **Outcome** — the value they get. This is the most important part — it answers "why bother?"
17
+ - **Persona** the specific user role from the PRD, not "a user"
18
+ - **Action** — what the user wants to do, in their language
19
+ - **Outcome** — the value they get (the most important part)
20
+
21
+ Deviations: **System stories** for background processes ("When a payment fails, the system retries twice...") and **Constraint stories** for NFRs ("All API responses within 500ms at p95").
22
+
23
+ ### INVEST Criteria
24
+
25
+ - **Independent** — can be developed without requiring another story first
26
+ - **Negotiable** — describes what/why, not how
27
+ - **Valuable** — delivers value to a user or stakeholder
28
+ - **Estimable** — specific enough to estimate effort
29
+ - **Small** — implementable in 1-3 focused agent sessions
30
+ - **Testable** — acceptance criteria have clear pass/fail outcomes
31
+
32
+ ### Acceptance Criteria Format
33
+
34
+ Use Given/When/Then for scenarios:
35
+ ```
36
+ Given [precondition/context]
37
+ When [action/trigger]
38
+ Then [expected outcome]
39
+ ```
40
+
41
+ Include parameterized scenarios for role variations, negative scenarios for every happy path, and boundary conditions at edges.
42
+
43
+ **AC vs. Test Cases**: ACs define WHAT should happen (business-level). Test cases define HOW to verify (technical-level, derived during implementation).
44
+
45
+ ## Deep Guidance
46
+
47
+ ### Story Anatomy — Extended
17
48
 
18
49
  **Good stories:**
19
50
  - "As a teacher, I want to assign homework to a class, so that students have practice material outside of class."
@@ -28,13 +59,9 @@ Each part serves a purpose:
28
59
  - **System stories** describe behavior with no direct user action: "When a payment fails, the system retries twice with exponential backoff and notifies the user after final failure." These are acceptable for background processes, scheduled jobs, and automated workflows.
29
60
  - **Constraint stories** capture non-functional requirements: "All API responses must complete within 500ms at p95 under normal load." These complement functional stories rather than replacing them.
30
61
 
31
- ---
32
-
33
- ## INVEST Criteria
62
+ ### INVEST Criteria — Deep Dive
34
63
 
35
- Every story should satisfy INVEST. Use these criteria to evaluate story quality.
36
-
37
- ### Independent
64
+ #### Independent
38
65
 
39
66
  The story can be developed and delivered without requiring another story to be done first. Stories with hard dependencies should be split or reordered.
40
67
 
@@ -42,7 +69,7 @@ The story can be developed and delivered without requiring another story to be d
42
69
  - **Fail:** "As a user, I want to edit my profile photo" that silently depends on "As a user, I want to upload files" — if upload isn't done, this story is blocked.
43
70
  - **Fix:** Make the dependency explicit and consider whether the stories should be combined or the shared functionality extracted.
44
71
 
45
- ### Negotiable
72
+ #### Negotiable
46
73
 
47
74
  The story describes what and why, not how. Implementation details are negotiated during development, not locked in the story.
48
75
 
@@ -50,7 +77,7 @@ The story describes what and why, not how. Implementation details are negotiated
50
77
  - **Fail:** "As a user, I want to receive WebSocket push notifications rendered as toast components in the bottom-right corner using the Sonner library."
51
78
  - **Fix:** Move implementation details to technical notes. The story stays focused on user value.
52
79
 
53
- ### Valuable
80
+ #### Valuable
54
81
 
55
82
  The story delivers value to a user or stakeholder. Every story should have a clear beneficiary.
56
83
 
@@ -58,7 +85,7 @@ The story delivers value to a user or stakeholder. Every story should have a cle
58
85
  - **Fail:** "As a developer, I want to refactor the authentication module." — No user value. This is a technical task, not a story.
59
86
  - **Fix:** Frame technical work in terms of user value, or track it as a task rather than a story.
60
87
 
61
- ### Estimable
88
+ #### Estimable
62
89
 
63
90
  The team (or agent) can estimate the effort. If a story is too vague to estimate, it needs more conversation or splitting.
64
91
 
@@ -66,7 +93,7 @@ The team (or agent) can estimate the effort. If a story is too vague to estimate
66
93
  - **Fail:** "As a user, I want AI-powered recommendations" — too vague. What data? What algorithm? What UI?
67
94
  - **Fix:** Split into smaller, more specific stories until each is estimable.
68
95
 
69
- ### Small
96
+ #### Small
70
97
 
71
98
  A story should be implementable in 1-3 focused agent sessions. Larger stories need splitting.
72
99
 
@@ -74,7 +101,7 @@ A story should be implementable in 1-3 focused agent sessions. Larger stories ne
74
101
  - **Fail:** "As a user, I want a complete e-commerce checkout flow with cart, address, payment, confirmation, and order tracking."
75
102
  - **Fix:** Split by workflow step: cart management, address entry, payment processing, order confirmation, order tracking.
76
103
 
77
- ### Testable
104
+ #### Testable
78
105
 
79
106
  Acceptance criteria have clear pass/fail outcomes. If you can't write a test for it, the story isn't ready.
80
107
 
@@ -82,9 +109,7 @@ Acceptance criteria have clear pass/fail outcomes. If you can't write a test for
82
109
  - **Fail:** "The checkout should be intuitive." — Not testable.
83
110
  - **Fix:** Replace subjective language with observable behavior.
84
111
 
85
- ---
86
-
87
- ## Persona Definition
112
+ ### Persona Definition
88
113
 
89
114
  Personas are extracted from the PRD's user/stakeholder descriptions. Each persona is a specific user type with distinct goals, not a generic role label.
90
115
 
@@ -103,9 +128,7 @@ Personas are extracted from the PRD's user/stakeholder descriptions. Each person
103
128
  - **Pain points** — what frustrates them today (informs acceptance criteria)
104
129
  - **Context** — when, where, how they use the product (informs UX decisions)
105
130
 
106
- ---
107
-
108
- ## Epic Structure
131
+ ### Epic Structure
109
132
 
110
133
  Epics group related stories by user journey, not by system component.
111
134
 
@@ -125,13 +148,9 @@ Epics group related stories by user journey, not by system component.
125
148
  - Use verb phrases that describe the user goal: "Managing Team Members," "Processing Payments," "Onboarding New Users."
126
149
  - Avoid technical names: "REST API," "Database Layer," "Auth Module."
127
150
 
128
- ---
129
-
130
- ## Acceptance Criteria Patterns
151
+ ### Acceptance Criteria Patterns — Extended
131
152
 
132
- Acceptance criteria define when a story is done. They are the contract between story and implementation.
133
-
134
- ### Given/When/Then Format
153
+ #### Given/When/Then Format
135
154
 
136
155
  The standard format for acceptance criteria scenarios:
137
156
 
@@ -148,7 +167,7 @@ When they enter valid credentials and click "Sign In"
148
167
  Then they are redirected to the dashboard and see a welcome message with their name
149
168
  ```
150
169
 
151
- ### Parameterized Scenarios
170
+ #### Parameterized Scenarios
152
171
 
153
172
  When the same behavior applies to multiple variations, use parameterized scenarios:
154
173
 
@@ -158,7 +177,7 @@ When they access the settings page
158
177
  Then they see [all settings | team settings only | read-only view]
159
178
  ```
160
179
 
161
- ### Negative Scenarios
180
+ #### Negative Scenarios
162
181
 
163
182
  Every happy path should have corresponding error scenarios:
164
183
 
@@ -169,7 +188,7 @@ Then they see "Invalid credentials" and the password field is cleared
169
188
  And after 5 failed attempts, the account is locked for 15 minutes
170
189
  ```
171
190
 
172
- ### Boundary Conditions
191
+ #### Boundary Conditions
173
192
 
174
193
  Test edges, not just middles:
175
194
 
@@ -181,19 +200,17 @@ When they enter 101 characters
181
200
  Then they see "Name must be 100 characters or fewer" and the extra character is rejected
182
201
  ```
183
202
 
184
- ### Acceptance Criteria vs. Test Cases
203
+ #### Acceptance Criteria vs. Test Cases
185
204
 
186
205
  - **Acceptance criteria** define WHAT should happen (business-level behavior)
187
206
  - **Test cases** define HOW to verify it (technical-level steps)
188
207
  - Stories contain acceptance criteria. Test cases are derived later during implementation.
189
208
 
190
- ---
191
-
192
- ## Story Splitting Heuristics
209
+ ### Story Splitting Heuristics
193
210
 
194
211
  When a story is too large, use these patterns to split it into smaller, independently valuable stories.
195
212
 
196
- ### By Workflow Step
213
+ #### By Workflow Step
197
214
 
198
215
  Before: "As a user, I want to complete the checkout process."
199
216
  After:
@@ -202,7 +219,7 @@ After:
202
219
  - "As a shopper, I want to select a payment method and pay."
203
220
  - "As a shopper, I want to see an order confirmation."
204
221
 
205
- ### By Data Variation
222
+ #### By Data Variation
206
223
 
207
224
  Before: "As a user, I want to create posts."
208
225
  After:
@@ -210,7 +227,7 @@ After:
210
227
  - "As a user, I want to create posts with images."
211
228
  - "As a user, I want to create posts with embedded videos."
212
229
 
213
- ### By Operation (CRUD)
230
+ #### By Operation (CRUD)
214
231
 
215
232
  Before: "As an admin, I want to manage users."
216
233
  After:
@@ -219,7 +236,7 @@ After:
219
236
  - "As an admin, I want to edit user roles."
220
237
  - "As an admin, I want to deactivate user accounts."
221
238
 
222
- ### By User Role
239
+ #### By User Role
223
240
 
224
241
  Before: "As a user, I want to access the dashboard."
225
242
  After:
@@ -227,16 +244,14 @@ After:
227
244
  - "As a team lead, I want to see team progress metrics on the dashboard."
228
245
  - "As an admin, I want to see system health and usage stats on the dashboard."
229
246
 
230
- ### By Happy/Sad Path
247
+ #### By Happy/Sad Path
231
248
 
232
249
  Before: "As a user, I want to upload a document."
233
250
  After:
234
251
  - "As a user, I want to upload a PDF or Word document."
235
252
  - "As a user, I want to see clear error messages when upload fails (wrong format, too large, network error)."
236
253
 
237
- ---
238
-
239
- ## Scope Boundaries
254
+ ### Scope Boundaries
240
255
 
241
256
  Every story should explicitly state what it does NOT include to prevent scope creep.
242
257
 
@@ -257,9 +272,7 @@ Every story should explicitly state what it does NOT include to prevent scope cr
257
272
  - "Won't" items in MoSCoW are scope boundaries at the PRD level
258
273
  - Story-level scope boundaries are more granular — they clarify what THIS story excludes even if another story covers it
259
274
 
260
- ---
261
-
262
- ## PRD-to-Story Traceability
275
+ ### PRD-to-Story Traceability
263
276
 
264
277
  Every PRD feature must map to at least one user story. This is a non-negotiable coverage requirement.
265
278
 
@@ -283,9 +296,7 @@ Every PRD feature must map to at least one user story. This is a non-negotiable
283
296
  - Use IDs to create a traceable chain: PRD-REQ-001 → US-001 → (downstream: Task BD-42)
284
297
  - Story IDs (US-001, US-002, ...) are stable — they persist through updates and are referenced by downstream phases
285
298
 
286
- ---
287
-
288
- ## Story Dependencies
299
+ ### Story Dependencies
289
300
 
290
301
  Some stories must be implemented before others. Document these explicitly.
291
302
 
@@ -304,34 +315,32 @@ Only blocked-by dependencies should be formal constraints. Informed-by relations
304
315
  - If Story C depends on B which depends on A, ask: can C depend directly on A instead? Can C's dependency be satisfied with a mock or interface?
305
316
  - Extract shared infrastructure into its own story at the front of the chain rather than letting it hide inside a feature story
306
317
 
307
- ---
308
-
309
- ## Common Pitfalls
318
+ ### Common Pitfalls
310
319
 
311
- ### Implementation Stories
320
+ #### Implementation Stories
312
321
  - **Problem:** "As a developer, I want a REST endpoint for user CRUD."
313
322
  - **Fix:** Rewrite from the user's perspective: "As a new visitor, I want to create an account with my email." The REST endpoint is an implementation detail, not a user story.
314
323
 
315
- ### Stories Too Large
324
+ #### Stories Too Large
316
325
  - **Problem:** A story with 10+ acceptance criteria spanning multiple workflows.
317
326
  - **Fix:** Split using the heuristics above. Each resulting story should have 3-5 acceptance criteria.
318
327
 
319
- ### Vague Acceptance Criteria
328
+ #### Vague Acceptance Criteria
320
329
  - **Problem:** "The feature works correctly and is user-friendly."
321
330
  - **Fix:** Replace with Given/When/Then scenarios. Define "correctly" and "user-friendly" in observable terms.
322
331
 
323
- ### Missing Personas
332
+ #### Missing Personas
324
333
  - **Problem:** Stories reference undefined personas ("a power user," "the operator").
325
334
  - **Fix:** Map back to PRD personas. If the PRD doesn't define this persona, either add it to the PRD or use an existing persona.
326
335
 
327
- ### Stories Without Value Statements
336
+ #### Stories Without Value Statements
328
337
  - **Problem:** "As a user, I want to click the submit button."
329
338
  - **Fix:** Add the "so that" clause: "As a user, I want to submit my feedback form, so that the support team can address my issue."
330
339
 
331
- ### Duplicate Stories Across Epics
340
+ #### Duplicate Stories Across Epics
332
341
  - **Problem:** "Upload profile photo" appears in both "Account Setup" and "Profile Management" epics.
333
342
  - **Fix:** Choose one epic. Add a scope boundary in the other epic referencing the canonical story.
334
343
 
335
- ### Confusing Acceptance Criteria with Implementation Steps
344
+ #### Confusing Acceptance Criteria with Implementation Steps
336
345
  - **Problem:** "1. Create a POST /api/users endpoint. 2. Validate email format with regex. 3. Hash password with bcrypt."
337
346
  - **Fix:** These are implementation steps, not acceptance criteria. Rewrite as: "Given a valid email and password, when the user submits registration, then their account is created and they receive a confirmation email."
@@ -4,6 +4,19 @@ description: Techniques for discovering UX enhancements and innovation opportuni
4
4
  topics: [innovation, ux-enhancements, user-stories, gap-analysis, differentiators]
5
5
  ---
6
6
 
7
+ # User Story Innovation
8
+
9
+ ## Summary
10
+
11
+ - **Scope**: UX-level improvements to existing features only (smart defaults, error handling, accessibility, progressive disclosure, AI-native enhancements). Feature-level innovation belongs in PRD innovation.
12
+ - **High-value low-effort patterns**: Smart defaults, inline validation, keyboard shortcuts, progressive disclosure, leveraging existing data, undo/redo, and batch operations.
13
+ - **Differentiators**: "Wow" moments, AI-native features (natural language search, auto-categorization, smart suggestions), and personalization without configuration.
14
+ - **Defensive gaps**: Accessibility (WCAG AA minimum), mobile responsiveness, offline/degraded mode, performance under load, error recovery, and empty states.
15
+ - **Evaluation framework**: Assess cost (trivial/moderate/significant) and impact (nice-to-have/noticeable/differentiator). Must-have for v1 = high impact + trivial or moderate cost.
16
+ - **Integration**: Approved innovations become additional acceptance criteria, new stories, or modified story scope. All must be traceable to PRD requirements.
17
+
18
+ ## Deep Guidance
19
+
7
20
  ## Scope Boundary
8
21
 
9
22
  This knowledge covers UX-level improvements only — making existing features better, not adding new features. Feature-level innovation belongs in PRD innovation (`innovate-prd`). If an enhancement requires a new PRD section, it is out of scope for user story innovation.
@@ -169,3 +182,60 @@ Group related suggestions for efficient decision-making. For each group:
169
182
  2. State the cost (trivial/moderate/significant)
170
183
  3. State your recommendation (must-have/backlog/reject)
171
184
  4. Wait for approval before integrating into stories
185
+
186
+ ### Example Innovation Finding
187
+
188
+ When documenting an innovation suggestion, use a structured format that makes the enhancement, its cost, and its impact immediately clear:
189
+
190
+ ```markdown
191
+ ## Innovation Finding: Smart Defaults for Checkout Address
192
+
193
+ **Category:** High-Value Low-Effort Enhancement — Smart Defaults
194
+ **Applies to:** Story 4.2 "As a returning customer, I want to enter my shipping address"
195
+
196
+ **Current behavior:** User must re-enter full shipping address on every order, even
197
+ if it has not changed since their last purchase.
198
+
199
+ **Proposed enhancement:** Pre-fill shipping address from the user's most recent order.
200
+ Show a "Same as last order" toggle that auto-populates all address fields. User can
201
+ still edit any field after pre-fill.
202
+
203
+ **User benefit:** Reduces a 6-field manual entry to a single click for repeat customers,
204
+ which account for 65% of orders per the PRD's user research.
205
+
206
+ **Cost:** Trivial — requires reading the most recent order's address (data already exists)
207
+ and pre-populating form fields. No new API endpoints, no new database tables.
208
+
209
+ **Impact:** Noticeable improvement — reduces checkout friction for the majority of users.
210
+ Directly supports the PRD success metric "reduce checkout abandonment from 72% to 45%."
211
+
212
+ **Recommendation:** Must-have for v1. High impact, trivial cost, directly tied to a
213
+ success metric.
214
+
215
+ **Acceptance criteria addition:**
216
+ - Given a returning customer with a previous order,
217
+ when they reach the shipping address step,
218
+ then all address fields are pre-filled with their most recent shipping address
219
+ - Given a new customer with no previous orders,
220
+ when they reach the shipping address step,
221
+ then all address fields are empty (current behavior)
222
+ ```
223
+
224
+ ---
225
+
226
+ ## Integration With User Stories
227
+
228
+ When approved innovations are integrated into the story set, they modify stories in one of three ways:
229
+
230
+ **Adding acceptance criteria** — The most common integration for trivial-cost enhancements. The innovation becomes additional acceptance criteria on an existing story.
231
+
232
+ **Adding a new story** — For moderate-cost enhancements that warrant their own story. The new story should reference the innovation finding and include a clear "why" tying it back to the PRD.
233
+
234
+ **Modifying an existing story's scope** — For enhancements that change how a feature works rather than adding to it. The original story's description and acceptance criteria are updated to reflect the enhanced behavior.
235
+
236
+ ### Traceability
237
+
238
+ Every innovation that gets integrated must be traceable:
239
+ - The innovation finding should reference the PRD requirement it enhances
240
+ - The modified or new story should reference the innovation finding
241
+ - The innovation decision (must-have/backlog/reject) should be recorded for audit