@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
@@ -0,0 +1,110 @@
1
+ [๐Ÿ“š Docs](../README.md) โ€บ [Reference](README.md) โ€บ Stack Modules
2
+
3
+ # Stack Modules
4
+
5
+ > Mแป—i module dฦฐแป›i `modules/` ship mแป™t `stack-profile.yaml` chแปฉa layer pattern, naming rule, vร  test pattern riรชng cho framework ฤ‘รณ. Framework detect platform type tแปซ `tech_stack.module` (hoแบทc `active_module` trong multi-service) vร  adapt mแปi artifact sinh ra.
6
+
7
+ ---
8
+
9
+ ## Mแปฅc lแปฅc
10
+
11
+ - [Danh sรกch module](#danh-sรกch-module)
12
+ - [Platform type grouping](#platform-type-grouping)
13
+ - [qc-playwright โ€” QC automation stack](#qc-playwright--qc-automation-stack)
14
+
15
+ ---
16
+
17
+ ## Danh sรกch module
18
+
19
+ 15 module (xรกc minh bแบฑng listing thฦฐ mแปฅc `modules/`):
20
+
21
+ | Module | Language / Framework | Platform type |
22
+ |--------|----------------------|---------------|
23
+ | `java-spring` | Java + Spring Boot | backend |
24
+ | `golang` | Go + Gin/Echo | backend |
25
+ | `dotnet` | C# + .NET / ASP.NET Core | backend |
26
+ | `php-laravel` | PHP + Laravel | backend |
27
+ | `context-engineering` | Generic AI/LLM projects | backend |
28
+ | `react` | TypeScript + React | web-frontend |
29
+ | `nextjs` | TypeScript + Next.js | web-frontend |
30
+ | `vue` | TypeScript + Vue 3 | web-frontend |
31
+ | `nuxt` | TypeScript + Nuxt 3 + @nuxt/ui | web-frontend |
32
+ | `angular` | TypeScript + Angular | web-frontend |
33
+ | `flutter` | Dart + Flutter | mobile |
34
+ | `react-native` | TypeScript + React Native / Expo | mobile |
35
+ | `ios-swiftui` | Swift + SwiftUI | mobile |
36
+ | `android-compose` | Kotlin + Jetpack Compose | mobile |
37
+ | `qc-playwright` | Python + pytest-playwright + Page Object | QC / E2E (xem dฦฐแป›i) |
38
+
39
+ ---
40
+
41
+ ## Platform type grouping
42
+
43
+ `platform_type` ฤ‘ฦฐแปฃc suy ra tแปซ module vร  quyแบฟt ฤ‘แป‹nh cรกch adapt BDD vocabulary, tech-design sections, vร  test templates.
44
+
45
+ | `platform_type` | Modules |
46
+ |-----------------|---------|
47
+ | `backend` | `java-spring`, `golang`, `dotnet`, `php-laravel`, `context-engineering` |
48
+ | `web-frontend` | `react`, `nextjs`, `vue`, `nuxt`, `angular` |
49
+ | `mobile` | `flutter`, `react-native`, `ios-swiftui`, `android-compose` |
50
+
51
+ Vรญ dแปฅ adapt theo platform type:
52
+
53
+ - **BDD vocabulary** โ€” backend dรนng "submits a request" / "receives response"; web dรนng "clicks" / "types into" / "navigates to"; mobile dรนng "taps" / "enters" / "opens".
54
+ - **Tech-design sections** โ€” backend: ยง4 API Endpoints / ยง5 Service Flow / ยง6 Data Modelโ€ฆ; web-frontend: ยง4 Screen/Component Breakdown / ยง5 State Managementโ€ฆ; mobile: ยง4 Screen/Widget Breakdown / ยง5 State & Data Flowโ€ฆ.
55
+ - **Test templates** โ€” Java โ†’ JUnit 5 + Mockito + `@WebMvcTest`; web โ†’ Vitest/Jest + Testing Library + Playwright/Cypress; Flutter โ†’ `testWidgets`; iOS โ†’ `XCTestCase`; Android โ†’ Compose rule + `@HiltAndroidTest`.
56
+
57
+ ---
58
+
59
+ ## qc-playwright โ€” QC automation stack
60
+
61
+ `qc-playwright` lร  **stack QC automation ฤ‘แป™c lแบญp** vแป›i dev implementation module. Nรณ power native QC pipeline (`/qc-run-test`, `/qc-report`) vร  ฤ‘ฦฐแปฃc chแปn qua `tech_stack.qc_module` hoแบทc per `/qc-*` run โ€” khรดng phแปฅ thuแป™c vร o stack dev (java-spring, react, flutterโ€ฆ). Per-layer guides nแบฑm แปŸ `skills/qc/<stage>/`. Xem [../02-guides/qc-automation.md](../02-guides/qc-automation.md).
62
+
63
+ **Stack** (tแปซ `modules/qc-playwright/stack-profile.yaml`): Python 3 + pytest-playwright + Page Object Model. Report = Playwright Trace + pytest-html (**khรดng** dรนng Allure, khรดng hand-written dashboard, khรดng `record_video`).
64
+
65
+ **Build commands:**
66
+
67
+ | Mแปฅc ฤ‘รญch | Command |
68
+ |----------|---------|
69
+ | Test | `python3 -m pytest` |
70
+ | E2E | `python3 -m pytest -m e2e` |
71
+ | Report | `python3 -m pytest --html=reports/<feature>/report.html --self-contained-html` |
72
+ | Show trace | `python3 -m playwright show-trace <test-results/<nodeid>/trace.zip>` |
73
+
74
+ **Key architecture rules:**
75
+ - **Markdown-first** โ€” khรดng sinh Python cho tแป›i khi cรณ `.Test.md` ฤ‘รฃ review cho feature.
76
+ - Khรดng hard-code URL/credential/timeout โ€” ฤ‘แปc tแปซ `Env.*` vร  `CONFIG[...]`.
77
+ - Khรดng `time.sleep()` โ€” dรนng Playwright auto-wait / `expect()`.
78
+ - Mแป—i test ฤ‘แป™c lแบญp qua pytest-playwright fixtures (`page` / `logged_in_page` / โ€ฆ).
79
+ - Page Object extends slim `BasePage`; tรกch 3 layer: locators `_x()`, actions `verb_noun()`, assertions `assert_x()` dรนng `expect()`.
80
+ - Locator priority: `data-testid` โ†’ role โ†’ label/text โ†’ CSS โ†’ trรกnh XPath.
81
+ - Group test theo `(role, account)` ฤ‘แปƒ login/logout khรดng interleave giแปฏa cรกc role.
82
+ - Cover 100% TC trong `.Test.md` โ€” mแป—i TC kแบฟt thรบc Pass/Fail/Skip, khรดng ฤ‘แปƒ Draft.
83
+
84
+ **Naming:** test case id `TC_<FEATURE>_<NNN>` ยท test class `TestFeatureHappyCase` ยท test function `test_TC<NNN>_<snake_case>` ยท page object `<feature>_page.py` (`<Feature>Page` extends `BasePage`).
85
+
86
+ **Folder structure:**
87
+ ```
88
+ {paths.qc_dir}/{UC-ID}/test-cases/ โ† test-case Markdown (.Test.md) โ€” source of truth (mแบทc ฤ‘แป‹nh docs/, lแป™ ra ngoร i)
89
+ pages/ โ† Page Object Model (base_page.py + <feature>_page.py)
90
+ tests/ โ† pytest scripts, 1-1 vแป›i test-cases/ (conftest.py + test_<feature>.py)
91
+ utils/ โ† config_loader, logger, steps, test_ordering, report helpers
92
+ test_data/ โ† JSON datasets
93
+ config/config.yaml โ† browser, timeout, video/screenshot/trace toggles
94
+ reports/ test-results/ โ† generated (gitignored): html report, trace.zip, screenshots
95
+ ```
96
+
97
+ **Test layers:** functional (gui-screen / gui-feature / api) ยท integration (api/db/gui/kafka) ยท e2e (journey) ยท non-functional ยท exploratory.
98
+
99
+ **Trace tags** (map QC test vแป scenario, drive `qc_status`):
100
+ ```python
101
+ # @trace.verifies={UC-ID}-SC{N}
102
+ # @trace.source=<official .feature path>
103
+ # @trace.test_type=functional|integration|e2e|non-functional
104
+ ```
105
+
106
+ > `/qc-run-test` ghi `pass|fail|skip|not_run` + `qc_run_at` vร o `{trace_dir}/{UC-ID}.tsv` (song song vแป›i `dev_selftest`), surfaced trong Living Docs lร  kแบฟt quแบฃ QC automation **chรญnh thแปฉc**. Mแป—i FAIL ฤ‘ฦฐแปฃc phรขn loแบกi script-bug (fix selector/logic) vs product-gap (giแปฏ FAIL + evidence, khรดng bao giแป fake-pass).
107
+
108
+ ---
109
+
110
+ *Xem thรชm:* [Trace TSV Schema](trace-schema.md) (`qc_status` vs `dev_selftest`) ยท [Command Reference](commands.md) (pipeline `/qc-*`) ยท [02 ยท Guides ยท QC Automation](../02-guides/qc-automation.md).
@@ -0,0 +1,152 @@
1
+ [๐Ÿ“š Docs](../README.md) โ€บ [Reference](README.md) โ€บ Trace TSV Schema
2
+
3
+ # Trace TSV Schema
4
+
5
+ > Schema chuแบฉn cแปงa `.trace/{UC-ID}.tsv` โ€” file trace state per use-case. Mแป—i UC mแป™t file: 1 header row + 1 data row mแป—i scenario. ฤรขy lร  nguแป“n dแปฏ liแป‡u cho `/validate-traces` vร  panel Living Docs.
6
+
7
+ ---
8
+
9
+ ## Mแปฅc lแปฅc
10
+
11
+ - [Canonical TSV header](#canonical-tsv-header)
12
+ - [Column reference](#column-reference)
13
+ - [Two independent signals: dev_selftest vs qc_status](#two-independent-signals-dev_selftest-vs-qc_status)
14
+ - [Status computation (validate-traces)](#status-computation-validate-traces)
15
+ - [@trace tags across artifacts](#trace-tags-across-artifacts)
16
+ - [trace-report.json](#trace-reportjson)
17
+
18
+ ---
19
+
20
+ ## Canonical TSV header
21
+
22
+ Tab-separated, mแป™t header row + mแป™t data row mแป—i scenario. Header chรญnh xรกc (tแปซ `generate-bdd.tmpl`):
23
+
24
+ ```
25
+ sc_id sc_title spec_ver gen_ver implemented_by test_count test_classes dev_selftest dev_selftest_at qc_status qc_run_at qc_owner qc_blocked_by prd_version bdd_version tech_doc_revision prd_status uc_status fe_phase status last_updated
26
+ ```
27
+
28
+ 21 cแป™t, theo ฤ‘รบng thแปฉ tแปฑ trรชn.
29
+
30
+ ---
31
+
32
+ ## Column reference
33
+
34
+ | # | Column | ร nghฤฉa | Giรก trแป‹ khแปŸi tแบกo (`/generate-bdd`) | Ai ghi |
35
+ |---|--------|---------|------------------------------------|--------|
36
+ | 1 | `sc_id` | `{UC-ID}-SC{N}` โ€” khรณa chรญnh cแปงa row | `{UC-ID}-SC{N}` | generate-bdd |
37
+ | 2 | `sc_title` | Scenario title text | tแปซ `.feature` | generate-bdd |
38
+ | 3 | `spec_ver` | `@trace.sc_version` hiแป‡n tแบกi cแปงa scenario | tแปซ `.feature` | generate-bdd / validate-traces (reconcile) |
39
+ | 4 | `gen_ver` | Version tแบกi thแปi ฤ‘iแปƒm code ฤ‘ฦฐแปฃc sinh | `โ€”` | generate-code |
40
+ | 5 | `implemented_by` | `ClassName.method` cร i ฤ‘แบทt scenario | `โ€”` | generate-code |
41
+ | 6 | `test_count` | Sแป‘ test verify scenario | `โ€”` | dev-gen-test |
42
+ | 7 | `test_classes` | Danh sรกch test class | `โ€”` | dev-gen-test |
43
+ | 8 | `dev_selftest` | Kแบฟt quแบฃ dev self-check: `pass` / `fail` / `not_run` | `โ€”` | **dev-run-test** |
44
+ | 9 | `dev_selftest_at` | Ngร y chแบกy dev self-check (`YYYY-MM-DD`) | `โ€”` | **dev-run-test** |
45
+ | 10 | `qc_status` | Kแบฟt quแบฃ QC chรญnh thแปฉc: `pass` / `fail` / `skip` / `not_run` | `โ€”` | **qc-run-test** |
46
+ | 11 | `qc_run_at` | Ngร y chแบกy QC (`YYYY-MM-DD`) | `โ€”` | **qc-run-test** |
47
+ | 12 | `qc_owner` | **ฤang chแป ai** (PM view) khi SC chฦฐa pass: `dev` / `po` / `โ€”` | `โ€”` | **qc-run-test** / **report-bug** |
48
+ | 13 | `qc_blocked_by` | Artifact liรชn quan: `BUG-{id}` / `GAP-{id}` / `โ€”` | `โ€”` | **qc-run-test** / **report-bug** |
49
+ | 14 | `prd_version` | `@trace.prd_version` tแปซ `.feature` header | tแปซ `.feature` | generate-bdd |
50
+ | 15 | `bdd_version` | `@trace.bdd_version` tแปซ `.feature` header | tแปซ `.feature` | generate-bdd |
51
+ | 16 | `tech_doc_revision` | Tech-doc revision tแบกi thแปi ฤ‘iแปƒm codegen | `โ€”` | generate-code |
52
+ | 17 | `prd_status` | `\| **Status** \|` tแปซ PRD metadata | tแปซ PRD | generate-bdd |
53
+ | 18 | `uc_status` | Trแบกng thรกi UC: `draft` / `approved` / โ€ฆ | `draft` (UC mแป›i) | generate-bdd |
54
+ | 19 | `fe_phase` | FE phase khi implement (`ui` / `integration`) | `โ€”` | generate-code `--phase` |
55
+ | 20 | `status` | Trแบกng thรกi tแป•ng hแปฃp: `OK` / `DRIFT` / `GAP` / `UNTRACKED` | `UNTRACKED` | validate-traces |
56
+ | 21 | `last_updated` | Ngร y update gแบงn nhแบฅt (`YYYY-MM-DD`) | today | mแปi command ghi row |
57
+
58
+ > **`qc_owner` / `qc_blocked_by` (PM "waiting-on" view):** dร nh cho PO kiรชm PM xem **case nร o ฤ‘ang chแป ai**. `/qc-run-test` set khi ghi `qc_status`: product-gap FAIL โ†’ `qc_owner=dev`; `skip`/`not_run` do `DOC_GAPS` ๐Ÿ”ด Blocker mแปŸ โ†’ `qc_owner=po` + `qc_blocked_by=GAP-{id}`; `pass` โ†’ cแบฃ hai vแป `โ€”`. `/report-bug` backfill `qc_blocked_by=BUG-{id}` (+ `qc_owner` theo layer) cho SC khแป›p. `/validate-traces` tแป•ng hแปฃp `waiting_dev` / `waiting_po` cho dashboard.
59
+
60
+ > **Re-generation rules (generate-bdd):** SC ฤ‘รฃ cรณ trong TSV & `spec_ver` khรดng ฤ‘แป•i โ†’ chแป‰ update `sc_title`, `prd_version`, `bdd_version`, `prd_status`, `uc_status`, `last_updated`. Nแบฟu `spec_ver` ฤ‘แป•i โ†’ thรชm `spec_ver` vร  set `status = DRIFT` ngay. SC mแป›i โ†’ append vแป›i `gen_ver`/`implemented_by`/`test_count`/`test_classes`/`dev_selftest`/`dev_selftest_at`/`qc_status`/`qc_run_at`/`qc_owner`/`qc_blocked_by`/`tech_doc_revision` = `โ€”`. SC bแป‹ xรณa khแปi `.feature` โ†’ xรณa row.
61
+
62
+ > **Backward-compat:** TSV cลฉ (19 cแป™t, trฦฐแป›c nรขng cแบฅp) thiแบฟu `qc_owner`/`qc_blocked_by` โ†’ `/validate-traces` ฤ‘แปc thร nh `null`, khรดng lแป—i; lแบงn `/generate-bdd` re-gen kแบฟ tiแบฟp tแปฑ nรขng header lรชn 21 cแป™t.
63
+
64
+ ---
65
+
66
+ ## Two independent signals: dev_selftest vs qc_status
67
+
68
+ Trace TSV mang **hai cแป™t tรญn hiแป‡u ฤ‘แป™c lแบญp** โ€” khรดng bao giแป trแป™n:
69
+
70
+ | | `dev_selftest` (+ `dev_selftest_at`) | `qc_status` (+ `qc_run_at`) |
71
+ |---|--------------------------------------|------------------------------|
72
+ | Ghi bแปŸi | `/dev-run-test` | `/qc-run-test` |
73
+ | ร nghฤฉa | Dev tแปฑ smoke-check code mรฌnh vแปซa sinh | Kแบฟt quแบฃ QC automation **chรญnh thแปฉc** |
74
+ | Giรก trแป‹ | `pass` / `fail` / `not_run` | `pass` / `fail` / `skip` / `not_run` |
75
+ | Stack | Dev implementation module | `qc-playwright` module |
76
+ | Coverage chรญnh thแปฉc? | **KHร”NG** โ€” chแป‰ lร  dev self-check | **Cร“** โ€” official QC result |
77
+ | Keyed by | `@trace.verifies={UC-ID}` | `@trace.verifies={UC-ID}-SC{N}` |
78
+
79
+ `/validate-traces` chแป‰ **ฤ‘แปc** hai cแป™t nร y cho report โ€” khรดng bao giแป ghi ฤ‘รจ (mแป—i cแป™t do command sแปŸ hแปฏu nรณ quแบฃn lรฝ). Living Docs hiแปƒn thแป‹ cแบฃ hai cแบกnh nhau.
80
+
81
+ ---
82
+
83
+ ## Status computation (validate-traces)
84
+
85
+ `/validate-traces` tรญnh cแป™t `status` theo thแปฉ tแปฑ ฦฐu tiรชn (rule ฤ‘แบงu tiรชn khแป›p thรฌ dแปซng):
86
+
87
+ | Rule | Status | ฤiแปu kiแป‡n |
88
+ |------|--------|-----------|
89
+ | 1 | `UNTRACKED` | `implemented_by == โ€”` (chฦฐa sinh code) |
90
+ | 2 | `GAP` | `implemented_by != โ€”` AND (`test_count == โ€”` OR `test_count == 0`) |
91
+ | 3 | `DRIFT` | `spec_ver != gen_ver` (scenario ฤ‘แป•i sau lแบงn codegen gแบงn nhแบฅt) |
92
+ | 4 | `OK` | tแบฅt cแบฃ: `spec_ver == gen_ver`, `implemented_by != โ€”`, `test_count > 0` |
93
+
94
+ Ngoร i ra `/validate-traces` cรฒn flag **`PRD_DRIFT`** (PRD version trong code/TSV trแป… hฦกn PRD file hiแป‡n tแบกi) vร  **`TECHDOC_DRIFT`** (code sinh tแปซ tech-doc revision cลฉ).
95
+
96
+ ---
97
+
98
+ ## @trace tags across artifacts
99
+
100
+ Mแปi artifact link vแป›i nhau qua `@trace.*` tags.
101
+
102
+ **`.feature` files:**
103
+ ```gherkin
104
+ # @trace.id: FEAT-001-UC1
105
+ # @trace.service: web-admin
106
+ # @trace.module: react
107
+ # @trace.prd_version: 1.2
108
+ # @trace.bdd_version: 3
109
+ # @trace.api_source: existing # brownfield: API ฤ‘รฃ tแป“n tแบกi, contract lแบฅy tแปซ PRD
110
+ ```
111
+ Per-scenario trong file: `# @trace.scenario: {UC-ID}-SC{N}`, `# @trace.sc_version: 1.0`, `# @trace.business_rules: ...`.
112
+
113
+ **Code:**
114
+ ```java
115
+ // @trace.implements=FEAT-001-UC1-SC2
116
+ // @trace.prd_version=1.2
117
+ // @trace.bdd_version=3
118
+ // @trace.tech_doc_revision=2
119
+ ```
120
+
121
+ **Dev self-check tests:**
122
+ ```java
123
+ // @trace.verifies=FEAT-001-UC1
124
+ // @trace.service=api-backend
125
+ // @trace.test_type=integration
126
+ ```
127
+
128
+ **QC tests** (`qc-playwright`, drive `qc_status`):
129
+ ```python
130
+ # @trace.verifies={UC-ID}-SC{N}
131
+ # @trace.source=<official .feature path>
132
+ # @trace.test_type=functional|integration|e2e|non-functional
133
+ ```
134
+
135
+ ---
136
+
137
+ ## trace-report.json
138
+
139
+ `/validate-traces` ghi `{paths.trace_dir}/trace-report.json` โ€” single source of truth cho web dashboards. Cแบฅu trรบc rรบt gแปn:
140
+
141
+ - `generated_at`, `domain`
142
+ - `summary` โ€” aggregates: `total_prds`, `approved_prds`, `total_ucs`, `approved_ucs`, `draft_ucs`, `total_scs`, `coded_scs`, `tested_scs`, `code_coverage_pct`, `test_coverage_pct`, `drift_count`, `gap_count`, `untracked_count`, `dev_selftest_passing/failing/not_run`, `qc_passing/failing/skipped/not_run`, `waiting_dev`, `waiting_po`, `tech_docs_count`
143
+ - `prds[]` โ†’ `ucs[]` โ†’ `scenarios[]` โ€” mแป—i scenario cรณ ฤ‘แบงy ฤ‘แปง cรกc trฦฐแปng cแปงa TSV row (gแป“m `dev_selftest`, `dev_selftest_at`, `qc_status`, `qc_run_at`)
144
+ - `issues` โ€” phรขn loแบกi: `drift`, `gap`, `untracked`, `prd_version_drift`, `techdoc_drift`, mแป—i entry kรจm `fix` command gแปฃi รฝ
145
+
146
+ **TSV `"โ€”"` โ†’ JSON mapping:** `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`.
147
+
148
+ > **Umbrella mode:** mแป—i service submodule giแปฏ `.trace/` riรชng (committed). `/validate-traces` (hoแบทc `/sync`) publish merged report vร o `{spec_source}/.living-docs/` (canonical) + mirror `./.trace/trace-report.json` แปŸ workspace hiแป‡n tแบกi. Cแบฃ hai lร  generated mirror โ€” gitignore, khรดng commit.
149
+
150
+ ---
151
+
152
+ *Xem thรชm:* [Command Reference](commands.md) (`/validate-traces`, `/qc-run-test`, `/dev-run-test`) ยท [03 ยท Concepts](../03-concepts/) (traceability system).
package/docs/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # ๐Ÿ“š Spec-Driven Dev โ€” Documentation
2
+
3
+ > AI-First Spec-Driven Development for Claude Code: Discovery โ†’ PRD โ†’ Design-Spec โ†’ BDD โ†’
4
+ > Code โ†’ Dev self-check โ†’ QC automation, with traceability and human review gates.
5
+
6
+ Tร i liแป‡u ฤ‘ฦฐแปฃc chia theo **vai trรฒ** vร  **chแปง ฤ‘แป**. Bแบฏt ฤ‘แบงu แปŸ mแปฅc phรน hแปฃp vแป›i bแบกn:
7
+
8
+ | Bแบกn lร โ€ฆ | Bแบฏt ฤ‘แบงu แปŸ |
9
+ |---------|-----------|
10
+ | Ngฦฐแปi mแป›i / cร i ฤ‘แบทt lแบงn ฤ‘แบงu | [01 ยท Getting Started](01-getting-started/) |
11
+ | Product Owner | [Guide ยท Product Owner](02-guides/product-owner/README.md) |
12
+ | Developer | [Guide ยท Developer](02-guides/developer/README.md) |
13
+ | Tester | [Guide ยท Tester](02-guides/tester/README.md) |
14
+ | QC Automation | [Guide ยท QC Automation](02-guides/qc-automation.md) |
15
+ | Muแป‘n hiแปƒu kiแบฟn trรบc | [03 ยท Concepts](03-concepts/) |
16
+ | Vแบญn hร nh / admin | [04 ยท Operations](04-operations/) |
17
+ | Tra cแปฉu lแป‡nh | [05 ยท Reference](05-reference/) |
18
+
19
+ ---
20
+
21
+ ## Mแปฅc lแปฅc
22
+
23
+ ### 01 ยท [Getting Started](01-getting-started/)
24
+ - [Installation](01-getting-started/installation.md) โ€” cร i framework, prerequisites
25
+ - [Quick Start](01-getting-started/quickstart.md) โ€” chแบกy feature ฤ‘แบงu tiรชn end-to-end
26
+ - [Core Concepts](01-getting-started/core-concepts.md) โ€” khรกi niแป‡m trong 5 phรบt
27
+
28
+ ### 02 ยท [Guides (theo vai trรฒ)](02-guides/)
29
+ - [Product Owner](02-guides/product-owner/README.md) โ€” define-product, PRD, design-spec, review
30
+ - [Developer](02-guides/developer/README.md) โ€” BDD, tech-docs, code, dev self-check
31
+ - [Tester](02-guides/tester/README.md) โ€” spec-manifest, report-bug, propose-scenario, Living Docs
32
+ - [QC Automation](02-guides/qc-automation.md) โ€” pipeline `/qc-*`, qc_status
33
+
34
+ ### 03 ยท [Concepts](03-concepts/)
35
+ - [Architecture](03-concepts/architecture.md) โ€” layers, modules, plug-in system
36
+ - [Pipeline](03-concepts/pipeline.md) โ€” cรกc phase Discovery โ†’ QC
37
+ - [Traceability & Living Docs](03-concepts/traceability.md) โ€” trace TSV, dev_selftest vs qc_status
38
+
39
+ ### 04 ยท [Operations](04-operations/)
40
+ - [Sync & Update](04-operations/sync-and-update.md) โ€” `/sync`, `/update-framework`, umbrella
41
+ - [Bug Flow](04-operations/bug-flow.md) โ€” report โ†’ fix โ†’ verify
42
+ - [Publishing](04-operations/publishing.md) โ€” build + npm publish
43
+
44
+ ### 05 ยท [Reference](05-reference/)
45
+ - [Commands](05-reference/commands.md) โ€” bแบฃng ฤ‘แบงy ฤ‘แปง mแปi slash command
46
+ - [Trace Schema](05-reference/trace-schema.md) โ€” cแป™t TSV, trace tags
47
+ - [Modules](05-reference/modules.md) โ€” stack modules (java-spring, react, โ€ฆ, qc-playwright)
48
+
49
+ ---
50
+
51
+ *Mแป—i file cรณ breadcrumb ฤ‘iแปu hฦฐแป›ng แปŸ ฤ‘แบงu. Phiรชn bแบฃn framework: xem `core/FRAMEWORK_VERSION`.*
@@ -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
+ {paths.qc_dir}/{UC-ID}/test-cases/ โ† test-case Markdown (.Test.md) โ€” source of truth (mแบทc ฤ‘แป‹nh docs/, lแป™ ra ngoร i)
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 test-cases/
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: "{paths.qc_dir}/{UC-ID}/test-cases/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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anhth2/spec-driven-dev-plugin",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "description": "AI-First Spec-Driven Development workflow plugin for Claude Code",
5
5
  "bin": {
6
6
  "spec-driven-dev": "./bin/index.js"
@@ -24,7 +24,7 @@
24
24
  "skills/",
25
25
  "steps/",
26
26
  "templates/",
27
- "ARCHITECTURE.md"
27
+ "docs/"
28
28
  ],
29
29
  "keywords": [
30
30
  "claude-code",
@@ -152,6 +152,8 @@ Read `.agent/project-context.yaml`. Extract and store:
152
152
  - `paths.specs_dir` โ†’ BDD specs root
153
153
  - `paths.prd_dir` โ†’ PRD documents root
154
154
  - `paths.refinement_dir` โ†’ findings/review output dir
155
+ - `paths.qc_dir` โ†’ QC automation artifacts root (visible top-level, one subfolder per UC: `{qc_dir}/{UC-ID}/`)
156
+ - `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)
155
157
  - `paths.product_definitions_dir` โ†’ product definitions root
156
158
  - `paths.domain_knowledge_dir` โ†’ domain knowledge root
157
159
  - `paths.business_dictionary` โ†’ path to business-dictionary.md
@@ -164,6 +166,8 @@ If `paths` section is absent, use these defaults:
164
166
  - `specs_dir` = `specs/bdd`
165
167
  - `prd_dir` = `specs/prd`
166
168
  - `refinement_dir` = `.agent/review`
169
+ - `qc_dir` = `docs`
170
+ - `qc_skills_dir` = `.agent/skills/qc`
167
171
  - `product_definitions_dir` = `specs/product-definition`
168
172
  - `domain_knowledge_dir` = `specs/domain-knowledge`
169
173
  - `business_dictionary` = `specs/domain-knowledge/business-dictionary.md`
@@ -208,6 +212,7 @@ If `services` section is present:
208
212
  - Override `paths.core_entities` โ†’ `{spec_source}/specs/domain-knowledge/core-entities.md`
209
213
  - Override `paths.bug_reports_dir` โ†’ `{spec_source}/feedback/bug-reports`
210
214
  - Override `paths.bdd_proposals_dir` โ†’ `{spec_source}/feedback/bdd-proposals`
215
+ - Override `paths.prd_change_requests_dir` โ†’ `{spec_source}/feedback/prd-change-requests`
211
216
 
212
217
  > **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.
213
218
 
@@ -248,19 +253,41 @@ If the file does not exist โ†’ skip silently.
248
253
 
249
254
  ---
250
255
 
251
- ## Step 3 โ€” [CRITICAL] Load CLAUDE.md
256
+ ## Step 3 โ€” [CRITICAL] Load CLAUDE.md (layered: root + service overlay)
252
257
 
253
258
  *This is the highest-priority context โ€” it defines HOW to write code and documents for this project.*
254
259
 
255
- Read `CLAUDE.md`. Extract and store:
260
+ CLAUDE.md is loaded in **two layers** so umbrella-wide rules and service-specific
261
+ architecture/coding standards compose correctly. The agent always sits at the umbrella
262
+ root, but the implementation code lives in a service submodule with its OWN stack,
263
+ architecture, and conventions โ€” so the service's CLAUDE.md must win for code generation.
264
+
265
+ **Layer 1 โ€” [BASE] Root CLAUDE.md (umbrella-wide).**
266
+ Read `CLAUDE.md` at the repo root. Treat its contents as the **shared baseline** for the
267
+ whole umbrella โ€” git conventions, data-protection posture, cross-cutting rules, and (in
268
+ single-service mode) the project's only architecture + coding standards.
269
+
270
+ **Layer 2 โ€” [OVERLAY] Service CLAUDE.md (umbrella mode only).**
271
+ *Run only if `service_root` was set in Step 1.6 (i.e. a real service was routed to).*
272
+ Read `{service_root}/CLAUDE.md`. This file defines the architecture + coding standards of
273
+ the **actual stack being implemented** (e.g. `user-service` = java-spring, `web` = nextjs).
274
+ Overlay it on top of Layer 1: **on any conflict, the service value WINS** for architecture,
275
+ coding standards, and error handling. Layer-1 values that the service does not redefine
276
+ (e.g. git conventions, banned patterns shared org-wide) remain in effect.
277
+
278
+ From the **merged** result, extract and store:
256
279
 
257
280
  - **ยง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
281
+ - **ยง2 Architecture** โ†’ layer order (e.g., Controller โ†’ Facade โ†’ Service โ†’ Repository), architectural rules โ€” *service overlay wins*
282
+ - **ยง3 Coding Standards** โ†’ naming conventions (classes, methods), response wrapper type, forbidden patterns โ€” *service overlay wins*
283
+ - **ยง5 Error Handling** โ†’ exception types, HTTP status code mapping, not-found exception class name โ€” *service overlay wins*
284
+ - **ยง7 Git Conventions** โ†’ branch naming pattern, commit message format โ€” *root baseline unless service redefines*
262
285
 
263
- If `CLAUDE.md` does not exist โ†’ note it as missing and continue with project-context.yaml data only.
286
+ **Resolution rules:**
287
+ - If both layers exist โ†’ merge as above; record `claude_md_source = root + {service_root}`.
288
+ - If only the service overlay exists (no root CLAUDE.md) โ†’ use the service file alone; `claude_md_source = {service_root}`.
289
+ - 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).
290
+ - If neither exists โ†’ note CLAUDE.md as missing and continue with project-context.yaml data only.
264
291
 
265
292
  ---
266
293
 
@@ -360,7 +387,8 @@ Output exactly this block:
360
387
  [CTX LOADED]
361
388
  Stack : {language} / {framework} / {database}
362
389
  Platform : {active_module} ({platform_type})
363
- Layers : {layer order from CLAUDE.md ยง2, e.g., Controller โ†’ Facade โ†’ Service โ†’ Repository}
390
+ Layers : {layer order from merged CLAUDE.md ยง2, e.g., Controller โ†’ Facade โ†’ Service โ†’ Repository}
391
+ CLAUDE.md : {root + {service_root} | {service_root} only | root only | โš ๏ธ service overlay MISSING โ€” using root | missing}
364
392
  Ticket : {ticket_prefix}-
365
393
  Dict : {loaded โ€” N canonical terms, M banned terms | missing}
366
394
  Entities : {loaded โ€” EntityA, EntityB, EntityC | missing}
@@ -504,6 +532,13 @@ Suggest the logical next command based on workflow phase:
504
532
  | /generate-design-spec | Designer review โ†’ Figma links confirmed โ†’ PO + Designer sign-off โ†’ `/generate-bdd {prd-file}` |
505
533
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
506
534
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
535
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve ๐Ÿ”ด blocker gaps first) |
536
+ | /qc-plan | `/qc-design-test {UC-ID}` |
537
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
538
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
539
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
540
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
541
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
507
542
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
508
543
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
509
544
  | /generate-code | First gen โ†’ `/review-code {UC-ID}`; re-gen โ†’ `/dev-gen-test {UC-ID}` |
@@ -622,6 +657,13 @@ Suggest the logical next command based on workflow phase:
622
657
  | /generate-design-spec | Designer review โ†’ Figma links confirmed โ†’ PO + Designer sign-off โ†’ `/generate-bdd {prd-file}` |
623
658
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
624
659
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
660
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve ๐Ÿ”ด blocker gaps first) |
661
+ | /qc-plan | `/qc-design-test {UC-ID}` |
662
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
663
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
664
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
665
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
666
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
625
667
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
626
668
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
627
669
  | /generate-code | First gen โ†’ `/review-code {UC-ID}`; re-gen โ†’ `/dev-gen-test {UC-ID}` |
@@ -67,6 +67,8 @@ Read `.agent/project-context.yaml`. Extract and store:
67
67
  - `paths.specs_dir` โ†’ BDD specs root
68
68
  - `paths.prd_dir` โ†’ PRD documents root
69
69
  - `paths.refinement_dir` โ†’ findings/review output dir
70
+ - `paths.qc_dir` โ†’ QC automation artifacts root (visible top-level, one subfolder per UC: `{qc_dir}/{UC-ID}/`)
71
+ - `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)
70
72
  - `paths.product_definitions_dir` โ†’ product definitions root
71
73
  - `paths.domain_knowledge_dir` โ†’ domain knowledge root
72
74
  - `paths.business_dictionary` โ†’ path to business-dictionary.md
@@ -79,6 +81,8 @@ If `paths` section is absent, use these defaults:
79
81
  - `specs_dir` = `specs/bdd`
80
82
  - `prd_dir` = `specs/prd`
81
83
  - `refinement_dir` = `.agent/review`
84
+ - `qc_dir` = `docs`
85
+ - `qc_skills_dir` = `.agent/skills/qc`
82
86
  - `product_definitions_dir` = `specs/product-definition`
83
87
  - `domain_knowledge_dir` = `specs/domain-knowledge`
84
88
  - `business_dictionary` = `specs/domain-knowledge/business-dictionary.md`
@@ -123,6 +127,7 @@ If `services` section is present:
123
127
  - Override `paths.core_entities` โ†’ `{spec_source}/specs/domain-knowledge/core-entities.md`
124
128
  - Override `paths.bug_reports_dir` โ†’ `{spec_source}/feedback/bug-reports`
125
129
  - Override `paths.bdd_proposals_dir` โ†’ `{spec_source}/feedback/bdd-proposals`
130
+ - Override `paths.prd_change_requests_dir` โ†’ `{spec_source}/feedback/prd-change-requests`
126
131
 
127
132
  > **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.
128
133
 
@@ -163,19 +168,41 @@ If the file does not exist โ†’ skip silently.
163
168
 
164
169
  ---
165
170
 
166
- ## Step 3 โ€” [CRITICAL] Load CLAUDE.md
171
+ ## Step 3 โ€” [CRITICAL] Load CLAUDE.md (layered: root + service overlay)
167
172
 
168
173
  *This is the highest-priority context โ€” it defines HOW to write code and documents for this project.*
169
174
 
170
- Read `CLAUDE.md`. Extract and store:
175
+ CLAUDE.md is loaded in **two layers** so umbrella-wide rules and service-specific
176
+ architecture/coding standards compose correctly. The agent always sits at the umbrella
177
+ root, but the implementation code lives in a service submodule with its OWN stack,
178
+ architecture, and conventions โ€” so the service's CLAUDE.md must win for code generation.
179
+
180
+ **Layer 1 โ€” [BASE] Root CLAUDE.md (umbrella-wide).**
181
+ Read `CLAUDE.md` at the repo root. Treat its contents as the **shared baseline** for the
182
+ whole umbrella โ€” git conventions, data-protection posture, cross-cutting rules, and (in
183
+ single-service mode) the project's only architecture + coding standards.
184
+
185
+ **Layer 2 โ€” [OVERLAY] Service CLAUDE.md (umbrella mode only).**
186
+ *Run only if `service_root` was set in Step 1.6 (i.e. a real service was routed to).*
187
+ Read `{service_root}/CLAUDE.md`. This file defines the architecture + coding standards of
188
+ the **actual stack being implemented** (e.g. `user-service` = java-spring, `web` = nextjs).
189
+ Overlay it on top of Layer 1: **on any conflict, the service value WINS** for architecture,
190
+ coding standards, and error handling. Layer-1 values that the service does not redefine
191
+ (e.g. git conventions, banned patterns shared org-wide) remain in effect.
192
+
193
+ From the **merged** result, extract and store:
171
194
 
172
195
  - **ยง1 Project Overview** โ†’ project name, language, framework, build/test commands, domains
173
- - **ยง2 Architecture** โ†’ layer order (e.g., Controller โ†’ Facade โ†’ Service โ†’ Repository), architectural rules
174
- - **ยง3 Coding Standards** โ†’ naming conventions (classes, methods), response wrapper type, forbidden patterns
175
- - **ยง5 Error Handling** โ†’ exception types, HTTP status code mapping, not-found exception class name
176
- - **ยง7 Git Conventions** โ†’ branch naming pattern, commit message format
196
+ - **ยง2 Architecture** โ†’ layer order (e.g., Controller โ†’ Facade โ†’ Service โ†’ Repository), architectural rules โ€” *service overlay wins*
197
+ - **ยง3 Coding Standards** โ†’ naming conventions (classes, methods), response wrapper type, forbidden patterns โ€” *service overlay wins*
198
+ - **ยง5 Error Handling** โ†’ exception types, HTTP status code mapping, not-found exception class name โ€” *service overlay wins*
199
+ - **ยง7 Git Conventions** โ†’ branch naming pattern, commit message format โ€” *root baseline unless service redefines*
177
200
 
178
- If `CLAUDE.md` does not exist โ†’ note it as missing and continue with project-context.yaml data only.
201
+ **Resolution rules:**
202
+ - If both layers exist โ†’ merge as above; record `claude_md_source = root + {service_root}`.
203
+ - If only the service overlay exists (no root CLAUDE.md) โ†’ use the service file alone; `claude_md_source = {service_root}`.
204
+ - 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).
205
+ - If neither exists โ†’ note CLAUDE.md as missing and continue with project-context.yaml data only.
179
206
 
180
207
  ---
181
208
 
@@ -275,7 +302,8 @@ Output exactly this block:
275
302
  [CTX LOADED]
276
303
  Stack : {language} / {framework} / {database}
277
304
  Platform : {active_module} ({platform_type})
278
- Layers : {layer order from CLAUDE.md ยง2, e.g., Controller โ†’ Facade โ†’ Service โ†’ Repository}
305
+ Layers : {layer order from merged CLAUDE.md ยง2, e.g., Controller โ†’ Facade โ†’ Service โ†’ Repository}
306
+ CLAUDE.md : {root + {service_root} | {service_root} only | root only | โš ๏ธ service overlay MISSING โ€” using root | missing}
279
307
  Ticket : {ticket_prefix}-
280
308
  Dict : {loaded โ€” N canonical terms, M banned terms | missing}
281
309
  Entities : {loaded โ€” EntityA, EntityB, EntityC | missing}
@@ -442,6 +470,13 @@ Suggest the logical next command based on workflow phase:
442
470
  | /generate-design-spec | Designer review โ†’ Figma links confirmed โ†’ PO + Designer sign-off โ†’ `/generate-bdd {prd-file}` |
443
471
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
444
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) |
445
480
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
446
481
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
447
482
  | /generate-code | First gen โ†’ `/review-code {UC-ID}`; re-gen โ†’ `/dev-gen-test {UC-ID}` |
@@ -586,6 +621,13 @@ Suggest the logical next command based on workflow phase:
586
621
  | /generate-design-spec | Designer review โ†’ Figma links confirmed โ†’ PO + Designer sign-off โ†’ `/generate-bdd {prd-file}` |
587
622
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
588
623
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
624
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve ๐Ÿ”ด blocker gaps first) |
625
+ | /qc-plan | `/qc-design-test {UC-ID}` |
626
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
627
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
628
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
629
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
630
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
589
631
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
590
632
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
591
633
  | /generate-code | First gen โ†’ `/review-code {UC-ID}`; re-gen โ†’ `/dev-gen-test {UC-ID}` |
@@ -687,6 +729,13 @@ Suggest the logical next command based on workflow phase:
687
729
  | /generate-design-spec | Designer review โ†’ Figma links confirmed โ†’ PO + Designer sign-off โ†’ `/generate-bdd {prd-file}` |
688
730
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
689
731
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
732
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve ๐Ÿ”ด blocker gaps first) |
733
+ | /qc-plan | `/qc-design-test {UC-ID}` |
734
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
735
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
736
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
737
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
738
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
690
739
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
691
740
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
692
741
  | /generate-code | First gen โ†’ `/review-code {UC-ID}`; re-gen โ†’ `/dev-gen-test {UC-ID}` |