@anhth2/spec-driven-dev-plugin 0.10.0 → 0.12.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 (207) hide show
  1. package/commands/debug.md +43 -8
  2. package/commands/define-product.md +43 -8
  3. package/commands/dev-gen-test.md +44 -9
  4. package/commands/dev-gen-test.tmpl +1 -1
  5. package/commands/dev-run-test.md +48 -10
  6. package/commands/dev-run-test.tmpl +5 -2
  7. package/commands/dev-smoke-test.md +43 -8
  8. package/commands/fix-bug.md +79 -14
  9. package/commands/fix-bug.tmpl +36 -6
  10. package/commands/generate-bdd.md +49 -10
  11. package/commands/generate-bdd.tmpl +6 -2
  12. package/commands/generate-code.md +44 -9
  13. package/commands/generate-code.tmpl +1 -1
  14. package/commands/generate-design-spec.md +43 -8
  15. package/commands/generate-prd.md +43 -8
  16. package/commands/generate-spec-manifest.md +43 -8
  17. package/commands/generate-tech-docs.md +43 -8
  18. package/commands/learn.md +43 -8
  19. package/commands/propose-scenario.md +74 -19
  20. package/commands/propose-scenario.tmpl +31 -11
  21. package/commands/qc-analyze.md +534 -0
  22. package/commands/qc-analyze.tmpl +86 -0
  23. package/commands/qc-design-test.md +515 -0
  24. package/commands/qc-design-test.tmpl +67 -0
  25. package/commands/qc-plan.md +497 -0
  26. package/commands/qc-plan.tmpl +49 -0
  27. package/commands/qc-report.md +508 -0
  28. package/commands/qc-report.tmpl +60 -0
  29. package/commands/qc-review.md +501 -0
  30. package/commands/qc-review.tmpl +53 -0
  31. package/commands/qc-run-test.md +549 -0
  32. package/commands/qc-run-test.tmpl +83 -0
  33. package/commands/refine-prd.md +43 -8
  34. package/commands/report-bug.md +59 -10
  35. package/commands/report-bug.tmpl +16 -2
  36. package/commands/review-code.md +43 -8
  37. package/commands/review-context.md +43 -8
  38. package/commands/review-tech-docs.md +43 -8
  39. package/commands/setup-ai-first.md +7 -0
  40. package/commands/sync.md +19 -9
  41. package/commands/sync.tmpl +12 -9
  42. package/commands/update-framework.md +7 -0
  43. package/commands/validate-traces.md +67 -12
  44. package/commands/validate-traces.tmpl +24 -4
  45. package/core/FRAMEWORK_VERSION +1 -1
  46. package/core/commands/debug.md +43 -8
  47. package/core/commands/define-product.md +43 -8
  48. package/core/commands/dev-gen-test.md +44 -9
  49. package/core/commands/dev-run-test.md +48 -10
  50. package/core/commands/dev-smoke-test.md +43 -8
  51. package/core/commands/fix-bug.md +79 -14
  52. package/core/commands/generate-bdd.md +49 -10
  53. package/core/commands/generate-code.md +44 -9
  54. package/core/commands/generate-design-spec.md +43 -8
  55. package/core/commands/generate-prd.md +43 -8
  56. package/core/commands/generate-spec-manifest.md +43 -8
  57. package/core/commands/generate-tech-docs.md +43 -8
  58. package/core/commands/learn.md +43 -8
  59. package/core/commands/propose-scenario.md +74 -19
  60. package/core/commands/qc-analyze.md +534 -0
  61. package/core/commands/qc-design-test.md +515 -0
  62. package/core/commands/qc-plan.md +497 -0
  63. package/core/commands/qc-report.md +508 -0
  64. package/core/commands/qc-review.md +501 -0
  65. package/core/commands/qc-run-test.md +549 -0
  66. package/core/commands/refine-prd.md +43 -8
  67. package/core/commands/report-bug.md +59 -10
  68. package/core/commands/review-code.md +43 -8
  69. package/core/commands/review-context.md +43 -8
  70. package/core/commands/review-tech-docs.md +43 -8
  71. package/core/commands/setup-ai-first.md +7 -0
  72. package/core/commands/sync.md +19 -9
  73. package/core/commands/update-framework.md +7 -0
  74. package/core/commands/validate-traces.md +67 -12
  75. package/core/modules/qc-playwright/stack-profile.yaml +65 -0
  76. package/core/skills/code/SKILL.md +50 -8
  77. package/core/skills/debug/SKILL.md +57 -8
  78. package/core/skills/design-spec/SKILL.md +43 -8
  79. package/core/skills/discovery/SKILL.md +43 -8
  80. package/core/skills/prd/SKILL.md +14 -0
  81. package/core/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
  82. package/core/skills/qc/qa-analyst/acceptance-criteria.md +60 -0
  83. package/core/skills/qc/qa-analyst/business-rules.md +59 -0
  84. package/core/skills/qc/qa-analyst/data-flow.md +64 -0
  85. package/core/skills/qc/qa-analyst/spec-breakdown.md +61 -0
  86. package/core/skills/qc/qa-designer/e2e/journey.md +41 -0
  87. package/core/skills/qc/qa-designer/exploratory/charter.md +68 -0
  88. package/core/skills/qc/qa-designer/exploratory/explore-to-functional.md +43 -0
  89. package/core/skills/qc/qa-designer/functional/api.md +45 -0
  90. package/core/skills/qc/qa-designer/functional/gui-feature.md +46 -0
  91. package/core/skills/qc/qa-designer/functional/gui-screen.md +52 -0
  92. package/core/skills/qc/qa-designer/integration/api.md +42 -0
  93. package/core/skills/qc/qa-designer/integration/db.md +39 -0
  94. package/core/skills/qc/qa-designer/integration/gui.md +40 -0
  95. package/core/skills/qc/qa-designer/integration/kafka.md +40 -0
  96. package/core/skills/qc/qa-designer/non-functional.md +40 -0
  97. package/core/skills/qc/qa-planner/test-plan.md +120 -0
  98. package/core/skills/qc/qa-reviewer/script/e2e.md +87 -0
  99. package/core/skills/qc/qa-reviewer/script/exploratory.md +45 -0
  100. package/core/skills/qc/qa-reviewer/script/functional.md +101 -0
  101. package/core/skills/qc/qa-reviewer/script/integration.md +91 -0
  102. package/core/skills/qc/qa-reviewer/script/non-functional.md +126 -0
  103. package/core/skills/qc/qa-reviewer/test-case/e2e.md +73 -0
  104. package/core/skills/qc/qa-reviewer/test-case/exploratory.md +43 -0
  105. package/core/skills/qc/qa-reviewer/test-case/functional.md +76 -0
  106. package/core/skills/qc/qa-reviewer/test-case/integration.md +69 -0
  107. package/core/skills/qc/qa-reviewer/test-case/non-functional.md +73 -0
  108. package/core/skills/qc/qa-runner/e2e.md +49 -0
  109. package/core/skills/qc/qa-runner/exploratory/session.md +36 -0
  110. package/core/skills/qc/qa-runner/functional/api.md +35 -0
  111. package/core/skills/qc/qa-runner/functional/gui-feature.md +51 -0
  112. package/core/skills/qc/qa-runner/functional/gui-screen.md +55 -0
  113. package/core/skills/qc/qa-runner/integration.md +47 -0
  114. package/core/skills/qc/qa-runner/non-functional.md +49 -0
  115. package/core/skills/qc/qa-runner/report/report.md +37 -0
  116. package/core/skills/setup-ai-first/SKILL.md +7 -0
  117. package/core/skills/spec/SKILL.md +14 -0
  118. package/core/skills/test/SKILL.md +93 -16
  119. package/core/steps/context-loader.md +36 -8
  120. package/core/steps/report-footer.md +7 -0
  121. package/core/templates/project-context.yaml +27 -1
  122. package/docs/01-getting-started/README.md +19 -0
  123. package/docs/01-getting-started/core-concepts.md +102 -0
  124. package/docs/01-getting-started/installation.md +156 -0
  125. package/docs/01-getting-started/quickstart.md +85 -0
  126. package/docs/02-guides/README.md +27 -0
  127. package/docs/02-guides/developer/README.md +46 -0
  128. package/docs/02-guides/developer/bdd-and-trace.md +123 -0
  129. package/docs/02-guides/developer/commands.md +76 -0
  130. package/docs/02-guides/developer/pr-checklist.md +15 -0
  131. package/docs/02-guides/developer/scenarios.md +448 -0
  132. package/docs/02-guides/developer/workflow.md +61 -0
  133. package/docs/02-guides/product-owner/README.md +77 -0
  134. package/docs/02-guides/product-owner/commands.md +30 -0
  135. package/docs/02-guides/product-owner/handoff-checklist.md +42 -0
  136. package/docs/02-guides/product-owner/prd-writing-rules.md +45 -0
  137. package/docs/02-guides/product-owner/scenarios.md +357 -0
  138. package/docs/02-guides/qc-automation.md +157 -0
  139. package/docs/02-guides/tester/README.md +74 -0
  140. package/docs/02-guides/tester/bug-reporting.md +117 -0
  141. package/docs/02-guides/tester/reading-specs.md +79 -0
  142. package/docs/02-guides/tester/scenarios.md +186 -0
  143. package/docs/02-guides/tester/spec-manifest.md +124 -0
  144. package/docs/02-guides/tester/test-checklist.md +31 -0
  145. package/docs/02-guides/tester/workflow.md +80 -0
  146. package/docs/03-concepts/README.md +19 -0
  147. package/docs/03-concepts/architecture.md +245 -0
  148. package/docs/03-concepts/pipeline.md +262 -0
  149. package/docs/03-concepts/traceability.md +149 -0
  150. package/docs/04-operations/README.md +33 -0
  151. package/docs/04-operations/bug-flow.md +362 -0
  152. package/docs/04-operations/publishing.md +137 -0
  153. package/docs/04-operations/sync-and-update.md +365 -0
  154. package/docs/05-reference/README.md +29 -0
  155. package/docs/05-reference/commands.md +229 -0
  156. package/docs/05-reference/modules.md +110 -0
  157. package/docs/05-reference/trace-schema.md +152 -0
  158. package/docs/README.md +51 -0
  159. package/modules/qc-playwright/stack-profile.yaml +65 -0
  160. package/package.json +2 -2
  161. package/skills/code/SKILL.md +50 -8
  162. package/skills/debug/SKILL.md +57 -8
  163. package/skills/design-spec/SKILL.md +43 -8
  164. package/skills/discovery/SKILL.md +43 -8
  165. package/skills/prd/SKILL.md +14 -0
  166. package/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
  167. package/skills/qc/qa-analyst/acceptance-criteria.md +60 -0
  168. package/skills/qc/qa-analyst/business-rules.md +59 -0
  169. package/skills/qc/qa-analyst/data-flow.md +64 -0
  170. package/skills/qc/qa-analyst/spec-breakdown.md +61 -0
  171. package/skills/qc/qa-designer/e2e/journey.md +41 -0
  172. package/skills/qc/qa-designer/exploratory/charter.md +68 -0
  173. package/skills/qc/qa-designer/exploratory/explore-to-functional.md +43 -0
  174. package/skills/qc/qa-designer/functional/api.md +45 -0
  175. package/skills/qc/qa-designer/functional/gui-feature.md +46 -0
  176. package/skills/qc/qa-designer/functional/gui-screen.md +52 -0
  177. package/skills/qc/qa-designer/integration/api.md +42 -0
  178. package/skills/qc/qa-designer/integration/db.md +39 -0
  179. package/skills/qc/qa-designer/integration/gui.md +40 -0
  180. package/skills/qc/qa-designer/integration/kafka.md +40 -0
  181. package/skills/qc/qa-designer/non-functional.md +40 -0
  182. package/skills/qc/qa-planner/test-plan.md +120 -0
  183. package/skills/qc/qa-reviewer/script/e2e.md +87 -0
  184. package/skills/qc/qa-reviewer/script/exploratory.md +45 -0
  185. package/skills/qc/qa-reviewer/script/functional.md +101 -0
  186. package/skills/qc/qa-reviewer/script/integration.md +91 -0
  187. package/skills/qc/qa-reviewer/script/non-functional.md +126 -0
  188. package/skills/qc/qa-reviewer/test-case/e2e.md +73 -0
  189. package/skills/qc/qa-reviewer/test-case/exploratory.md +43 -0
  190. package/skills/qc/qa-reviewer/test-case/functional.md +76 -0
  191. package/skills/qc/qa-reviewer/test-case/integration.md +69 -0
  192. package/skills/qc/qa-reviewer/test-case/non-functional.md +73 -0
  193. package/skills/qc/qa-runner/e2e.md +49 -0
  194. package/skills/qc/qa-runner/exploratory/session.md +36 -0
  195. package/skills/qc/qa-runner/functional/api.md +35 -0
  196. package/skills/qc/qa-runner/functional/gui-feature.md +51 -0
  197. package/skills/qc/qa-runner/functional/gui-screen.md +55 -0
  198. package/skills/qc/qa-runner/integration.md +47 -0
  199. package/skills/qc/qa-runner/non-functional.md +49 -0
  200. package/skills/qc/qa-runner/report/report.md +37 -0
  201. package/skills/setup-ai-first/SKILL.md +7 -0
  202. package/skills/spec/SKILL.md +14 -0
  203. package/skills/test/SKILL.md +93 -16
  204. package/steps/context-loader.md +36 -8
  205. package/steps/report-footer.md +7 -0
  206. package/templates/project-context.yaml +27 -1
  207. package/ARCHITECTURE.md +0 -258
package/commands/sync.md CHANGED
@@ -144,9 +144,9 @@ Collect from output:
144
144
 
145
145
  ---
146
146
 
147
- ## Step 1d — Surface Tester Feedback *(new bug reports / scenario proposals)*
147
+ ## Step 1d — Surface Tester/QC Feedback *(bug reports / scenario proposals / PRD change requests)*
148
148
 
149
- Tester `/report-bug` and `/propose-scenario` commit feedback into the spec repo. This step tells PO/Dev what arrived in **this** pull, so they are notified through their normal routine. It covers both audiences:
149
+ Tester & QC `/report-bug`, `/propose-scenario` (incl. Case B PRD change requests) commit feedback into the spec repo. This step tells PO/Dev what arrived in **this** pull, so they are notified through their normal routine. It covers both audiences:
150
150
 
151
151
  - **Dev/tester in umbrella** → feedback came in via the spec submodule advance (Step 1c)
152
152
  - **PO working directly in the spec repo** → feedback came in via the umbrella/current-repo `git pull` (Step 1)
@@ -158,22 +158,25 @@ Pick the repo + range that pulled the feedback:
158
158
  If `feedback/` does not exist in REPO → skip silently.
159
159
 
160
160
  ```bash
161
- git -C {REPO} diff --name-status {old_sha}..{new_sha} -- feedback/bug-reports/ feedback/bdd-proposals/
161
+ git -C {REPO} diff --name-status {old_sha}..{new_sha} -- feedback/bug-reports/ feedback/bdd-proposals/ feedback/prd-change-requests/
162
162
  ```
163
163
 
164
- For each entry, read its title/summary and report:
164
+ For each entry, read its title/summary + `State` and report. **Bug reports: surface only `State: Open`** as needing attention; list `Fixed`/`Closed` separately (or omit) so the PO/PM sees what's still pending:
165
165
  ```
166
- 📥 New tester feedback (pulled this sync):
167
- Bug reports:
168
- BUG-20260608-01 FT-001 — account locks after 6 fails (spec says 5) [layer: Code]
166
+ 📥 New feedback (pulled this sync):
167
+ Bug reports (open):
168
+ BUG-20260608-01 FT-001 — account locks after 6 fails (spec says 5) [layer: Code · waiting: dev]
169
+ Bug reports (fixed, awaiting QC re-verify): BUG-20260605-02
169
170
  Scenario proposals:
170
171
  FT-001-trailing-spaces.md → maps to AC2 (pending review)
172
+ PRD change requests:
173
+ FT-001-bulk-export.md → new requirement, needs an AC (waiting: PO)
171
174
  ```
172
175
 
173
- If none changed → print `📥 Tester feedback: none new this sync`.
176
+ If none changed → print `📥 Feedback: none new this sync`.
174
177
 
175
178
  If the reader is a PO/Dev, add a one-line nudge:
176
- `→ Review feedback/ then act: /fix-bug {BUG-ID} · promote proposal into BDD · or update PRD.`
179
+ `→ Review feedback/ then act: /fix-bug {BUG-ID} · promote proposal via /generate-bdd · or add an AC to the PRD.`
177
180
 
178
181
  ---
179
182
 
@@ -335,6 +338,13 @@ Suggest the logical next command based on workflow phase:
335
338
  | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
336
339
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
337
340
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
341
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
342
+ | /qc-plan | `/qc-design-test {UC-ID}` |
343
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
344
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
345
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
346
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
347
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
338
348
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
339
349
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
340
350
  | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
@@ -144,9 +144,9 @@ Collect from output:
144
144
 
145
145
  ---
146
146
 
147
- ## Step 1d — Surface Tester Feedback *(new bug reports / scenario proposals)*
147
+ ## Step 1d — Surface Tester/QC Feedback *(bug reports / scenario proposals / PRD change requests)*
148
148
 
149
- Tester `/report-bug` and `/propose-scenario` commit feedback into the spec repo. This step tells PO/Dev what arrived in **this** pull, so they are notified through their normal routine. It covers both audiences:
149
+ Tester & QC `/report-bug`, `/propose-scenario` (incl. Case B PRD change requests) commit feedback into the spec repo. This step tells PO/Dev what arrived in **this** pull, so they are notified through their normal routine. It covers both audiences:
150
150
 
151
151
  - **Dev/tester in umbrella** → feedback came in via the spec submodule advance (Step 1c)
152
152
  - **PO working directly in the spec repo** → feedback came in via the umbrella/current-repo `git pull` (Step 1)
@@ -158,22 +158,25 @@ Pick the repo + range that pulled the feedback:
158
158
  If `feedback/` does not exist in REPO → skip silently.
159
159
 
160
160
  ```bash
161
- git -C {REPO} diff --name-status {old_sha}..{new_sha} -- feedback/bug-reports/ feedback/bdd-proposals/
161
+ git -C {REPO} diff --name-status {old_sha}..{new_sha} -- feedback/bug-reports/ feedback/bdd-proposals/ feedback/prd-change-requests/
162
162
  ```
163
163
 
164
- For each entry, read its title/summary and report:
164
+ For each entry, read its title/summary + `State` and report. **Bug reports: surface only `State: Open`** as needing attention; list `Fixed`/`Closed` separately (or omit) so the PO/PM sees what's still pending:
165
165
  ```
166
- 📥 New tester feedback (pulled this sync):
167
- Bug reports:
168
- BUG-20260608-01 FT-001 — account locks after 6 fails (spec says 5) [layer: Code]
166
+ 📥 New feedback (pulled this sync):
167
+ Bug reports (open):
168
+ BUG-20260608-01 FT-001 — account locks after 6 fails (spec says 5) [layer: Code · waiting: dev]
169
+ Bug reports (fixed, awaiting QC re-verify): BUG-20260605-02
169
170
  Scenario proposals:
170
171
  FT-001-trailing-spaces.md → maps to AC2 (pending review)
172
+ PRD change requests:
173
+ FT-001-bulk-export.md → new requirement, needs an AC (waiting: PO)
171
174
  ```
172
175
 
173
- If none changed → print `📥 Tester feedback: none new this sync`.
176
+ If none changed → print `📥 Feedback: none new this sync`.
174
177
 
175
178
  If the reader is a PO/Dev, add a one-line nudge:
176
- `→ Review feedback/ then act: /fix-bug {BUG-ID} · promote proposal into BDD · or update PRD.`
179
+ `→ Review feedback/ then act: /fix-bug {BUG-ID} · promote proposal via /generate-bdd · or add an AC to the PRD.`
177
180
 
178
181
  ---
179
182
 
@@ -161,6 +161,13 @@ Suggest the logical next command based on workflow phase:
161
161
  | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
162
162
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
163
163
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
164
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
165
+ | /qc-plan | `/qc-design-test {UC-ID}` |
166
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
167
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
168
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
169
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
170
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
164
171
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
165
172
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
166
173
  | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
@@ -127,6 +127,8 @@ Read `.agent/project-context.yaml`. Extract and store:
127
127
  - `paths.specs_dir` → BDD specs root
128
128
  - `paths.prd_dir` → PRD documents root
129
129
  - `paths.refinement_dir` → findings/review output dir
130
+ - `paths.qc_dir` → QC automation artifacts root (visible top-level, one subfolder per UC: `{qc_dir}/{UC-ID}/`)
131
+ - `paths.qc_skills_dir` → where qc-* commands load QC skills from (default bundled `.agent/skills/qc`; override to the QC team's own repo/submodule so framework upgrade won't overwrite them)
130
132
  - `paths.product_definitions_dir` → product definitions root
131
133
  - `paths.domain_knowledge_dir` → domain knowledge root
132
134
  - `paths.business_dictionary` → path to business-dictionary.md
@@ -139,6 +141,8 @@ If `paths` section is absent, use these defaults:
139
141
  - `specs_dir` = `specs/bdd`
140
142
  - `prd_dir` = `specs/prd`
141
143
  - `refinement_dir` = `.agent/review`
144
+ - `qc_dir` = `docs`
145
+ - `qc_skills_dir` = `.agent/skills/qc`
142
146
  - `product_definitions_dir` = `specs/product-definition`
143
147
  - `domain_knowledge_dir` = `specs/domain-knowledge`
144
148
  - `business_dictionary` = `specs/domain-knowledge/business-dictionary.md`
@@ -183,6 +187,7 @@ If `services` section is present:
183
187
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
184
188
  - Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
185
189
  - Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
190
+ - Override `paths.prd_change_requests_dir` → `{spec_source}/feedback/prd-change-requests`
186
191
 
187
192
  > **Why under `spec_source`:** PRD, design-spec, domain knowledge, the **API contract (tech-docs)**, and tester feedback are all **cross-team artifacts** — they must live in the **shared spec repo** so every umbrella (FE/App/BE) reads the same source via `/sync`. Tech-docs specifically: BE authors the tech-design (API contract), commits + pushes it into the spec submodule (2-layer commit), and FE/App pull it on their next `/sync` to wire the real API in `/generate-code --phase=integration`. In single-service mode (no `spec_source`), these default under the repo root — still shared, same repo.
188
193
 
@@ -223,19 +228,41 @@ If the file does not exist → skip silently.
223
228
 
224
229
  ---
225
230
 
226
- ## Step 3 — [CRITICAL] Load CLAUDE.md
231
+ ## Step 3 — [CRITICAL] Load CLAUDE.md (layered: root + service overlay)
227
232
 
228
233
  *This is the highest-priority context — it defines HOW to write code and documents for this project.*
229
234
 
230
- Read `CLAUDE.md`. Extract and store:
235
+ CLAUDE.md is loaded in **two layers** so umbrella-wide rules and service-specific
236
+ architecture/coding standards compose correctly. The agent always sits at the umbrella
237
+ root, but the implementation code lives in a service submodule with its OWN stack,
238
+ architecture, and conventions — so the service's CLAUDE.md must win for code generation.
239
+
240
+ **Layer 1 — [BASE] Root CLAUDE.md (umbrella-wide).**
241
+ Read `CLAUDE.md` at the repo root. Treat its contents as the **shared baseline** for the
242
+ whole umbrella — git conventions, data-protection posture, cross-cutting rules, and (in
243
+ single-service mode) the project's only architecture + coding standards.
244
+
245
+ **Layer 2 — [OVERLAY] Service CLAUDE.md (umbrella mode only).**
246
+ *Run only if `service_root` was set in Step 1.6 (i.e. a real service was routed to).*
247
+ Read `{service_root}/CLAUDE.md`. This file defines the architecture + coding standards of
248
+ the **actual stack being implemented** (e.g. `user-service` = java-spring, `web` = nextjs).
249
+ Overlay it on top of Layer 1: **on any conflict, the service value WINS** for architecture,
250
+ coding standards, and error handling. Layer-1 values that the service does not redefine
251
+ (e.g. git conventions, banned patterns shared org-wide) remain in effect.
252
+
253
+ From the **merged** result, extract and store:
231
254
 
232
255
  - **§1 Project Overview** → project name, language, framework, build/test commands, domains
233
- - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules
234
- - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns
235
- - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name
236
- - **§7 Git Conventions** → branch naming pattern, commit message format
256
+ - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules — *service overlay wins*
257
+ - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns — *service overlay wins*
258
+ - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name — *service overlay wins*
259
+ - **§7 Git Conventions** → branch naming pattern, commit message format — *root baseline unless service redefines*
237
260
 
238
- If `CLAUDE.md` does not exist → note it as missing and continue with project-context.yaml data only.
261
+ **Resolution rules:**
262
+ - If both layers exist → merge as above; record `claude_md_source = root + {service_root}`.
263
+ - If only the service overlay exists (no root CLAUDE.md) → use the service file alone; `claude_md_source = {service_root}`.
264
+ - If `service_root` is set but `{service_root}/CLAUDE.md` is **missing** → fall back to root CLAUDE.md and flag ⚠️ in the Step 7 recap (the service has no architecture/coding-standards definition — code generation will use umbrella defaults, which may be the wrong stack).
265
+ - If neither exists → note CLAUDE.md as missing and continue with project-context.yaml data only.
239
266
 
240
267
  ---
241
268
 
@@ -335,7 +362,8 @@ Output exactly this block:
335
362
  [CTX LOADED]
336
363
  Stack : {language} / {framework} / {database}
337
364
  Platform : {active_module} ({platform_type})
338
- Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
365
+ Layers : {layer order from merged CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
366
+ CLAUDE.md : {root + {service_root} | {service_root} only | root only | ⚠️ service overlay MISSING — using root | missing}
339
367
  Ticket : {ticket_prefix}-
340
368
  Dict : {loaded — N canonical terms, M banned terms | missing}
341
369
  Entities : {loaded — EntityA, EntityB, EntityC | missing}
@@ -444,7 +472,7 @@ If code was generated from an older revision → flag `TECHDOC_DRIFT`.
444
472
  *Skip this step if no TSV files existed (handled by Step 1 no-TSV path).*
445
473
 
446
474
  For each `.tsv` file processed: write updated `spec_ver`, `status`, `last_updated` back to disk.
447
- Do **not** modify `dev_selftest` or `dev_selftest_at` — those are owned by `/dev-run-test`; this command only reads them for the report.
475
+ Do **not** modify `dev_selftest`/`dev_selftest_at` (owned by `/dev-run-test`) or `qc_status`/`qc_run_at`/`qc_owner`/`qc_blocked_by` (owned by `/qc-run-test` + `/report-bug`); this command only reads them for the report.
448
476
 
449
477
  ### Step 7 — Compute dashboard aggregates
450
478
 
@@ -463,8 +491,17 @@ gap_count = rows where status == GAP
463
491
  dev_selftest_passing = rows where dev_selftest == pass
464
492
  dev_selftest_failing = rows where dev_selftest == fail
465
493
  dev_selftest_not_run = rows where dev_selftest in (not_run, —)
466
- # NOTE: this is the DEV self-check signal (did the dev run their own smoke tests),
467
- # NOT official QC/dev-team coverage — keep it labeled as such on the dashboard.
494
+ # NOTE: dev_selftest is the DEV self-check signal (did the dev run their own smoke tests),
495
+ # NOT official coverage — keep it labeled as such on the dashboard.
496
+ qc_passing = rows where qc_status == pass
497
+ qc_failing = rows where qc_status == fail
498
+ qc_skipped = rows where qc_status == skip
499
+ qc_not_run = rows where qc_status in (not_run, —)
500
+ # qc_status is the OFFICIAL QC automation result (set by /qc-run-test),
501
+ # shown alongside — never merged with — dev_selftest.
502
+ waiting_dev = rows where qc_owner == dev # PM view: QC-found, waiting on dev to fix
503
+ waiting_po = rows where qc_owner == po # PM view: blocked, waiting on PO to confirm/clarify
504
+ # qc_owner + qc_blocked_by answer "case nào đang chờ ai" — surface as a "Waiting on" column.
468
505
  tech_docs_count = count .md files in {paths.tech_docs_dir}/{domain}/
469
506
  ```
470
507
 
@@ -495,6 +532,12 @@ Schema:
495
532
  "dev_selftest_passing": 0,
496
533
  "dev_selftest_failing": 0,
497
534
  "dev_selftest_not_run": 0,
535
+ "qc_passing": 0,
536
+ "qc_failing": 0,
537
+ "qc_skipped": 0,
538
+ "qc_not_run": 0,
539
+ "waiting_dev": 0,
540
+ "waiting_po": 0,
498
541
  "tech_docs_count": 0
499
542
  },
500
543
  "prds": [
@@ -522,6 +565,10 @@ Schema:
522
565
  "test_classes": ["<TestClass1>", "<TestClass2>"],
523
566
  "dev_selftest": "pass | fail | not_run",
524
567
  "dev_selftest_at": "<YYYY-MM-DD or null>",
568
+ "qc_status": "pass | fail | skip | not_run",
569
+ "qc_run_at": "<YYYY-MM-DD or null>",
570
+ "qc_owner": "dev | po | null",
571
+ "qc_blocked_by": "<BUG-id / GAP-id or null>",
525
572
  "prd_version": "<prd version when BDD was generated>",
526
573
  "bdd_version": "<bdd version when code was generated>",
527
574
  "tech_doc_revision": 0,
@@ -586,7 +633,8 @@ Schema:
586
633
  - `tech_doc_revision`: use integer; `0` if not yet generated
587
634
  - `code_coverage_pct` / `test_coverage_pct`: round to nearest integer (0–100)
588
635
  - Always write to `{paths.trace_dir}/trace-report.json` regardless of domain filter — if a domain filter was applied, include only those PRDs in `prds[]` but note the domain in the `domain` field
589
- - **TSV `"—"` mapping**: when reading TSV files, map dash values to JSON types: `implemented_by: "—"` → `null`; `test_count: "—"` → `0`; `test_classes: "—"` → `[]`; `tech_doc_revision: "—"` → `0`; `dev_selftest: "—"` → `"not_run"`; `dev_selftest_at: "—"` → `null`
636
+ - **TSV `"—"` mapping**: when reading TSV files, map dash values to JSON types: `implemented_by: "—"` → `null`; `test_count: "—"` → `0`; `test_classes: "—"` → `[]`; `tech_doc_revision: "—"` → `0`; `dev_selftest: "—"` → `"not_run"`; `dev_selftest_at: "—"` → `null`; `qc_status: "—"` → `"not_run"`; `qc_run_at: "—"` → `null`; `qc_owner: "—"` → `null`; `qc_blocked_by: "—"` → `null`
637
+ - **Backward-compat (older 19-col TSV):** if `qc_owner` / `qc_blocked_by` columns are **absent** from the header (a pre-upgrade TSV), treat them as `null` — do not error. The next `/generate-bdd` re-gen upgrades the header to include them.
590
638
 
591
639
  ### Step 8b — Living Docs Sync *(umbrella mode only)*
592
640
 
@@ -659,6 +707,13 @@ Suggest the logical next command based on workflow phase:
659
707
  | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
660
708
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
661
709
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
710
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
711
+ | /qc-plan | `/qc-design-test {UC-ID}` |
712
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
713
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
714
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
715
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
716
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
662
717
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
663
718
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
664
719
  | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
@@ -91,7 +91,7 @@ If code was generated from an older revision → flag `TECHDOC_DRIFT`.
91
91
  *Skip this step if no TSV files existed (handled by Step 1 no-TSV path).*
92
92
 
93
93
  For each `.tsv` file processed: write updated `spec_ver`, `status`, `last_updated` back to disk.
94
- Do **not** modify `dev_selftest` or `dev_selftest_at` — those are owned by `/dev-run-test`; this command only reads them for the report.
94
+ Do **not** modify `dev_selftest`/`dev_selftest_at` (owned by `/dev-run-test`) or `qc_status`/`qc_run_at`/`qc_owner`/`qc_blocked_by` (owned by `/qc-run-test` + `/report-bug`); this command only reads them for the report.
95
95
 
96
96
  ### Step 7 — Compute dashboard aggregates
97
97
 
@@ -110,8 +110,17 @@ gap_count = rows where status == GAP
110
110
  dev_selftest_passing = rows where dev_selftest == pass
111
111
  dev_selftest_failing = rows where dev_selftest == fail
112
112
  dev_selftest_not_run = rows where dev_selftest in (not_run, —)
113
- # NOTE: this is the DEV self-check signal (did the dev run their own smoke tests),
114
- # NOT official QC/dev-team coverage — keep it labeled as such on the dashboard.
113
+ # NOTE: dev_selftest is the DEV self-check signal (did the dev run their own smoke tests),
114
+ # NOT official coverage — keep it labeled as such on the dashboard.
115
+ qc_passing = rows where qc_status == pass
116
+ qc_failing = rows where qc_status == fail
117
+ qc_skipped = rows where qc_status == skip
118
+ qc_not_run = rows where qc_status in (not_run, —)
119
+ # qc_status is the OFFICIAL QC automation result (set by /qc-run-test),
120
+ # shown alongside — never merged with — dev_selftest.
121
+ waiting_dev = rows where qc_owner == dev # PM view: QC-found, waiting on dev to fix
122
+ waiting_po = rows where qc_owner == po # PM view: blocked, waiting on PO to confirm/clarify
123
+ # qc_owner + qc_blocked_by answer "case nào đang chờ ai" — surface as a "Waiting on" column.
115
124
  tech_docs_count = count .md files in {paths.tech_docs_dir}/{domain}/
116
125
  ```
117
126
 
@@ -142,6 +151,12 @@ Schema:
142
151
  "dev_selftest_passing": 0,
143
152
  "dev_selftest_failing": 0,
144
153
  "dev_selftest_not_run": 0,
154
+ "qc_passing": 0,
155
+ "qc_failing": 0,
156
+ "qc_skipped": 0,
157
+ "qc_not_run": 0,
158
+ "waiting_dev": 0,
159
+ "waiting_po": 0,
145
160
  "tech_docs_count": 0
146
161
  },
147
162
  "prds": [
@@ -169,6 +184,10 @@ Schema:
169
184
  "test_classes": ["<TestClass1>", "<TestClass2>"],
170
185
  "dev_selftest": "pass | fail | not_run",
171
186
  "dev_selftest_at": "<YYYY-MM-DD or null>",
187
+ "qc_status": "pass | fail | skip | not_run",
188
+ "qc_run_at": "<YYYY-MM-DD or null>",
189
+ "qc_owner": "dev | po | null",
190
+ "qc_blocked_by": "<BUG-id / GAP-id or null>",
172
191
  "prd_version": "<prd version when BDD was generated>",
173
192
  "bdd_version": "<bdd version when code was generated>",
174
193
  "tech_doc_revision": 0,
@@ -233,7 +252,8 @@ Schema:
233
252
  - `tech_doc_revision`: use integer; `0` if not yet generated
234
253
  - `code_coverage_pct` / `test_coverage_pct`: round to nearest integer (0–100)
235
254
  - Always write to `{paths.trace_dir}/trace-report.json` regardless of domain filter — if a domain filter was applied, include only those PRDs in `prds[]` but note the domain in the `domain` field
236
- - **TSV `"—"` mapping**: when reading TSV files, map dash values to JSON types: `implemented_by: "—"` → `null`; `test_count: "—"` → `0`; `test_classes: "—"` → `[]`; `tech_doc_revision: "—"` → `0`; `dev_selftest: "—"` → `"not_run"`; `dev_selftest_at: "—"` → `null`
255
+ - **TSV `"—"` mapping**: when reading TSV files, map dash values to JSON types: `implemented_by: "—"` → `null`; `test_count: "—"` → `0`; `test_classes: "—"` → `[]`; `tech_doc_revision: "—"` → `0`; `dev_selftest: "—"` → `"not_run"`; `dev_selftest_at: "—"` → `null`; `qc_status: "—"` → `"not_run"`; `qc_run_at: "—"` → `null`; `qc_owner: "—"` → `null`; `qc_blocked_by: "—"` → `null`
256
+ - **Backward-compat (older 19-col TSV):** if `qc_owner` / `qc_blocked_by` columns are **absent** from the header (a pre-upgrade TSV), treat them as `null` — do not error. The next `/generate-bdd` re-gen upgrades the header to include them.
237
257
 
238
258
  ### Step 8b — Living Docs Sync *(umbrella mode only)*
239
259
 
@@ -1 +1 @@
1
- 0.10.0
1
+ 0.12.0
@@ -128,6 +128,8 @@ Read `.agent/project-context.yaml`. Extract and store:
128
128
  - `paths.specs_dir` → BDD specs root
129
129
  - `paths.prd_dir` → PRD documents root
130
130
  - `paths.refinement_dir` → findings/review output dir
131
+ - `paths.qc_dir` → QC automation artifacts root (visible top-level, one subfolder per UC: `{qc_dir}/{UC-ID}/`)
132
+ - `paths.qc_skills_dir` → where qc-* commands load QC skills from (default bundled `.agent/skills/qc`; override to the QC team's own repo/submodule so framework upgrade won't overwrite them)
131
133
  - `paths.product_definitions_dir` → product definitions root
132
134
  - `paths.domain_knowledge_dir` → domain knowledge root
133
135
  - `paths.business_dictionary` → path to business-dictionary.md
@@ -140,6 +142,8 @@ If `paths` section is absent, use these defaults:
140
142
  - `specs_dir` = `specs/bdd`
141
143
  - `prd_dir` = `specs/prd`
142
144
  - `refinement_dir` = `.agent/review`
145
+ - `qc_dir` = `docs`
146
+ - `qc_skills_dir` = `.agent/skills/qc`
143
147
  - `product_definitions_dir` = `specs/product-definition`
144
148
  - `domain_knowledge_dir` = `specs/domain-knowledge`
145
149
  - `business_dictionary` = `specs/domain-knowledge/business-dictionary.md`
@@ -184,6 +188,7 @@ If `services` section is present:
184
188
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
185
189
  - Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
186
190
  - Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
191
+ - Override `paths.prd_change_requests_dir` → `{spec_source}/feedback/prd-change-requests`
187
192
 
188
193
  > **Why under `spec_source`:** PRD, design-spec, domain knowledge, the **API contract (tech-docs)**, and tester feedback are all **cross-team artifacts** — they must live in the **shared spec repo** so every umbrella (FE/App/BE) reads the same source via `/sync`. Tech-docs specifically: BE authors the tech-design (API contract), commits + pushes it into the spec submodule (2-layer commit), and FE/App pull it on their next `/sync` to wire the real API in `/generate-code --phase=integration`. In single-service mode (no `spec_source`), these default under the repo root — still shared, same repo.
189
194
 
@@ -224,19 +229,41 @@ If the file does not exist → skip silently.
224
229
 
225
230
  ---
226
231
 
227
- ## Step 3 — [CRITICAL] Load CLAUDE.md
232
+ ## Step 3 — [CRITICAL] Load CLAUDE.md (layered: root + service overlay)
228
233
 
229
234
  *This is the highest-priority context — it defines HOW to write code and documents for this project.*
230
235
 
231
- Read `CLAUDE.md`. Extract and store:
236
+ CLAUDE.md is loaded in **two layers** so umbrella-wide rules and service-specific
237
+ architecture/coding standards compose correctly. The agent always sits at the umbrella
238
+ root, but the implementation code lives in a service submodule with its OWN stack,
239
+ architecture, and conventions — so the service's CLAUDE.md must win for code generation.
240
+
241
+ **Layer 1 — [BASE] Root CLAUDE.md (umbrella-wide).**
242
+ Read `CLAUDE.md` at the repo root. Treat its contents as the **shared baseline** for the
243
+ whole umbrella — git conventions, data-protection posture, cross-cutting rules, and (in
244
+ single-service mode) the project's only architecture + coding standards.
245
+
246
+ **Layer 2 — [OVERLAY] Service CLAUDE.md (umbrella mode only).**
247
+ *Run only if `service_root` was set in Step 1.6 (i.e. a real service was routed to).*
248
+ Read `{service_root}/CLAUDE.md`. This file defines the architecture + coding standards of
249
+ the **actual stack being implemented** (e.g. `user-service` = java-spring, `web` = nextjs).
250
+ Overlay it on top of Layer 1: **on any conflict, the service value WINS** for architecture,
251
+ coding standards, and error handling. Layer-1 values that the service does not redefine
252
+ (e.g. git conventions, banned patterns shared org-wide) remain in effect.
253
+
254
+ From the **merged** result, extract and store:
232
255
 
233
256
  - **§1 Project Overview** → project name, language, framework, build/test commands, domains
234
- - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules
235
- - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns
236
- - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name
237
- - **§7 Git Conventions** → branch naming pattern, commit message format
257
+ - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules — *service overlay wins*
258
+ - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns — *service overlay wins*
259
+ - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name — *service overlay wins*
260
+ - **§7 Git Conventions** → branch naming pattern, commit message format — *root baseline unless service redefines*
238
261
 
239
- If `CLAUDE.md` does not exist → note it as missing and continue with project-context.yaml data only.
262
+ **Resolution rules:**
263
+ - If both layers exist → merge as above; record `claude_md_source = root + {service_root}`.
264
+ - If only the service overlay exists (no root CLAUDE.md) → use the service file alone; `claude_md_source = {service_root}`.
265
+ - If `service_root` is set but `{service_root}/CLAUDE.md` is **missing** → fall back to root CLAUDE.md and flag ⚠️ in the Step 7 recap (the service has no architecture/coding-standards definition — code generation will use umbrella defaults, which may be the wrong stack).
266
+ - If neither exists → note CLAUDE.md as missing and continue with project-context.yaml data only.
240
267
 
241
268
  ---
242
269
 
@@ -336,7 +363,8 @@ Output exactly this block:
336
363
  [CTX LOADED]
337
364
  Stack : {language} / {framework} / {database}
338
365
  Platform : {active_module} ({platform_type})
339
- Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
366
+ Layers : {layer order from merged CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
367
+ CLAUDE.md : {root + {service_root} | {service_root} only | root only | ⚠️ service overlay MISSING — using root | missing}
340
368
  Ticket : {ticket_prefix}-
341
369
  Dict : {loaded — N canonical terms, M banned terms | missing}
342
370
  Entities : {loaded — EntityA, EntityB, EntityC | missing}
@@ -604,6 +632,13 @@ Suggest the logical next command based on workflow phase:
604
632
  | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
605
633
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
606
634
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
635
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
636
+ | /qc-plan | `/qc-design-test {UC-ID}` |
637
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
638
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
639
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
640
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
641
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
607
642
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
608
643
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
609
644
  | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
@@ -125,6 +125,8 @@ Read `.agent/project-context.yaml`. Extract and store:
125
125
  - `paths.specs_dir` → BDD specs root
126
126
  - `paths.prd_dir` → PRD documents root
127
127
  - `paths.refinement_dir` → findings/review output dir
128
+ - `paths.qc_dir` → QC automation artifacts root (visible top-level, one subfolder per UC: `{qc_dir}/{UC-ID}/`)
129
+ - `paths.qc_skills_dir` → where qc-* commands load QC skills from (default bundled `.agent/skills/qc`; override to the QC team's own repo/submodule so framework upgrade won't overwrite them)
128
130
  - `paths.product_definitions_dir` → product definitions root
129
131
  - `paths.domain_knowledge_dir` → domain knowledge root
130
132
  - `paths.business_dictionary` → path to business-dictionary.md
@@ -137,6 +139,8 @@ If `paths` section is absent, use these defaults:
137
139
  - `specs_dir` = `specs/bdd`
138
140
  - `prd_dir` = `specs/prd`
139
141
  - `refinement_dir` = `.agent/review`
142
+ - `qc_dir` = `docs`
143
+ - `qc_skills_dir` = `.agent/skills/qc`
140
144
  - `product_definitions_dir` = `specs/product-definition`
141
145
  - `domain_knowledge_dir` = `specs/domain-knowledge`
142
146
  - `business_dictionary` = `specs/domain-knowledge/business-dictionary.md`
@@ -181,6 +185,7 @@ If `services` section is present:
181
185
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
182
186
  - Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
183
187
  - Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
188
+ - Override `paths.prd_change_requests_dir` → `{spec_source}/feedback/prd-change-requests`
184
189
 
185
190
  > **Why under `spec_source`:** PRD, design-spec, domain knowledge, the **API contract (tech-docs)**, and tester feedback are all **cross-team artifacts** — they must live in the **shared spec repo** so every umbrella (FE/App/BE) reads the same source via `/sync`. Tech-docs specifically: BE authors the tech-design (API contract), commits + pushes it into the spec submodule (2-layer commit), and FE/App pull it on their next `/sync` to wire the real API in `/generate-code --phase=integration`. In single-service mode (no `spec_source`), these default under the repo root — still shared, same repo.
186
191
 
@@ -221,19 +226,41 @@ If the file does not exist → skip silently.
221
226
 
222
227
  ---
223
228
 
224
- ## Step 3 — [CRITICAL] Load CLAUDE.md
229
+ ## Step 3 — [CRITICAL] Load CLAUDE.md (layered: root + service overlay)
225
230
 
226
231
  *This is the highest-priority context — it defines HOW to write code and documents for this project.*
227
232
 
228
- Read `CLAUDE.md`. Extract and store:
233
+ CLAUDE.md is loaded in **two layers** so umbrella-wide rules and service-specific
234
+ architecture/coding standards compose correctly. The agent always sits at the umbrella
235
+ root, but the implementation code lives in a service submodule with its OWN stack,
236
+ architecture, and conventions — so the service's CLAUDE.md must win for code generation.
237
+
238
+ **Layer 1 — [BASE] Root CLAUDE.md (umbrella-wide).**
239
+ Read `CLAUDE.md` at the repo root. Treat its contents as the **shared baseline** for the
240
+ whole umbrella — git conventions, data-protection posture, cross-cutting rules, and (in
241
+ single-service mode) the project's only architecture + coding standards.
242
+
243
+ **Layer 2 — [OVERLAY] Service CLAUDE.md (umbrella mode only).**
244
+ *Run only if `service_root` was set in Step 1.6 (i.e. a real service was routed to).*
245
+ Read `{service_root}/CLAUDE.md`. This file defines the architecture + coding standards of
246
+ the **actual stack being implemented** (e.g. `user-service` = java-spring, `web` = nextjs).
247
+ Overlay it on top of Layer 1: **on any conflict, the service value WINS** for architecture,
248
+ coding standards, and error handling. Layer-1 values that the service does not redefine
249
+ (e.g. git conventions, banned patterns shared org-wide) remain in effect.
250
+
251
+ From the **merged** result, extract and store:
229
252
 
230
253
  - **§1 Project Overview** → project name, language, framework, build/test commands, domains
231
- - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules
232
- - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns
233
- - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name
234
- - **§7 Git Conventions** → branch naming pattern, commit message format
254
+ - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules — *service overlay wins*
255
+ - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns — *service overlay wins*
256
+ - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name — *service overlay wins*
257
+ - **§7 Git Conventions** → branch naming pattern, commit message format — *root baseline unless service redefines*
235
258
 
236
- If `CLAUDE.md` does not exist → note it as missing and continue with project-context.yaml data only.
259
+ **Resolution rules:**
260
+ - If both layers exist → merge as above; record `claude_md_source = root + {service_root}`.
261
+ - If only the service overlay exists (no root CLAUDE.md) → use the service file alone; `claude_md_source = {service_root}`.
262
+ - If `service_root` is set but `{service_root}/CLAUDE.md` is **missing** → fall back to root CLAUDE.md and flag ⚠️ in the Step 7 recap (the service has no architecture/coding-standards definition — code generation will use umbrella defaults, which may be the wrong stack).
263
+ - If neither exists → note CLAUDE.md as missing and continue with project-context.yaml data only.
237
264
 
238
265
  ---
239
266
 
@@ -333,7 +360,8 @@ Output exactly this block:
333
360
  [CTX LOADED]
334
361
  Stack : {language} / {framework} / {database}
335
362
  Platform : {active_module} ({platform_type})
336
- Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
363
+ Layers : {layer order from merged CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
364
+ CLAUDE.md : {root + {service_root} | {service_root} only | root only | ⚠️ service overlay MISSING — using root | missing}
337
365
  Ticket : {ticket_prefix}-
338
366
  Dict : {loaded — N canonical terms, M banned terms | missing}
339
367
  Entities : {loaded — EntityA, EntityB, EntityC | missing}
@@ -538,6 +566,13 @@ Suggest the logical next command based on workflow phase:
538
566
  | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
539
567
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
540
568
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
569
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
570
+ | /qc-plan | `/qc-design-test {UC-ID}` |
571
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
572
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
573
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
574
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
575
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
541
576
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
542
577
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
543
578
  | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |