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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. package/commands/debug.md +43 -8
  2. package/commands/define-product.md +43 -8
  3. package/commands/dev-gen-test.md +44 -9
  4. package/commands/dev-gen-test.tmpl +1 -1
  5. package/commands/dev-run-test.md +48 -10
  6. package/commands/dev-run-test.tmpl +5 -2
  7. package/commands/dev-smoke-test.md +43 -8
  8. package/commands/fix-bug.md +79 -14
  9. package/commands/fix-bug.tmpl +36 -6
  10. package/commands/generate-bdd.md +49 -10
  11. package/commands/generate-bdd.tmpl +6 -2
  12. package/commands/generate-code.md +44 -9
  13. package/commands/generate-code.tmpl +1 -1
  14. package/commands/generate-design-spec.md +43 -8
  15. package/commands/generate-prd.md +43 -8
  16. package/commands/generate-spec-manifest.md +43 -8
  17. package/commands/generate-tech-docs.md +43 -8
  18. package/commands/learn.md +43 -8
  19. package/commands/propose-scenario.md +74 -19
  20. package/commands/propose-scenario.tmpl +31 -11
  21. package/commands/qc-analyze.md +534 -0
  22. package/commands/qc-analyze.tmpl +86 -0
  23. package/commands/qc-design-test.md +515 -0
  24. package/commands/qc-design-test.tmpl +67 -0
  25. package/commands/qc-plan.md +497 -0
  26. package/commands/qc-plan.tmpl +49 -0
  27. package/commands/qc-report.md +508 -0
  28. package/commands/qc-report.tmpl +60 -0
  29. package/commands/qc-review.md +501 -0
  30. package/commands/qc-review.tmpl +53 -0
  31. package/commands/qc-run-test.md +549 -0
  32. package/commands/qc-run-test.tmpl +83 -0
  33. package/commands/refine-prd.md +43 -8
  34. package/commands/report-bug.md +59 -10
  35. package/commands/report-bug.tmpl +16 -2
  36. package/commands/review-code.md +43 -8
  37. package/commands/review-context.md +43 -8
  38. package/commands/review-tech-docs.md +43 -8
  39. package/commands/setup-ai-first.md +7 -0
  40. package/commands/sync.md +19 -9
  41. package/commands/sync.tmpl +12 -9
  42. package/commands/update-framework.md +7 -0
  43. package/commands/validate-traces.md +67 -12
  44. package/commands/validate-traces.tmpl +24 -4
  45. package/core/FRAMEWORK_VERSION +1 -1
  46. package/core/commands/debug.md +43 -8
  47. package/core/commands/define-product.md +43 -8
  48. package/core/commands/dev-gen-test.md +44 -9
  49. package/core/commands/dev-run-test.md +48 -10
  50. package/core/commands/dev-smoke-test.md +43 -8
  51. package/core/commands/fix-bug.md +79 -14
  52. package/core/commands/generate-bdd.md +49 -10
  53. package/core/commands/generate-code.md +44 -9
  54. package/core/commands/generate-design-spec.md +43 -8
  55. package/core/commands/generate-prd.md +43 -8
  56. package/core/commands/generate-spec-manifest.md +43 -8
  57. package/core/commands/generate-tech-docs.md +43 -8
  58. package/core/commands/learn.md +43 -8
  59. package/core/commands/propose-scenario.md +74 -19
  60. package/core/commands/qc-analyze.md +534 -0
  61. package/core/commands/qc-design-test.md +515 -0
  62. package/core/commands/qc-plan.md +497 -0
  63. package/core/commands/qc-report.md +508 -0
  64. package/core/commands/qc-review.md +501 -0
  65. package/core/commands/qc-run-test.md +549 -0
  66. package/core/commands/refine-prd.md +43 -8
  67. package/core/commands/report-bug.md +59 -10
  68. package/core/commands/review-code.md +43 -8
  69. package/core/commands/review-context.md +43 -8
  70. package/core/commands/review-tech-docs.md +43 -8
  71. package/core/commands/setup-ai-first.md +7 -0
  72. package/core/commands/sync.md +19 -9
  73. package/core/commands/update-framework.md +7 -0
  74. package/core/commands/validate-traces.md +67 -12
  75. package/core/modules/qc-playwright/stack-profile.yaml +65 -0
  76. package/core/skills/code/SKILL.md +50 -8
  77. package/core/skills/debug/SKILL.md +57 -8
  78. package/core/skills/design-spec/SKILL.md +43 -8
  79. package/core/skills/discovery/SKILL.md +43 -8
  80. package/core/skills/prd/SKILL.md +14 -0
  81. package/core/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
  82. package/core/skills/qc/qa-analyst/acceptance-criteria.md +60 -0
  83. package/core/skills/qc/qa-analyst/business-rules.md +59 -0
  84. package/core/skills/qc/qa-analyst/data-flow.md +64 -0
  85. package/core/skills/qc/qa-analyst/spec-breakdown.md +61 -0
  86. package/core/skills/qc/qa-designer/e2e/journey.md +41 -0
  87. package/core/skills/qc/qa-designer/exploratory/charter.md +68 -0
  88. package/core/skills/qc/qa-designer/exploratory/explore-to-functional.md +43 -0
  89. package/core/skills/qc/qa-designer/functional/api.md +45 -0
  90. package/core/skills/qc/qa-designer/functional/gui-feature.md +46 -0
  91. package/core/skills/qc/qa-designer/functional/gui-screen.md +52 -0
  92. package/core/skills/qc/qa-designer/integration/api.md +42 -0
  93. package/core/skills/qc/qa-designer/integration/db.md +39 -0
  94. package/core/skills/qc/qa-designer/integration/gui.md +40 -0
  95. package/core/skills/qc/qa-designer/integration/kafka.md +40 -0
  96. package/core/skills/qc/qa-designer/non-functional.md +40 -0
  97. package/core/skills/qc/qa-planner/test-plan.md +120 -0
  98. package/core/skills/qc/qa-reviewer/script/e2e.md +87 -0
  99. package/core/skills/qc/qa-reviewer/script/exploratory.md +45 -0
  100. package/core/skills/qc/qa-reviewer/script/functional.md +101 -0
  101. package/core/skills/qc/qa-reviewer/script/integration.md +91 -0
  102. package/core/skills/qc/qa-reviewer/script/non-functional.md +126 -0
  103. package/core/skills/qc/qa-reviewer/test-case/e2e.md +73 -0
  104. package/core/skills/qc/qa-reviewer/test-case/exploratory.md +43 -0
  105. package/core/skills/qc/qa-reviewer/test-case/functional.md +76 -0
  106. package/core/skills/qc/qa-reviewer/test-case/integration.md +69 -0
  107. package/core/skills/qc/qa-reviewer/test-case/non-functional.md +73 -0
  108. package/core/skills/qc/qa-runner/e2e.md +49 -0
  109. package/core/skills/qc/qa-runner/exploratory/session.md +36 -0
  110. package/core/skills/qc/qa-runner/functional/api.md +35 -0
  111. package/core/skills/qc/qa-runner/functional/gui-feature.md +51 -0
  112. package/core/skills/qc/qa-runner/functional/gui-screen.md +55 -0
  113. package/core/skills/qc/qa-runner/integration.md +47 -0
  114. package/core/skills/qc/qa-runner/non-functional.md +49 -0
  115. package/core/skills/qc/qa-runner/report/report.md +37 -0
  116. package/core/skills/setup-ai-first/SKILL.md +7 -0
  117. package/core/skills/spec/SKILL.md +14 -0
  118. package/core/skills/test/SKILL.md +93 -16
  119. package/core/steps/context-loader.md +36 -8
  120. package/core/steps/report-footer.md +7 -0
  121. package/core/templates/project-context.yaml +27 -1
  122. package/docs/01-getting-started/README.md +19 -0
  123. package/docs/01-getting-started/core-concepts.md +102 -0
  124. package/docs/01-getting-started/installation.md +156 -0
  125. package/docs/01-getting-started/quickstart.md +85 -0
  126. package/docs/02-guides/README.md +27 -0
  127. package/docs/02-guides/developer/README.md +46 -0
  128. package/docs/02-guides/developer/bdd-and-trace.md +123 -0
  129. package/docs/02-guides/developer/commands.md +76 -0
  130. package/docs/02-guides/developer/pr-checklist.md +15 -0
  131. package/docs/02-guides/developer/scenarios.md +448 -0
  132. package/docs/02-guides/developer/workflow.md +61 -0
  133. package/docs/02-guides/product-owner/README.md +77 -0
  134. package/docs/02-guides/product-owner/commands.md +30 -0
  135. package/docs/02-guides/product-owner/handoff-checklist.md +42 -0
  136. package/docs/02-guides/product-owner/prd-writing-rules.md +45 -0
  137. package/docs/02-guides/product-owner/scenarios.md +357 -0
  138. package/docs/02-guides/qc-automation.md +157 -0
  139. package/docs/02-guides/tester/README.md +74 -0
  140. package/docs/02-guides/tester/bug-reporting.md +117 -0
  141. package/docs/02-guides/tester/reading-specs.md +79 -0
  142. package/docs/02-guides/tester/scenarios.md +186 -0
  143. package/docs/02-guides/tester/spec-manifest.md +124 -0
  144. package/docs/02-guides/tester/test-checklist.md +31 -0
  145. package/docs/02-guides/tester/workflow.md +80 -0
  146. package/docs/03-concepts/README.md +19 -0
  147. package/docs/03-concepts/architecture.md +245 -0
  148. package/docs/03-concepts/pipeline.md +262 -0
  149. package/docs/03-concepts/traceability.md +149 -0
  150. package/docs/04-operations/README.md +33 -0
  151. package/docs/04-operations/bug-flow.md +362 -0
  152. package/docs/04-operations/publishing.md +137 -0
  153. package/docs/04-operations/sync-and-update.md +365 -0
  154. package/docs/05-reference/README.md +29 -0
  155. package/docs/05-reference/commands.md +229 -0
  156. package/docs/05-reference/modules.md +110 -0
  157. package/docs/05-reference/trace-schema.md +152 -0
  158. package/docs/README.md +51 -0
  159. package/modules/qc-playwright/stack-profile.yaml +65 -0
  160. package/package.json +2 -2
  161. package/skills/code/SKILL.md +50 -8
  162. package/skills/debug/SKILL.md +57 -8
  163. package/skills/design-spec/SKILL.md +43 -8
  164. package/skills/discovery/SKILL.md +43 -8
  165. package/skills/prd/SKILL.md +14 -0
  166. package/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
  167. package/skills/qc/qa-analyst/acceptance-criteria.md +60 -0
  168. package/skills/qc/qa-analyst/business-rules.md +59 -0
  169. package/skills/qc/qa-analyst/data-flow.md +64 -0
  170. package/skills/qc/qa-analyst/spec-breakdown.md +61 -0
  171. package/skills/qc/qa-designer/e2e/journey.md +41 -0
  172. package/skills/qc/qa-designer/exploratory/charter.md +68 -0
  173. package/skills/qc/qa-designer/exploratory/explore-to-functional.md +43 -0
  174. package/skills/qc/qa-designer/functional/api.md +45 -0
  175. package/skills/qc/qa-designer/functional/gui-feature.md +46 -0
  176. package/skills/qc/qa-designer/functional/gui-screen.md +52 -0
  177. package/skills/qc/qa-designer/integration/api.md +42 -0
  178. package/skills/qc/qa-designer/integration/db.md +39 -0
  179. package/skills/qc/qa-designer/integration/gui.md +40 -0
  180. package/skills/qc/qa-designer/integration/kafka.md +40 -0
  181. package/skills/qc/qa-designer/non-functional.md +40 -0
  182. package/skills/qc/qa-planner/test-plan.md +120 -0
  183. package/skills/qc/qa-reviewer/script/e2e.md +87 -0
  184. package/skills/qc/qa-reviewer/script/exploratory.md +45 -0
  185. package/skills/qc/qa-reviewer/script/functional.md +101 -0
  186. package/skills/qc/qa-reviewer/script/integration.md +91 -0
  187. package/skills/qc/qa-reviewer/script/non-functional.md +126 -0
  188. package/skills/qc/qa-reviewer/test-case/e2e.md +73 -0
  189. package/skills/qc/qa-reviewer/test-case/exploratory.md +43 -0
  190. package/skills/qc/qa-reviewer/test-case/functional.md +76 -0
  191. package/skills/qc/qa-reviewer/test-case/integration.md +69 -0
  192. package/skills/qc/qa-reviewer/test-case/non-functional.md +73 -0
  193. package/skills/qc/qa-runner/e2e.md +49 -0
  194. package/skills/qc/qa-runner/exploratory/session.md +36 -0
  195. package/skills/qc/qa-runner/functional/api.md +35 -0
  196. package/skills/qc/qa-runner/functional/gui-feature.md +51 -0
  197. package/skills/qc/qa-runner/functional/gui-screen.md +55 -0
  198. package/skills/qc/qa-runner/integration.md +47 -0
  199. package/skills/qc/qa-runner/non-functional.md +49 -0
  200. package/skills/qc/qa-runner/report/report.md +37 -0
  201. package/skills/setup-ai-first/SKILL.md +7 -0
  202. package/skills/spec/SKILL.md +14 -0
  203. package/skills/test/SKILL.md +93 -16
  204. package/steps/context-loader.md +36 -8
  205. package/steps/report-footer.md +7 -0
  206. package/templates/project-context.yaml +27 -1
  207. package/ARCHITECTURE.md +0 -258
@@ -141,6 +141,8 @@ Read `.agent/project-context.yaml`. Extract and store:
141
141
  - `paths.specs_dir` → BDD specs root
142
142
  - `paths.prd_dir` → PRD documents root
143
143
  - `paths.refinement_dir` → findings/review output dir
144
+ - `paths.qc_dir` → QC automation artifacts root (visible top-level, one subfolder per UC: `{qc_dir}/{UC-ID}/`)
145
+ - `paths.qc_skills_dir` → where qc-* commands load QC skills from (default bundled `.agent/skills/qc`; override to the QC team's own repo/submodule so framework upgrade won't overwrite them)
144
146
  - `paths.product_definitions_dir` → product definitions root
145
147
  - `paths.domain_knowledge_dir` → domain knowledge root
146
148
  - `paths.business_dictionary` → path to business-dictionary.md
@@ -153,6 +155,8 @@ If `paths` section is absent, use these defaults:
153
155
  - `specs_dir` = `specs/bdd`
154
156
  - `prd_dir` = `specs/prd`
155
157
  - `refinement_dir` = `.agent/review`
158
+ - `qc_dir` = `docs`
159
+ - `qc_skills_dir` = `.agent/skills/qc`
156
160
  - `product_definitions_dir` = `specs/product-definition`
157
161
  - `domain_knowledge_dir` = `specs/domain-knowledge`
158
162
  - `business_dictionary` = `specs/domain-knowledge/business-dictionary.md`
@@ -197,6 +201,7 @@ If `services` section is present:
197
201
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
198
202
  - Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
199
203
  - Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
204
+ - Override `paths.prd_change_requests_dir` → `{spec_source}/feedback/prd-change-requests`
200
205
 
201
206
  > **Why under `spec_source`:** PRD, design-spec, domain knowledge, the **API contract (tech-docs)**, and tester feedback are all **cross-team artifacts** — they must live in the **shared spec repo** so every umbrella (FE/App/BE) reads the same source via `/sync`. Tech-docs specifically: BE authors the tech-design (API contract), commits + pushes it into the spec submodule (2-layer commit), and FE/App pull it on their next `/sync` to wire the real API in `/generate-code --phase=integration`. In single-service mode (no `spec_source`), these default under the repo root — still shared, same repo.
202
207
 
@@ -237,19 +242,41 @@ If the file does not exist → skip silently.
237
242
 
238
243
  ---
239
244
 
240
- ## Step 3 — [CRITICAL] Load CLAUDE.md
245
+ ## Step 3 — [CRITICAL] Load CLAUDE.md (layered: root + service overlay)
241
246
 
242
247
  *This is the highest-priority context — it defines HOW to write code and documents for this project.*
243
248
 
244
- Read `CLAUDE.md`. Extract and store:
249
+ CLAUDE.md is loaded in **two layers** so umbrella-wide rules and service-specific
250
+ architecture/coding standards compose correctly. The agent always sits at the umbrella
251
+ root, but the implementation code lives in a service submodule with its OWN stack,
252
+ architecture, and conventions — so the service's CLAUDE.md must win for code generation.
253
+
254
+ **Layer 1 — [BASE] Root CLAUDE.md (umbrella-wide).**
255
+ Read `CLAUDE.md` at the repo root. Treat its contents as the **shared baseline** for the
256
+ whole umbrella — git conventions, data-protection posture, cross-cutting rules, and (in
257
+ single-service mode) the project's only architecture + coding standards.
258
+
259
+ **Layer 2 — [OVERLAY] Service CLAUDE.md (umbrella mode only).**
260
+ *Run only if `service_root` was set in Step 1.6 (i.e. a real service was routed to).*
261
+ Read `{service_root}/CLAUDE.md`. This file defines the architecture + coding standards of
262
+ the **actual stack being implemented** (e.g. `user-service` = java-spring, `web` = nextjs).
263
+ Overlay it on top of Layer 1: **on any conflict, the service value WINS** for architecture,
264
+ coding standards, and error handling. Layer-1 values that the service does not redefine
265
+ (e.g. git conventions, banned patterns shared org-wide) remain in effect.
266
+
267
+ From the **merged** result, extract and store:
245
268
 
246
269
  - **§1 Project Overview** → project name, language, framework, build/test commands, domains
247
- - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules
248
- - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns
249
- - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name
250
- - **§7 Git Conventions** → branch naming pattern, commit message format
270
+ - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules — *service overlay wins*
271
+ - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns — *service overlay wins*
272
+ - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name — *service overlay wins*
273
+ - **§7 Git Conventions** → branch naming pattern, commit message format — *root baseline unless service redefines*
251
274
 
252
- If `CLAUDE.md` does not exist → note it as missing and continue with project-context.yaml data only.
275
+ **Resolution rules:**
276
+ - If both layers exist → merge as above; record `claude_md_source = root + {service_root}`.
277
+ - If only the service overlay exists (no root CLAUDE.md) → use the service file alone; `claude_md_source = {service_root}`.
278
+ - 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).
279
+ - If neither exists → note CLAUDE.md as missing and continue with project-context.yaml data only.
253
280
 
254
281
  ---
255
282
 
@@ -349,7 +376,8 @@ Output exactly this block:
349
376
  [CTX LOADED]
350
377
  Stack : {language} / {framework} / {database}
351
378
  Platform : {active_module} ({platform_type})
352
- Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
379
+ Layers : {layer order from merged CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
380
+ CLAUDE.md : {root + {service_root} | {service_root} only | root only | ⚠️ service overlay MISSING — using root | missing}
353
381
  Ticket : {ticket_prefix}-
354
382
  Dict : {loaded — N canonical terms, M banned terms | missing}
355
383
  Entities : {loaded — EntityA, EntityB, EntityC | missing}
@@ -471,6 +499,13 @@ Suggest the logical next command based on workflow phase:
471
499
  | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
472
500
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
473
501
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
502
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
503
+ | /qc-plan | `/qc-design-test {UC-ID}` |
504
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
505
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
506
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
507
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
508
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
474
509
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
475
510
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
476
511
  | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
@@ -46,6 +46,8 @@ Read `.agent/project-context.yaml`. Extract and store:
46
46
  - `paths.specs_dir` → BDD specs root
47
47
  - `paths.prd_dir` → PRD documents root
48
48
  - `paths.refinement_dir` → findings/review output dir
49
+ - `paths.qc_dir` → QC automation artifacts root (visible top-level, one subfolder per UC: `{qc_dir}/{UC-ID}/`)
50
+ - `paths.qc_skills_dir` → where qc-* commands load QC skills from (default bundled `.agent/skills/qc`; override to the QC team's own repo/submodule so framework upgrade won't overwrite them)
49
51
  - `paths.product_definitions_dir` → product definitions root
50
52
  - `paths.domain_knowledge_dir` → domain knowledge root
51
53
  - `paths.business_dictionary` → path to business-dictionary.md
@@ -58,6 +60,8 @@ If `paths` section is absent, use these defaults:
58
60
  - `specs_dir` = `specs/bdd`
59
61
  - `prd_dir` = `specs/prd`
60
62
  - `refinement_dir` = `.agent/review`
63
+ - `qc_dir` = `docs`
64
+ - `qc_skills_dir` = `.agent/skills/qc`
61
65
  - `product_definitions_dir` = `specs/product-definition`
62
66
  - `domain_knowledge_dir` = `specs/domain-knowledge`
63
67
  - `business_dictionary` = `specs/domain-knowledge/business-dictionary.md`
@@ -102,6 +106,7 @@ If `services` section is present:
102
106
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
103
107
  - Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
104
108
  - Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
109
+ - Override `paths.prd_change_requests_dir` → `{spec_source}/feedback/prd-change-requests`
105
110
 
106
111
  > **Why under `spec_source`:** PRD, design-spec, domain knowledge, the **API contract (tech-docs)**, and tester feedback are all **cross-team artifacts** — they must live in the **shared spec repo** so every umbrella (FE/App/BE) reads the same source via `/sync`. Tech-docs specifically: BE authors the tech-design (API contract), commits + pushes it into the spec submodule (2-layer commit), and FE/App pull it on their next `/sync` to wire the real API in `/generate-code --phase=integration`. In single-service mode (no `spec_source`), these default under the repo root — still shared, same repo.
107
112
 
@@ -142,19 +147,41 @@ If the file does not exist → skip silently.
142
147
 
143
148
  ---
144
149
 
145
- ## Step 3 — [CRITICAL] Load CLAUDE.md
150
+ ## Step 3 — [CRITICAL] Load CLAUDE.md (layered: root + service overlay)
146
151
 
147
152
  *This is the highest-priority context — it defines HOW to write code and documents for this project.*
148
153
 
149
- Read `CLAUDE.md`. Extract and store:
154
+ CLAUDE.md is loaded in **two layers** so umbrella-wide rules and service-specific
155
+ architecture/coding standards compose correctly. The agent always sits at the umbrella
156
+ root, but the implementation code lives in a service submodule with its OWN stack,
157
+ architecture, and conventions — so the service's CLAUDE.md must win for code generation.
158
+
159
+ **Layer 1 — [BASE] Root CLAUDE.md (umbrella-wide).**
160
+ Read `CLAUDE.md` at the repo root. Treat its contents as the **shared baseline** for the
161
+ whole umbrella — git conventions, data-protection posture, cross-cutting rules, and (in
162
+ single-service mode) the project's only architecture + coding standards.
163
+
164
+ **Layer 2 — [OVERLAY] Service CLAUDE.md (umbrella mode only).**
165
+ *Run only if `service_root` was set in Step 1.6 (i.e. a real service was routed to).*
166
+ Read `{service_root}/CLAUDE.md`. This file defines the architecture + coding standards of
167
+ the **actual stack being implemented** (e.g. `user-service` = java-spring, `web` = nextjs).
168
+ Overlay it on top of Layer 1: **on any conflict, the service value WINS** for architecture,
169
+ coding standards, and error handling. Layer-1 values that the service does not redefine
170
+ (e.g. git conventions, banned patterns shared org-wide) remain in effect.
171
+
172
+ From the **merged** result, extract and store:
150
173
 
151
174
  - **§1 Project Overview** → project name, language, framework, build/test commands, domains
152
- - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules
153
- - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns
154
- - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name
155
- - **§7 Git Conventions** → branch naming pattern, commit message format
175
+ - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules — *service overlay wins*
176
+ - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns — *service overlay wins*
177
+ - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name — *service overlay wins*
178
+ - **§7 Git Conventions** → branch naming pattern, commit message format — *root baseline unless service redefines*
156
179
 
157
- If `CLAUDE.md` does not exist → note it as missing and continue with project-context.yaml data only.
180
+ **Resolution rules:**
181
+ - If both layers exist → merge as above; record `claude_md_source = root + {service_root}`.
182
+ - If only the service overlay exists (no root CLAUDE.md) → use the service file alone; `claude_md_source = {service_root}`.
183
+ - 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).
184
+ - If neither exists → note CLAUDE.md as missing and continue with project-context.yaml data only.
158
185
 
159
186
  ---
160
187
 
@@ -254,7 +281,8 @@ Output exactly this block:
254
281
  [CTX LOADED]
255
282
  Stack : {language} / {framework} / {database}
256
283
  Platform : {active_module} ({platform_type})
257
- Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
284
+ Layers : {layer order from merged CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
285
+ CLAUDE.md : {root + {service_root} | {service_root} only | root only | ⚠️ service overlay MISSING — using root | missing}
258
286
  Ticket : {ticket_prefix}-
259
287
  Dict : {loaded — N canonical terms, M banned terms | missing}
260
288
  Entities : {loaded — EntityA, EntityB, EntityC | missing}
@@ -452,6 +480,13 @@ Suggest the logical next command based on workflow phase:
452
480
  | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
453
481
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
454
482
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
483
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
484
+ | /qc-plan | `/qc-design-test {UC-ID}` |
485
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
486
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
487
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
488
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
489
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
455
490
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
456
491
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
457
492
  | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
@@ -194,6 +194,13 @@ Suggest the logical next command based on workflow phase:
194
194
  | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
195
195
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
196
196
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
197
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
198
+ | /qc-plan | `/qc-design-test {UC-ID}` |
199
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
200
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
201
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
202
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
203
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
197
204
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
198
205
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
199
206
  | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
@@ -443,6 +450,13 @@ Suggest the logical next command based on workflow phase:
443
450
  | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
444
451
  | /generate-bdd | `/review-context {feature-file}` to verify coverage |
445
452
  | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
453
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
454
+ | /qc-plan | `/qc-design-test {UC-ID}` |
455
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
456
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
457
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
458
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
459
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
446
460
  | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
447
461
  | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
448
462
  | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
@@ -0,0 +1,63 @@
1
+ ---
2
+ version: 1.1
3
+ updated: 2026-06-11
4
+ ported_from: ai-automation-qc-base
5
+ ---
6
+
7
+ # Gap Analysis – <FEATURE>
8
+
9
+ > File ghi lại các **khoảng trống của tài liệu** mà `qa-analyst` phát hiện sau khi
10
+ > phân tích. Là đầu vào để hỏi dev/BA và cho `qa-planner`. Mỗi gap có ID `GAP-xx`
11
+ > để business rule (BR-xx), acceptance criteria (AC-xx) và test case trace ngược về.
12
+
13
+ | Trường | Giá trị |
14
+ |---|---|
15
+ | Feature | `<FEATURE>` |
16
+ | Project / Service | `<project or service name / domain>` |
17
+ | Tài liệu nguồn | `<đường dẫn / link PRD / user story>` |
18
+ | Người phân tích | qa-analyst |
19
+ | Ngày phân tích | `<YYYY-MM-DD>` |
20
+ | Tổng số gap | `<N>` (Blocker: x · High: y · Medium: z · Low: w) |
21
+ | Trạng thái chung | 🔴 Blocked / 🟡 Cần làm rõ / 🟢 Đủ rõ để thiết kế TC |
22
+
23
+ ---
24
+
25
+ ## Bảng Gap
26
+
27
+ | ID | Loại | Mô tả gap | Vị trí (mục/nguồn) | Ảnh hưởng (chức năng / BR / AC) | Mức độ | Người trả lời | Trạng thái | Câu trả lời |
28
+ |---|---|---|---|---|---|---|---|---|
29
+ | GAP-01 | MISSING | … | spec §x | chức năng A / BR-02 | 🔴 Blocker | Dev/BA | Open | — |
30
+ | GAP-02 | AMBIGUOUS | … | mockup màn hình Y | AC-03 | 🟠 High | BA | Open | — |
31
+ | GAP-03 | CONTRADICTORY | … | §2 vs §5 | BR-04 | 🟠 High | BA | Open | — |
32
+ | GAP-04 | ASSUMPTION | … (giả định AI tự đưa, cần xác nhận) | — | chức năng B | 🟡 Medium | Dev | Open | — |
33
+
34
+ ### Loại gap
35
+ - **MISSING** – thông tin/chức năng/field/rule chưa được mô tả.
36
+ - **AMBIGUOUS** – mô tả mơ hồ, có ≥ 2 cách hiểu.
37
+ - **CONTRADICTORY** – các phần tài liệu mâu thuẫn nhau.
38
+ - **ASSUMPTION** – giả định do qa-analyst tự suy ra, cần dev/BA xác nhận.
39
+ - **OPEN QUESTION** – câu hỏi mở cần trả lời trước khi thiết kế/triển khai.
40
+
41
+ ### Mức độ
42
+ 🔴 Blocker (chặn thiết kế TC) · 🟠 High · 🟡 Medium · 🟢 Low
43
+
44
+ ---
45
+
46
+ ## Quy ước cập nhật
47
+ - `qa-analyst` tạo & điền gap khi phân tích; **không tự bịa câu trả lời** cho gap Blocker.
48
+ - Khi có phản hồi dev/BA: điền cột *Câu trả lời*, đổi *Trạng thái* → `Answered`.
49
+ - Còn gap 🔴 Blocker `Open` ⇒ **chưa** chuyển sang `qa-designer`; đẩy sang `qa-planner`
50
+ (skill `questions-for-dev`) để chốt câu hỏi.
51
+
52
+ ---
53
+
54
+ ## ⚠️ Checklist bắt buộc trước khi lưu file
55
+
56
+ Trước khi lưu `DOC_GAPS.md`, kiểm tra **từng hàng** trong bảng gap:
57
+
58
+ - [ ] **9 cột đủ** – đúng thứ tự: `ID | Loại | Mô tả gap | Vị trí (mục/nguồn) | Ảnh hưởng (chức năng / BR / AC) | Mức độ | Người trả lời | Trạng thái | Câu trả lời`
59
+ - [ ] **Cột Vị trí không rỗng** – phải có tham chiếu cụ thể đến mục trong tài liệu nguồn (vd `§3 UC4 BR25`, `Appendix B loại 7`, `§4.b Screen 3`). Đây là cột hay bị bỏ thiếu nhất → gây lệch toàn bộ cột sau.
60
+ - [ ] **Cột Ảnh hưởng = BR/AC references** – KHÔNG phải mức độ severity. Ví dụ đúng: `BR25, BR26 / AC-F01-33`. Nếu thấy "Blocker" / "High" ở đây → đang bị lệch cột.
61
+ - [ ] **Cột Mức độ có emoji** – bắt buộc dùng: `🔴 Blocker` / `🟠 High` / `🟡 Medium` / `🟢 Low`. Không được ghi text thuần.
62
+ - [ ] **Cột Người trả lời = vai trò** (PO / BA / Dev / Design / Content / DPO / QC Lead). Nếu thấy "Open" ở đây → đang bị lệch cột.
63
+ - [ ] **Cột Trạng thái = Open / Answered**. Nếu thấy "—" ở đây → đang bị lệch cột.
@@ -0,0 +1,60 @@
1
+ ---
2
+ version: 1.0
3
+ updated: 2026-06-11
4
+ ported_from: ai-automation-qc-base
5
+ ---
6
+
7
+ # Acceptance Criteria — Sinh tiêu chí chấp nhận
8
+
9
+ Chuyển yêu cầu đã phân tích thành acceptance criteria (Given/When/Then) làm cơ sở thiết kế TC.
10
+
11
+ ## Khi nào trigger
12
+ - "viết acceptance criteria cho [X]" / "định nghĩa tiêu chí pass"
13
+ - Sau spec-breakdown + business-rules, là bước cuối của qa-analyst
14
+ - Cần điều kiện chấp nhận rõ ràng để qa-designer trace TC ngược về
15
+
16
+ ## Khi KHÔNG trigger
17
+ - Cần bóc tách spec → dùng spec-breakdown
18
+ - Cần thiết kế test case chi tiết (steps cụ thể) → dùng qa-designer
19
+ - Cần phân tích rủi ro → dùng qa-planner
20
+
21
+ ---
22
+
23
+ ## Phase 1 — Tổng hợp
24
+
25
+ Gom đầu vào từ spec-breakdown, business-rules, data-flow:
26
+ - Mỗi chức năng/luồng → một nhóm acceptance criteria.
27
+ - Mỗi business rule (BR-xx) → ít nhất một AC kiểm chứng.
28
+
29
+ ---
30
+
31
+ ## Phase 2 — Viết AC
32
+
33
+ Dùng format Given/When/Then, mỗi AC kiểm chứng MỘT điều:
34
+
35
+ ```
36
+ AC-01 (chức năng / BR-xx):
37
+ Given <tiền điều kiện>
38
+ When <hành động + dữ liệu cụ thể>
39
+ Then <kết quả mong đợi CỤ THỂ>
40
+ ```
41
+
42
+ Bắt buộc phủ:
43
+ - Happy path (điều kiện hợp lệ).
44
+ - Negative (vi phạm validation / authorization).
45
+ - Boundary (giá trị biên của giới hạn trong business-rules).
46
+ - Alternate flow (luồng phụ trong data-flow).
47
+
48
+ Mỗi AC gắn mã trace: chức năng + BR-xx để TC sau này map 1-1.
49
+
50
+ ---
51
+
52
+ ## Output
53
+
54
+ Ghi vào **mục Acceptance Criteria** của `{paths.qc_dir}/{UC-ID}/REQUIREMENT_ANALYSIS.md`
55
+ (KHÔNG tạo file riêng — qc-analyze chỉ trả 2 file: `REQUIREMENT_ANALYSIS.md` + `DOC_GAPS.md`):
56
+
57
+ - Danh sách AC dạng Given/When/Then, có mã trace về chức năng, business rule (BR-xx)
58
+ và scenario chính thức `{UC-ID}-SC{N}` của `.feature`.
59
+ - Bảng ma trận: BR / chức năng × AC để xác nhận không bỏ sót.
60
+ - Đây là đầu vào trực tiếp cho `qa-designer` (mỗi AC → ≥1 test case) và `qa-reviewer` (đối chiếu coverage).
@@ -0,0 +1,59 @@
1
+ ---
2
+ version: 1.0
3
+ updated: 2026-06-11
4
+ ported_from: ai-automation-qc-base
5
+ ---
6
+
7
+ # Business Rules — Trích xuất luật nghiệp vụ
8
+
9
+ Trích xuất và liệt kê toàn bộ business rule, điều kiện và ràng buộc từ yêu cầu.
10
+
11
+ ## Khi nào trigger
12
+ - "liệt kê business rule cho [X]" / "feature này có luật nghiệp vụ gì"
13
+ - Sau spec-breakdown, khi cần làm rõ logic điều kiện trước khi thiết kế TC
14
+ - Feature có nhiều điều kiện AND/OR, phân quyền, tính toán, giới hạn
15
+
16
+ ## Khi KHÔNG trigger
17
+ - Cần bóc tách tổng thể spec → dùng spec-breakdown
18
+ - Cần luồng dữ liệu → dùng data-flow
19
+ - Cần phân tích rủi ro / lập test plan → thuộc qa-planner (skill test-plan)
20
+
21
+ ---
22
+
23
+ ## Phase 1 — Quét
24
+
25
+ 1. Đọc spec đã bóc tách (output của spec-breakdown) hoặc tài liệu gốc.
26
+ 2. Quét tìm: điều kiện ("nếu… thì…"), ràng buộc field, giới hạn (min/max, rate limit),
27
+ quy tắc phân quyền, công thức tính, quy tắc trạng thái, default value.
28
+
29
+ ---
30
+
31
+ ## Phase 2 — Cấu trúc hoá
32
+
33
+ Mỗi rule ghi dưới dạng bảng:
34
+
35
+ | ID | Rule | Điều kiện | Kết quả | Nguồn | Ghi chú/Ưu tiên |
36
+ |---|---|---|---|---|---|
37
+ | BR-01 | … | … | … | spec §x | … |
38
+
39
+ Phân loại rule:
40
+ - VALIDATION: ràng buộc input (định dạng, bắt buộc, độ dài, range).
41
+ - AUTHORIZATION: ai được làm gì.
42
+ - CALCULATION: công thức, làm tròn, đơn vị.
43
+ - STATE: điều kiện chuyển trạng thái hợp lệ vs cấm.
44
+ - LIMIT: rate limit, quota, concurrent.
45
+
46
+ Với rule có nhiều điều kiện kết hợp → gợi ý dựng **Decision Table** (đầu vào cho qa-designer).
47
+
48
+ ---
49
+
50
+ ## Output
51
+
52
+ Ghi vào **mục Business Rules** của `{paths.qc_dir}/{UC-ID}/REQUIREMENT_ANALYSIS.md`
53
+ (KHÔNG tạo file riêng — qc-analyze chỉ trả 2 file: `REQUIREMENT_ANALYSIS.md` + `DOC_GAPS.md`):
54
+
55
+ - Bảng business rule có ID (BR-xx) để TC trace ngược về.
56
+ - Gợi ý các rule cần Decision Table / BVA khi sang qa-designer.
57
+
58
+ Rule MÂU THUẪN / KHÔNG RÕ → ghi vào `{paths.qc_dir}/{UC-ID}/DOC_GAPS.md`
59
+ (loại CONTRADICTORY / AMBIGUOUS, cột "Ảnh hưởng" trỏ BR-xx).
@@ -0,0 +1,64 @@
1
+ ---
2
+ version: 1.0
3
+ updated: 2026-06-11
4
+ ported_from: ai-automation-qc-base
5
+ ---
6
+
7
+ # Data Flow — Phân tích luồng dữ liệu
8
+
9
+ Phân tích luồng dữ liệu, input/output, state và điểm tích hợp của feature.
10
+
11
+ ## Khi nào trigger
12
+ - "phân tích data flow cho [X]" / "dữ liệu đi qua đâu"
13
+ - Feature có nhiều bước, qua nhiều màn hình/API/DB, hoặc tích hợp Kafka/service khác
14
+ - Cần xác định điểm tích hợp trước khi thiết kế integration/e2e TC
15
+
16
+ ## Khi KHÔNG trigger
17
+ - Chỉ cần bóc tách spec tổng quan → dùng spec-breakdown
18
+ - Chỉ cần luật nghiệp vụ → dùng business-rules
19
+ - Thiết kế integration TC → dùng qa-designer/integration
20
+
21
+ ---
22
+
23
+ ## Phase 1 — Lập bản đồ
24
+
25
+ Với mỗi luồng nghiệp vụ, xác định:
26
+ 1. ĐIỂM BẮT ĐẦU: actor/sự kiện kích hoạt + dữ liệu đầu vào.
27
+ 2. CÁC CHẶNG: UI → API → service → DB → message queue → service ngoài.
28
+ 3. BIẾN ĐỔI: dữ liệu được tạo/sửa/xoá/validate ở mỗi chặng.
29
+ 4. ĐIỂM KẾT THÚC: output, side-effect (email, notification, audit log).
30
+
31
+ ---
32
+
33
+ ## Phase 2 — Mô tả
34
+
35
+ Thể hiện luồng dạng bước tuần tự hoặc sơ đồ text:
36
+
37
+ ```
38
+ [User submit form]
39
+ → POST /api/... (payload: ...)
40
+ → Service validate (rule BR-xx)
41
+ → DB insert bảng X
42
+ → Kafka topic Y (event Z)
43
+ → UI hiển thị kết quả / trạng thái
44
+ ```
45
+
46
+ Đánh dấu cho mỗi chặng:
47
+ - INTEGRATION POINT (nơi cần integration test).
48
+ - STATE CHANGE (dữ liệu/trạng thái thay đổi → cần verify + cleanup).
49
+ - FAILURE POINT (nơi có thể lỗi: timeout, validation fail, partial commit).
50
+
51
+ ---
52
+
53
+ ## Output
54
+
55
+ Ghi vào **mục Data Flow** của `{paths.qc_dir}/{UC-ID}/REQUIREMENT_ANALYSIS.md`
56
+ (KHÔNG tạo file riêng — qc-analyze chỉ trả 2 file: `REQUIREMENT_ANALYSIS.md` + `DOC_GAPS.md`):
57
+
58
+ - Sơ đồ/list luồng dữ liệu cho mỗi kịch bản chính.
59
+ - Danh sách integration point + state change + failure point.
60
+ - Gợi ý loại test cần cho từng điểm (gui-feature / integration / e2e) khi sang qa-designer.
61
+ - Dữ liệu/trạng thái cần chuẩn bị & cleanup → đầu vào fixture cho qa-runner.
62
+
63
+ Chặng nào luồng/hành vi chưa rõ (vd lỗi xử lý ra sao, retry, partial commit) →
64
+ ghi vào `{paths.qc_dir}/{UC-ID}/DOC_GAPS.md` (loại MISSING / OPEN QUESTION).
@@ -0,0 +1,61 @@
1
+ ---
2
+ version: 1.0
3
+ updated: 2026-06-11
4
+ ported_from: ai-automation-qc-base
5
+ ---
6
+
7
+ # Spec Breakdown — Bóc tách yêu cầu
8
+
9
+ Bóc tách spec/PRD/user story thô thành mô tả yêu cầu có cấu trúc cho QC.
10
+
11
+ ## Khi nào trigger
12
+ - "phân tích spec/PRD cho feature [X]" / "bóc tách yêu cầu"
13
+ - Nhận tài liệu thô (PRD, user story, mô tả Figma, email) cần làm rõ trước khi thiết kế TC
14
+ - Là bước ĐẦU TIÊN của pipeline, trước qa-planner
15
+
16
+ ## Khi KHÔNG trigger
17
+ - Cần phân tích rủi ro / what-if → dùng qa-planner
18
+ - Cần trích riêng business rule → dùng business-rules
19
+ - Cần thiết kế test case → dùng qa-designer
20
+
21
+ ---
22
+
23
+ ## Phase 1 — Thu thập
24
+
25
+ 1. Đọc toàn bộ tài liệu nguồn QC cung cấp (PRD, user story, mockup, ghi chú).
26
+ 2. **Bỏ qua văn bản gạch ngang (strikethrough)** — đó là nội dung đã huỷ, KHÔNG đưa
27
+ vào phân tích/BR/AC. Với file Confluence/HTML/MHTML: phát hiện qua thẻ `<s>`,
28
+ `<strike>`, `<del>` hoặc style `text-decoration: line-through`.
29
+ 3. Xác định: feature name, actor/role, mục tiêu nghiệp vụ, phạm vi (in/out scope).
30
+ 4. Đánh dấu phần MƠ HỒ / THIẾU → ghi vào `DOC_GAPS.md` (gap GAP-xx).
31
+
32
+ ---
33
+
34
+ ## Phase 2 — Bóc tách
35
+
36
+ Tách yêu cầu thành các khối:
37
+
38
+ A. TỔNG QUAN: mục tiêu, actor, giá trị nghiệp vụ.
39
+ B. CHỨC NĂNG: list từng chức năng (visible + ẩn + integration point).
40
+ C. INPUT/OUTPUT: mỗi chức năng có input gì, output gì, ràng buộc field.
41
+ D. TRẠNG THÁI & LUỒNG: các state, điều kiện chuyển, happy path + alternate flow.
42
+ E. PHỤ THUỘC: hệ thống/API/module liên quan.
43
+ F. GIẢ ĐỊNH & CÂU HỎI MỞ: điều suy ra được vs điều cần dev/BA xác nhận.
44
+
45
+ ---
46
+
47
+ ## Output
48
+
49
+ ⚠️ `/qc-analyze` chỉ ghi **ĐÚNG 2 FILE** cho mỗi UC, đặt trong thư mục QC **lộ ra ngoài**
50
+ `{paths.qc_dir}/{UC-ID}/` (mặc định `docs/{UC-ID}/` — KHÔNG để trong `.agent/` ẩn):
51
+ `REQUIREMENT_ANALYSIS.md` + `DOC_GAPS.md`. KHÔNG tách mỗi bước phân tích thành file riêng.
52
+
53
+ Phần spec-breakdown là **mục đầu tiên** của `REQUIREMENT_ANALYSIS.md`:
54
+ - Bảng chức năng + input/output/constraint
55
+ - Sơ đồ/list luồng chính & phụ
56
+ - Danh sách giả định và câu hỏi mở (đánh dấu rõ điều CHƯA chắc)
57
+
58
+ Đồng thời ghi mọi khoảng trống phát hiện vào `{paths.qc_dir}/{UC-ID}/DOC_GAPS.md`
59
+ (theo `{paths.qc_skills_dir}/qa-analyst/DOC_GAPS.template.md`), mỗi gap có ID `GAP-xx`.
60
+
61
+ Kết thúc bằng gợi ý: feature đã đủ rõ để chuyển sang `qa-planner` (phân tích rủi ro) chưa.
@@ -0,0 +1,41 @@
1
+ ---
2
+ version: 1.0
3
+ updated: 2026-06-11
4
+ ported_from: ai-automation-qc-base
5
+ ---
6
+
7
+ # Test Case — E2E Journey
8
+
9
+ Skill **tự chứa** để viết TC end-to-end: hành trình đầu→cuối xuyên nhiều màn/module
10
+ (mở → nhập → submit → verify tạo + định tuyến + đồng bộ + hiển thị). Chỉ cần load file này.
11
+
12
+ ## Khi nào trigger
13
+ - "viết E2E cho [feature]" / nở danh sách journey trong TEST_PLAN thành TC chi tiết đầu-cuối
14
+
15
+ ## Khi KHÔNG trigger
16
+ - Test 1 màn/field → `functional/*` · test riêng 1 điểm tích hợp → `integration/*`
17
+
18
+ ---
19
+
20
+ ## Format file TC (bắt buộc)
21
+ - Metadata **list**: Title · Feature · Priority · Status(Draft) · Author(AI) · Tags · **Trace** `[BR-xx](REQUIREMENT_ANALYSIS.md#3-business-rules)` (không có → `⚠️ Chưa có Business Rule`) · **🚫 Block** `[GAP-xx](DOC_GAPS.md)`.
22
+ - **Test Data** dạng list (tài khoản/role, dữ liệu lớp/buổi…) · **Steps** `[Action]`/`[Verify]` xuyên các màn ·
23
+ **Expected** 1 bullet = chuỗi verify point (tạo thành công, mã đúng, định tuyến đúng, đồng bộ đúng, hiển thị danh sách).
24
+ - ID journey `E2E-<FEATURE>-NN` · cuối file: Trace matrix + bảng TC block · bỏ nội dung gạch ngang.
25
+
26
+ ## Kỹ thuật áp dụng
27
+ - **Use Case/Scenario:** mỗi journey = main + alternate + exception flow.
28
+ - **Decision Table** để chọn journey đại diện cho mỗi nhánh của **trục bao phủ** (vd Đối tượng × Bộ phận xử lý × lớp/buổi × role × CRM).
29
+ - **Verify points chung** (V1…Vn) áp cho mọi journey · **end-to-end data** (nhập màn A → hiện đúng màn B/DB/hệ thống ngoài).
30
+
31
+ ## Phase 1 — Clarify
32
+ Lấy danh sách journey + trục bao phủ + verify points từ TEST_PLAN · mỗi journey: actor/role, tiền điều kiện
33
+ (data + tài khoản), bước chính, kết quả/định tuyến kỳ vọng · journey nào phụ thuộc gap Blocker.
34
+
35
+ ## Phase 2 — Write
36
+ Mỗi journey → 1 TC bám Format; Expected = chuỗi verify point; chuẩn bị tiền điều kiện & cleanup, mỗi journey độc lập.
37
+ **Journey phụ thuộc gap vẫn viết + 🚫 Block: GAP-xx**, định tuyến ghi "dự kiến theo BR". Trace BR.
38
+
39
+ ## Output
40
+ File TC e2e (hoặc nhóm E2E trong file feature) trong `{paths.qc_dir}/{UC-ID}/test-cases/`.
41
+ In bảng `E2E-ID | Journey | Pri | Trace | Block` + bảng TC block. Bàn giao `qa-reviewer`.
@@ -0,0 +1,68 @@
1
+ ---
2
+ version: 1.0
3
+ updated: 2026-06-11
4
+ ported_from: ai-automation-qc-base
5
+ ---
6
+
7
+ # Gen Test Charter — Exploratory
8
+
9
+ Sinh bộ test charter + SFDIPOT test ideas + What-If scenarios cho exploratory session.
10
+
11
+ ## Khi nào trigger
12
+ - "generate charter cho [Feature]" / "chuẩn bị exploratory session"
13
+ - Trước khi bắt đầu exploratory session
14
+ - Feature mới chưa ai khám phá, hoặc feature có risk cao
15
+
16
+ ## Khi KHÔNG trigger
17
+ - Cần sinh functional TC từ spec → dùng qa-designer-gui-screen / qa-designer-gui-feature
18
+ - Cần khám phá feature rồi CHUYỂN ĐỔI thành functional TC → dùng explore-to-functional
19
+ - Cần review charter đã viết → dùng qa-reviewer/test-case/exploratory
20
+
21
+ ---
22
+
23
+ ## Phase 1 — Clarify
24
+
25
+ Thu thập:
26
+ 1. Feature name + mô tả ngắn
27
+ 2. Tester level — junior / mid / senior (ảnh hưởng charter complexity)
28
+ 3. Time-box — 30 / 60 / 90 phút
29
+ 4. Môi trường — staging / production-like
30
+ 5. Đã có functional TC coverage chưa (nếu có → exploratory focus vào edge case NGOÀI spec)
31
+
32
+ ---
33
+
34
+ ## Phase 2 — Analyze
35
+
36
+ Áp dụng SFDIPOT 7 dimension:
37
+ S - Structure: thành phần/module/page liên quan
38
+ F - Function: chức năng chính + phụ + ẩn
39
+ D - Data: edge data, boundary, empty, max, special chars
40
+ I - Interface: UI, API, integration point
41
+ P - Platform: browser, OS, device, network
42
+ O - Operations: ai dùng, khi nào, tần suất
43
+ T - Time: timeout, expiry, concurrent, timezone
44
+
45
+ Với mỗi dimension: 3-5 test idea CỤ THỂ.
46
+
47
+ Brainstorm 15-20 "What If" scenarios bất thường:
48
+ double click, network drop, 2 tab, back button, idle 2h, emoji input, device rotate...
49
+
50
+ ---
51
+
52
+ ## Phase 3 — Write
53
+
54
+ Sinh 3-5 charter, mỗi charter gồm:
55
+ - Format: "Explore <target> With <resource> To discover <information>"
56
+ - Whittaker Tour phù hợp (Money/FedEx/Saboteur/Couch Potato/Intellectual/...)
57
+ - Risk level: HIGH / MEDIUM / LOW
58
+ - Time-box: 30 / 60 / 90 phút
59
+
60
+ Sinh 10-15 câu hỏi cho dev/BA (assumptions, edge case, error handling, security)
61
+
62
+ ---
63
+
64
+ ## Output
65
+
66
+ Charter files: {paths.qc_dir}/exploratory/charters/<feature>_01.md, _02.md...
67
+ Ideas file: {paths.qc_dir}/exploratory/ideas/<feature>.md
68
+ Bảng tổng kết: STT | Charter | Tour | Risk | Time-box