@anhth2/spec-driven-dev-plugin 0.9.2 → 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 (223) hide show
  1. package/commands/debug.md +50 -20
  2. package/commands/define-product.md +49 -19
  3. package/commands/{generate-tests.md → dev-gen-test.md} +85 -23
  4. package/commands/{generate-tests.tmpl → dev-gen-test.tmpl} +18 -4
  5. package/{core/commands/run-tests.md → commands/dev-run-test.md} +102 -21
  6. package/commands/{run-tests.tmpl → dev-run-test.tmpl} +35 -2
  7. package/commands/{smoke-test.md → dev-smoke-test.md} +54 -24
  8. package/commands/{smoke-test.tmpl → dev-smoke-test.tmpl} +5 -5
  9. package/commands/fix-bug.md +50 -20
  10. package/commands/generate-bdd.md +78 -21
  11. package/commands/generate-bdd.tmpl +11 -2
  12. package/commands/generate-code.md +123 -23
  13. package/commands/generate-code.tmpl +56 -4
  14. package/commands/generate-design-spec.md +142 -47
  15. package/commands/generate-design-spec.tmpl +93 -28
  16. package/commands/generate-prd.md +49 -19
  17. package/commands/generate-spec-manifest.md +49 -19
  18. package/commands/generate-tech-docs.md +50 -20
  19. package/commands/generate-tech-docs.tmpl +1 -1
  20. package/commands/learn.md +50 -20
  21. package/commands/propose-scenario.md +50 -20
  22. package/commands/propose-scenario.tmpl +1 -1
  23. package/commands/qc-analyze.md +514 -0
  24. package/commands/qc-analyze.tmpl +71 -0
  25. package/commands/qc-design-test.md +510 -0
  26. package/commands/qc-design-test.tmpl +67 -0
  27. package/commands/qc-plan.md +492 -0
  28. package/commands/qc-plan.tmpl +49 -0
  29. package/commands/qc-report.md +491 -0
  30. package/commands/qc-report.tmpl +48 -0
  31. package/commands/qc-review.md +496 -0
  32. package/commands/qc-review.tmpl +53 -0
  33. package/commands/qc-run-test.md +538 -0
  34. package/commands/qc-run-test.tmpl +77 -0
  35. package/commands/refine-prd.md +203 -24
  36. package/commands/refine-prd.tmpl +16 -5
  37. package/commands/report-bug.md +49 -19
  38. package/commands/review-code.md +51 -21
  39. package/commands/review-code.tmpl +1 -1
  40. package/commands/review-context.md +198 -20
  41. package/commands/review-context.tmpl +11 -1
  42. package/commands/review-tech-docs.md +49 -19
  43. package/commands/setup-ai-first.md +14 -7
  44. package/commands/sync.md +30 -20
  45. package/commands/sync.tmpl +16 -13
  46. package/commands/update-framework.md +14 -7
  47. package/commands/validate-traces.md +106 -45
  48. package/commands/validate-traces.tmpl +57 -26
  49. package/core/FRAMEWORK_VERSION +1 -1
  50. package/core/commands/debug.md +50 -20
  51. package/core/commands/define-product.md +49 -19
  52. package/core/commands/{generate-tests.md → dev-gen-test.md} +85 -23
  53. package/{commands/run-tests.md → core/commands/dev-run-test.md} +102 -21
  54. package/core/commands/{smoke-test.md → dev-smoke-test.md} +54 -24
  55. package/core/commands/fix-bug.md +50 -20
  56. package/core/commands/generate-bdd.md +78 -21
  57. package/core/commands/generate-code.md +123 -23
  58. package/core/commands/generate-design-spec.md +142 -47
  59. package/core/commands/generate-prd.md +49 -19
  60. package/core/commands/generate-spec-manifest.md +49 -19
  61. package/core/commands/generate-tech-docs.md +50 -20
  62. package/core/commands/learn.md +50 -20
  63. package/core/commands/propose-scenario.md +50 -20
  64. package/core/commands/qc-analyze.md +514 -0
  65. package/core/commands/qc-design-test.md +510 -0
  66. package/core/commands/qc-plan.md +492 -0
  67. package/core/commands/qc-report.md +491 -0
  68. package/core/commands/qc-review.md +496 -0
  69. package/core/commands/qc-run-test.md +538 -0
  70. package/core/commands/refine-prd.md +203 -24
  71. package/core/commands/report-bug.md +49 -19
  72. package/core/commands/review-code.md +51 -21
  73. package/core/commands/review-context.md +198 -20
  74. package/core/commands/review-tech-docs.md +49 -19
  75. package/core/commands/setup-ai-first.md +14 -7
  76. package/core/commands/sync.md +30 -20
  77. package/core/commands/update-framework.md +14 -7
  78. package/core/commands/validate-traces.md +106 -45
  79. package/core/modules/qc-playwright/stack-profile.yaml +65 -0
  80. package/core/skills/code/SKILL.md +63 -26
  81. package/core/skills/debug/SKILL.md +78 -34
  82. package/core/skills/design-spec/SKILL.md +49 -19
  83. package/core/skills/discovery/SKILL.md +49 -19
  84. package/core/skills/prd/SKILL.md +28 -14
  85. package/core/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
  86. package/core/skills/qc/qa-analyst/acceptance-criteria.md +56 -0
  87. package/core/skills/qc/qa-analyst/business-rules.md +55 -0
  88. package/core/skills/qc/qa-analyst/data-flow.md +60 -0
  89. package/core/skills/qc/qa-analyst/spec-breakdown.md +57 -0
  90. package/core/skills/qc/qa-designer/e2e/journey.md +41 -0
  91. package/core/skills/qc/qa-designer/exploratory/charter.md +68 -0
  92. package/core/skills/qc/qa-designer/exploratory/explore-to-functional.md +43 -0
  93. package/core/skills/qc/qa-designer/functional/api.md +45 -0
  94. package/core/skills/qc/qa-designer/functional/gui-feature.md +46 -0
  95. package/core/skills/qc/qa-designer/functional/gui-screen.md +52 -0
  96. package/core/skills/qc/qa-designer/integration/api.md +42 -0
  97. package/core/skills/qc/qa-designer/integration/db.md +39 -0
  98. package/core/skills/qc/qa-designer/integration/gui.md +40 -0
  99. package/core/skills/qc/qa-designer/integration/kafka.md +40 -0
  100. package/core/skills/qc/qa-designer/non-functional.md +40 -0
  101. package/core/skills/qc/qa-planner/test-plan.md +120 -0
  102. package/core/skills/qc/qa-reviewer/script/e2e.md +87 -0
  103. package/core/skills/qc/qa-reviewer/script/exploratory.md +45 -0
  104. package/core/skills/qc/qa-reviewer/script/functional.md +101 -0
  105. package/core/skills/qc/qa-reviewer/script/integration.md +91 -0
  106. package/core/skills/qc/qa-reviewer/script/non-functional.md +126 -0
  107. package/core/skills/qc/qa-reviewer/test-case/e2e.md +73 -0
  108. package/core/skills/qc/qa-reviewer/test-case/exploratory.md +43 -0
  109. package/core/skills/qc/qa-reviewer/test-case/functional.md +76 -0
  110. package/core/skills/qc/qa-reviewer/test-case/integration.md +69 -0
  111. package/core/skills/qc/qa-reviewer/test-case/non-functional.md +73 -0
  112. package/core/skills/qc/qa-runner/e2e.md +49 -0
  113. package/core/skills/qc/qa-runner/exploratory/session.md +36 -0
  114. package/core/skills/qc/qa-runner/functional/api.md +35 -0
  115. package/core/skills/qc/qa-runner/functional/gui-feature.md +51 -0
  116. package/core/skills/qc/qa-runner/functional/gui-screen.md +55 -0
  117. package/core/skills/qc/qa-runner/integration.md +47 -0
  118. package/core/skills/qc/qa-runner/non-functional.md +49 -0
  119. package/core/skills/qc/qa-runner/report/report.md +37 -0
  120. package/core/skills/setup-ai-first/SKILL.md +14 -7
  121. package/core/skills/spec/SKILL.md +28 -14
  122. package/core/skills/test/SKILL.md +121 -54
  123. package/core/steps/capture-lesson.md +1 -1
  124. package/core/steps/context-loader.md +35 -12
  125. package/core/steps/report-footer.md +14 -7
  126. package/core/steps/review-fanout.md +138 -0
  127. package/core/steps/spawn-agent.md +1 -1
  128. package/core/steps/trace-mirror.md +18 -0
  129. package/core/templates/design-spec.template.md +16 -8
  130. package/core/templates/project-context.yaml +8 -0
  131. package/docs/01-getting-started/README.md +19 -0
  132. package/docs/01-getting-started/core-concepts.md +102 -0
  133. package/docs/01-getting-started/installation.md +154 -0
  134. package/docs/01-getting-started/quickstart.md +85 -0
  135. package/docs/02-guides/README.md +27 -0
  136. package/docs/02-guides/developer/README.md +46 -0
  137. package/docs/02-guides/developer/bdd-and-trace.md +123 -0
  138. package/docs/02-guides/developer/commands.md +76 -0
  139. package/docs/02-guides/developer/pr-checklist.md +15 -0
  140. package/docs/02-guides/developer/scenarios.md +448 -0
  141. package/docs/02-guides/developer/workflow.md +59 -0
  142. package/docs/02-guides/product-owner/README.md +77 -0
  143. package/docs/02-guides/product-owner/commands.md +30 -0
  144. package/docs/02-guides/product-owner/handoff-checklist.md +42 -0
  145. package/docs/02-guides/product-owner/prd-writing-rules.md +45 -0
  146. package/docs/02-guides/product-owner/scenarios.md +357 -0
  147. package/docs/02-guides/qc-automation.md +92 -0
  148. package/docs/02-guides/tester/README.md +72 -0
  149. package/docs/02-guides/tester/bug-reporting.md +117 -0
  150. package/docs/02-guides/tester/reading-specs.md +79 -0
  151. package/docs/02-guides/tester/scenarios.md +186 -0
  152. package/docs/02-guides/tester/spec-manifest.md +124 -0
  153. package/docs/02-guides/tester/test-checklist.md +31 -0
  154. package/docs/02-guides/tester/workflow.md +79 -0
  155. package/docs/03-concepts/README.md +19 -0
  156. package/docs/03-concepts/architecture.md +243 -0
  157. package/docs/03-concepts/pipeline.md +249 -0
  158. package/docs/03-concepts/traceability.md +148 -0
  159. package/docs/04-operations/README.md +33 -0
  160. package/docs/04-operations/bug-flow.md +321 -0
  161. package/docs/04-operations/publishing.md +137 -0
  162. package/docs/04-operations/sync-and-update.md +328 -0
  163. package/docs/05-reference/README.md +29 -0
  164. package/docs/05-reference/commands.md +229 -0
  165. package/docs/05-reference/modules.md +110 -0
  166. package/docs/05-reference/trace-schema.md +146 -0
  167. package/docs/README.md +51 -0
  168. package/modules/qc-playwright/stack-profile.yaml +65 -0
  169. package/package.json +2 -2
  170. package/skills/code/SKILL.md +63 -26
  171. package/skills/debug/SKILL.md +78 -34
  172. package/skills/debug/SKILL.tmpl +1 -1
  173. package/skills/design-spec/SKILL.md +49 -19
  174. package/skills/discovery/SKILL.md +49 -19
  175. package/skills/prd/SKILL.md +28 -14
  176. package/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
  177. package/skills/qc/qa-analyst/acceptance-criteria.md +56 -0
  178. package/skills/qc/qa-analyst/business-rules.md +55 -0
  179. package/skills/qc/qa-analyst/data-flow.md +60 -0
  180. package/skills/qc/qa-analyst/spec-breakdown.md +57 -0
  181. package/skills/qc/qa-designer/e2e/journey.md +41 -0
  182. package/skills/qc/qa-designer/exploratory/charter.md +68 -0
  183. package/skills/qc/qa-designer/exploratory/explore-to-functional.md +43 -0
  184. package/skills/qc/qa-designer/functional/api.md +45 -0
  185. package/skills/qc/qa-designer/functional/gui-feature.md +46 -0
  186. package/skills/qc/qa-designer/functional/gui-screen.md +52 -0
  187. package/skills/qc/qa-designer/integration/api.md +42 -0
  188. package/skills/qc/qa-designer/integration/db.md +39 -0
  189. package/skills/qc/qa-designer/integration/gui.md +40 -0
  190. package/skills/qc/qa-designer/integration/kafka.md +40 -0
  191. package/skills/qc/qa-designer/non-functional.md +40 -0
  192. package/skills/qc/qa-planner/test-plan.md +120 -0
  193. package/skills/qc/qa-reviewer/script/e2e.md +87 -0
  194. package/skills/qc/qa-reviewer/script/exploratory.md +45 -0
  195. package/skills/qc/qa-reviewer/script/functional.md +101 -0
  196. package/skills/qc/qa-reviewer/script/integration.md +91 -0
  197. package/skills/qc/qa-reviewer/script/non-functional.md +126 -0
  198. package/skills/qc/qa-reviewer/test-case/e2e.md +73 -0
  199. package/skills/qc/qa-reviewer/test-case/exploratory.md +43 -0
  200. package/skills/qc/qa-reviewer/test-case/functional.md +76 -0
  201. package/skills/qc/qa-reviewer/test-case/integration.md +69 -0
  202. package/skills/qc/qa-reviewer/test-case/non-functional.md +73 -0
  203. package/skills/qc/qa-runner/e2e.md +49 -0
  204. package/skills/qc/qa-runner/exploratory/session.md +36 -0
  205. package/skills/qc/qa-runner/functional/api.md +35 -0
  206. package/skills/qc/qa-runner/functional/gui-feature.md +51 -0
  207. package/skills/qc/qa-runner/functional/gui-screen.md +55 -0
  208. package/skills/qc/qa-runner/integration.md +47 -0
  209. package/skills/qc/qa-runner/non-functional.md +49 -0
  210. package/skills/qc/qa-runner/report/report.md +37 -0
  211. package/skills/setup-ai-first/SKILL.md +14 -7
  212. package/skills/spec/SKILL.md +28 -14
  213. package/skills/test/SKILL.md +121 -54
  214. package/skills/test/SKILL.tmpl +9 -9
  215. package/steps/capture-lesson.md +1 -1
  216. package/steps/context-loader.md +35 -12
  217. package/steps/report-footer.md +14 -7
  218. package/steps/review-fanout.md +138 -0
  219. package/steps/spawn-agent.md +1 -1
  220. package/steps/trace-mirror.md +18 -0
  221. package/templates/design-spec.template.md +16 -8
  222. package/templates/project-context.yaml +8 -0
  223. package/ARCHITECTURE.md +0 -247
@@ -0,0 +1,49 @@
1
+ ---
2
+ version: 1.0
3
+ updated: 2026-06-11
4
+ ported_from: ai-automation-qc-base
5
+ ---
6
+
7
+ # Gen Script — Non-Functional
8
+
9
+ Skill **tự chứa**: convert TC non-functional (performance/security/accessibility/compatibility) → script/đo. Chỉ cần load file này.
10
+
11
+ ## Khi nào trigger
12
+ - Convert TC non-functional (output qa-designer non-functional) sang script/kịch bản đo; TC đã Reviewed
13
+
14
+ ## Khi KHÔNG trigger
15
+ - Kiểm thử chức năng → `functional/*` · tích hợp → `integration.md`
16
+
17
+ ## Quy ước script (bám CLAUDE.md)
18
+ - Tiền đề: `.Test.md` đã Reviewed, có **ngưỡng đo cụ thể**. KHÔNG hardcode → `Env.*`/`CONFIG`.
19
+ - Mỗi loại dùng công cụ phù hợp, gói trong fixture/helper:
20
+ - **Performance:** đo response time / throughput (pytest + timer, hoặc tích hợp k6/locust); assert ngưỡng.
21
+ - **Security:** test authZ (role không quyền → 403), input injection, PII không lộ, session/timeout, rate limit.
22
+ - **Accessibility:** axe-core/lighthouse qua Playwright; assert vi phạm = 0 ở mức WCAG mục tiêu.
23
+ - **Compatibility:** parametrize trình duyệt/thiết bị.
24
+ - Assert theo **ngưỡng pass** trong TC bằng `expect()`/`assert`; bọc bước `with step("…")` (`from utils.steps import step`, **KHÔNG Allure**); marker `@pytest.mark.{performance,security,accessibility}`.
25
+
26
+ ## Phase 1 — Clarify
27
+ Đọc `.Test.md` · loại + ngưỡng + công cụ · môi trường/tải mẫu · data đặc biệt.
28
+
29
+ ## Phase 2 — Generate
30
+ Mỗi TC → 1 test đo + assert ngưỡng; đánh dấu test cần môi trường/tải riêng (`@pytest.mark.slow`).
31
+
32
+ ## Phase 3 — Verify
33
+ `py_compile` + collect · chạy (môi trường phù hợp) · cập nhật Status TC + số đo thực tế.
34
+
35
+ ## Output
36
+ Script `tests/<project>/non_functional/test_<feature>.py` + helper đo/scan. Bàn giao `qa-reviewer`.
37
+
38
+ ## Phase 4 — Report (bắt buộc sau khi chạy test)
39
+ Report = **Playwright Trace viewer + pytest-html** (KHÔNG Allure, KHÔNG dashboard tự viết).
40
+
41
+ 1. Chạy test kèm pytest-html (trace đã bật sẵn ở conftest → mỗi test có `test-results/<nodeid>/trace.zip`):
42
+ ```bash
43
+ pytest tests/<project>/non_functional/test_<feature>.py --html=reports/<feature>/report.html --self-contained-html
44
+ ```
45
+ 2. Gửi cho người dùng:
46
+ - HTML report: `reports/<feature>/report.html` (self-contained, mở trực tiếp) + số đo thực tế.
47
+ - Trace từng test (debug step-by-step): `python3 -m playwright show-trace test-results/<nodeid>/trace.zip`.
48
+ - Tóm tắt: **TOTAL / PASS / FAIL / SKIP** + duration.
49
+ 3. TC Fail → mở trace tương ứng để xem timeline/DOM snapshot/network, phân loại script-bug vs product-gap; ghi mô tả lỗi tiếng Việt dễ hiểu + số đo vào Status/khối kết quả của `.Test.md`.
@@ -0,0 +1,37 @@
1
+ ---
2
+ version: 1.1
3
+ updated: 2026-06-11
4
+ ported_from: ai-automation-qc-base
5
+ ---
6
+
7
+ # Report — Playwright Trace + pytest-html (stack chuẩn)
8
+
9
+ Skill **tự chứa**: sinh report sau khi chạy test. Stack chuẩn dự án dùng **Playwright
10
+ Trace viewer** + **pytest-html** (KHÔNG Allure, KHÔNG dashboard tự viết). Chỉ cần load file này.
11
+
12
+ ## Khi nào trigger
13
+ - Sau khi chạy test cần xuất report / xem lại bằng chứng (trace, screenshot).
14
+
15
+ ## Cơ chế (đã dựng sẵn ở tests/conftest.py)
16
+ - **Trace viewer**: fixture `context` (root conftest) gọi `context.tracing.start(screenshots=True, snapshots=True, sources=True)`; teardown lưu `test-results/<nodeid>/trace.zip`.
17
+ - Xem: `python3 -m playwright show-trace test-results/<...>/trace.zip` → timeline + DOM snapshot + network + console (UI giống Playwright report bản JS).
18
+ - **pytest-html**: 1 file HTML self-contained. Hook `pytest_runtest_makereport` (root conftest) đính screenshot full-page khi FAIL/SKIP.
19
+ - Mặc định `reports/report.html` (pytest.ini). Theo feature: `--html=reports/<feature>/report.html --self-contained-html`.
20
+
21
+ ## Quy trình
22
+ 1. Chạy test với report theo feature:
23
+ ```
24
+ python3 -m pytest tests/<project>/<file>.py \
25
+ --html=reports/<feature>/report.html --self-contained-html
26
+ ```
27
+ (Trace tự bật trong conftest → test-results/<nodeid>/trace.zip cho mọi test.)
28
+ 2. Báo path:
29
+ - HTML: `reports/<feature>/report.html` (on WSL, the Windows-accessible path is `\\wsl.localhost\<distro>\<repo-path>\reports\<feature>\report.html`).
30
+ - Trace TC fail: `test-results/<nodeid>/trace.zip` + lệnh `playwright show-trace`.
31
+ - Tóm tắt TOTAL / PASS / FAIL / SKIP + duration.
32
+
33
+ ## Nguyên tắc
34
+ - KHÔNG dùng Allure, KHÔNG sinh dashboard HTML tự viết (đã bỏ utils/html_report.py & cộng sự).
35
+ - Evidence trung thực: trace + screenshot phản ánh đúng lần run; FAIL/gap giữ nguyên.
36
+ - `reports/` và `test-results/` đã gitignore (artifact nặng) — không commit.
37
+ - Interpreter `python3`; browser = the system/installed Chromium configured via `browser_type_launch_args` in the root conftest (see the qc-playwright module) — do not hard-code a binary path.
@@ -140,15 +140,22 @@ Suggest the logical next command based on workflow phase:
140
140
  | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
141
141
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
142
142
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
143
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
144
+ | /qc-plan | `/qc-design-test {UC-ID}` |
145
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
146
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
147
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
148
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
149
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
143
150
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
144
151
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
145
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
146
- | /generate-tests | `/run-tests {UC-ID}` |
147
- | /run-tests (passing) | `/review-code {UC-ID}` |
148
- | /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
149
- | /review-code | `/smoke-test {UC-ID}` or create PR |
150
- | /smoke-test | Create PR and link to ticket |
151
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
152
+ | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
153
+ | /dev-gen-test | `/dev-run-test {UC-ID}` |
154
+ | /dev-run-test (passing) | `/review-code {UC-ID}` |
155
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
156
+ | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
157
+ | /dev-smoke-test | Create PR and link to ticket |
158
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
152
159
  | /fix-bug | Create PR and link to ticket |
153
160
  | /debug | `/fix-bug {ticket-id}` if fix needed |
154
161
  | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
@@ -211,15 +211,22 @@ Suggest the logical next command based on workflow phase:
211
211
  | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
212
212
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
213
213
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
214
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
215
+ | /qc-plan | `/qc-design-test {UC-ID}` |
216
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
217
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
218
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
219
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
220
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
214
221
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
215
222
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
216
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
217
- | /generate-tests | `/run-tests {UC-ID}` |
218
- | /run-tests (passing) | `/review-code {UC-ID}` |
219
- | /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
220
- | /review-code | `/smoke-test {UC-ID}` or create PR |
221
- | /smoke-test | Create PR and link to ticket |
222
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
223
+ | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
224
+ | /dev-gen-test | `/dev-run-test {UC-ID}` |
225
+ | /dev-run-test (passing) | `/review-code {UC-ID}` |
226
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
227
+ | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
228
+ | /dev-smoke-test | Create PR and link to ticket |
229
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
223
230
  | /fix-bug | Create PR and link to ticket |
224
231
  | /debug | `/fix-bug {ticket-id}` if fix needed |
225
232
  | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
@@ -348,15 +355,22 @@ Suggest the logical next command based on workflow phase:
348
355
  | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
349
356
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
350
357
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
358
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
359
+ | /qc-plan | `/qc-design-test {UC-ID}` |
360
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
361
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
362
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
363
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
364
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
351
365
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
352
366
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
353
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
354
- | /generate-tests | `/run-tests {UC-ID}` |
355
- | /run-tests (passing) | `/review-code {UC-ID}` |
356
- | /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
357
- | /review-code | `/smoke-test {UC-ID}` or create PR |
358
- | /smoke-test | Create PR and link to ticket |
359
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
367
+ | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
368
+ | /dev-gen-test | `/dev-run-test {UC-ID}` |
369
+ | /dev-run-test (passing) | `/review-code {UC-ID}` |
370
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
371
+ | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
372
+ | /dev-smoke-test | Create PR and link to ticket |
373
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
360
374
  | /fix-bug | Create PR and link to ticket |
361
375
  | /debug | `/fix-bug {ticket-id}` if fix needed |
362
376
  | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
@@ -1,14 +1,14 @@
1
1
  ---
2
- description: Generates unit and integration tests from BDD specs, runs the test suite and reports results, or smoke-tests live API endpoints on a running service. Trigger when: "/generate-tests", "/run-tests", "/smoke-test", "tạo test", "viết test", "chạy test", "generate tests", "run tests", "test kết quả", "smoke test", "test API", "kiểm tra endpoint đang chạy".
2
+ description: Generates unit and integration tests from BDD specs, runs the test suite and reports results, or dev-smoke-tests live API endpoints on a running service. Trigger when: "/dev-gen-test", "/dev-run-test", "/dev-smoke-test", "tạo test", "viết test", "chạy test", "generate tests", "run tests", "test kết quả", "smoke test", "test API", "kiểm tra endpoint đang chạy".
3
3
  ---
4
4
 
5
5
  # Test Skills — Generate, Run & Smoke Test
6
6
 
7
- This skill handles three commands: `/generate-tests`, `/run-tests`, and `/smoke-test`.
7
+ This skill handles three commands: `/dev-gen-test`, `/dev-run-test`, and `/dev-smoke-test`.
8
8
 
9
9
  ---
10
10
 
11
- ## /generate-tests — Generate Unit & Integration Tests
11
+ ## /dev-gen-test — Generate Unit & Integration Tests
12
12
 
13
13
  ### Gate
14
14
 
@@ -212,7 +212,7 @@ src/test/{language}/{package}/
212
212
  ### Output
213
213
 
214
214
  ```
215
- /generate-tests Complete — {UC-ID}:
215
+ /dev-gen-test Complete — {UC-ID}:
216
216
  ✅ service/{Service}Test.{ext} ({M} tests)
217
217
  ✅ facade/{Facade}Test.{ext} ({M} tests)
218
218
  ✅ controller/{Controller}Test.{ext} ({M} tests)
@@ -254,15 +254,22 @@ Suggest the logical next command based on workflow phase:
254
254
  | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
255
255
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
256
256
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
257
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
258
+ | /qc-plan | `/qc-design-test {UC-ID}` |
259
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
260
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
261
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
262
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
263
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
257
264
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
258
265
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
259
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
260
- | /generate-tests | `/run-tests {UC-ID}` |
261
- | /run-tests (passing) | `/review-code {UC-ID}` |
262
- | /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
263
- | /review-code | `/smoke-test {UC-ID}` or create PR |
264
- | /smoke-test | Create PR and link to ticket |
265
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
266
+ | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
267
+ | /dev-gen-test | `/dev-run-test {UC-ID}` |
268
+ | /dev-run-test (passing) | `/review-code {UC-ID}` |
269
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
270
+ | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
271
+ | /dev-smoke-test | Create PR and link to ticket |
272
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
266
273
  | /fix-bug | Create PR and link to ticket |
267
274
  | /debug | `/fix-bug {ticket-id}` if fix needed |
268
275
  | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
@@ -282,7 +289,7 @@ Next : {suggested command with example arguments}
282
289
 
283
290
  ---
284
291
 
285
- ## /run-tests — Run Tests & Report Results
292
+ ## /dev-run-test — Run Tests & Report Results
286
293
 
287
294
  ### Gate
288
295
 
@@ -362,7 +369,7 @@ If `services` section is present:
362
369
 
363
370
  **2. Route to service** — if active domain matches a key in `services`:
364
371
  - Override `paths.specs_dir` → `services.{domain}.specs_dir`
365
- - Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir`
372
+ - Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir` — **only if `setup.spec_source` is NOT set.** When `spec_source` IS set, the tech-design (API contract) is a cross-team artifact and must live in the shared spec repo (handled in step 4), so leave `tech_docs_dir` for step 4 to route — do NOT pin it per-service here.
366
373
  - Store `active_service` = `services.{domain}.path`
367
374
  - Store `active_service_module` = `services.{domain}.module`
368
375
  - If service has its own `module` → use it as `active_module` (overrides `tech_stack.module`)
@@ -374,7 +381,7 @@ If `services` section is present:
374
381
  **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
375
382
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
376
383
  - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
377
- - Override `paths.tech_docs_dir` → `{spec_source}/specs/tech-docs` — **only if step 2 did not already route it to a service** (multi-service umbrellas keep per-service tech-docs). This publishes the BE-authored API contract into the shared spec repo so FE/App can read it via the spec submodule at `/generate-code --phase=integration`.
384
+ - Override `paths.tech_docs_dir` → `{spec_source}/specs/tech-docs` — **always when `spec_source` is set** (step 2 no longer pins tech-docs per-service in this case). The tech-design IS the cross-team API contract: BE authors it here, and FE/App read it from the same spec submodule at `/generate-code --phase=integration`. *(Per-service tech-docs only happen when there is no `spec_source` — a pure multi-service BE repo with no shared spec module.)*
378
385
  - Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
379
386
  - Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
380
387
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
@@ -405,7 +412,7 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
405
412
  | `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
406
413
 
407
414
  **3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
408
- - Shell commands (`/run-tests`, `/generate-tests`) run **from within** `service_root`
415
+ - Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
409
416
  - File write operations (test files, trace TSVs) use paths **relative to** `service_root`
410
417
 
411
418
  **4. If service config not found** — keep umbrella defaults, still set `service_root = {active_service}` (path anchor is always needed even without a config override).
@@ -420,19 +427,41 @@ If the file does not exist → skip silently.
420
427
 
421
428
  ---
422
429
 
423
- ## Step 3 — [CRITICAL] Load CLAUDE.md
430
+ ## Step 3 — [CRITICAL] Load CLAUDE.md (layered: root + service overlay)
424
431
 
425
432
  *This is the highest-priority context — it defines HOW to write code and documents for this project.*
426
433
 
427
- Read `CLAUDE.md`. Extract and store:
434
+ CLAUDE.md is loaded in **two layers** so umbrella-wide rules and service-specific
435
+ architecture/coding standards compose correctly. The agent always sits at the umbrella
436
+ root, but the implementation code lives in a service submodule with its OWN stack,
437
+ architecture, and conventions — so the service's CLAUDE.md must win for code generation.
438
+
439
+ **Layer 1 — [BASE] Root CLAUDE.md (umbrella-wide).**
440
+ Read `CLAUDE.md` at the repo root. Treat its contents as the **shared baseline** for the
441
+ whole umbrella — git conventions, data-protection posture, cross-cutting rules, and (in
442
+ single-service mode) the project's only architecture + coding standards.
443
+
444
+ **Layer 2 — [OVERLAY] Service CLAUDE.md (umbrella mode only).**
445
+ *Run only if `service_root` was set in Step 1.6 (i.e. a real service was routed to).*
446
+ Read `{service_root}/CLAUDE.md`. This file defines the architecture + coding standards of
447
+ the **actual stack being implemented** (e.g. `user-service` = java-spring, `web` = nextjs).
448
+ Overlay it on top of Layer 1: **on any conflict, the service value WINS** for architecture,
449
+ coding standards, and error handling. Layer-1 values that the service does not redefine
450
+ (e.g. git conventions, banned patterns shared org-wide) remain in effect.
451
+
452
+ From the **merged** result, extract and store:
428
453
 
429
454
  - **§1 Project Overview** → project name, language, framework, build/test commands, domains
430
- - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules
431
- - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns
432
- - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name
433
- - **§7 Git Conventions** → branch naming pattern, commit message format
455
+ - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules — *service overlay wins*
456
+ - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns — *service overlay wins*
457
+ - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name — *service overlay wins*
458
+ - **§7 Git Conventions** → branch naming pattern, commit message format — *root baseline unless service redefines*
434
459
 
435
- If `CLAUDE.md` does not exist → note it as missing and continue with project-context.yaml data only.
460
+ **Resolution rules:**
461
+ - If both layers exist → merge as above; record `claude_md_source = root + {service_root}`.
462
+ - If only the service overlay exists (no root CLAUDE.md) → use the service file alone; `claude_md_source = {service_root}`.
463
+ - 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).
464
+ - If neither exists → note CLAUDE.md as missing and continue with project-context.yaml data only.
436
465
 
437
466
  ---
438
467
 
@@ -498,7 +527,7 @@ active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
498
527
 
499
528
  If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
500
529
 
501
- These two variables (`active_module`, `platform_type`) are the canonical source for all branching logic in commands that need platform-specific behavior (generate-tests, debug, fix-bug, smoke-test).
530
+ These two variables (`active_module`, `platform_type`) are the canonical source for all branching logic in commands that need platform-specific behavior (dev-gen-test, debug, fix-bug, dev-smoke-test).
502
531
 
503
532
  ---
504
533
 
@@ -532,7 +561,8 @@ Output exactly this block:
532
561
  [CTX LOADED]
533
562
  Stack : {language} / {framework} / {database}
534
563
  Platform : {active_module} ({platform_type})
535
- Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
564
+ Layers : {layer order from merged CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
565
+ CLAUDE.md : {root + {service_root} | {service_root} only | root only | ⚠️ service overlay MISSING — using root | missing}
536
566
  Ticket : {ticket_prefix}-
537
567
  Dict : {loaded — N canonical terms, M banned terms | missing}
538
568
  Entities : {loaded — EntityA, EntityB, EntityC | missing}
@@ -603,7 +633,7 @@ Read stack trace and analyze:
603
633
  ### Output
604
634
 
605
635
  ```
606
- /run-tests Report — {service}
636
+ /dev-run-test Report — {service}
607
637
  Run at: {datetime}
608
638
 
609
639
  ## Summary
@@ -655,15 +685,22 @@ Suggest the logical next command based on workflow phase:
655
685
  | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
656
686
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
657
687
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
688
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
689
+ | /qc-plan | `/qc-design-test {UC-ID}` |
690
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
691
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
692
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
693
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
694
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
658
695
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
659
696
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
660
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
661
- | /generate-tests | `/run-tests {UC-ID}` |
662
- | /run-tests (passing) | `/review-code {UC-ID}` |
663
- | /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
664
- | /review-code | `/smoke-test {UC-ID}` or create PR |
665
- | /smoke-test | Create PR and link to ticket |
666
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
697
+ | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
698
+ | /dev-gen-test | `/dev-run-test {UC-ID}` |
699
+ | /dev-run-test (passing) | `/review-code {UC-ID}` |
700
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
701
+ | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
702
+ | /dev-smoke-test | Create PR and link to ticket |
703
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
667
704
  | /fix-bug | Create PR and link to ticket |
668
705
  | /debug | `/fix-bug {ticket-id}` if fix needed |
669
706
  | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
@@ -683,10 +720,10 @@ Next : {suggested command with example arguments}
683
720
 
684
721
  ---
685
722
 
686
- ## /smoke-test — Test Live API Endpoints
723
+ ## /dev-smoke-test — Test Live API Endpoints
687
724
 
688
725
  Use when the service is **already running** to verify endpoints work correctly.
689
- Different from `/run-tests` (which runs unit/integration tests without a live server).
726
+ Different from `/dev-run-test` (which runs unit/integration tests without a live server).
690
727
 
691
728
  ### Phase 1 — Find Service URL
692
729
 
@@ -766,7 +803,7 @@ If `services` section is present:
766
803
 
767
804
  **2. Route to service** — if active domain matches a key in `services`:
768
805
  - Override `paths.specs_dir` → `services.{domain}.specs_dir`
769
- - Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir`
806
+ - Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir` — **only if `setup.spec_source` is NOT set.** When `spec_source` IS set, the tech-design (API contract) is a cross-team artifact and must live in the shared spec repo (handled in step 4), so leave `tech_docs_dir` for step 4 to route — do NOT pin it per-service here.
770
807
  - Store `active_service` = `services.{domain}.path`
771
808
  - Store `active_service_module` = `services.{domain}.module`
772
809
  - If service has its own `module` → use it as `active_module` (overrides `tech_stack.module`)
@@ -778,7 +815,7 @@ If `services` section is present:
778
815
  **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
779
816
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
780
817
  - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
781
- - Override `paths.tech_docs_dir` → `{spec_source}/specs/tech-docs` — **only if step 2 did not already route it to a service** (multi-service umbrellas keep per-service tech-docs). This publishes the BE-authored API contract into the shared spec repo so FE/App can read it via the spec submodule at `/generate-code --phase=integration`.
818
+ - Override `paths.tech_docs_dir` → `{spec_source}/specs/tech-docs` — **always when `spec_source` is set** (step 2 no longer pins tech-docs per-service in this case). The tech-design IS the cross-team API contract: BE authors it here, and FE/App read it from the same spec submodule at `/generate-code --phase=integration`. *(Per-service tech-docs only happen when there is no `spec_source` — a pure multi-service BE repo with no shared spec module.)*
782
819
  - Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
783
820
  - Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
784
821
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
@@ -809,7 +846,7 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
809
846
  | `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
810
847
 
811
848
  **3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
812
- - Shell commands (`/run-tests`, `/generate-tests`) run **from within** `service_root`
849
+ - Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
813
850
  - File write operations (test files, trace TSVs) use paths **relative to** `service_root`
814
851
 
815
852
  **4. If service config not found** — keep umbrella defaults, still set `service_root = {active_service}` (path anchor is always needed even without a config override).
@@ -824,19 +861,41 @@ If the file does not exist → skip silently.
824
861
 
825
862
  ---
826
863
 
827
- ## Step 3 — [CRITICAL] Load CLAUDE.md
864
+ ## Step 3 — [CRITICAL] Load CLAUDE.md (layered: root + service overlay)
828
865
 
829
866
  *This is the highest-priority context — it defines HOW to write code and documents for this project.*
830
867
 
831
- Read `CLAUDE.md`. Extract and store:
868
+ CLAUDE.md is loaded in **two layers** so umbrella-wide rules and service-specific
869
+ architecture/coding standards compose correctly. The agent always sits at the umbrella
870
+ root, but the implementation code lives in a service submodule with its OWN stack,
871
+ architecture, and conventions — so the service's CLAUDE.md must win for code generation.
872
+
873
+ **Layer 1 — [BASE] Root CLAUDE.md (umbrella-wide).**
874
+ Read `CLAUDE.md` at the repo root. Treat its contents as the **shared baseline** for the
875
+ whole umbrella — git conventions, data-protection posture, cross-cutting rules, and (in
876
+ single-service mode) the project's only architecture + coding standards.
877
+
878
+ **Layer 2 — [OVERLAY] Service CLAUDE.md (umbrella mode only).**
879
+ *Run only if `service_root` was set in Step 1.6 (i.e. a real service was routed to).*
880
+ Read `{service_root}/CLAUDE.md`. This file defines the architecture + coding standards of
881
+ the **actual stack being implemented** (e.g. `user-service` = java-spring, `web` = nextjs).
882
+ Overlay it on top of Layer 1: **on any conflict, the service value WINS** for architecture,
883
+ coding standards, and error handling. Layer-1 values that the service does not redefine
884
+ (e.g. git conventions, banned patterns shared org-wide) remain in effect.
885
+
886
+ From the **merged** result, extract and store:
832
887
 
833
888
  - **§1 Project Overview** → project name, language, framework, build/test commands, domains
834
- - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules
835
- - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns
836
- - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name
837
- - **§7 Git Conventions** → branch naming pattern, commit message format
889
+ - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules — *service overlay wins*
890
+ - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns — *service overlay wins*
891
+ - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name — *service overlay wins*
892
+ - **§7 Git Conventions** → branch naming pattern, commit message format — *root baseline unless service redefines*
838
893
 
839
- If `CLAUDE.md` does not exist → note it as missing and continue with project-context.yaml data only.
894
+ **Resolution rules:**
895
+ - If both layers exist → merge as above; record `claude_md_source = root + {service_root}`.
896
+ - If only the service overlay exists (no root CLAUDE.md) → use the service file alone; `claude_md_source = {service_root}`.
897
+ - 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).
898
+ - If neither exists → note CLAUDE.md as missing and continue with project-context.yaml data only.
840
899
 
841
900
  ---
842
901
 
@@ -902,7 +961,7 @@ active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
902
961
 
903
962
  If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
904
963
 
905
- These two variables (`active_module`, `platform_type`) are the canonical source for all branching logic in commands that need platform-specific behavior (generate-tests, debug, fix-bug, smoke-test).
964
+ These two variables (`active_module`, `platform_type`) are the canonical source for all branching logic in commands that need platform-specific behavior (dev-gen-test, debug, fix-bug, dev-smoke-test).
906
965
 
907
966
  ---
908
967
 
@@ -936,7 +995,8 @@ Output exactly this block:
936
995
  [CTX LOADED]
937
996
  Stack : {language} / {framework} / {database}
938
997
  Platform : {active_module} ({platform_type})
939
- Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
998
+ Layers : {layer order from merged CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
999
+ CLAUDE.md : {root + {service_root} | {service_root} only | root only | ⚠️ service overlay MISSING — using root | missing}
940
1000
  Ticket : {ticket_prefix}-
941
1001
  Dict : {loaded — N canonical terms, M banned terms | missing}
942
1002
  Entities : {loaded — EntityA, EntityB, EntityC | missing}
@@ -1024,7 +1084,7 @@ tail -n 100 {LOG_FILE_PATH}
1024
1084
  ### Output
1025
1085
 
1026
1086
  ```
1027
- /smoke-test Report — {UC-ID}
1087
+ /dev-smoke-test Report — {UC-ID}
1028
1088
  Tested at: {datetime}
1029
1089
  Base URL: http://localhost:{port}
1030
1090
 
@@ -1074,15 +1134,22 @@ Suggest the logical next command based on workflow phase:
1074
1134
  | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
1075
1135
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
1076
1136
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
1137
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
1138
+ | /qc-plan | `/qc-design-test {UC-ID}` |
1139
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
1140
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
1141
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
1142
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
1143
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
1077
1144
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
1078
1145
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
1079
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
1080
- | /generate-tests | `/run-tests {UC-ID}` |
1081
- | /run-tests (passing) | `/review-code {UC-ID}` |
1082
- | /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
1083
- | /review-code | `/smoke-test {UC-ID}` or create PR |
1084
- | /smoke-test | Create PR and link to ticket |
1085
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
1146
+ | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
1147
+ | /dev-gen-test | `/dev-run-test {UC-ID}` |
1148
+ | /dev-run-test (passing) | `/review-code {UC-ID}` |
1149
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
1150
+ | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
1151
+ | /dev-smoke-test | Create PR and link to ticket |
1152
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
1086
1153
  | /fix-bug | Create PR and link to ticket |
1087
1154
  | /debug | `/fix-bug {ticket-id}` if fix needed |
1088
1155
  | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
@@ -54,7 +54,7 @@ If `lessons_path` does not exist, create it with this header first:
54
54
  | code-gen | /generate-code output |
55
55
  | bdd | /generate-bdd output |
56
56
  | tech-docs | /generate-tech-docs output |
57
- | tests | /generate-tests output |
57
+ | tests | /dev-gen-test output |
58
58
  | prd | /generate-prd, /refine-prd output |
59
59
  | general | every command |
60
60