@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
@@ -132,6 +132,8 @@ Read `.agent/project-context.yaml`. Extract and store:
132
132
  - `paths.specs_dir` → BDD specs root
133
133
  - `paths.prd_dir` → PRD documents root
134
134
  - `paths.refinement_dir` → findings/review output dir
135
+ - `paths.qc_dir` → QC automation artifacts root (visible top-level, one subfolder per UC: `{qc_dir}/{UC-ID}/`)
136
+ - `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)
135
137
  - `paths.product_definitions_dir` → product definitions root
136
138
  - `paths.domain_knowledge_dir` → domain knowledge root
137
139
  - `paths.business_dictionary` → path to business-dictionary.md
@@ -144,6 +146,8 @@ If `paths` section is absent, use these defaults:
144
146
  - `specs_dir` = `specs/bdd`
145
147
  - `prd_dir` = `specs/prd`
146
148
  - `refinement_dir` = `.agent/review`
149
+ - `qc_dir` = `docs`
150
+ - `qc_skills_dir` = `.agent/skills/qc`
147
151
  - `product_definitions_dir` = `specs/product-definition`
148
152
  - `domain_knowledge_dir` = `specs/domain-knowledge`
149
153
  - `business_dictionary` = `specs/domain-knowledge/business-dictionary.md`
@@ -169,7 +173,7 @@ If `services` section is present:
169
173
  - If `$ARGUMENTS` contains a path, extract the segment after `prd_dir`
170
174
 
171
175
  **2. Route to service** — if active domain matches a key in `services`:
172
- - Override `paths.specs_dir` → `services.{domain}.specs_dir`
176
+ - 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.
173
177
  - 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.
174
178
  - Store `active_service` = `services.{domain}.path`
175
179
  - Store `active_service_module` = `services.{domain}.module`
@@ -180,6 +184,7 @@ If `services` section is present:
180
184
  - Set `active_service = unresolved`
181
185
 
182
186
  **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
187
+ - 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`.)*
183
188
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
184
189
  - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
185
190
  - 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.)*
@@ -188,8 +193,10 @@ If `services` section is present:
188
193
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
189
194
  - Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
190
195
  - Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
196
+ - Override `paths.prd_change_requests_dir` → `{spec_source}/feedback/prd-change-requests`
197
+ - 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`.)*
191
198
 
192
- > **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.
199
+ > **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.
193
200
 
194
201
  ---
195
202
 
@@ -209,12 +216,12 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
209
216
  |----------|--------|
210
217
  | `conventions.test_command` | service's `conventions.test_command` |
211
218
  | `conventions.build_command` | service's `conventions.build_command` |
212
- | `paths.trace_dir` | `{active_service}/{service paths.trace_dir}` default: `{active_service}/.trace` |
213
- | `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
219
+ | `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`). |
220
+ | `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. |
214
221
 
215
222
  **3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
216
223
  - Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
217
- - File write operations (test files, trace TSVs) use paths **relative to** `service_root`
224
+ - **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/`).
218
225
 
219
226
  **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).
220
227
 
@@ -788,6 +795,36 @@ Output Artifacts:
788
795
 
789
796
  If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
790
797
 
798
+ ## Pipeline Position
799
+
800
+ Print a one-line map of the pipeline with the CURRENT command's phase marked `◀ bạn ở đây`,
801
+ so the user always sees where this command sits in the end-to-end flow:
802
+
803
+ ```
804
+ Discovery → PRD → [Design Spec] → BDD → Tech Design → Code → Dev Self-Check → QC → Trace Audit
805
+ ```
806
+
807
+ Find the current command in this phase legend and mark **its** phase in the map above:
808
+
809
+ | Phase | Commands |
810
+ |-------|----------|
811
+ | Discovery | `/define-product` |
812
+ | PRD | `/generate-prd` · `/refine-prd` · `/review-context` (PRD) |
813
+ | Design Spec | `/generate-design-spec` |
814
+ | BDD | `/generate-bdd` · `/review-context` (BDD) |
815
+ | Tech Design | `/generate-tech-docs` · `/map-testids` · `/review-tech-docs` |
816
+ | Code | `/generate-code` · `/review-code` |
817
+ | Dev Self-Check | `/dev-gen-test` · `/dev-run-test` · `/dev-smoke-test` |
818
+ | QC | `/qc-analyze` · `/qc-plan` · `/qc-design-test` · `/qc-review` · `/qc-run-test` · `/qc-report` |
819
+ | Trace Audit | `/validate-traces` |
820
+
821
+ For a **review command**, also append the 3-step review loop with the current step marked, e.g.:
822
+ `Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume`.
823
+
824
+ **Cross-cutting commands** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
825
+ `/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) sit outside the linear pipeline —
826
+ **omit the Pipeline line entirely** for these (do not force-fit them onto the map).
827
+
791
828
  ## Next Command Suggestion
792
829
 
793
830
  Suggest the logical next command based on workflow phase:
@@ -829,10 +866,13 @@ Suggest the logical next command based on workflow phase:
829
866
  Format the footer as:
830
867
  ```
831
868
  ---
832
- Status : {badge}
869
+ Status : {badge}
833
870
  {Output Artifacts block}
834
- Next : {suggested command with example arguments}
871
+ Pipeline : Discovery PRD [BDD ◀ bạn ở đây] → Tech Design → Code → Dev Self-Check → QC → Trace Audit
872
+ (review cmd) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
873
+ Next : {suggested command with example arguments}
835
874
  ```
875
+ *(Omit the `Pipeline` line for cross-cutting commands listed above.)*
836
876
 
837
877
 
838
878
  ```
@@ -129,6 +129,8 @@ Read `.agent/project-context.yaml`. Extract and store:
129
129
  - `paths.specs_dir` → BDD specs root
130
130
  - `paths.prd_dir` → PRD documents root
131
131
  - `paths.refinement_dir` → findings/review output dir
132
+ - `paths.qc_dir` → QC automation artifacts root (visible top-level, one subfolder per UC: `{qc_dir}/{UC-ID}/`)
133
+ - `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)
132
134
  - `paths.product_definitions_dir` → product definitions root
133
135
  - `paths.domain_knowledge_dir` → domain knowledge root
134
136
  - `paths.business_dictionary` → path to business-dictionary.md
@@ -141,6 +143,8 @@ If `paths` section is absent, use these defaults:
141
143
  - `specs_dir` = `specs/bdd`
142
144
  - `prd_dir` = `specs/prd`
143
145
  - `refinement_dir` = `.agent/review`
146
+ - `qc_dir` = `docs`
147
+ - `qc_skills_dir` = `.agent/skills/qc`
144
148
  - `product_definitions_dir` = `specs/product-definition`
145
149
  - `domain_knowledge_dir` = `specs/domain-knowledge`
146
150
  - `business_dictionary` = `specs/domain-knowledge/business-dictionary.md`
@@ -166,7 +170,7 @@ If `services` section is present:
166
170
  - If `$ARGUMENTS` contains a path, extract the segment after `prd_dir`
167
171
 
168
172
  **2. Route to service** — if active domain matches a key in `services`:
169
- - Override `paths.specs_dir` → `services.{domain}.specs_dir`
173
+ - 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.
170
174
  - 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.
171
175
  - Store `active_service` = `services.{domain}.path`
172
176
  - Store `active_service_module` = `services.{domain}.module`
@@ -177,6 +181,7 @@ If `services` section is present:
177
181
  - Set `active_service = unresolved`
178
182
 
179
183
  **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
184
+ - 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`.)*
180
185
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
181
186
  - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
182
187
  - 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.)*
@@ -185,8 +190,10 @@ If `services` section is present:
185
190
  - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
186
191
  - Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
187
192
  - Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
193
+ - Override `paths.prd_change_requests_dir` → `{spec_source}/feedback/prd-change-requests`
194
+ - 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`.)*
188
195
 
189
- > **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.
196
+ > **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.
190
197
 
191
198
  ---
192
199
 
@@ -206,12 +213,12 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
206
213
  |----------|--------|
207
214
  | `conventions.test_command` | service's `conventions.test_command` |
208
215
  | `conventions.build_command` | service's `conventions.build_command` |
209
- | `paths.trace_dir` | `{active_service}/{service paths.trace_dir}` default: `{active_service}/.trace` |
210
- | `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
216
+ | `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`). |
217
+ | `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. |
211
218
 
212
219
  **3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
213
220
  - Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
214
- - File write operations (test files, trace TSVs) use paths **relative to** `service_root`
221
+ - **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/`).
215
222
 
216
223
  **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).
217
224
 
@@ -623,6 +630,36 @@ Output Artifacts:
623
630
 
624
631
  If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
625
632
 
633
+ ## Pipeline Position
634
+
635
+ Print a one-line map of the pipeline with the CURRENT command's phase marked `◀ bạn ở đây`,
636
+ so the user always sees where this command sits in the end-to-end flow:
637
+
638
+ ```
639
+ Discovery → PRD → [Design Spec] → BDD → Tech Design → Code → Dev Self-Check → QC → Trace Audit
640
+ ```
641
+
642
+ Find the current command in this phase legend and mark **its** phase in the map above:
643
+
644
+ | Phase | Commands |
645
+ |-------|----------|
646
+ | Discovery | `/define-product` |
647
+ | PRD | `/generate-prd` · `/refine-prd` · `/review-context` (PRD) |
648
+ | Design Spec | `/generate-design-spec` |
649
+ | BDD | `/generate-bdd` · `/review-context` (BDD) |
650
+ | Tech Design | `/generate-tech-docs` · `/map-testids` · `/review-tech-docs` |
651
+ | Code | `/generate-code` · `/review-code` |
652
+ | Dev Self-Check | `/dev-gen-test` · `/dev-run-test` · `/dev-smoke-test` |
653
+ | QC | `/qc-analyze` · `/qc-plan` · `/qc-design-test` · `/qc-review` · `/qc-run-test` · `/qc-report` |
654
+ | Trace Audit | `/validate-traces` |
655
+
656
+ For a **review command**, also append the 3-step review loop with the current step marked, e.g.:
657
+ `Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume`.
658
+
659
+ **Cross-cutting commands** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
660
+ `/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) sit outside the linear pipeline —
661
+ **omit the Pipeline line entirely** for these (do not force-fit them onto the map).
662
+
626
663
  ## Next Command Suggestion
627
664
 
628
665
  Suggest the logical next command based on workflow phase:
@@ -664,10 +701,13 @@ Suggest the logical next command based on workflow phase:
664
701
  Format the footer as:
665
702
  ```
666
703
  ---
667
- Status : {badge}
704
+ Status : {badge}
668
705
  {Output Artifacts block}
669
- Next : {suggested command with example arguments}
706
+ Pipeline : Discovery PRD [BDD ◀ bạn ở đây] → Tech Design → Code → Dev Self-Check → QC → Trace Audit
707
+ (review cmd) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
708
+ Next : {suggested command with example arguments}
670
709
  ```
710
+ *(Omit the `Pipeline` line for cross-cutting commands listed above.)*
671
711
 
672
712
 
673
713
  ```
@@ -728,8 +768,9 @@ Edit the tech-doc file directly:
728
768
 
729
769
  Write both changes to the file.
730
770
 
731
- Then update `{paths.trace_dir}/{UC-ID}.tsv`:
732
- - Set `tech_doc_revision` column to the new `@trace.revision` integer for all rows of this UC.
771
+ Then update `{paths.trace_dir}/{UC-ID}.tsv` — pick the column by which tech-doc was reviewed (read the filename):
772
+ - **BE contract** (`{UC-ID}-tech-design.md`) → set `tech_doc_revision` to the new `@trace.revision` integer for all rows of this UC.
773
+ - **FE tech-design** (`{UC-ID}-tech-design-{platform}.md`) → set `fe_tech_doc_revision` instead, for the rows of this UC on that platform (leave `tech_doc_revision` untouched).
733
774
  - Set `last_updated` to today's date (`YYYY-MM-DD`) for all rows of this UC.
734
775
 
735
776
  Print the report after all file writes are complete.
@@ -166,8 +166,8 @@ Create these directories (skip if they exist):
166
166
  | project_type | Create | Skip |
167
167
  |---|---|---|
168
168
  | **1 — Single-service** | Full structure above | — |
169
- | **2 — Umbrella** | `.agent/review/` only (at umbrella root) | Everything else — `specs/` dirs live inside service submodules |
170
- | **3 — PO Spec repo** | `specs/prd/`, `specs/design-spec/`, `specs/product-definition/`, `specs/domain-knowledge/`, `.agent/review/` | `specs/bdd/`, `specs/tech-docs/`, `.trace/` |
169
+ | **2 — Umbrella** | `.agent/review/` only (at umbrella root) | Everything else — **all specs live in the spec submodule (`spec_source`)**; service submodules hold only **code + `.trace/`** |
170
+ | **3 — PO Spec repo** | `specs/prd/`, `specs/design-spec/`, `specs/product-definition/`, `specs/domain-knowledge/`, **`specs/bdd/`**, **`specs/tech-docs/`**, **`feedback/`**, `.agent/review/` | `.trace/` (per-service, lives beside code in each service submodule) |
171
171
 
172
172
  ## Step 2 — Create CLAUDE.md
173
173
 
@@ -392,6 +392,36 @@ Output Artifacts:
392
392
 
393
393
  If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
394
394
 
395
+ ## Pipeline Position
396
+
397
+ Print a one-line map of the pipeline with the CURRENT command's phase marked `◀ bạn ở đây`,
398
+ so the user always sees where this command sits in the end-to-end flow:
399
+
400
+ ```
401
+ Discovery → PRD → [Design Spec] → BDD → Tech Design → Code → Dev Self-Check → QC → Trace Audit
402
+ ```
403
+
404
+ Find the current command in this phase legend and mark **its** phase in the map above:
405
+
406
+ | Phase | Commands |
407
+ |-------|----------|
408
+ | Discovery | `/define-product` |
409
+ | PRD | `/generate-prd` · `/refine-prd` · `/review-context` (PRD) |
410
+ | Design Spec | `/generate-design-spec` |
411
+ | BDD | `/generate-bdd` · `/review-context` (BDD) |
412
+ | Tech Design | `/generate-tech-docs` · `/map-testids` · `/review-tech-docs` |
413
+ | Code | `/generate-code` · `/review-code` |
414
+ | Dev Self-Check | `/dev-gen-test` · `/dev-run-test` · `/dev-smoke-test` |
415
+ | QC | `/qc-analyze` · `/qc-plan` · `/qc-design-test` · `/qc-review` · `/qc-run-test` · `/qc-report` |
416
+ | Trace Audit | `/validate-traces` |
417
+
418
+ For a **review command**, also append the 3-step review loop with the current step marked, e.g.:
419
+ `Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume`.
420
+
421
+ **Cross-cutting commands** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
422
+ `/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) sit outside the linear pipeline —
423
+ **omit the Pipeline line entirely** for these (do not force-fit them onto the map).
424
+
395
425
  ## Next Command Suggestion
396
426
 
397
427
  Suggest the logical next command based on workflow phase:
@@ -433,10 +463,13 @@ Suggest the logical next command based on workflow phase:
433
463
  Format the footer as:
434
464
  ```
435
465
  ---
436
- Status : {badge}
466
+ Status : {badge}
437
467
  {Output Artifacts block}
438
- Next : {suggested command with example arguments}
468
+ Pipeline : Discovery PRD [BDD ◀ bạn ở đây] → Tech Design → Code → Dev Self-Check → QC → Trace Audit
469
+ (review cmd) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
470
+ Next : {suggested command with example arguments}
439
471
  ```
472
+ *(Omit the `Pipeline` line for cross-cutting commands listed above.)*
440
473
 
441
474
 
442
475
  ```
@@ -144,9 +144,9 @@ Collect from output:
144
144
 
145
145
  ---
146
146
 
147
- ## Step 1d — Surface Tester Feedback *(new bug reports / scenario proposals)*
147
+ ## Step 1d — Surface Tester/QC Feedback *(bug reports / scenario proposals / PRD change requests)*
148
148
 
149
- Tester `/report-bug` and `/propose-scenario` commit feedback into the spec repo. This step tells PO/Dev what arrived in **this** pull, so they are notified through their normal routine. It covers both audiences:
149
+ Tester & QC `/report-bug`, `/propose-scenario` (incl. Case B PRD change requests) commit feedback into the spec repo. This step tells PO/Dev what arrived in **this** pull, so they are notified through their normal routine. It covers both audiences:
150
150
 
151
151
  - **Dev/tester in umbrella** → feedback came in via the spec submodule advance (Step 1c)
152
152
  - **PO working directly in the spec repo** → feedback came in via the umbrella/current-repo `git pull` (Step 1)
@@ -158,22 +158,25 @@ Pick the repo + range that pulled the feedback:
158
158
  If `feedback/` does not exist in REPO → skip silently.
159
159
 
160
160
  ```bash
161
- git -C {REPO} diff --name-status {old_sha}..{new_sha} -- feedback/bug-reports/ feedback/bdd-proposals/
161
+ git -C {REPO} diff --name-status {old_sha}..{new_sha} -- feedback/bug-reports/ feedback/bdd-proposals/ feedback/prd-change-requests/
162
162
  ```
163
163
 
164
- For each entry, read its title/summary and report:
164
+ For each entry, read its title/summary + `State` and report. **Bug reports: surface only `State: Open`** as needing attention; list `Fixed`/`Closed` separately (or omit) so the PO/PM sees what's still pending:
165
165
  ```
166
- 📥 New tester feedback (pulled this sync):
167
- Bug reports:
168
- BUG-20260608-01 FT-001 — account locks after 6 fails (spec says 5) [layer: Code]
166
+ 📥 New feedback (pulled this sync):
167
+ Bug reports (open):
168
+ BUG-20260608-01 FT-001 — account locks after 6 fails (spec says 5) [layer: Code · waiting: dev]
169
+ Bug reports (fixed, awaiting QC re-verify): BUG-20260605-02
169
170
  Scenario proposals:
170
171
  FT-001-trailing-spaces.md → maps to AC2 (pending review)
172
+ PRD change requests:
173
+ FT-001-bulk-export.md → new requirement, needs an AC (waiting: PO)
171
174
  ```
172
175
 
173
- If none changed → print `📥 Tester feedback: none new this sync`.
176
+ If none changed → print `📥 Feedback: none new this sync`.
174
177
 
175
178
  If the reader is a PO/Dev, add a one-line nudge:
176
- `→ Review feedback/ then act: /fix-bug {BUG-ID} · promote proposal into BDD · or update PRD.`
179
+ `→ Review feedback/ then act: /fix-bug {BUG-ID} · promote proposal via /generate-bdd · or add an AC to the PRD.`
177
180
 
178
181
  ---
179
182
 
@@ -321,6 +324,36 @@ Output Artifacts:
321
324
 
322
325
  If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
323
326
 
327
+ ## Pipeline Position
328
+
329
+ Print a one-line map of the pipeline with the CURRENT command's phase marked `◀ bạn ở đây`,
330
+ so the user always sees where this command sits in the end-to-end flow:
331
+
332
+ ```
333
+ Discovery → PRD → [Design Spec] → BDD → Tech Design → Code → Dev Self-Check → QC → Trace Audit
334
+ ```
335
+
336
+ Find the current command in this phase legend and mark **its** phase in the map above:
337
+
338
+ | Phase | Commands |
339
+ |-------|----------|
340
+ | Discovery | `/define-product` |
341
+ | PRD | `/generate-prd` · `/refine-prd` · `/review-context` (PRD) |
342
+ | Design Spec | `/generate-design-spec` |
343
+ | BDD | `/generate-bdd` · `/review-context` (BDD) |
344
+ | Tech Design | `/generate-tech-docs` · `/map-testids` · `/review-tech-docs` |
345
+ | Code | `/generate-code` · `/review-code` |
346
+ | Dev Self-Check | `/dev-gen-test` · `/dev-run-test` · `/dev-smoke-test` |
347
+ | QC | `/qc-analyze` · `/qc-plan` · `/qc-design-test` · `/qc-review` · `/qc-run-test` · `/qc-report` |
348
+ | Trace Audit | `/validate-traces` |
349
+
350
+ For a **review command**, also append the 3-step review loop with the current step marked, e.g.:
351
+ `Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume`.
352
+
353
+ **Cross-cutting commands** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
354
+ `/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) sit outside the linear pipeline —
355
+ **omit the Pipeline line entirely** for these (do not force-fit them onto the map).
356
+
324
357
  ## Next Command Suggestion
325
358
 
326
359
  Suggest the logical next command based on workflow phase:
@@ -362,10 +395,13 @@ Suggest the logical next command based on workflow phase:
362
395
  Format the footer as:
363
396
  ```
364
397
  ---
365
- Status : {badge}
398
+ Status : {badge}
366
399
  {Output Artifacts block}
367
- Next : {suggested command with example arguments}
400
+ Pipeline : Discovery PRD [BDD ◀ bạn ở đây] → Tech Design → Code → Dev Self-Check → QC → Trace Audit
401
+ (review cmd) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
402
+ Next : {suggested command with example arguments}
368
403
  ```
404
+ *(Omit the `Pipeline` line for cross-cutting commands listed above.)*
369
405
 
370
406
 
371
407
  ```
@@ -147,6 +147,36 @@ Output Artifacts:
147
147
 
148
148
  If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
149
149
 
150
+ ## Pipeline Position
151
+
152
+ Print a one-line map of the pipeline with the CURRENT command's phase marked `◀ bạn ở đây`,
153
+ so the user always sees where this command sits in the end-to-end flow:
154
+
155
+ ```
156
+ Discovery → PRD → [Design Spec] → BDD → Tech Design → Code → Dev Self-Check → QC → Trace Audit
157
+ ```
158
+
159
+ Find the current command in this phase legend and mark **its** phase in the map above:
160
+
161
+ | Phase | Commands |
162
+ |-------|----------|
163
+ | Discovery | `/define-product` |
164
+ | PRD | `/generate-prd` · `/refine-prd` · `/review-context` (PRD) |
165
+ | Design Spec | `/generate-design-spec` |
166
+ | BDD | `/generate-bdd` · `/review-context` (BDD) |
167
+ | Tech Design | `/generate-tech-docs` · `/map-testids` · `/review-tech-docs` |
168
+ | Code | `/generate-code` · `/review-code` |
169
+ | Dev Self-Check | `/dev-gen-test` · `/dev-run-test` · `/dev-smoke-test` |
170
+ | QC | `/qc-analyze` · `/qc-plan` · `/qc-design-test` · `/qc-review` · `/qc-run-test` · `/qc-report` |
171
+ | Trace Audit | `/validate-traces` |
172
+
173
+ For a **review command**, also append the 3-step review loop with the current step marked, e.g.:
174
+ `Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume`.
175
+
176
+ **Cross-cutting commands** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
177
+ `/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) sit outside the linear pipeline —
178
+ **omit the Pipeline line entirely** for these (do not force-fit them onto the map).
179
+
150
180
  ## Next Command Suggestion
151
181
 
152
182
  Suggest the logical next command based on workflow phase:
@@ -188,10 +218,13 @@ Suggest the logical next command based on workflow phase:
188
218
  Format the footer as:
189
219
  ```
190
220
  ---
191
- Status : {badge}
221
+ Status : {badge}
192
222
  {Output Artifacts block}
193
- Next : {suggested command with example arguments}
223
+ Pipeline : Discovery PRD [BDD ◀ bạn ở đây] → Tech Design → Code → Dev Self-Check → QC → Trace Audit
224
+ (review cmd) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
225
+ Next : {suggested command with example arguments}
194
226
  ```
227
+ *(Omit the `Pipeline` line for cross-cutting commands listed above.)*
195
228
 
196
229
 
197
230
  ```