@anhth2/spec-driven-dev-plugin 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/commands/debug.md +38 -8
  2. package/commands/define-product.md +38 -8
  3. package/commands/dev-gen-test.md +39 -9
  4. package/commands/dev-gen-test.tmpl +1 -1
  5. package/commands/dev-run-test.md +43 -10
  6. package/commands/dev-run-test.tmpl +5 -2
  7. package/commands/dev-smoke-test.md +38 -8
  8. package/commands/fix-bug.md +38 -8
  9. package/commands/generate-bdd.md +42 -10
  10. package/commands/generate-bdd.tmpl +4 -2
  11. package/commands/generate-code.md +39 -9
  12. package/commands/generate-code.tmpl +1 -1
  13. package/commands/generate-design-spec.md +38 -8
  14. package/commands/generate-prd.md +38 -8
  15. package/commands/generate-spec-manifest.md +38 -8
  16. package/commands/generate-tech-docs.md +38 -8
  17. package/commands/learn.md +38 -8
  18. package/commands/propose-scenario.md +38 -8
  19. package/commands/qc-analyze.md +514 -0
  20. package/commands/qc-analyze.tmpl +71 -0
  21. package/commands/qc-design-test.md +510 -0
  22. package/commands/qc-design-test.tmpl +67 -0
  23. package/commands/qc-plan.md +492 -0
  24. package/commands/qc-plan.tmpl +49 -0
  25. package/commands/qc-report.md +491 -0
  26. package/commands/qc-report.tmpl +48 -0
  27. package/commands/qc-review.md +496 -0
  28. package/commands/qc-review.tmpl +53 -0
  29. package/commands/qc-run-test.md +538 -0
  30. package/commands/qc-run-test.tmpl +77 -0
  31. package/commands/refine-prd.md +38 -8
  32. package/commands/report-bug.md +38 -8
  33. package/commands/review-code.md +38 -8
  34. package/commands/review-context.md +38 -8
  35. package/commands/review-tech-docs.md +38 -8
  36. package/commands/setup-ai-first.md +7 -0
  37. package/commands/sync.md +7 -0
  38. package/commands/update-framework.md +7 -0
  39. package/commands/validate-traces.md +54 -12
  40. package/commands/validate-traces.tmpl +16 -4
  41. package/core/FRAMEWORK_VERSION +1 -1
  42. package/core/commands/debug.md +38 -8
  43. package/core/commands/define-product.md +38 -8
  44. package/core/commands/dev-gen-test.md +39 -9
  45. package/core/commands/dev-run-test.md +43 -10
  46. package/core/commands/dev-smoke-test.md +38 -8
  47. package/core/commands/fix-bug.md +38 -8
  48. package/core/commands/generate-bdd.md +42 -10
  49. package/core/commands/generate-code.md +39 -9
  50. package/core/commands/generate-design-spec.md +38 -8
  51. package/core/commands/generate-prd.md +38 -8
  52. package/core/commands/generate-spec-manifest.md +38 -8
  53. package/core/commands/generate-tech-docs.md +38 -8
  54. package/core/commands/learn.md +38 -8
  55. package/core/commands/propose-scenario.md +38 -8
  56. package/core/commands/qc-analyze.md +514 -0
  57. package/core/commands/qc-design-test.md +510 -0
  58. package/core/commands/qc-plan.md +492 -0
  59. package/core/commands/qc-report.md +491 -0
  60. package/core/commands/qc-review.md +496 -0
  61. package/core/commands/qc-run-test.md +538 -0
  62. package/core/commands/refine-prd.md +38 -8
  63. package/core/commands/report-bug.md +38 -8
  64. package/core/commands/review-code.md +38 -8
  65. package/core/commands/review-context.md +38 -8
  66. package/core/commands/review-tech-docs.md +38 -8
  67. package/core/commands/setup-ai-first.md +7 -0
  68. package/core/commands/sync.md +7 -0
  69. package/core/commands/update-framework.md +7 -0
  70. package/core/commands/validate-traces.md +54 -12
  71. package/core/modules/qc-playwright/stack-profile.yaml +65 -0
  72. package/core/skills/code/SKILL.md +45 -8
  73. package/core/skills/debug/SKILL.md +52 -8
  74. package/core/skills/design-spec/SKILL.md +38 -8
  75. package/core/skills/discovery/SKILL.md +38 -8
  76. package/core/skills/prd/SKILL.md +14 -0
  77. package/core/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
  78. package/core/skills/qc/qa-analyst/acceptance-criteria.md +56 -0
  79. package/core/skills/qc/qa-analyst/business-rules.md +55 -0
  80. package/core/skills/qc/qa-analyst/data-flow.md +60 -0
  81. package/core/skills/qc/qa-analyst/spec-breakdown.md +57 -0
  82. package/core/skills/qc/qa-designer/e2e/journey.md +41 -0
  83. package/core/skills/qc/qa-designer/exploratory/charter.md +68 -0
  84. package/core/skills/qc/qa-designer/exploratory/explore-to-functional.md +43 -0
  85. package/core/skills/qc/qa-designer/functional/api.md +45 -0
  86. package/core/skills/qc/qa-designer/functional/gui-feature.md +46 -0
  87. package/core/skills/qc/qa-designer/functional/gui-screen.md +52 -0
  88. package/core/skills/qc/qa-designer/integration/api.md +42 -0
  89. package/core/skills/qc/qa-designer/integration/db.md +39 -0
  90. package/core/skills/qc/qa-designer/integration/gui.md +40 -0
  91. package/core/skills/qc/qa-designer/integration/kafka.md +40 -0
  92. package/core/skills/qc/qa-designer/non-functional.md +40 -0
  93. package/core/skills/qc/qa-planner/test-plan.md +120 -0
  94. package/core/skills/qc/qa-reviewer/script/e2e.md +87 -0
  95. package/core/skills/qc/qa-reviewer/script/exploratory.md +45 -0
  96. package/core/skills/qc/qa-reviewer/script/functional.md +101 -0
  97. package/core/skills/qc/qa-reviewer/script/integration.md +91 -0
  98. package/core/skills/qc/qa-reviewer/script/non-functional.md +126 -0
  99. package/core/skills/qc/qa-reviewer/test-case/e2e.md +73 -0
  100. package/core/skills/qc/qa-reviewer/test-case/exploratory.md +43 -0
  101. package/core/skills/qc/qa-reviewer/test-case/functional.md +76 -0
  102. package/core/skills/qc/qa-reviewer/test-case/integration.md +69 -0
  103. package/core/skills/qc/qa-reviewer/test-case/non-functional.md +73 -0
  104. package/core/skills/qc/qa-runner/e2e.md +49 -0
  105. package/core/skills/qc/qa-runner/exploratory/session.md +36 -0
  106. package/core/skills/qc/qa-runner/functional/api.md +35 -0
  107. package/core/skills/qc/qa-runner/functional/gui-feature.md +51 -0
  108. package/core/skills/qc/qa-runner/functional/gui-screen.md +55 -0
  109. package/core/skills/qc/qa-runner/integration.md +47 -0
  110. package/core/skills/qc/qa-runner/non-functional.md +49 -0
  111. package/core/skills/qc/qa-runner/report/report.md +37 -0
  112. package/core/skills/setup-ai-first/SKILL.md +7 -0
  113. package/core/skills/spec/SKILL.md +14 -0
  114. package/core/skills/test/SKILL.md +83 -16
  115. package/core/steps/context-loader.md +31 -8
  116. package/core/steps/report-footer.md +7 -0
  117. package/core/templates/project-context.yaml +8 -0
  118. package/docs/01-getting-started/README.md +19 -0
  119. package/docs/01-getting-started/core-concepts.md +102 -0
  120. package/docs/01-getting-started/installation.md +154 -0
  121. package/docs/01-getting-started/quickstart.md +85 -0
  122. package/docs/02-guides/README.md +27 -0
  123. package/docs/02-guides/developer/README.md +46 -0
  124. package/docs/02-guides/developer/bdd-and-trace.md +123 -0
  125. package/docs/02-guides/developer/commands.md +76 -0
  126. package/docs/02-guides/developer/pr-checklist.md +15 -0
  127. package/docs/02-guides/developer/scenarios.md +448 -0
  128. package/docs/02-guides/developer/workflow.md +59 -0
  129. package/docs/02-guides/product-owner/README.md +77 -0
  130. package/docs/02-guides/product-owner/commands.md +30 -0
  131. package/docs/02-guides/product-owner/handoff-checklist.md +42 -0
  132. package/docs/02-guides/product-owner/prd-writing-rules.md +45 -0
  133. package/docs/02-guides/product-owner/scenarios.md +357 -0
  134. package/docs/02-guides/qc-automation.md +92 -0
  135. package/docs/02-guides/tester/README.md +72 -0
  136. package/docs/02-guides/tester/bug-reporting.md +117 -0
  137. package/docs/02-guides/tester/reading-specs.md +79 -0
  138. package/docs/02-guides/tester/scenarios.md +186 -0
  139. package/docs/02-guides/tester/spec-manifest.md +124 -0
  140. package/docs/02-guides/tester/test-checklist.md +31 -0
  141. package/docs/02-guides/tester/workflow.md +79 -0
  142. package/docs/03-concepts/README.md +19 -0
  143. package/docs/03-concepts/architecture.md +243 -0
  144. package/docs/03-concepts/pipeline.md +249 -0
  145. package/docs/03-concepts/traceability.md +148 -0
  146. package/docs/04-operations/README.md +33 -0
  147. package/docs/04-operations/bug-flow.md +321 -0
  148. package/docs/04-operations/publishing.md +137 -0
  149. package/docs/04-operations/sync-and-update.md +328 -0
  150. package/docs/05-reference/README.md +29 -0
  151. package/docs/05-reference/commands.md +229 -0
  152. package/docs/05-reference/modules.md +110 -0
  153. package/docs/05-reference/trace-schema.md +146 -0
  154. package/docs/README.md +51 -0
  155. package/modules/qc-playwright/stack-profile.yaml +65 -0
  156. package/package.json +2 -2
  157. package/skills/code/SKILL.md +45 -8
  158. package/skills/debug/SKILL.md +52 -8
  159. package/skills/design-spec/SKILL.md +38 -8
  160. package/skills/discovery/SKILL.md +38 -8
  161. package/skills/prd/SKILL.md +14 -0
  162. package/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
  163. package/skills/qc/qa-analyst/acceptance-criteria.md +56 -0
  164. package/skills/qc/qa-analyst/business-rules.md +55 -0
  165. package/skills/qc/qa-analyst/data-flow.md +60 -0
  166. package/skills/qc/qa-analyst/spec-breakdown.md +57 -0
  167. package/skills/qc/qa-designer/e2e/journey.md +41 -0
  168. package/skills/qc/qa-designer/exploratory/charter.md +68 -0
  169. package/skills/qc/qa-designer/exploratory/explore-to-functional.md +43 -0
  170. package/skills/qc/qa-designer/functional/api.md +45 -0
  171. package/skills/qc/qa-designer/functional/gui-feature.md +46 -0
  172. package/skills/qc/qa-designer/functional/gui-screen.md +52 -0
  173. package/skills/qc/qa-designer/integration/api.md +42 -0
  174. package/skills/qc/qa-designer/integration/db.md +39 -0
  175. package/skills/qc/qa-designer/integration/gui.md +40 -0
  176. package/skills/qc/qa-designer/integration/kafka.md +40 -0
  177. package/skills/qc/qa-designer/non-functional.md +40 -0
  178. package/skills/qc/qa-planner/test-plan.md +120 -0
  179. package/skills/qc/qa-reviewer/script/e2e.md +87 -0
  180. package/skills/qc/qa-reviewer/script/exploratory.md +45 -0
  181. package/skills/qc/qa-reviewer/script/functional.md +101 -0
  182. package/skills/qc/qa-reviewer/script/integration.md +91 -0
  183. package/skills/qc/qa-reviewer/script/non-functional.md +126 -0
  184. package/skills/qc/qa-reviewer/test-case/e2e.md +73 -0
  185. package/skills/qc/qa-reviewer/test-case/exploratory.md +43 -0
  186. package/skills/qc/qa-reviewer/test-case/functional.md +76 -0
  187. package/skills/qc/qa-reviewer/test-case/integration.md +69 -0
  188. package/skills/qc/qa-reviewer/test-case/non-functional.md +73 -0
  189. package/skills/qc/qa-runner/e2e.md +49 -0
  190. package/skills/qc/qa-runner/exploratory/session.md +36 -0
  191. package/skills/qc/qa-runner/functional/api.md +35 -0
  192. package/skills/qc/qa-runner/functional/gui-feature.md +51 -0
  193. package/skills/qc/qa-runner/functional/gui-screen.md +55 -0
  194. package/skills/qc/qa-runner/integration.md +47 -0
  195. package/skills/qc/qa-runner/non-functional.md +49 -0
  196. package/skills/qc/qa-runner/report/report.md +37 -0
  197. package/skills/setup-ai-first/SKILL.md +7 -0
  198. package/skills/spec/SKILL.md +14 -0
  199. package/skills/test/SKILL.md +83 -16
  200. package/steps/context-loader.md +31 -8
  201. package/steps/report-footer.md +7 -0
  202. package/templates/project-context.yaml +8 -0
  203. package/ARCHITECTURE.md +0 -258
@@ -254,6 +254,13 @@ 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
266
  | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
@@ -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
 
@@ -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}
@@ -655,6 +685,13 @@ 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
697
  | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
@@ -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
 
@@ -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}
@@ -1074,6 +1134,13 @@ 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
1146
  | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
@@ -132,19 +132,41 @@ If the file does not exist → skip silently.
132
132
 
133
133
  ---
134
134
 
135
- ## Step 3 — [CRITICAL] Load CLAUDE.md
135
+ ## Step 3 — [CRITICAL] Load CLAUDE.md (layered: root + service overlay)
136
136
 
137
137
  *This is the highest-priority context — it defines HOW to write code and documents for this project.*
138
138
 
139
- Read `CLAUDE.md`. Extract and store:
139
+ CLAUDE.md is loaded in **two layers** so umbrella-wide rules and service-specific
140
+ architecture/coding standards compose correctly. The agent always sits at the umbrella
141
+ root, but the implementation code lives in a service submodule with its OWN stack,
142
+ architecture, and conventions — so the service's CLAUDE.md must win for code generation.
143
+
144
+ **Layer 1 — [BASE] Root CLAUDE.md (umbrella-wide).**
145
+ Read `CLAUDE.md` at the repo root. Treat its contents as the **shared baseline** for the
146
+ whole umbrella — git conventions, data-protection posture, cross-cutting rules, and (in
147
+ single-service mode) the project's only architecture + coding standards.
148
+
149
+ **Layer 2 — [OVERLAY] Service CLAUDE.md (umbrella mode only).**
150
+ *Run only if `service_root` was set in Step 1.6 (i.e. a real service was routed to).*
151
+ Read `{service_root}/CLAUDE.md`. This file defines the architecture + coding standards of
152
+ the **actual stack being implemented** (e.g. `user-service` = java-spring, `web` = nextjs).
153
+ Overlay it on top of Layer 1: **on any conflict, the service value WINS** for architecture,
154
+ coding standards, and error handling. Layer-1 values that the service does not redefine
155
+ (e.g. git conventions, banned patterns shared org-wide) remain in effect.
156
+
157
+ From the **merged** result, extract and store:
140
158
 
141
159
  - **§1 Project Overview** → project name, language, framework, build/test commands, domains
142
- - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules
143
- - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns
144
- - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name
145
- - **§7 Git Conventions** → branch naming pattern, commit message format
160
+ - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules — *service overlay wins*
161
+ - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns — *service overlay wins*
162
+ - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name — *service overlay wins*
163
+ - **§7 Git Conventions** → branch naming pattern, commit message format — *root baseline unless service redefines*
146
164
 
147
- If `CLAUDE.md` does not exist → note it as missing and continue with project-context.yaml data only.
165
+ **Resolution rules:**
166
+ - If both layers exist → merge as above; record `claude_md_source = root + {service_root}`.
167
+ - If only the service overlay exists (no root CLAUDE.md) → use the service file alone; `claude_md_source = {service_root}`.
168
+ - 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).
169
+ - If neither exists → note CLAUDE.md as missing and continue with project-context.yaml data only.
148
170
 
149
171
  ---
150
172
 
@@ -244,7 +266,8 @@ Output exactly this block:
244
266
  [CTX LOADED]
245
267
  Stack : {language} / {framework} / {database}
246
268
  Platform : {active_module} ({platform_type})
247
- Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
269
+ Layers : {layer order from merged CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
270
+ CLAUDE.md : {root + {service_root} | {service_root} only | root only | ⚠️ service overlay MISSING — using root | missing}
248
271
  Ticket : {ticket_prefix}-
249
272
  Dict : {loaded — N canonical terms, M banned terms | missing}
250
273
  Entities : {loaded — EntityA, EntityB, EntityC | missing}
@@ -34,6 +34,13 @@ Suggest the logical next command based on workflow phase:
34
34
  | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
35
35
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
36
36
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
37
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
38
+ | /qc-plan | `/qc-design-test {UC-ID}` |
39
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
40
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
41
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
42
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
43
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
37
44
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
38
45
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
39
46
  | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
@@ -106,6 +106,14 @@ domains:
106
106
  # module: "{{STACK_MODULE}}" # e.g., java-spring, nextjs, flutter
107
107
  # specs_dir: "{{SERVICE_SUBMODULE_DIR}}/specs/bdd"
108
108
  # tech_docs_dir: "{{SERVICE_SUBMODULE_DIR}}/specs/tech-docs"
109
+ #
110
+ # IMPORTANT — per-service CLAUDE.md:
111
+ # Each service submodule should have its OWN CLAUDE.md ({path}/CLAUDE.md) defining its
112
+ # architecture + coding standards for ITS stack. context-loader loads CLAUDE.md in two
113
+ # layers: root CLAUDE.md (umbrella-wide shared rules) + {service}/CLAUDE.md (overlay,
114
+ # wins on conflict for architecture/coding-standards). The agent sits at the umbrella
115
+ # root, so without a service CLAUDE.md, code generation falls back to umbrella defaults
116
+ # (likely the wrong stack). Generate one per service via /setup-ai-first inside each.
109
117
  # {{DOMAIN_2}}:
110
118
  # path: "{{SERVICE_2_DIR}}"
111
119
  # module: "{{STACK_MODULE}}"
@@ -0,0 +1,19 @@
1
+ [📚 Docs](../README.md) › Getting Started
2
+
3
+ # Getting Started
4
+
5
+ Bắt đầu với spec-driven-dev framework — cài đặt, chạy feature đầu tiên, và nắm các khái niệm cốt lõi trong vài phút.
6
+
7
+ ## Mục lục (this section)
8
+
9
+ - [installation.md](installation.md) — Cài framework, prerequisites (Node, Claude Code), QC automation stack, và VS Code extension (Review Board + Living Docs panels).
10
+ - [quickstart.md](quickstart.md) — Chạy feature đầu tiên end-to-end: Discovery → PRD → BDD → Tech Design → Code → Dev self-check.
11
+ - [core-concepts.md](core-concepts.md) — Khái niệm trong 5 phút: spec-as-source-of-truth, pipeline phases, traceability, dev_selftest vs qc_status, umbrella/spec-module.
12
+
13
+ ## Đọc gì trước?
14
+
15
+ 1. Mới hoàn toàn? → bắt đầu ở [core-concepts.md](core-concepts.md) để hiểu triết lý.
16
+ 2. Sẵn sàng cài? → [installation.md](installation.md).
17
+ 3. Đã cài xong? → [quickstart.md](quickstart.md) để chạy feature đầu tiên.
18
+
19
+ > Cần đào sâu hơn? Xem các section khác trong [📚 Docs](../README.md) — concepts, multi-repo/umbrella, QC pipeline, command reference, architecture.
@@ -0,0 +1,102 @@
1
+ [📚 Docs](../README.md) › [Getting Started](README.md) › Core Concepts
2
+
3
+ # Core Concepts
4
+
5
+ Các khái niệm cốt lõi trong 5 phút. Đào sâu hơn ở [../03-concepts](../03-concepts).
6
+
7
+ ## Mục lục
8
+
9
+ - [Spec là source of truth](#spec-là-source-of-truth)
10
+ - [Pipeline phases](#pipeline-phases)
11
+ - [Traceability](#traceability)
12
+ - [dev_selftest vs qc_status](#dev_selftest-vs-qc_status)
13
+ - [Umbrella & spec module](#umbrella--spec-module)
14
+
15
+ ## Spec là source of truth
16
+
17
+ > **Write the spec first. Generate the code from the spec. Trace everything.**
18
+
19
+ - Con người định nghĩa *WHAT* — acceptance criteria, business rules, platform requirements.
20
+ - AI sinh ra *HOW* — BDD scenarios, tech design, code, tests — thích ứng theo platform.
21
+ - Mỗi artifact được review trước khi sang phase kế tiếp (AI review gate ở mọi transition).
22
+ - Mỗi dòng code truy ngược về một scenario trong file `.feature`.
23
+
24
+ **PRD platform-agnostic (Option C):** một PRD phục vụ mọi platform — chỉ mô tả nghiệp vụ, không có chi tiết UI hay API. FE/App đọc PRD → Design Spec → BDD; BE đọc PRD trực tiếp → BDD. Thêm platform mới sau không cần sửa PRD.
25
+
26
+ ## Pipeline phases
27
+
28
+ ```
29
+ Discovery → PRD → BDD Spec → Tech Design → Code → Dev Self-Check
30
+ (+ QC suite chính thức song song)
31
+ ```
32
+
33
+ | Phase | Ai | Lệnh chính | Output |
34
+ |-------|-----|-----------|--------|
35
+ | Discovery | PO + AI | `/define-product` | `specs/product-definition/{slug}.md` |
36
+ | PRD | AI → SA/PO | `/generate-prd`, `/refine-prd`, `/review-context` | `specs/prd/{domain}/{slug}.md` |
37
+ | Design Spec *(FE/App)* | AI → Designer/PO | `/generate-design-spec` | `specs/design-spec/...` |
38
+ | BDD Spec | AI → SA/Dev | `/generate-bdd`, `/review-context` | `specs/bdd/{domain}/{UC-ID}.feature` |
39
+ | Tech Design | AI → SA/Lead | `/generate-tech-docs`, `/review-tech-docs` | `tech-docs/{domain}/{UC-ID}-tech-design.md` |
40
+ | Code | AI → Dev | `/generate-code`, `/review-code` | `src/...` |
41
+ | Dev Self-Check | Dev | `/dev-gen-test`, `/dev-run-test`, `/dev-smoke-test` | `src/test/...` |
42
+ | QC Automation | QC | `/qc-analyze → /qc-plan → /qc-design-test → /qc-review → /qc-run-test → /qc-report` | QC designs + run results |
43
+ | Trace audit | Tech Lead | `/validate-traces {domain}` | Coverage + drift report |
44
+
45
+ Chi tiết từng phase + happy-path lệnh: [quickstart.md](quickstart.md).
46
+
47
+ ## Traceability
48
+
49
+ Mỗi artifact link tới artifact khác qua `@trace.*` tags:
50
+
51
+ ```
52
+ product-definition.md
53
+ └─► PRD.md (Service, Module trong metadata)
54
+ └─► {UC-ID}.feature (@trace.service, @trace.module, @trace.prd_version)
55
+ └─► tech-design.md (@trace.bdd_version)
56
+ └─► src/ code (@trace.implements, @trace.prd_version, @trace.bdd_version)
57
+ └─► src/test/ (@trace.verifies, @trace.service)
58
+ └─► .trace/{UC-ID}.tsv (drift tracking)
59
+ ```
60
+
61
+ `/validate-traces {domain}` đọc các `.trace/{UC-ID}.tsv` và báo cáo:
62
+
63
+ | Status | Nghĩa |
64
+ |--------|-------|
65
+ | ✅ OK | Code version khớp spec version |
66
+ | ⚠️ DRIFT | Code sinh từ PRD/BDD version cũ — cần re-generate |
67
+ | 🔴 GAP | Scenario có trong spec nhưng chưa có code implement |
68
+ | — UNTRACKED | Scenario ghi nhận nhưng chưa code-gen |
69
+
70
+ Chi tiết tags + chain: [../03-concepts/traceability.md](../03-concepts/traceability.md).
71
+
72
+ ## dev_selftest vs qc_status
73
+
74
+ Hai signal **độc lập** trong trace TSV — đừng nhầm lẫn:
75
+
76
+ | Signal | Set bởi | Ý nghĩa |
77
+ |--------|---------|---------|
78
+ | `dev_selftest` (+ `dev_selftest_at`) | `/dev-run-test` | Dev tự verify code của mình (smoke / self-check). **KHÔNG phải** official coverage. |
79
+ | `qc_status` (+ `qc_run_at`) | `/qc-run-test` | Bộ QC suite chính thức (native `/qc-*` pipeline), keyed theo `@trace.verifies={UC-ID}-SC{N}`. |
80
+
81
+ QC owns `qc_status`; dev owns `dev_selftest`. Living Docs panel hiển thị cả hai cạnh nhau. `/qc-run-test` & `/qc-report` dùng stack `qc-playwright` (độc lập với dev module — xem [installation.md](installation.md)).
82
+
83
+ ## Umbrella & spec module
84
+
85
+ Cho project có nhiều service repo riêng (microservices, multi-platform): pattern khuyến nghị là **umbrella repo** — repo tổng chứa các service repo dưới dạng git submodule.
86
+
87
+ ```
88
+ my-project-umbrella/ ← mở Claude Code ở đây
89
+ ├── .agent/project-context.yaml ← routing config (domain → service)
90
+ ├── my-project-specs/ ← submodule: spec module của PO (PRD, design-spec, tech-docs)
91
+ ├── user-service/ ← submodule: microservice
92
+ └── web-app/ ← submodule: FE app
93
+ ```
94
+
95
+ - **Spec module** (`{spec_source}/`): chứa PRD, Design Spec, và tech-docs (API contract) — shared để mọi umbrella đọc cùng contract. Report canonical của Living Docs cũng sinh tại `{spec_source}/.living-docs/`.
96
+ - **Routing:** context-loader đọc `@trace.domain` từ PRD → tra trong `services` config → route BDD/code vào đúng service submodule. PRD phải có `@trace.domain` khớp một key trong `services`.
97
+
98
+ Setup umbrella đầy đủ, file ownership, two-layer commit, multi-platform → [Operations › Sync & Update §4 Umbrella mode](../04-operations/sync-and-update.md#4-umbrella-mode--git-submodule).
99
+
100
+ ---
101
+
102
+ Sẵn sàng chạy? → [quickstart.md](quickstart.md).
@@ -0,0 +1,154 @@
1
+ [📚 Docs](../README.md) › [Getting Started](README.md) › Installation
2
+
3
+ # Installation
4
+
5
+ Cài đặt framework vào project và (tùy chọn) VS Code extension.
6
+
7
+ ## Mục lục
8
+
9
+ - [Prerequisites](#prerequisites)
10
+ - [Cài framework](#cài-framework)
11
+ - [Kiểm tra cài đặt](#kiểm-tra-cài-đặt)
12
+ - [Upgrade](#upgrade)
13
+ - [QC automation stack (tùy chọn)](#qc-automation-stack-tùy-chọn)
14
+ - [VS Code extension (khuyến nghị)](#vs-code-extension-khuyến-nghị)
15
+ - [Uninstall](#uninstall)
16
+
17
+ ## Prerequisites
18
+
19
+ | Tool | Version | Link |
20
+ |------|---------|------|
21
+ | Node.js | bất kỳ (check: `node -v`) | [nodejs.org](https://nodejs.org) |
22
+ | Claude Code CLI | Latest | [claude.ai/code](https://claude.ai/code) |
23
+ | VS Code | ≥ 1.85 | [code.visualstudio.com](https://code.visualstudio.com) |
24
+ | Git | bất kỳ | |
25
+
26
+ > Claude Code cần subscription (Claude Pro / Team / API key).
27
+
28
+ ## Cài framework
29
+
30
+ Chạy từ **thư mục root của project**. Cách khuyến nghị là `--init` — cài framework vào `.agent/` (commit vào git, cả team dùng chung) và tạo shortcut trong `.claude/commands/`.
31
+
32
+ ```bash
33
+ # Single-service project:
34
+ npx @anhth2/spec-driven-dev-plugin --init --module java-spring
35
+
36
+ # Multi-service monorepo (cài vào từng subfolder trong 1 lệnh):
37
+ npx @anhth2/spec-driven-dev-plugin --init \
38
+ --services backend:java-spring,web-admin:react,app-mobile:flutter
39
+ ```
40
+
41
+ Kết quả:
42
+ - `.agent/` — toàn bộ framework files (commit vào git, shared với team)
43
+ - `.claude/commands/` — shortcut trỏ về `.agent/commands/`
44
+ - `.agent/FRAMEWORK_VERSION` — tracking version để upgrade
45
+
46
+ ```bash
47
+ git add .agent/ .claude/commands/
48
+ git commit -m "chore: init spec-driven-dev"
49
+ ```
50
+
51
+ > **Multi-repo / umbrella?** Xem hướng dẫn umbrella setup chi tiết trong [Operations › Sync & Update §4 Umbrella mode](../04-operations/sync-and-update.md#4-umbrella-mode--git-submodule).
52
+
53
+ ### Legacy install (global / per-project)
54
+
55
+ ```bash
56
+ npx @anhth2/spec-driven-dev-plugin # global: ~/.claude/commands/
57
+ npx @anhth2/spec-driven-dev-plugin --project # project: ./.claude/commands/
58
+ ```
59
+
60
+ ## Kiểm tra cài đặt
61
+
62
+ Mở Claude Code tại project, gõ `/` — bạn sẽ thấy các lệnh:
63
+
64
+ ```
65
+ /setup-ai-first
66
+ /define-product
67
+ /generate-prd
68
+ /generate-bdd
69
+ ...
70
+ ```
71
+
72
+ > Không thấy lệnh? Chạy lại lệnh cài (global lưu tại `~/.claude/commands/`, trên Windows: `ls "$env:USERPROFILE\.claude\commands\"`).
73
+
74
+ ## Upgrade
75
+
76
+ Từ **trong Claude Code** (khuyến nghị — check version, xử lý umbrella mode, review diff):
77
+
78
+ ```
79
+ /update-framework
80
+ ```
81
+
82
+ Hoặc từ terminal:
83
+
84
+ ```bash
85
+ bash scripts/upgrade.sh
86
+ # hoặc:
87
+ npx @anhth2/spec-driven-dev-plugin@latest --init
88
+ git diff .agent/ && git add .agent/ && git commit -m "chore: upgrade framework"
89
+ ```
90
+
91
+ > Chỉ upgrade framework command files. `project-context.yaml`, `CLAUDE.md`, domain-knowledge, và `.trace/` không bao giờ bị ghi đè. Để sync *content* của project (submodule code/specs) dùng `/sync`.
92
+
93
+ ## QC automation stack (tùy chọn)
94
+
95
+ Bộ QC suite chính thức (`/qc-*`) là **native** trong framework. Hai lệnh cuối — `/qc-run-test` và `/qc-report` — dùng stack module **`qc-playwright`**, **độc lập với dev module**. Cài riêng:
96
+
97
+ ```bash
98
+ # 1. Python 3 + pytest-playwright
99
+ pip install pytest-playwright
100
+
101
+ # 2. Cài browsers
102
+ python3 -m playwright install
103
+ ```
104
+
105
+ `qc-playwright` = Python + pytest-playwright + Page Object (output: Playwright Trace + pytest-html). Chi tiết pipeline: [../02-guides/qc-automation.md](../02-guides/qc-automation.md).
106
+
107
+ ## VS Code extension (khuyến nghị)
108
+
109
+ **Spec Driven Dev** là VS Code extension với 2 panels. Không bắt buộc nhưng khuyến nghị. VS Code tự cập nhật khi có version mới.
110
+
111
+ ```bash
112
+ code --install-extension edupia-team.spec-driven-dev-team
113
+ ```
114
+
115
+ Hoặc: `Ctrl+Shift+P` → **"Extensions: Install from Marketplace"** → search **Spec Driven Dev**.
116
+
117
+ ### Panel 1 — Review Board
118
+
119
+ Đọc `*-findings.yaml` từ `.agent/review/` — hỗ trợ findings từ mọi review command (`/refine-prd`, `/review-context`, `/review-tech-docs`).
120
+
121
+ - Lens tabs: All / QA / DEV / SA / PO hoặc PRD / BDD / TECH.
122
+ - Mỗi finding có badge `⚡ auto-fix` / `👤 human`.
123
+ - 4 actions: Accept · Modify (có note) · Defer · Reject — kèm progress bar, full-text search.
124
+ - **Smart Apply** spawn terminal chạy đúng lệnh `--resume`.
125
+
126
+ Mở Review Board: sidebar panel (Activity Bar), hoặc right-click file `*-findings.yaml` → "Open Review Board", hoặc Command Palette. Nếu panel trống: file phải có đuôi `-findings.yaml`, nằm trong `.agent/review/`, và đóng hẳn rồi mở lại VS Code.
127
+
128
+ ### Panel 2 — Living Documentation
129
+
130
+ Đọc `.trace/*.tsv` — dashboard traceability health toàn project.
131
+
132
+ - Stat cards: PRDs, Use Cases, Scenarios, Code Cov%, Test Cov%, Drift, Gap.
133
+ - Drill-down: PRD → UC → per-scenario table (Spec ver, Gen ver, Code, Tests, `dev_selftest`, `qc_status`, Status).
134
+ - Status badges: ✅ OK · ⚠️ DRIFT · 🔴 GAP · — UNTRACKED. Filter + search + live reload.
135
+
136
+ Mở: `Ctrl+Shift+P` → **"Spec Driven Dev: Open Living Documentation"**. Mở được cả ở umbrella root lẫn trong một service submodule riêng lẻ. Nếu trống, chạy `/generate-bdd` cho ≥1 feature để tạo file `.trace/{UC-ID}.tsv` đầu tiên.
137
+
138
+ > Report canonical sinh vào spec module tại `{spec_source}/.living-docs/` (gitignored); bản mirror cục bộ ở `./.trace`. Chi tiết traceability: [core-concepts.md](core-concepts.md) và [../03-concepts/traceability.md](../03-concepts/traceability.md).
139
+
140
+ ## Uninstall
141
+
142
+ **Mac/Linux:**
143
+ ```bash
144
+ rm -rf .agent/ .claude/commands/
145
+ ```
146
+
147
+ **Windows (PowerShell):**
148
+ ```powershell
149
+ Remove-Item -Recurse -Force .agent, .claude\commands
150
+ ```
151
+
152
+ ---
153
+
154
+ Cài xong? → [quickstart.md](quickstart.md) để chạy feature đầu tiên.
@@ -0,0 +1,85 @@
1
+ [📚 Docs](../README.md) › [Getting Started](README.md) › Quick Start
2
+
3
+ # Quick Start
4
+
5
+ Chạy feature đầu tiên end-to-end theo happy path. Mở Claude Code tại root project và làm theo thứ tự.
6
+
7
+ ## Mục lục
8
+
9
+ - [Bước 0 — Setup project (một lần)](#bước-0--setup-project-một-lần)
10
+ - [Happy-path command sequence](#happy-path-command-sequence)
11
+ - [Bước tiếp theo](#bước-tiếp-theo)
12
+
13
+ ## Bước 0 — Setup project (một lần)
14
+
15
+ ```bash
16
+ # 1. Cài framework (nếu chưa) — xem installation.md
17
+ npx @anhth2/spec-driven-dev-plugin --init
18
+
19
+ # 2. Mở project trong Claude Code, tạo cấu trúc + config files:
20
+ /setup-ai-first
21
+ ```
22
+
23
+ `/setup-ai-first` tạo cấu trúc thư mục (`specs/`, `tech-docs/`, `.trace/`, `.agent/`, `CLAUDE.md`). Sau đó điền thông tin thực tế vào 4 file config:
24
+
25
+ | File | Nội dung |
26
+ |------|----------|
27
+ | `CLAUDE.md` | Architecture layers, coding standards, git conventions |
28
+ | `.agent/project-context.yaml` | Tech stack, services, paths, ticket prefix |
29
+ | `specs/domain-knowledge/business-dictionary.md` | Canonical terms, banned terms |
30
+ | `specs/domain-knowledge/core-entities.md` | Entity glossary (fields, relationships) |
31
+
32
+ > Project đã có sẵn `specs/`, `CLAUDE.md`, `.agent/project-context.yaml`? Bỏ qua bước này, vào thẳng happy path bên dưới. Chi tiết điền config + Figma setup: xem [../02-guides](../02-guides) và [../03-concepts](../03-concepts).
33
+
34
+ ## Happy-path command sequence
35
+
36
+ Discovery → PRD → BDD → Tech Design → Code → Dev self-check:
37
+
38
+ ```
39
+ # PHASE 1 — DISCOVERY
40
+ /define-product
41
+ → specs/product-definition/{slug}.md
42
+
43
+ # PHASE 2 — PRD
44
+ /generate-prd specs/product-definition/{slug}.md
45
+ → specs/prd/{domain}/{slug}.md
46
+ /refine-prd specs/prd/{domain}/{slug}.md # AI suggestions → Review Board
47
+ /refine-prd --resume specs/prd/{domain}/{slug}.md # apply + bump version
48
+ /review-context specs/prd/{domain}/{slug}.md # quality gate (P1–P4)
49
+ /review-context --resume specs/prd/{domain}/{slug}.md
50
+ → ✅ APPROVED → tiếp Phase 3
51
+
52
+ # PHASE 3 — SPEC & DESIGN
53
+ # (FE/App only) /generate-design-spec specs/prd/{domain}/{slug}.md → designer + PO sign-off
54
+ /generate-bdd specs/prd/{domain}/{slug}.md
55
+ → specs/bdd/{domain}/{UC-ID}.feature
56
+ /review-context specs/bdd/{domain}/{UC-ID}.feature
57
+ /review-context --resume specs/bdd/{domain}/{UC-ID}.feature # apply + bump bdd_version
58
+ /generate-tech-docs specs/bdd/{domain}/{UC-ID}.feature
59
+ → tech-docs/{domain}/{UC-ID}-tech-design.md
60
+ /review-tech-docs tech-docs/{domain}/{UC-ID}-tech-design.md
61
+ /review-tech-docs --resume tech-docs/{domain}/{UC-ID}-tech-design.md
62
+
63
+ # PHASE 4 — CODE
64
+ /generate-code specs/bdd/{domain}/{UC-ID}.feature
65
+ → src/... (@trace.implements tags)
66
+ /review-code # fix CRITICAL / MAJOR
67
+
68
+ # PHASE 5 — DEV SELF-CHECK (dev verify code của mình — KHÔNG phải QC suite chính thức)
69
+ /dev-gen-test specs/bdd/{domain}/{UC-ID}.feature
70
+ → src/test/... (@trace.verifies tags)
71
+ /dev-run-test # sets dev_selftest in trace
72
+ /dev-smoke-test # optional — live endpoint check
73
+ /validate-traces {domain} # coverage & drift
74
+ ```
75
+
76
+ Mỗi review command ghi findings vào `.agent/review/*-findings.yaml`. Mở **Review Board** (VS Code panel) → Accept / Modify / Defer / Reject từng finding → chạy `--resume` để apply. Quick-fix không qua Review Board: `/review-context --fix {file}` (chỉ apply auto-fixable).
77
+
78
+ > **FE/App:** `/generate-code --phase=ui` (UI + mock adapter, tester test ngay) rồi `--phase=integration` (wire API thật sau sign-off).
79
+
80
+ ## Bước tiếp theo
81
+
82
+ - Hiểu khái niệm phía sau pipeline → [core-concepts.md](core-concepts.md).
83
+ - QC suite chính thức (`/qc-analyze → /qc-plan → /qc-design-test → /qc-review → /qc-run-test → /qc-report`) → [../02-guides/qc-automation.md](../02-guides/qc-automation.md).
84
+ - Role guides, scenarios thực tế, multi-repo/umbrella → [../02-guides](../02-guides) và [../03-concepts](../03-concepts).
85
+ - Full command reference → [../05-reference](../05-reference).
@@ -0,0 +1,27 @@
1
+ [📚 Docs](../README.md) › Guides
2
+
3
+ # Guides — Role Playbooks
4
+
5
+ Mỗi role trong framework spec-driven-dev có một guide riêng: vai trò, commands, workflow, và các tình huống thực tế. Bắt đầu từ guide khớp với role của bạn.
6
+
7
+ ## Mục Lục
8
+
9
+ | Guide | Dành cho | Nội dung |
10
+ |---|---|---|
11
+ | [Product Owner / BA](product-owner/README.md) | PO, BA | Viết PRD platform-agnostic, generate Design Spec + BDD, handoff cho dev team |
12
+ | [Developer (FE / BE / App)](developer/README.md) | Dev | Đọc PRD + BDD từ spec submodule, generate tech-docs + code, dev self-check, trace system |
13
+ | [Tester / QA](tester/README.md) | QA, Tester | Spec-manifest, đọc spec chain, viết test cases, `/report-bug` + `/propose-scenario` |
14
+ | [QC Automation](qc-automation.md) | QC | Pipeline `/qc-*` 6 bước, `qc_status` chính thức, stack module `qc-playwright` |
15
+ | Designer | Designer, UX | Tham gia giai đoạn Design Spec — sign-off màn hình + component trước khi PO gen BDD. Chưa có guide riêng; xem [Product Owner › Design Spec](product-owner/scenarios.md#tình-huống-3--tạo-design-spec-và-bdd-sau-khi-prd-approved) để biết điểm giao. |
16
+
17
+ ## Phân biệt nhanh hai luồng test
18
+
19
+ - **Dev self-check** — `/dev-gen-test` · `/dev-run-test` · `/dev-smoke-test`, ghi `dev_selftest`. Smoke check của riêng dev, KHÔNG phải coverage chính thức.
20
+ - **QC chính thức** — pipeline `/qc-analyze … /qc-report`, ghi `qc_status`. Bộ test authoritative, do QC chạy.
21
+
22
+ Hai tín hiệu này đứng cạnh nhau trong Living Docs và không ghi đè nhau.
23
+
24
+ ## Xem thêm
25
+
26
+ - [Concepts › Traceability](../03-concepts/traceability.md) — trace chain PRD → BDD → Code
27
+ - [Reference › Commands](../05-reference/commands.md) — danh mục đầy đủ mọi command