@anhth2/spec-driven-dev-plugin 0.11.0 → 0.14.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 (173) hide show
  1. package/commands/debug.md +47 -7
  2. package/commands/define-product.md +47 -7
  3. package/commands/dev-gen-test.md +65 -17
  4. package/commands/dev-run-test.md +66 -18
  5. package/commands/dev-run-test.tmpl +1 -1
  6. package/commands/dev-smoke-test.md +47 -7
  7. package/commands/fix-bug.md +83 -13
  8. package/commands/fix-bug.tmpl +36 -6
  9. package/commands/generate-bdd.md +74 -21
  10. package/commands/generate-bdd.tmpl +9 -4
  11. package/commands/generate-code.md +118 -35
  12. package/commands/generate-code.tmpl +53 -18
  13. package/commands/generate-design-spec.md +47 -7
  14. package/commands/generate-prd.md +47 -7
  15. package/commands/generate-spec-manifest.md +47 -7
  16. package/commands/generate-tech-docs.md +234 -20
  17. package/commands/generate-tech-docs.tmpl +187 -13
  18. package/commands/learn.md +47 -7
  19. package/commands/map-testids.md +564 -0
  20. package/commands/map-testids.tmpl +81 -0
  21. package/commands/propose-scenario.md +78 -18
  22. package/commands/propose-scenario.tmpl +31 -11
  23. package/commands/qc-analyze.md +67 -12
  24. package/commands/qc-analyze.tmpl +20 -5
  25. package/commands/qc-design-test.md +51 -10
  26. package/commands/qc-design-test.tmpl +4 -3
  27. package/commands/qc-plan.md +50 -10
  28. package/commands/qc-plan.tmpl +3 -3
  29. package/commands/qc-report.md +60 -8
  30. package/commands/qc-report.tmpl +13 -1
  31. package/commands/qc-review.md +49 -9
  32. package/commands/qc-review.tmpl +2 -2
  33. package/commands/qc-run-test.md +75 -20
  34. package/commands/qc-run-test.tmpl +10 -3
  35. package/commands/refine-prd.md +47 -7
  36. package/commands/report-bug.md +63 -9
  37. package/commands/report-bug.tmpl +16 -2
  38. package/commands/review-code.md +47 -7
  39. package/commands/review-context.md +47 -7
  40. package/commands/review-tech-docs.md +50 -9
  41. package/commands/review-tech-docs.tmpl +3 -2
  42. package/commands/setup-ai-first.md +37 -4
  43. package/commands/setup-ai-first.tmpl +2 -2
  44. package/commands/sync.md +47 -11
  45. package/commands/sync.tmpl +12 -9
  46. package/commands/update-framework.md +35 -2
  47. package/commands/validate-traces.md +98 -40
  48. package/commands/validate-traces.tmpl +51 -33
  49. package/core/FRAMEWORK_VERSION +1 -1
  50. package/core/commands/debug.md +47 -7
  51. package/core/commands/define-product.md +47 -7
  52. package/core/commands/dev-gen-test.md +65 -17
  53. package/core/commands/dev-run-test.md +66 -18
  54. package/core/commands/dev-smoke-test.md +47 -7
  55. package/core/commands/fix-bug.md +83 -13
  56. package/core/commands/generate-bdd.md +74 -21
  57. package/core/commands/generate-code.md +118 -35
  58. package/core/commands/generate-design-spec.md +47 -7
  59. package/core/commands/generate-prd.md +47 -7
  60. package/core/commands/generate-spec-manifest.md +47 -7
  61. package/core/commands/generate-tech-docs.md +234 -20
  62. package/core/commands/learn.md +47 -7
  63. package/core/commands/map-testids.md +564 -0
  64. package/core/commands/propose-scenario.md +78 -18
  65. package/core/commands/qc-analyze.md +67 -12
  66. package/core/commands/qc-design-test.md +51 -10
  67. package/core/commands/qc-plan.md +50 -10
  68. package/core/commands/qc-report.md +60 -8
  69. package/core/commands/qc-review.md +49 -9
  70. package/core/commands/qc-run-test.md +75 -20
  71. package/core/commands/refine-prd.md +47 -7
  72. package/core/commands/report-bug.md +63 -9
  73. package/core/commands/review-code.md +47 -7
  74. package/core/commands/review-context.md +47 -7
  75. package/core/commands/review-tech-docs.md +50 -9
  76. package/core/commands/setup-ai-first.md +37 -4
  77. package/core/commands/sync.md +47 -11
  78. package/core/commands/update-framework.md +35 -2
  79. package/core/commands/validate-traces.md +98 -40
  80. package/core/modules/qc-playwright/stack-profile.yaml +4 -3
  81. package/core/skills/code/SKILL.md +82 -9
  82. package/core/skills/debug/SKILL.md +117 -11
  83. package/core/skills/design-spec/SKILL.md +47 -7
  84. package/core/skills/discovery/SKILL.md +47 -7
  85. package/core/skills/prd/SKILL.md +70 -4
  86. package/core/skills/qc/qa-analyst/acceptance-criteria.md +5 -1
  87. package/core/skills/qc/qa-analyst/business-rules.md +6 -2
  88. package/core/skills/qc/qa-analyst/data-flow.md +6 -2
  89. package/core/skills/qc/qa-analyst/spec-breakdown.md +7 -3
  90. package/core/skills/qc/qa-designer/e2e/journey.md +1 -1
  91. package/core/skills/qc/qa-designer/exploratory/charter.md +2 -2
  92. package/core/skills/qc/qa-designer/exploratory/explore-to-functional.md +1 -1
  93. package/core/skills/qc/qa-designer/functional/api.md +1 -1
  94. package/core/skills/qc/qa-designer/functional/gui-feature.md +1 -1
  95. package/core/skills/qc/qa-designer/functional/gui-screen.md +1 -1
  96. package/core/skills/qc/qa-designer/integration/api.md +1 -1
  97. package/core/skills/qc/qa-designer/integration/db.md +1 -1
  98. package/core/skills/qc/qa-designer/integration/gui.md +1 -1
  99. package/core/skills/qc/qa-designer/integration/kafka.md +1 -1
  100. package/core/skills/qc/qa-designer/non-functional.md +1 -1
  101. package/core/skills/qc/qa-planner/test-plan.md +4 -4
  102. package/core/skills/qc/qa-runner/exploratory/session.md +2 -2
  103. package/core/skills/setup-ai-first/SKILL.md +35 -2
  104. package/core/skills/spec/SKILL.md +70 -4
  105. package/core/skills/test/SKILL.md +129 -16
  106. package/core/steps/context-loader.md +12 -5
  107. package/core/steps/report-footer.md +35 -2
  108. package/core/steps/trace-mirror.md +18 -10
  109. package/core/templates/project-context.yaml +27 -6
  110. package/docs/01-getting-started/core-concepts.md +7 -7
  111. package/docs/01-getting-started/installation.md +4 -2
  112. package/docs/01-getting-started/quickstart.md +1 -1
  113. package/docs/02-guides/README.md +1 -2
  114. package/docs/02-guides/developer/README.md +1 -1
  115. package/docs/02-guides/developer/bdd-and-trace.md +10 -8
  116. package/docs/02-guides/developer/commands.md +4 -4
  117. package/docs/02-guides/developer/scenarios.md +26 -14
  118. package/docs/02-guides/developer/workflow.md +81 -19
  119. package/docs/02-guides/product-owner/README.md +6 -4
  120. package/docs/02-guides/product-owner/commands.md +1 -1
  121. package/docs/02-guides/product-owner/scenarios.md +80 -1
  122. package/docs/02-guides/tester/README.md +13 -10
  123. package/docs/02-guides/tester/bug-reporting.md +2 -2
  124. package/docs/02-guides/tester/qc-automation.md +165 -0
  125. package/docs/02-guides/tester/reading-specs.md +4 -4
  126. package/docs/02-guides/tester/scenarios.md +5 -5
  127. package/docs/02-guides/tester/spec-manifest.md +17 -12
  128. package/docs/02-guides/tester/test-checklist.md +3 -3
  129. package/docs/02-guides/tester/workflow.md +12 -14
  130. package/docs/03-concepts/architecture.md +7 -4
  131. package/docs/03-concepts/pipeline.md +37 -12
  132. package/docs/03-concepts/traceability.md +19 -18
  133. package/docs/04-operations/README.md +1 -1
  134. package/docs/04-operations/bug-flow.md +46 -5
  135. package/docs/04-operations/sync-and-update.md +186 -24
  136. package/docs/05-reference/README.md +3 -0
  137. package/docs/05-reference/command-cheatsheet.md +147 -0
  138. package/docs/05-reference/commands.md +73 -70
  139. package/docs/05-reference/modules.md +4 -4
  140. package/docs/05-reference/trace-schema.md +23 -16
  141. package/docs/README.md +3 -5
  142. package/modules/qc-playwright/stack-profile.yaml +4 -3
  143. package/package.json +1 -1
  144. package/skills/code/SKILL.md +82 -9
  145. package/skills/debug/SKILL.md +117 -11
  146. package/skills/design-spec/SKILL.md +47 -7
  147. package/skills/discovery/SKILL.md +47 -7
  148. package/skills/prd/SKILL.md +70 -4
  149. package/skills/qc/qa-analyst/acceptance-criteria.md +5 -1
  150. package/skills/qc/qa-analyst/business-rules.md +6 -2
  151. package/skills/qc/qa-analyst/data-flow.md +6 -2
  152. package/skills/qc/qa-analyst/spec-breakdown.md +7 -3
  153. package/skills/qc/qa-designer/e2e/journey.md +1 -1
  154. package/skills/qc/qa-designer/exploratory/charter.md +2 -2
  155. package/skills/qc/qa-designer/exploratory/explore-to-functional.md +1 -1
  156. package/skills/qc/qa-designer/functional/api.md +1 -1
  157. package/skills/qc/qa-designer/functional/gui-feature.md +1 -1
  158. package/skills/qc/qa-designer/functional/gui-screen.md +1 -1
  159. package/skills/qc/qa-designer/integration/api.md +1 -1
  160. package/skills/qc/qa-designer/integration/db.md +1 -1
  161. package/skills/qc/qa-designer/integration/gui.md +1 -1
  162. package/skills/qc/qa-designer/integration/kafka.md +1 -1
  163. package/skills/qc/qa-designer/non-functional.md +1 -1
  164. package/skills/qc/qa-planner/test-plan.md +4 -4
  165. package/skills/qc/qa-runner/exploratory/session.md +2 -2
  166. package/skills/setup-ai-first/SKILL.md +35 -2
  167. package/skills/spec/SKILL.md +70 -4
  168. package/skills/test/SKILL.md +129 -16
  169. package/steps/context-loader.md +12 -5
  170. package/steps/report-footer.md +35 -2
  171. package/steps/trace-mirror.md +18 -10
  172. package/templates/project-context.yaml +27 -6
  173. package/docs/02-guides/qc-automation.md +0 -92
@@ -92,7 +92,7 @@ Wait for explicit "Y" or "N" from the user before continuing.
92
92
  - "N" → stop and ask what the user wants to change.
93
93
 
94
94
 
95
- *Note: For this command, the target in Step 1 is a UC-ID. Read the qc-analyze output (requirement breakdown + `DOC_GAPS.md`) from `{paths.refinement_dir}/qc/{UC-ID}/` and the official `.feature` for the UC.*
95
+ *Note: For this command, the target in Step 1 is a UC-ID. Read the qc-analyze output (`REQUIREMENT_ANALYSIS.md` + `DOC_GAPS.md`) from `{paths.qc_dir}/{UC-ID}/` and the official `.feature` for the UC.*
96
96
 
97
97
  ## Context
98
98
  # Context Loader — Load All Project Context
@@ -133,6 +133,8 @@ Read `.agent/project-context.yaml`. Extract and store:
133
133
  - `paths.specs_dir` → BDD specs root
134
134
  - `paths.prd_dir` → PRD documents root
135
135
  - `paths.refinement_dir` → findings/review output dir
136
+ - `paths.qc_dir` → QC automation artifacts root (visible top-level, one subfolder per UC: `{qc_dir}/{UC-ID}/`)
137
+ - `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)
136
138
  - `paths.product_definitions_dir` → product definitions root
137
139
  - `paths.domain_knowledge_dir` → domain knowledge root
138
140
  - `paths.business_dictionary` → path to business-dictionary.md
@@ -145,6 +147,8 @@ If `paths` section is absent, use these defaults:
145
147
  - `specs_dir` = `specs/bdd`
146
148
  - `prd_dir` = `specs/prd`
147
149
  - `refinement_dir` = `.agent/review`
150
+ - `qc_dir` = `docs`
151
+ - `qc_skills_dir` = `.agent/skills/qc`
148
152
  - `product_definitions_dir` = `specs/product-definition`
149
153
  - `domain_knowledge_dir` = `specs/domain-knowledge`
150
154
  - `business_dictionary` = `specs/domain-knowledge/business-dictionary.md`
@@ -170,7 +174,7 @@ If `services` section is present:
170
174
  - If `$ARGUMENTS` contains a path, extract the segment after `prd_dir`
171
175
 
172
176
  **2. Route to service** — if active domain matches a key in `services`:
173
- - Override `paths.specs_dir` → `services.{domain}.specs_dir`
177
+ - Override `paths.specs_dir` → `services.{domain}.specs_dir` — **only if `setup.spec_source` is NOT set.** When `spec_source` IS set, ALL BDD (web/app/**system**) is a shared cross-team artifact → leave `specs_dir` for step 4 to route to the spec repo; do NOT pin it per-service here.
174
178
  - Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir` — **only if `setup.spec_source` is NOT set.** When `spec_source` IS set, the tech-design (API contract) is a cross-team artifact and must live in the shared spec repo (handled in step 4), so leave `tech_docs_dir` for step 4 to route — do NOT pin it per-service here.
175
179
  - Store `active_service` = `services.{domain}.path`
176
180
  - Store `active_service_module` = `services.{domain}.module`
@@ -181,6 +185,7 @@ If `services` section is present:
181
185
  - Set `active_service = unresolved`
182
186
 
183
187
  **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
188
+ - Override `paths.specs_dir` → `{spec_source}/specs/bdd` — **always when `spec_source` is set.** All BDD (web/app/**system**) lives in the shared spec repo so every umbrella (FE/App/BE) reads the same scenarios; the FE tech-design gate + `/generate-code --phase=ui`/`--phase=integration` resolve the `system/` BDD here. *(Per-service `specs/bdd` only when there is no `spec_source`.)*
184
189
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
185
190
  - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
186
191
  - Override `paths.tech_docs_dir` → `{spec_source}/specs/tech-docs` — **always when `spec_source` is set** (step 2 no longer pins tech-docs per-service in this case). The tech-design IS the cross-team API contract: BE authors it here, and FE/App read it from the same spec submodule at `/generate-code --phase=integration`. *(Per-service tech-docs only happen when there is no `spec_source` — a pure multi-service BE repo with no shared spec module.)*
@@ -189,8 +194,10 @@ If `services` section is present:
189
194
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
190
195
  - Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
191
196
  - Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
197
+ - Override `paths.prd_change_requests_dir` → `{spec_source}/feedback/prd-change-requests`
198
+ - Override `paths.trace_dir` → `{spec_source}/.trace` — **always when `spec_source` is set.** Trace TSVs are consolidated in the spec repo (single authoritative location, no per-service split) so the PM/PO has one place to manage status. Code-side commands (`/generate-code`, `/dev-run-test`, `/qc-run-test`) run from `service_root` but **write their trace row into `{spec_source}/.trace`** — like they already push `feedback/` there. *(Per-service `.trace` only when there is no `spec_source`.)*
192
199
 
193
- > **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.
200
+ > **Why under `spec_source`:** PRD, design-spec, domain knowledge, **all BDD (web/app/system)**, the **API contract (tech-docs)**, tester feedback, **and the `.trace/` coverage state** are all **cross-team artifacts** — they live in the **shared spec repo** so every umbrella (FE/App/BE) and the PM read one source via `/sync`. The service submodule holds only **code** (+ build/test tooling). `.trace/` and `feedback/` are the dev/QC **write areas** in the spec repo (the PRD/BDD/design-spec/tech-docs there stay read-only for dev/QC only PO edits those). In single-service mode (no `spec_source`), everything defaults under the repo root — still one repo.
194
201
 
195
202
  ---
196
203
 
@@ -210,12 +217,12 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
210
217
  |----------|--------|
211
218
  | `conventions.test_command` | service's `conventions.test_command` |
212
219
  | `conventions.build_command` | service's `conventions.build_command` |
213
- | `paths.trace_dir` | `{active_service}/{service paths.trace_dir}` default: `{active_service}/.trace` |
214
- | `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
220
+ | `paths.trace_dir` | **If `spec_source` is set → keep the Step 4 spec-repo route (`{spec_source}/.trace`); ignore any service-level `trace_dir`.** Only when there is no `spec_source`: `{active_service}/{service paths.trace_dir}` (default `{active_service}/.trace`). |
221
+ | `paths.specs_dir` | **If `spec_source` is set → keep the Step 4 spec-repo route (`{spec_source}/specs/bdd`); ignore any service-level `specs_dir`** (BDD is cross-team, never per-service in this mode). Only when there is no `spec_source`: `{active_service}/{service paths.specs_dir}` if set, else the Step 1.5 override. |
215
222
 
216
223
  **3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
217
224
  - Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
218
- - File write operations (test files, trace TSVs) use paths **relative to** `service_root`
225
+ - **Source/test files** are written relative to `service_root`; **trace TSVs** are written to `{paths.trace_dir}` (the spec repo when `spec_source` is set — a cross-repo write, committed/pushed to the spec submodule like `feedback/`).
219
226
 
220
227
  **4. If service config not found** — keep umbrella defaults, still set `service_root = {active_service}` (path anchor is always needed even without a config override).
221
228
 
@@ -401,7 +408,7 @@ risk analysis, what-if scenarios, test scope/strategy per layer, and `questions-
401
408
  for any open/blocker gaps. You answer *"where is the risk, what must we ask?"* — you do not
402
409
  design concrete test cases (that is qc-design-test).
403
410
 
404
- ## Skills (`skills/qc/qa-planner/`)
411
+ ## Skills (`{paths.qc_skills_dir}/qa-planner/`)
405
412
 
406
413
  - `test-plan.md` — self-contained: risk matrix, what-if, scope by test layer
407
414
  (functional / integration / e2e / non-functional), entry/exit criteria, and the
@@ -409,7 +416,7 @@ design concrete test cases (that is qc-design-test).
409
416
 
410
417
  ## Output
411
418
 
412
- Write the test plan to `{paths.refinement_dir}/qc/{UC-ID}/TEST_PLAN.md`. Scope the plan to
419
+ Write the test plan to `{paths.qc_dir}/{UC-ID}/TEST_PLAN.md`. Scope the plan to
413
420
  the UC's scenarios (`{UC-ID}-SC{N}` from the `.feature`) so qc-design-test can design
414
421
  cases per scenario.
415
422
 
@@ -437,6 +444,36 @@ Output Artifacts:
437
444
 
438
445
  If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
439
446
 
447
+ ## Pipeline Position
448
+
449
+ Print a one-line map of the pipeline with the CURRENT command's phase marked `◀ bạn ở đây`,
450
+ so the user always sees where this command sits in the end-to-end flow:
451
+
452
+ ```
453
+ Discovery → PRD → [Design Spec] → BDD → Tech Design → Code → Dev Self-Check → QC → Trace Audit
454
+ ```
455
+
456
+ Find the current command in this phase legend and mark **its** phase in the map above:
457
+
458
+ | Phase | Commands |
459
+ |-------|----------|
460
+ | Discovery | `/define-product` |
461
+ | PRD | `/generate-prd` · `/refine-prd` · `/review-context` (PRD) |
462
+ | Design Spec | `/generate-design-spec` |
463
+ | BDD | `/generate-bdd` · `/review-context` (BDD) |
464
+ | Tech Design | `/generate-tech-docs` · `/map-testids` · `/review-tech-docs` |
465
+ | Code | `/generate-code` · `/review-code` |
466
+ | Dev Self-Check | `/dev-gen-test` · `/dev-run-test` · `/dev-smoke-test` |
467
+ | QC | `/qc-analyze` · `/qc-plan` · `/qc-design-test` · `/qc-review` · `/qc-run-test` · `/qc-report` |
468
+ | Trace Audit | `/validate-traces` |
469
+
470
+ For a **review command**, also append the 3-step review loop with the current step marked, e.g.:
471
+ `Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume`.
472
+
473
+ **Cross-cutting commands** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
474
+ `/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) sit outside the linear pipeline —
475
+ **omit the Pipeline line entirely** for these (do not force-fit them onto the map).
476
+
440
477
  ## Next Command Suggestion
441
478
 
442
479
  Suggest the logical next command based on workflow phase:
@@ -478,10 +515,13 @@ Suggest the logical next command based on workflow phase:
478
515
  Format the footer as:
479
516
  ```
480
517
  ---
481
- Status : {badge}
518
+ Status : {badge}
482
519
  {Output Artifacts block}
483
- Next : {suggested command with example arguments}
520
+ Pipeline : Discovery PRD [BDD ◀ bạn ở đây] → Tech Design → Code → Dev Self-Check → QC → Trace Audit
521
+ (review cmd) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
522
+ Next : {suggested command with example arguments}
484
523
  ```
524
+ *(Omit the `Pipeline` line for cross-cutting commands listed above.)*
485
525
 
486
526
 
487
527
  ```
@@ -133,6 +133,8 @@ Read `.agent/project-context.yaml`. Extract and store:
133
133
  - `paths.specs_dir` → BDD specs root
134
134
  - `paths.prd_dir` → PRD documents root
135
135
  - `paths.refinement_dir` → findings/review output dir
136
+ - `paths.qc_dir` → QC automation artifacts root (visible top-level, one subfolder per UC: `{qc_dir}/{UC-ID}/`)
137
+ - `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)
136
138
  - `paths.product_definitions_dir` → product definitions root
137
139
  - `paths.domain_knowledge_dir` → domain knowledge root
138
140
  - `paths.business_dictionary` → path to business-dictionary.md
@@ -145,6 +147,8 @@ If `paths` section is absent, use these defaults:
145
147
  - `specs_dir` = `specs/bdd`
146
148
  - `prd_dir` = `specs/prd`
147
149
  - `refinement_dir` = `.agent/review`
150
+ - `qc_dir` = `docs`
151
+ - `qc_skills_dir` = `.agent/skills/qc`
148
152
  - `product_definitions_dir` = `specs/product-definition`
149
153
  - `domain_knowledge_dir` = `specs/domain-knowledge`
150
154
  - `business_dictionary` = `specs/domain-knowledge/business-dictionary.md`
@@ -170,7 +174,7 @@ If `services` section is present:
170
174
  - If `$ARGUMENTS` contains a path, extract the segment after `prd_dir`
171
175
 
172
176
  **2. Route to service** — if active domain matches a key in `services`:
173
- - Override `paths.specs_dir` → `services.{domain}.specs_dir`
177
+ - Override `paths.specs_dir` → `services.{domain}.specs_dir` — **only if `setup.spec_source` is NOT set.** When `spec_source` IS set, ALL BDD (web/app/**system**) is a shared cross-team artifact → leave `specs_dir` for step 4 to route to the spec repo; do NOT pin it per-service here.
174
178
  - Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir` — **only if `setup.spec_source` is NOT set.** When `spec_source` IS set, the tech-design (API contract) is a cross-team artifact and must live in the shared spec repo (handled in step 4), so leave `tech_docs_dir` for step 4 to route — do NOT pin it per-service here.
175
179
  - Store `active_service` = `services.{domain}.path`
176
180
  - Store `active_service_module` = `services.{domain}.module`
@@ -181,6 +185,7 @@ If `services` section is present:
181
185
  - Set `active_service = unresolved`
182
186
 
183
187
  **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
188
+ - Override `paths.specs_dir` → `{spec_source}/specs/bdd` — **always when `spec_source` is set.** All BDD (web/app/**system**) lives in the shared spec repo so every umbrella (FE/App/BE) reads the same scenarios; the FE tech-design gate + `/generate-code --phase=ui`/`--phase=integration` resolve the `system/` BDD here. *(Per-service `specs/bdd` only when there is no `spec_source`.)*
184
189
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
185
190
  - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
186
191
  - Override `paths.tech_docs_dir` → `{spec_source}/specs/tech-docs` — **always when `spec_source` is set** (step 2 no longer pins tech-docs per-service in this case). The tech-design IS the cross-team API contract: BE authors it here, and FE/App read it from the same spec submodule at `/generate-code --phase=integration`. *(Per-service tech-docs only happen when there is no `spec_source` — a pure multi-service BE repo with no shared spec module.)*
@@ -189,8 +194,10 @@ If `services` section is present:
189
194
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
190
195
  - Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
191
196
  - Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
197
+ - Override `paths.prd_change_requests_dir` → `{spec_source}/feedback/prd-change-requests`
198
+ - Override `paths.trace_dir` → `{spec_source}/.trace` — **always when `spec_source` is set.** Trace TSVs are consolidated in the spec repo (single authoritative location, no per-service split) so the PM/PO has one place to manage status. Code-side commands (`/generate-code`, `/dev-run-test`, `/qc-run-test`) run from `service_root` but **write their trace row into `{spec_source}/.trace`** — like they already push `feedback/` there. *(Per-service `.trace` only when there is no `spec_source`.)*
192
199
 
193
- > **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.
200
+ > **Why under `spec_source`:** PRD, design-spec, domain knowledge, **all BDD (web/app/system)**, the **API contract (tech-docs)**, tester feedback, **and the `.trace/` coverage state** are all **cross-team artifacts** — they live in the **shared spec repo** so every umbrella (FE/App/BE) and the PM read one source via `/sync`. The service submodule holds only **code** (+ build/test tooling). `.trace/` and `feedback/` are the dev/QC **write areas** in the spec repo (the PRD/BDD/design-spec/tech-docs there stay read-only for dev/QC only PO edits those). In single-service mode (no `spec_source`), everything defaults under the repo root — still one repo.
194
201
 
195
202
  ---
196
203
 
@@ -210,12 +217,12 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
210
217
  |----------|--------|
211
218
  | `conventions.test_command` | service's `conventions.test_command` |
212
219
  | `conventions.build_command` | service's `conventions.build_command` |
213
- | `paths.trace_dir` | `{active_service}/{service paths.trace_dir}` default: `{active_service}/.trace` |
214
- | `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
220
+ | `paths.trace_dir` | **If `spec_source` is set → keep the Step 4 spec-repo route (`{spec_source}/.trace`); ignore any service-level `trace_dir`.** Only when there is no `spec_source`: `{active_service}/{service paths.trace_dir}` (default `{active_service}/.trace`). |
221
+ | `paths.specs_dir` | **If `spec_source` is set → keep the Step 4 spec-repo route (`{spec_source}/specs/bdd`); ignore any service-level `specs_dir`** (BDD is cross-team, never per-service in this mode). Only when there is no `spec_source`: `{active_service}/{service paths.specs_dir}` if set, else the Step 1.5 override. |
215
222
 
216
223
  **3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
217
224
  - Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
218
- - File write operations (test files, trace TSVs) use paths **relative to** `service_root`
225
+ - **Source/test files** are written relative to `service_root`; **trace TSVs** are written to `{paths.trace_dir}` (the spec repo when `spec_source` is set — a cross-repo write, committed/pushed to the spec submodule like `feedback/`).
219
226
 
220
227
  **4. If service config not found** — keep umbrella defaults, still set `service_root = {active_service}` (path anchor is always needed even without a config override).
221
228
 
@@ -398,7 +405,7 @@ Proceed to the next step of the calling command.
398
405
 
399
406
  You are the **QC Report** stage — turn the latest run into a shareable report + evidence.
400
407
 
401
- ## Skill (`skills/qc/qa-runner/report/`)
408
+ ## Skill (`{paths.qc_skills_dir}/qa-runner/report/`)
402
409
 
403
410
  - `report.md` — self-contained: pytest-html (`--html=reports/<feature>/report.html
404
411
  --self-contained-html`) + Playwright Trace (`test-results/<nodeid>/trace.zip`, viewed via
@@ -411,6 +418,12 @@ You are the **QC Report** stage — turn the latest run into a shareable report
411
418
  FAIL/SKIP has a trace + screenshot attached.
412
419
  3. Summarize TOTAL / PASS / FAIL / SKIP; for each FAIL include the `show-trace` command and
413
420
  whether it was classified script-bug or product-gap.
421
+ 4. **Hand off product-gaps to the specs (prompted).** For every FAIL classified **product-gap**
422
+ (a real defect, impl ≠ spec — not a script-bug), print a ready-to-run
423
+ `/report-bug {UC-ID} {one-line expected-vs-actual}` so QC files it to the shared spec repo.
424
+ `/report-bug`'s BUG_FLOW then routes the root cause (Code / BDD / PRD / Design / Env). Never
425
+ fake-pass a product-gap — it stays FAIL in `qc_status` until fixed + re-run. **script-bugs are
426
+ NOT filed** (QC fixes the script and re-runs). List the commands; do not auto-create the reports.
414
427
 
415
428
  ## Report
416
429
 
@@ -436,6 +449,36 @@ Output Artifacts:
436
449
 
437
450
  If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
438
451
 
452
+ ## Pipeline Position
453
+
454
+ Print a one-line map of the pipeline with the CURRENT command's phase marked `◀ bạn ở đây`,
455
+ so the user always sees where this command sits in the end-to-end flow:
456
+
457
+ ```
458
+ Discovery → PRD → [Design Spec] → BDD → Tech Design → Code → Dev Self-Check → QC → Trace Audit
459
+ ```
460
+
461
+ Find the current command in this phase legend and mark **its** phase in the map above:
462
+
463
+ | Phase | Commands |
464
+ |-------|----------|
465
+ | Discovery | `/define-product` |
466
+ | PRD | `/generate-prd` · `/refine-prd` · `/review-context` (PRD) |
467
+ | Design Spec | `/generate-design-spec` |
468
+ | BDD | `/generate-bdd` · `/review-context` (BDD) |
469
+ | Tech Design | `/generate-tech-docs` · `/map-testids` · `/review-tech-docs` |
470
+ | Code | `/generate-code` · `/review-code` |
471
+ | Dev Self-Check | `/dev-gen-test` · `/dev-run-test` · `/dev-smoke-test` |
472
+ | QC | `/qc-analyze` · `/qc-plan` · `/qc-design-test` · `/qc-review` · `/qc-run-test` · `/qc-report` |
473
+ | Trace Audit | `/validate-traces` |
474
+
475
+ For a **review command**, also append the 3-step review loop with the current step marked, e.g.:
476
+ `Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume`.
477
+
478
+ **Cross-cutting commands** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
479
+ `/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) sit outside the linear pipeline —
480
+ **omit the Pipeline line entirely** for these (do not force-fit them onto the map).
481
+
439
482
  ## Next Command Suggestion
440
483
 
441
484
  Suggest the logical next command based on workflow phase:
@@ -477,15 +520,24 @@ Suggest the logical next command based on workflow phase:
477
520
  Format the footer as:
478
521
  ```
479
522
  ---
480
- Status : {badge}
523
+ Status : {badge}
481
524
  {Output Artifacts block}
482
- Next : {suggested command with example arguments}
525
+ Pipeline : Discovery PRD [BDD ◀ bạn ở đây] → Tech Design → Code → Dev Self-Check → QC → Trace Audit
526
+ (review cmd) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
527
+ Next : {suggested command with example arguments}
483
528
  ```
529
+ *(Omit the `Pipeline` line for cross-cutting commands listed above.)*
484
530
 
485
531
 
486
532
  ```
487
533
  /qc-report Complete — {UC-ID}
488
534
  Report: reports/<feature>/report.html (TOTAL {N} · PASS {p} · FAIL {f} · SKIP {s})
489
535
  Trace : test-results/<nodeid>/trace.zip (python3 -m playwright show-trace <file>)
536
+
537
+ Product-gaps to file ({g}): ← run these so PO/Dev see them on /sync (script-bugs excluded)
538
+ /report-bug {UC-ID} {gap 1 — expected vs actual}
539
+ /report-bug {UC-ID} {gap 2 …}
540
+ (none → skip)
541
+
490
542
  Next: /validate-traces {UC-ID} ← refresh Living Docs (qc_status), then create PR
491
543
  ```
@@ -92,7 +92,7 @@ Wait for explicit "Y" or "N" from the user before continuing.
92
92
  - "N" → stop and ask what the user wants to change.
93
93
 
94
94
 
95
- *Note: For this command, the target in Step 1 is a UC-ID. Detect review mode from `$ARGUMENTS`/context: review test-case `.Test.md` (after design) or review Python scripts (after run). Read artifacts from `{paths.refinement_dir}/qc/{UC-ID}/` and the generated test/page-object source.*
95
+ *Note: For this command, the target in Step 1 is a UC-ID. Detect review mode from `$ARGUMENTS`/context: review test-case `.Test.md` (after design) or review Python scripts (after run). Read artifacts from `{paths.qc_dir}/{UC-ID}/` and the generated test/page-object source.*
96
96
 
97
97
  ## Context
98
98
  # Context Loader — Load All Project Context
@@ -133,6 +133,8 @@ Read `.agent/project-context.yaml`. Extract and store:
133
133
  - `paths.specs_dir` → BDD specs root
134
134
  - `paths.prd_dir` → PRD documents root
135
135
  - `paths.refinement_dir` → findings/review output dir
136
+ - `paths.qc_dir` → QC automation artifacts root (visible top-level, one subfolder per UC: `{qc_dir}/{UC-ID}/`)
137
+ - `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)
136
138
  - `paths.product_definitions_dir` → product definitions root
137
139
  - `paths.domain_knowledge_dir` → domain knowledge root
138
140
  - `paths.business_dictionary` → path to business-dictionary.md
@@ -145,6 +147,8 @@ If `paths` section is absent, use these defaults:
145
147
  - `specs_dir` = `specs/bdd`
146
148
  - `prd_dir` = `specs/prd`
147
149
  - `refinement_dir` = `.agent/review`
150
+ - `qc_dir` = `docs`
151
+ - `qc_skills_dir` = `.agent/skills/qc`
148
152
  - `product_definitions_dir` = `specs/product-definition`
149
153
  - `domain_knowledge_dir` = `specs/domain-knowledge`
150
154
  - `business_dictionary` = `specs/domain-knowledge/business-dictionary.md`
@@ -170,7 +174,7 @@ If `services` section is present:
170
174
  - If `$ARGUMENTS` contains a path, extract the segment after `prd_dir`
171
175
 
172
176
  **2. Route to service** — if active domain matches a key in `services`:
173
- - Override `paths.specs_dir` → `services.{domain}.specs_dir`
177
+ - Override `paths.specs_dir` → `services.{domain}.specs_dir` — **only if `setup.spec_source` is NOT set.** When `spec_source` IS set, ALL BDD (web/app/**system**) is a shared cross-team artifact → leave `specs_dir` for step 4 to route to the spec repo; do NOT pin it per-service here.
174
178
  - Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir` — **only if `setup.spec_source` is NOT set.** When `spec_source` IS set, the tech-design (API contract) is a cross-team artifact and must live in the shared spec repo (handled in step 4), so leave `tech_docs_dir` for step 4 to route — do NOT pin it per-service here.
175
179
  - Store `active_service` = `services.{domain}.path`
176
180
  - Store `active_service_module` = `services.{domain}.module`
@@ -181,6 +185,7 @@ If `services` section is present:
181
185
  - Set `active_service = unresolved`
182
186
 
183
187
  **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
188
+ - Override `paths.specs_dir` → `{spec_source}/specs/bdd` — **always when `spec_source` is set.** All BDD (web/app/**system**) lives in the shared spec repo so every umbrella (FE/App/BE) reads the same scenarios; the FE tech-design gate + `/generate-code --phase=ui`/`--phase=integration` resolve the `system/` BDD here. *(Per-service `specs/bdd` only when there is no `spec_source`.)*
184
189
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
185
190
  - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
186
191
  - Override `paths.tech_docs_dir` → `{spec_source}/specs/tech-docs` — **always when `spec_source` is set** (step 2 no longer pins tech-docs per-service in this case). The tech-design IS the cross-team API contract: BE authors it here, and FE/App read it from the same spec submodule at `/generate-code --phase=integration`. *(Per-service tech-docs only happen when there is no `spec_source` — a pure multi-service BE repo with no shared spec module.)*
@@ -189,8 +194,10 @@ If `services` section is present:
189
194
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
190
195
  - Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
191
196
  - Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
197
+ - Override `paths.prd_change_requests_dir` → `{spec_source}/feedback/prd-change-requests`
198
+ - Override `paths.trace_dir` → `{spec_source}/.trace` — **always when `spec_source` is set.** Trace TSVs are consolidated in the spec repo (single authoritative location, no per-service split) so the PM/PO has one place to manage status. Code-side commands (`/generate-code`, `/dev-run-test`, `/qc-run-test`) run from `service_root` but **write their trace row into `{spec_source}/.trace`** — like they already push `feedback/` there. *(Per-service `.trace` only when there is no `spec_source`.)*
192
199
 
193
- > **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.
200
+ > **Why under `spec_source`:** PRD, design-spec, domain knowledge, **all BDD (web/app/system)**, the **API contract (tech-docs)**, tester feedback, **and the `.trace/` coverage state** are all **cross-team artifacts** — they live in the **shared spec repo** so every umbrella (FE/App/BE) and the PM read one source via `/sync`. The service submodule holds only **code** (+ build/test tooling). `.trace/` and `feedback/` are the dev/QC **write areas** in the spec repo (the PRD/BDD/design-spec/tech-docs there stay read-only for dev/QC only PO edits those). In single-service mode (no `spec_source`), everything defaults under the repo root — still one repo.
194
201
 
195
202
  ---
196
203
 
@@ -210,12 +217,12 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
210
217
  |----------|--------|
211
218
  | `conventions.test_command` | service's `conventions.test_command` |
212
219
  | `conventions.build_command` | service's `conventions.build_command` |
213
- | `paths.trace_dir` | `{active_service}/{service paths.trace_dir}` default: `{active_service}/.trace` |
214
- | `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
220
+ | `paths.trace_dir` | **If `spec_source` is set → keep the Step 4 spec-repo route (`{spec_source}/.trace`); ignore any service-level `trace_dir`.** Only when there is no `spec_source`: `{active_service}/{service paths.trace_dir}` (default `{active_service}/.trace`). |
221
+ | `paths.specs_dir` | **If `spec_source` is set → keep the Step 4 spec-repo route (`{spec_source}/specs/bdd`); ignore any service-level `specs_dir`** (BDD is cross-team, never per-service in this mode). Only when there is no `spec_source`: `{active_service}/{service paths.specs_dir}` if set, else the Step 1.5 override. |
215
222
 
216
223
  **3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
217
224
  - Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
218
- - File write operations (test files, trace TSVs) use paths **relative to** `service_root`
225
+ - **Source/test files** are written relative to `service_root`; **trace TSVs** are written to `{paths.trace_dir}` (the spec repo when `spec_source` is set — a cross-repo write, committed/pushed to the spec submodule like `feedback/`).
219
226
 
220
227
  **4. If service config not found** — keep umbrella defaults, still set `service_root = {active_service}` (path anchor is always needed even without a config override).
221
228
 
@@ -403,7 +410,7 @@ You are the **QC Reviewer** — the shared review gate, run twice in the pipelin
403
410
  Detect mode: if the target artifacts are `.Test.md` → test-case review; if Python test/PO
404
411
  files exist for the UC and are newer → script review. If ambiguous, ask.
405
412
 
406
- ## Skills (`skills/qc/qa-reviewer/`)
413
+ ## Skills (`{paths.qc_skills_dir}/qa-reviewer/`)
407
414
 
408
415
  Pick by mode + layer, load ONE file:
409
416
  - Test-case review: `test-case/{functional,e2e,integration,non-functional,exploratory}.md`
@@ -440,6 +447,36 @@ Output Artifacts:
440
447
 
441
448
  If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
442
449
 
450
+ ## Pipeline Position
451
+
452
+ Print a one-line map of the pipeline with the CURRENT command's phase marked `◀ bạn ở đây`,
453
+ so the user always sees where this command sits in the end-to-end flow:
454
+
455
+ ```
456
+ Discovery → PRD → [Design Spec] → BDD → Tech Design → Code → Dev Self-Check → QC → Trace Audit
457
+ ```
458
+
459
+ Find the current command in this phase legend and mark **its** phase in the map above:
460
+
461
+ | Phase | Commands |
462
+ |-------|----------|
463
+ | Discovery | `/define-product` |
464
+ | PRD | `/generate-prd` · `/refine-prd` · `/review-context` (PRD) |
465
+ | Design Spec | `/generate-design-spec` |
466
+ | BDD | `/generate-bdd` · `/review-context` (BDD) |
467
+ | Tech Design | `/generate-tech-docs` · `/map-testids` · `/review-tech-docs` |
468
+ | Code | `/generate-code` · `/review-code` |
469
+ | Dev Self-Check | `/dev-gen-test` · `/dev-run-test` · `/dev-smoke-test` |
470
+ | QC | `/qc-analyze` · `/qc-plan` · `/qc-design-test` · `/qc-review` · `/qc-run-test` · `/qc-report` |
471
+ | Trace Audit | `/validate-traces` |
472
+
473
+ For a **review command**, also append the 3-step review loop with the current step marked, e.g.:
474
+ `Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume`.
475
+
476
+ **Cross-cutting commands** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
477
+ `/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) sit outside the linear pipeline —
478
+ **omit the Pipeline line entirely** for these (do not force-fit them onto the map).
479
+
443
480
  ## Next Command Suggestion
444
481
 
445
482
  Suggest the logical next command based on workflow phase:
@@ -481,10 +518,13 @@ Suggest the logical next command based on workflow phase:
481
518
  Format the footer as:
482
519
  ```
483
520
  ---
484
- Status : {badge}
521
+ Status : {badge}
485
522
  {Output Artifacts block}
486
- Next : {suggested command with example arguments}
523
+ Pipeline : Discovery PRD [BDD ◀ bạn ở đây] → Tech Design → Code → Dev Self-Check → QC → Trace Audit
524
+ (review cmd) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
525
+ Next : {suggested command with example arguments}
487
526
  ```
527
+ *(Omit the `Pipeline` line for cross-cutting commands listed above.)*
488
528
 
489
529
 
490
530
  ```