@anhth2/spec-driven-dev-plugin 0.10.0 → 0.11.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 (203) hide show
  1. package/commands/debug.md +38 -8
  2. package/commands/define-product.md +38 -8
  3. package/commands/dev-gen-test.md +39 -9
  4. package/commands/dev-gen-test.tmpl +1 -1
  5. package/commands/dev-run-test.md +43 -10
  6. package/commands/dev-run-test.tmpl +5 -2
  7. package/commands/dev-smoke-test.md +38 -8
  8. package/commands/fix-bug.md +38 -8
  9. package/commands/generate-bdd.md +42 -10
  10. package/commands/generate-bdd.tmpl +4 -2
  11. package/commands/generate-code.md +39 -9
  12. package/commands/generate-code.tmpl +1 -1
  13. package/commands/generate-design-spec.md +38 -8
  14. package/commands/generate-prd.md +38 -8
  15. package/commands/generate-spec-manifest.md +38 -8
  16. package/commands/generate-tech-docs.md +38 -8
  17. package/commands/learn.md +38 -8
  18. package/commands/propose-scenario.md +38 -8
  19. package/commands/qc-analyze.md +514 -0
  20. package/commands/qc-analyze.tmpl +71 -0
  21. package/commands/qc-design-test.md +510 -0
  22. package/commands/qc-design-test.tmpl +67 -0
  23. package/commands/qc-plan.md +492 -0
  24. package/commands/qc-plan.tmpl +49 -0
  25. package/commands/qc-report.md +491 -0
  26. package/commands/qc-report.tmpl +48 -0
  27. package/commands/qc-review.md +496 -0
  28. package/commands/qc-review.tmpl +53 -0
  29. package/commands/qc-run-test.md +538 -0
  30. package/commands/qc-run-test.tmpl +77 -0
  31. package/commands/refine-prd.md +38 -8
  32. package/commands/report-bug.md +38 -8
  33. package/commands/review-code.md +38 -8
  34. package/commands/review-context.md +38 -8
  35. package/commands/review-tech-docs.md +38 -8
  36. package/commands/setup-ai-first.md +7 -0
  37. package/commands/sync.md +7 -0
  38. package/commands/update-framework.md +7 -0
  39. package/commands/validate-traces.md +54 -12
  40. package/commands/validate-traces.tmpl +16 -4
  41. package/core/FRAMEWORK_VERSION +1 -1
  42. package/core/commands/debug.md +38 -8
  43. package/core/commands/define-product.md +38 -8
  44. package/core/commands/dev-gen-test.md +39 -9
  45. package/core/commands/dev-run-test.md +43 -10
  46. package/core/commands/dev-smoke-test.md +38 -8
  47. package/core/commands/fix-bug.md +38 -8
  48. package/core/commands/generate-bdd.md +42 -10
  49. package/core/commands/generate-code.md +39 -9
  50. package/core/commands/generate-design-spec.md +38 -8
  51. package/core/commands/generate-prd.md +38 -8
  52. package/core/commands/generate-spec-manifest.md +38 -8
  53. package/core/commands/generate-tech-docs.md +38 -8
  54. package/core/commands/learn.md +38 -8
  55. package/core/commands/propose-scenario.md +38 -8
  56. package/core/commands/qc-analyze.md +514 -0
  57. package/core/commands/qc-design-test.md +510 -0
  58. package/core/commands/qc-plan.md +492 -0
  59. package/core/commands/qc-report.md +491 -0
  60. package/core/commands/qc-review.md +496 -0
  61. package/core/commands/qc-run-test.md +538 -0
  62. package/core/commands/refine-prd.md +38 -8
  63. package/core/commands/report-bug.md +38 -8
  64. package/core/commands/review-code.md +38 -8
  65. package/core/commands/review-context.md +38 -8
  66. package/core/commands/review-tech-docs.md +38 -8
  67. package/core/commands/setup-ai-first.md +7 -0
  68. package/core/commands/sync.md +7 -0
  69. package/core/commands/update-framework.md +7 -0
  70. package/core/commands/validate-traces.md +54 -12
  71. package/core/modules/qc-playwright/stack-profile.yaml +65 -0
  72. package/core/skills/code/SKILL.md +45 -8
  73. package/core/skills/debug/SKILL.md +52 -8
  74. package/core/skills/design-spec/SKILL.md +38 -8
  75. package/core/skills/discovery/SKILL.md +38 -8
  76. package/core/skills/prd/SKILL.md +14 -0
  77. package/core/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
  78. package/core/skills/qc/qa-analyst/acceptance-criteria.md +56 -0
  79. package/core/skills/qc/qa-analyst/business-rules.md +55 -0
  80. package/core/skills/qc/qa-analyst/data-flow.md +60 -0
  81. package/core/skills/qc/qa-analyst/spec-breakdown.md +57 -0
  82. package/core/skills/qc/qa-designer/e2e/journey.md +41 -0
  83. package/core/skills/qc/qa-designer/exploratory/charter.md +68 -0
  84. package/core/skills/qc/qa-designer/exploratory/explore-to-functional.md +43 -0
  85. package/core/skills/qc/qa-designer/functional/api.md +45 -0
  86. package/core/skills/qc/qa-designer/functional/gui-feature.md +46 -0
  87. package/core/skills/qc/qa-designer/functional/gui-screen.md +52 -0
  88. package/core/skills/qc/qa-designer/integration/api.md +42 -0
  89. package/core/skills/qc/qa-designer/integration/db.md +39 -0
  90. package/core/skills/qc/qa-designer/integration/gui.md +40 -0
  91. package/core/skills/qc/qa-designer/integration/kafka.md +40 -0
  92. package/core/skills/qc/qa-designer/non-functional.md +40 -0
  93. package/core/skills/qc/qa-planner/test-plan.md +120 -0
  94. package/core/skills/qc/qa-reviewer/script/e2e.md +87 -0
  95. package/core/skills/qc/qa-reviewer/script/exploratory.md +45 -0
  96. package/core/skills/qc/qa-reviewer/script/functional.md +101 -0
  97. package/core/skills/qc/qa-reviewer/script/integration.md +91 -0
  98. package/core/skills/qc/qa-reviewer/script/non-functional.md +126 -0
  99. package/core/skills/qc/qa-reviewer/test-case/e2e.md +73 -0
  100. package/core/skills/qc/qa-reviewer/test-case/exploratory.md +43 -0
  101. package/core/skills/qc/qa-reviewer/test-case/functional.md +76 -0
  102. package/core/skills/qc/qa-reviewer/test-case/integration.md +69 -0
  103. package/core/skills/qc/qa-reviewer/test-case/non-functional.md +73 -0
  104. package/core/skills/qc/qa-runner/e2e.md +49 -0
  105. package/core/skills/qc/qa-runner/exploratory/session.md +36 -0
  106. package/core/skills/qc/qa-runner/functional/api.md +35 -0
  107. package/core/skills/qc/qa-runner/functional/gui-feature.md +51 -0
  108. package/core/skills/qc/qa-runner/functional/gui-screen.md +55 -0
  109. package/core/skills/qc/qa-runner/integration.md +47 -0
  110. package/core/skills/qc/qa-runner/non-functional.md +49 -0
  111. package/core/skills/qc/qa-runner/report/report.md +37 -0
  112. package/core/skills/setup-ai-first/SKILL.md +7 -0
  113. package/core/skills/spec/SKILL.md +14 -0
  114. package/core/skills/test/SKILL.md +83 -16
  115. package/core/steps/context-loader.md +31 -8
  116. package/core/steps/report-footer.md +7 -0
  117. package/core/templates/project-context.yaml +8 -0
  118. package/docs/01-getting-started/README.md +19 -0
  119. package/docs/01-getting-started/core-concepts.md +102 -0
  120. package/docs/01-getting-started/installation.md +154 -0
  121. package/docs/01-getting-started/quickstart.md +85 -0
  122. package/docs/02-guides/README.md +27 -0
  123. package/docs/02-guides/developer/README.md +46 -0
  124. package/docs/02-guides/developer/bdd-and-trace.md +123 -0
  125. package/docs/02-guides/developer/commands.md +76 -0
  126. package/docs/02-guides/developer/pr-checklist.md +15 -0
  127. package/docs/02-guides/developer/scenarios.md +448 -0
  128. package/docs/02-guides/developer/workflow.md +59 -0
  129. package/docs/02-guides/product-owner/README.md +77 -0
  130. package/docs/02-guides/product-owner/commands.md +30 -0
  131. package/docs/02-guides/product-owner/handoff-checklist.md +42 -0
  132. package/docs/02-guides/product-owner/prd-writing-rules.md +45 -0
  133. package/docs/02-guides/product-owner/scenarios.md +357 -0
  134. package/docs/02-guides/qc-automation.md +92 -0
  135. package/docs/02-guides/tester/README.md +72 -0
  136. package/docs/02-guides/tester/bug-reporting.md +117 -0
  137. package/docs/02-guides/tester/reading-specs.md +79 -0
  138. package/docs/02-guides/tester/scenarios.md +186 -0
  139. package/docs/02-guides/tester/spec-manifest.md +124 -0
  140. package/docs/02-guides/tester/test-checklist.md +31 -0
  141. package/docs/02-guides/tester/workflow.md +79 -0
  142. package/docs/03-concepts/README.md +19 -0
  143. package/docs/03-concepts/architecture.md +243 -0
  144. package/docs/03-concepts/pipeline.md +249 -0
  145. package/docs/03-concepts/traceability.md +148 -0
  146. package/docs/04-operations/README.md +33 -0
  147. package/docs/04-operations/bug-flow.md +321 -0
  148. package/docs/04-operations/publishing.md +137 -0
  149. package/docs/04-operations/sync-and-update.md +328 -0
  150. package/docs/05-reference/README.md +29 -0
  151. package/docs/05-reference/commands.md +229 -0
  152. package/docs/05-reference/modules.md +110 -0
  153. package/docs/05-reference/trace-schema.md +146 -0
  154. package/docs/README.md +51 -0
  155. package/modules/qc-playwright/stack-profile.yaml +65 -0
  156. package/package.json +2 -2
  157. package/skills/code/SKILL.md +45 -8
  158. package/skills/debug/SKILL.md +52 -8
  159. package/skills/design-spec/SKILL.md +38 -8
  160. package/skills/discovery/SKILL.md +38 -8
  161. package/skills/prd/SKILL.md +14 -0
  162. package/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
  163. package/skills/qc/qa-analyst/acceptance-criteria.md +56 -0
  164. package/skills/qc/qa-analyst/business-rules.md +55 -0
  165. package/skills/qc/qa-analyst/data-flow.md +60 -0
  166. package/skills/qc/qa-analyst/spec-breakdown.md +57 -0
  167. package/skills/qc/qa-designer/e2e/journey.md +41 -0
  168. package/skills/qc/qa-designer/exploratory/charter.md +68 -0
  169. package/skills/qc/qa-designer/exploratory/explore-to-functional.md +43 -0
  170. package/skills/qc/qa-designer/functional/api.md +45 -0
  171. package/skills/qc/qa-designer/functional/gui-feature.md +46 -0
  172. package/skills/qc/qa-designer/functional/gui-screen.md +52 -0
  173. package/skills/qc/qa-designer/integration/api.md +42 -0
  174. package/skills/qc/qa-designer/integration/db.md +39 -0
  175. package/skills/qc/qa-designer/integration/gui.md +40 -0
  176. package/skills/qc/qa-designer/integration/kafka.md +40 -0
  177. package/skills/qc/qa-designer/non-functional.md +40 -0
  178. package/skills/qc/qa-planner/test-plan.md +120 -0
  179. package/skills/qc/qa-reviewer/script/e2e.md +87 -0
  180. package/skills/qc/qa-reviewer/script/exploratory.md +45 -0
  181. package/skills/qc/qa-reviewer/script/functional.md +101 -0
  182. package/skills/qc/qa-reviewer/script/integration.md +91 -0
  183. package/skills/qc/qa-reviewer/script/non-functional.md +126 -0
  184. package/skills/qc/qa-reviewer/test-case/e2e.md +73 -0
  185. package/skills/qc/qa-reviewer/test-case/exploratory.md +43 -0
  186. package/skills/qc/qa-reviewer/test-case/functional.md +76 -0
  187. package/skills/qc/qa-reviewer/test-case/integration.md +69 -0
  188. package/skills/qc/qa-reviewer/test-case/non-functional.md +73 -0
  189. package/skills/qc/qa-runner/e2e.md +49 -0
  190. package/skills/qc/qa-runner/exploratory/session.md +36 -0
  191. package/skills/qc/qa-runner/functional/api.md +35 -0
  192. package/skills/qc/qa-runner/functional/gui-feature.md +51 -0
  193. package/skills/qc/qa-runner/functional/gui-screen.md +55 -0
  194. package/skills/qc/qa-runner/integration.md +47 -0
  195. package/skills/qc/qa-runner/non-functional.md +49 -0
  196. package/skills/qc/qa-runner/report/report.md +37 -0
  197. package/skills/setup-ai-first/SKILL.md +7 -0
  198. package/skills/spec/SKILL.md +14 -0
  199. package/skills/test/SKILL.md +83 -16
  200. package/steps/context-loader.md +31 -8
  201. package/steps/report-footer.md +7 -0
  202. package/templates/project-context.yaml +8 -0
  203. package/ARCHITECTURE.md +0 -258
@@ -230,19 +230,41 @@ If the file does not exist → skip silently.
230
230
 
231
231
  ---
232
232
 
233
- ## Step 3 — [CRITICAL] Load CLAUDE.md
233
+ ## Step 3 — [CRITICAL] Load CLAUDE.md (layered: root + service overlay)
234
234
 
235
235
  *This is the highest-priority context — it defines HOW to write code and documents for this project.*
236
236
 
237
- Read `CLAUDE.md`. Extract and store:
237
+ CLAUDE.md is loaded in **two layers** so umbrella-wide rules and service-specific
238
+ architecture/coding standards compose correctly. The agent always sits at the umbrella
239
+ root, but the implementation code lives in a service submodule with its OWN stack,
240
+ architecture, and conventions — so the service's CLAUDE.md must win for code generation.
241
+
242
+ **Layer 1 — [BASE] Root CLAUDE.md (umbrella-wide).**
243
+ Read `CLAUDE.md` at the repo root. Treat its contents as the **shared baseline** for the
244
+ whole umbrella — git conventions, data-protection posture, cross-cutting rules, and (in
245
+ single-service mode) the project's only architecture + coding standards.
246
+
247
+ **Layer 2 — [OVERLAY] Service CLAUDE.md (umbrella mode only).**
248
+ *Run only if `service_root` was set in Step 1.6 (i.e. a real service was routed to).*
249
+ Read `{service_root}/CLAUDE.md`. This file defines the architecture + coding standards of
250
+ the **actual stack being implemented** (e.g. `user-service` = java-spring, `web` = nextjs).
251
+ Overlay it on top of Layer 1: **on any conflict, the service value WINS** for architecture,
252
+ coding standards, and error handling. Layer-1 values that the service does not redefine
253
+ (e.g. git conventions, banned patterns shared org-wide) remain in effect.
254
+
255
+ From the **merged** result, extract and store:
238
256
 
239
257
  - **§1 Project Overview** → project name, language, framework, build/test commands, domains
240
- - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules
241
- - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns
242
- - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name
243
- - **§7 Git Conventions** → branch naming pattern, commit message format
258
+ - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules — *service overlay wins*
259
+ - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns — *service overlay wins*
260
+ - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name — *service overlay wins*
261
+ - **§7 Git Conventions** → branch naming pattern, commit message format — *root baseline unless service redefines*
244
262
 
245
- If `CLAUDE.md` does not exist → note it as missing and continue with project-context.yaml data only.
263
+ **Resolution rules:**
264
+ - If both layers exist → merge as above; record `claude_md_source = root + {service_root}`.
265
+ - If only the service overlay exists (no root CLAUDE.md) → use the service file alone; `claude_md_source = {service_root}`.
266
+ - 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).
267
+ - If neither exists → note CLAUDE.md as missing and continue with project-context.yaml data only.
246
268
 
247
269
  ---
248
270
 
@@ -342,7 +364,8 @@ Output exactly this block:
342
364
  [CTX LOADED]
343
365
  Stack : {language} / {framework} / {database}
344
366
  Platform : {active_module} ({platform_type})
345
- Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
367
+ Layers : {layer order from merged CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
368
+ CLAUDE.md : {root + {service_root} | {service_root} only | root only | ⚠️ service overlay MISSING — using root | missing}
346
369
  Ticket : {ticket_prefix}-
347
370
  Dict : {loaded — N canonical terms, M banned terms | missing}
348
371
  Entities : {loaded — EntityA, EntityB, EntityC | missing}
@@ -485,6 +508,13 @@ Suggest the logical next command based on workflow phase:
485
508
  | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
486
509
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
487
510
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
511
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
512
+ | /qc-plan | `/qc-design-test {UC-ID}` |
513
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
514
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
515
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
516
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
517
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
488
518
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
489
519
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
490
520
  | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
@@ -223,19 +223,41 @@ If the file does not exist → skip silently.
223
223
 
224
224
  ---
225
225
 
226
- ## Step 3 — [CRITICAL] Load CLAUDE.md
226
+ ## Step 3 — [CRITICAL] Load CLAUDE.md (layered: root + service overlay)
227
227
 
228
228
  *This is the highest-priority context — it defines HOW to write code and documents for this project.*
229
229
 
230
- Read `CLAUDE.md`. Extract and store:
230
+ CLAUDE.md is loaded in **two layers** so umbrella-wide rules and service-specific
231
+ architecture/coding standards compose correctly. The agent always sits at the umbrella
232
+ root, but the implementation code lives in a service submodule with its OWN stack,
233
+ architecture, and conventions — so the service's CLAUDE.md must win for code generation.
234
+
235
+ **Layer 1 — [BASE] Root CLAUDE.md (umbrella-wide).**
236
+ Read `CLAUDE.md` at the repo root. Treat its contents as the **shared baseline** for the
237
+ whole umbrella — git conventions, data-protection posture, cross-cutting rules, and (in
238
+ single-service mode) the project's only architecture + coding standards.
239
+
240
+ **Layer 2 — [OVERLAY] Service CLAUDE.md (umbrella mode only).**
241
+ *Run only if `service_root` was set in Step 1.6 (i.e. a real service was routed to).*
242
+ Read `{service_root}/CLAUDE.md`. This file defines the architecture + coding standards of
243
+ the **actual stack being implemented** (e.g. `user-service` = java-spring, `web` = nextjs).
244
+ Overlay it on top of Layer 1: **on any conflict, the service value WINS** for architecture,
245
+ coding standards, and error handling. Layer-1 values that the service does not redefine
246
+ (e.g. git conventions, banned patterns shared org-wide) remain in effect.
247
+
248
+ From the **merged** result, extract and store:
231
249
 
232
250
  - **§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
251
+ - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules — *service overlay wins*
252
+ - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns — *service overlay wins*
253
+ - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name — *service overlay wins*
254
+ - **§7 Git Conventions** → branch naming pattern, commit message format — *root baseline unless service redefines*
237
255
 
238
- If `CLAUDE.md` does not exist → note it as missing and continue with project-context.yaml data only.
256
+ **Resolution rules:**
257
+ - If both layers exist → merge as above; record `claude_md_source = root + {service_root}`.
258
+ - If only the service overlay exists (no root CLAUDE.md) → use the service file alone; `claude_md_source = {service_root}`.
259
+ - 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).
260
+ - If neither exists → note CLAUDE.md as missing and continue with project-context.yaml data only.
239
261
 
240
262
  ---
241
263
 
@@ -335,7 +357,8 @@ Output exactly this block:
335
357
  [CTX LOADED]
336
358
  Stack : {language} / {framework} / {database}
337
359
  Platform : {active_module} ({platform_type})
338
- Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
360
+ Layers : {layer order from merged CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
361
+ CLAUDE.md : {root + {service_root} | {service_root} only | root only | ⚠️ service overlay MISSING — using root | missing}
339
362
  Ticket : {ticket_prefix}-
340
363
  Dict : {loaded — N canonical terms, M banned terms | missing}
341
364
  Entities : {loaded — EntityA, EntityB, EntityC | missing}
@@ -447,6 +470,13 @@ Suggest the logical next command based on workflow phase:
447
470
  | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
448
471
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
449
472
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
473
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
474
+ | /qc-plan | `/qc-design-test {UC-ID}` |
475
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
476
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
477
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
478
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
479
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
450
480
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
451
481
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
452
482
  | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
@@ -228,19 +228,41 @@ If the file does not exist → skip silently.
228
228
 
229
229
  ---
230
230
 
231
- ## Step 3 — [CRITICAL] Load CLAUDE.md
231
+ ## Step 3 — [CRITICAL] Load CLAUDE.md (layered: root + service overlay)
232
232
 
233
233
  *This is the highest-priority context — it defines HOW to write code and documents for this project.*
234
234
 
235
- 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:
236
254
 
237
255
  - **§1 Project Overview** → project name, language, framework, build/test commands, domains
238
- - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules
239
- - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns
240
- - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name
241
- - **§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*
242
260
 
243
- 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.
244
266
 
245
267
  ---
246
268
 
@@ -340,7 +362,8 @@ Output exactly this block:
340
362
  [CTX LOADED]
341
363
  Stack : {language} / {framework} / {database}
342
364
  Platform : {active_module} ({platform_type})
343
- 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}
344
367
  Ticket : {ticket_prefix}-
345
368
  Dict : {loaded — N canonical terms, M banned terms | missing}
346
369
  Entities : {loaded — EntityA, EntityB, EntityC | missing}
@@ -779,6 +802,13 @@ Suggest the logical next command based on workflow phase:
779
802
  | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
780
803
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
781
804
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
805
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
806
+ | /qc-plan | `/qc-design-test {UC-ID}` |
807
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
808
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
809
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
810
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
811
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
782
812
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
783
813
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
784
814
  | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
@@ -225,19 +225,41 @@ If the file does not exist → skip silently.
225
225
 
226
226
  ---
227
227
 
228
- ## Step 3 — [CRITICAL] Load CLAUDE.md
228
+ ## Step 3 — [CRITICAL] Load CLAUDE.md (layered: root + service overlay)
229
229
 
230
230
  *This is the highest-priority context — it defines HOW to write code and documents for this project.*
231
231
 
232
- Read `CLAUDE.md`. Extract and store:
232
+ CLAUDE.md is loaded in **two layers** so umbrella-wide rules and service-specific
233
+ architecture/coding standards compose correctly. The agent always sits at the umbrella
234
+ root, but the implementation code lives in a service submodule with its OWN stack,
235
+ architecture, and conventions — so the service's CLAUDE.md must win for code generation.
236
+
237
+ **Layer 1 — [BASE] Root CLAUDE.md (umbrella-wide).**
238
+ Read `CLAUDE.md` at the repo root. Treat its contents as the **shared baseline** for the
239
+ whole umbrella — git conventions, data-protection posture, cross-cutting rules, and (in
240
+ single-service mode) the project's only architecture + coding standards.
241
+
242
+ **Layer 2 — [OVERLAY] Service CLAUDE.md (umbrella mode only).**
243
+ *Run only if `service_root` was set in Step 1.6 (i.e. a real service was routed to).*
244
+ Read `{service_root}/CLAUDE.md`. This file defines the architecture + coding standards of
245
+ the **actual stack being implemented** (e.g. `user-service` = java-spring, `web` = nextjs).
246
+ Overlay it on top of Layer 1: **on any conflict, the service value WINS** for architecture,
247
+ coding standards, and error handling. Layer-1 values that the service does not redefine
248
+ (e.g. git conventions, banned patterns shared org-wide) remain in effect.
249
+
250
+ From the **merged** result, extract and store:
233
251
 
234
252
  - **§1 Project Overview** → project name, language, framework, build/test commands, domains
235
- - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules
236
- - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns
237
- - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name
238
- - **§7 Git Conventions** → branch naming pattern, commit message format
253
+ - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules — *service overlay wins*
254
+ - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns — *service overlay wins*
255
+ - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name — *service overlay wins*
256
+ - **§7 Git Conventions** → branch naming pattern, commit message format — *root baseline unless service redefines*
239
257
 
240
- If `CLAUDE.md` does not exist → note it as missing and continue with project-context.yaml data only.
258
+ **Resolution rules:**
259
+ - If both layers exist → merge as above; record `claude_md_source = root + {service_root}`.
260
+ - If only the service overlay exists (no root CLAUDE.md) → use the service file alone; `claude_md_source = {service_root}`.
261
+ - 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).
262
+ - If neither exists → note CLAUDE.md as missing and continue with project-context.yaml data only.
241
263
 
242
264
  ---
243
265
 
@@ -337,7 +359,8 @@ Output exactly this block:
337
359
  [CTX LOADED]
338
360
  Stack : {language} / {framework} / {database}
339
361
  Platform : {active_module} ({platform_type})
340
- Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
362
+ Layers : {layer order from merged CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
363
+ CLAUDE.md : {root + {service_root} | {service_root} only | root only | ⚠️ service overlay MISSING — using root | missing}
341
364
  Ticket : {ticket_prefix}-
342
365
  Dict : {loaded — N canonical terms, M banned terms | missing}
343
366
  Entities : {loaded — EntityA, EntityB, EntityC | missing}
@@ -614,6 +637,13 @@ Suggest the logical next command based on workflow phase:
614
637
  | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
615
638
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
616
639
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
640
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
641
+ | /qc-plan | `/qc-design-test {UC-ID}` |
642
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
643
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
644
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
645
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
646
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
617
647
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
618
648
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
619
649
  | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
@@ -406,6 +406,13 @@ Suggest the logical next command based on workflow phase:
406
406
  | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
407
407
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
408
408
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
409
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
410
+ | /qc-plan | `/qc-design-test {UC-ID}` |
411
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
412
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
413
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
414
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
415
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
409
416
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
410
417
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
411
418
  | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
@@ -335,6 +335,13 @@ Suggest the logical next command based on workflow phase:
335
335
  | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
336
336
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
337
337
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
338
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
339
+ | /qc-plan | `/qc-design-test {UC-ID}` |
340
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
341
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
342
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
343
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
344
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
338
345
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
339
346
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
340
347
  | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
@@ -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}` |
@@ -223,19 +223,41 @@ If the file does not exist → skip silently.
223
223
 
224
224
  ---
225
225
 
226
- ## Step 3 — [CRITICAL] Load CLAUDE.md
226
+ ## Step 3 — [CRITICAL] Load CLAUDE.md (layered: root + service overlay)
227
227
 
228
228
  *This is the highest-priority context — it defines HOW to write code and documents for this project.*
229
229
 
230
- Read `CLAUDE.md`. Extract and store:
230
+ CLAUDE.md is loaded in **two layers** so umbrella-wide rules and service-specific
231
+ architecture/coding standards compose correctly. The agent always sits at the umbrella
232
+ root, but the implementation code lives in a service submodule with its OWN stack,
233
+ architecture, and conventions — so the service's CLAUDE.md must win for code generation.
234
+
235
+ **Layer 1 — [BASE] Root CLAUDE.md (umbrella-wide).**
236
+ Read `CLAUDE.md` at the repo root. Treat its contents as the **shared baseline** for the
237
+ whole umbrella — git conventions, data-protection posture, cross-cutting rules, and (in
238
+ single-service mode) the project's only architecture + coding standards.
239
+
240
+ **Layer 2 — [OVERLAY] Service CLAUDE.md (umbrella mode only).**
241
+ *Run only if `service_root` was set in Step 1.6 (i.e. a real service was routed to).*
242
+ Read `{service_root}/CLAUDE.md`. This file defines the architecture + coding standards of
243
+ the **actual stack being implemented** (e.g. `user-service` = java-spring, `web` = nextjs).
244
+ Overlay it on top of Layer 1: **on any conflict, the service value WINS** for architecture,
245
+ coding standards, and error handling. Layer-1 values that the service does not redefine
246
+ (e.g. git conventions, banned patterns shared org-wide) remain in effect.
247
+
248
+ From the **merged** result, extract and store:
231
249
 
232
250
  - **§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
251
+ - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules — *service overlay wins*
252
+ - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns — *service overlay wins*
253
+ - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name — *service overlay wins*
254
+ - **§7 Git Conventions** → branch naming pattern, commit message format — *root baseline unless service redefines*
237
255
 
238
- If `CLAUDE.md` does not exist → note it as missing and continue with project-context.yaml data only.
256
+ **Resolution rules:**
257
+ - If both layers exist → merge as above; record `claude_md_source = root + {service_root}`.
258
+ - If only the service overlay exists (no root CLAUDE.md) → use the service file alone; `claude_md_source = {service_root}`.
259
+ - 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).
260
+ - If neither exists → note CLAUDE.md as missing and continue with project-context.yaml data only.
239
261
 
240
262
  ---
241
263
 
@@ -335,7 +357,8 @@ Output exactly this block:
335
357
  [CTX LOADED]
336
358
  Stack : {language} / {framework} / {database}
337
359
  Platform : {active_module} ({platform_type})
338
- Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
360
+ Layers : {layer order from merged CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
361
+ CLAUDE.md : {root + {service_root} | {service_root} only | root only | ⚠️ service overlay MISSING — using root | missing}
339
362
  Ticket : {ticket_prefix}-
340
363
  Dict : {loaded — N canonical terms, M banned terms | missing}
341
364
  Entities : {loaded — EntityA, EntityB, EntityC | missing}
@@ -444,7 +467,7 @@ If code was generated from an older revision → flag `TECHDOC_DRIFT`.
444
467
  *Skip this step if no TSV files existed (handled by Step 1 no-TSV path).*
445
468
 
446
469
  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.
470
+ Do **not** modify `dev_selftest`/`dev_selftest_at` (owned by `/dev-run-test`) or `qc_status`/`qc_run_at` (owned by `/qc-run-test`); this command only reads them for the report.
448
471
 
449
472
  ### Step 7 — Compute dashboard aggregates
450
473
 
@@ -463,8 +486,14 @@ gap_count = rows where status == GAP
463
486
  dev_selftest_passing = rows where dev_selftest == pass
464
487
  dev_selftest_failing = rows where dev_selftest == fail
465
488
  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.
489
+ # NOTE: dev_selftest is the DEV self-check signal (did the dev run their own smoke tests),
490
+ # NOT official coverage — keep it labeled as such on the dashboard.
491
+ qc_passing = rows where qc_status == pass
492
+ qc_failing = rows where qc_status == fail
493
+ qc_skipped = rows where qc_status == skip
494
+ qc_not_run = rows where qc_status in (not_run, —)
495
+ # qc_status is the OFFICIAL QC automation result (set by /qc-run-test),
496
+ # shown alongside — never merged with — dev_selftest.
468
497
  tech_docs_count = count .md files in {paths.tech_docs_dir}/{domain}/
469
498
  ```
470
499
 
@@ -495,6 +524,10 @@ Schema:
495
524
  "dev_selftest_passing": 0,
496
525
  "dev_selftest_failing": 0,
497
526
  "dev_selftest_not_run": 0,
527
+ "qc_passing": 0,
528
+ "qc_failing": 0,
529
+ "qc_skipped": 0,
530
+ "qc_not_run": 0,
498
531
  "tech_docs_count": 0
499
532
  },
500
533
  "prds": [
@@ -522,6 +555,8 @@ Schema:
522
555
  "test_classes": ["<TestClass1>", "<TestClass2>"],
523
556
  "dev_selftest": "pass | fail | not_run",
524
557
  "dev_selftest_at": "<YYYY-MM-DD or null>",
558
+ "qc_status": "pass | fail | skip | not_run",
559
+ "qc_run_at": "<YYYY-MM-DD or null>",
525
560
  "prd_version": "<prd version when BDD was generated>",
526
561
  "bdd_version": "<bdd version when code was generated>",
527
562
  "tech_doc_revision": 0,
@@ -586,7 +621,7 @@ Schema:
586
621
  - `tech_doc_revision`: use integer; `0` if not yet generated
587
622
  - `code_coverage_pct` / `test_coverage_pct`: round to nearest integer (0–100)
588
623
  - 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`
624
+ - **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`
590
625
 
591
626
  ### Step 8b — Living Docs Sync *(umbrella mode only)*
592
627
 
@@ -659,6 +694,13 @@ Suggest the logical next command based on workflow phase:
659
694
  | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
660
695
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
661
696
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
697
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
698
+ | /qc-plan | `/qc-design-test {UC-ID}` |
699
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
700
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
701
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
702
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
703
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
662
704
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
663
705
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
664
706
  | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
@@ -0,0 +1,65 @@
1
+ # QC automation module — Python + pytest-playwright + Page Object
2
+ # Used by the /qc-* commands (the official QC automation pipeline ported from the QC team).
3
+ # This is the QC test-authoring/execution stack, independent of the dev implementation
4
+ # module (java-spring, react, flutter, …). Selected via tech_stack.qc_module or per /qc-* run.
5
+
6
+ build:
7
+ test: "python3 -m pytest"
8
+ e2e: "python3 -m pytest -m e2e"
9
+ report: "python3 -m pytest --html=reports/<feature>/report.html --self-contained-html"
10
+ show_trace: "python3 -m playwright show-trace <test-results/<nodeid>/trace.zip>"
11
+
12
+ architecture:
13
+ style: "Page Object Model over pytest-playwright — Markdown test-case first, Python second"
14
+ key_rules:
15
+ - "Markdown-first: never generate Python until a reviewed .Test.md exists for the feature"
16
+ - "No Allure, no hand-written dashboard, no record_video — use Playwright Trace + pytest-html"
17
+ - "No hard-coded URL/credential/timeout — read from Env.* and CONFIG[...]"
18
+ - "No time.sleep() — use Playwright auto-wait / expect()"
19
+ - "Each test independent via pytest-playwright fixtures (page / logged_in_page / …)"
20
+ - "Page Object extends slim BasePage; split 3 layers: locators _x(), actions verb_noun(), assertions assert_x() using expect()"
21
+ - "Locator priority: data-testid → role → label/text → CSS → avoid XPath"
22
+ - "Group tests by (role, account) so login/logout never interleaves across roles"
23
+ - "Cover 100% of TCs in the .Test.md — every TC ends Pass/Fail/Skip, none left Draft"
24
+ folder_structure: |
25
+ docs/<project>/<feature>/ ← test-case Markdown (.Test.md) — source of truth
26
+ pages/ ← Page Object Model
27
+ │ ├── base_page.py ← slim BasePage (click/fill/wait/screenshot)
28
+ │ └── <feature>_page.py
29
+ tests/ ← pytest scripts, 1-1 with docs/
30
+ │ ├── conftest.py ← fixtures: browser, page, logged_in_page, tracing
31
+ │ └── <project>/test_<feature>.py
32
+ utils/ ← config_loader, logger, steps, test_ordering, report helpers
33
+ test_data/ ← JSON datasets
34
+ config/config.yaml ← browser, timeout, video/screenshot/trace toggles
35
+ reports/ test-results/ ← generated (gitignored): html report, trace.zip, screenshots
36
+
37
+ coding_standards:
38
+ naming:
39
+ test_case_id: "TC_<FEATURE>_<NNN>"
40
+ test_class: "TestFeatureHappyCase"
41
+ test_function: "test_TC<NNN>_<snake_case>"
42
+ page_object: "<feature>_page.py with <Feature>Page class extending BasePage"
43
+ files:
44
+ test_case_md: "docs/<project>/<feature>/TC_<FEATURE>.Test.md"
45
+ page_object: "pages/<feature>_page.py"
46
+ test_script: "tests/<project>/test_<feature>.py"
47
+ patterns:
48
+ steps: "wrap steps with `with step(\"…\")` (from utils.steps import step)"
49
+ assertions: "Playwright expect() — never bare assert on dynamic UI"
50
+ fixtures: "auth fixtures register via register_auth_fixtures([...]) in project conftest"
51
+ fail_triage: "classify each FAIL as script-bug (fix selector/logic) vs product-gap (keep FAIL + evidence, never fake-pass)"
52
+
53
+ testing:
54
+ layers: "functional (gui-screen / gui-feature / api), integration (api/db/gui/kafka), e2e (journey), non-functional, exploratory"
55
+ runner: "pytest-playwright; trace via context.tracing.start in conftest"
56
+ report: "pytest-html (--html ... --self-contained-html) + Playwright Trace viewer"
57
+
58
+ trace_tags:
59
+ # QC tests map back to the framework's scenarios — drives qc_status in the trace TSV.
60
+ verifies: "# @trace.verifies={UC-ID}-SC{N}"
61
+ source: "# @trace.source=<official .feature path>"
62
+ test_type: "# @trace.test_type=functional|integration|e2e|non-functional"
63
+
64
+ # qc_status: /qc-run-test writes pass|fail|skip|not_run + qc_run_at into {trace_dir}/{UC-ID}.tsv
65
+ # (parallel to dev_selftest), surfaced in Living Docs as the OFFICIAL QC automation result.
@@ -248,19 +248,41 @@ If the file does not exist → skip silently.
248
248
 
249
249
  ---
250
250
 
251
- ## Step 3 — [CRITICAL] Load CLAUDE.md
251
+ ## Step 3 — [CRITICAL] Load CLAUDE.md (layered: root + service overlay)
252
252
 
253
253
  *This is the highest-priority context — it defines HOW to write code and documents for this project.*
254
254
 
255
- Read `CLAUDE.md`. Extract and store:
255
+ CLAUDE.md is loaded in **two layers** so umbrella-wide rules and service-specific
256
+ architecture/coding standards compose correctly. The agent always sits at the umbrella
257
+ root, but the implementation code lives in a service submodule with its OWN stack,
258
+ architecture, and conventions — so the service's CLAUDE.md must win for code generation.
259
+
260
+ **Layer 1 — [BASE] Root CLAUDE.md (umbrella-wide).**
261
+ Read `CLAUDE.md` at the repo root. Treat its contents as the **shared baseline** for the
262
+ whole umbrella — git conventions, data-protection posture, cross-cutting rules, and (in
263
+ single-service mode) the project's only architecture + coding standards.
264
+
265
+ **Layer 2 — [OVERLAY] Service CLAUDE.md (umbrella mode only).**
266
+ *Run only if `service_root` was set in Step 1.6 (i.e. a real service was routed to).*
267
+ Read `{service_root}/CLAUDE.md`. This file defines the architecture + coding standards of
268
+ the **actual stack being implemented** (e.g. `user-service` = java-spring, `web` = nextjs).
269
+ Overlay it on top of Layer 1: **on any conflict, the service value WINS** for architecture,
270
+ coding standards, and error handling. Layer-1 values that the service does not redefine
271
+ (e.g. git conventions, banned patterns shared org-wide) remain in effect.
272
+
273
+ From the **merged** result, extract and store:
256
274
 
257
275
  - **§1 Project Overview** → project name, language, framework, build/test commands, domains
258
- - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules
259
- - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns
260
- - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name
261
- - **§7 Git Conventions** → branch naming pattern, commit message format
276
+ - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules — *service overlay wins*
277
+ - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns — *service overlay wins*
278
+ - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name — *service overlay wins*
279
+ - **§7 Git Conventions** → branch naming pattern, commit message format — *root baseline unless service redefines*
262
280
 
263
- If `CLAUDE.md` does not exist → note it as missing and continue with project-context.yaml data only.
281
+ **Resolution rules:**
282
+ - If both layers exist → merge as above; record `claude_md_source = root + {service_root}`.
283
+ - If only the service overlay exists (no root CLAUDE.md) → use the service file alone; `claude_md_source = {service_root}`.
284
+ - 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).
285
+ - If neither exists → note CLAUDE.md as missing and continue with project-context.yaml data only.
264
286
 
265
287
  ---
266
288
 
@@ -360,7 +382,8 @@ Output exactly this block:
360
382
  [CTX LOADED]
361
383
  Stack : {language} / {framework} / {database}
362
384
  Platform : {active_module} ({platform_type})
363
- Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
385
+ Layers : {layer order from merged CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
386
+ CLAUDE.md : {root + {service_root} | {service_root} only | root only | ⚠️ service overlay MISSING — using root | missing}
364
387
  Ticket : {ticket_prefix}-
365
388
  Dict : {loaded — N canonical terms, M banned terms | missing}
366
389
  Entities : {loaded — EntityA, EntityB, EntityC | missing}
@@ -504,6 +527,13 @@ Suggest the logical next command based on workflow phase:
504
527
  | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
505
528
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
506
529
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
530
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
531
+ | /qc-plan | `/qc-design-test {UC-ID}` |
532
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
533
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
534
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
535
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
536
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
507
537
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
508
538
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
509
539
  | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
@@ -622,6 +652,13 @@ Suggest the logical next command based on workflow phase:
622
652
  | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
623
653
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
624
654
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
655
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
656
+ | /qc-plan | `/qc-design-test {UC-ID}` |
657
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
658
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
659
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
660
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
661
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
625
662
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
626
663
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
627
664
  | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |