@anhth2/spec-driven-dev-plugin 0.12.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 (130) hide show
  1. package/commands/debug.md +42 -7
  2. package/commands/define-product.md +42 -7
  3. package/commands/dev-gen-test.md +60 -17
  4. package/commands/dev-run-test.md +61 -18
  5. package/commands/dev-run-test.tmpl +1 -1
  6. package/commands/dev-smoke-test.md +42 -7
  7. package/commands/fix-bug.md +42 -7
  8. package/commands/generate-bdd.md +67 -21
  9. package/commands/generate-bdd.tmpl +7 -4
  10. package/commands/generate-code.md +113 -35
  11. package/commands/generate-code.tmpl +53 -18
  12. package/commands/generate-design-spec.md +42 -7
  13. package/commands/generate-prd.md +42 -7
  14. package/commands/generate-spec-manifest.md +42 -7
  15. package/commands/generate-tech-docs.md +229 -20
  16. package/commands/generate-tech-docs.tmpl +187 -13
  17. package/commands/learn.md +42 -7
  18. package/commands/map-testids.md +564 -0
  19. package/commands/map-testids.tmpl +81 -0
  20. package/commands/propose-scenario.md +42 -7
  21. package/commands/qc-analyze.md +42 -7
  22. package/commands/qc-design-test.md +44 -8
  23. package/commands/qc-design-test.tmpl +2 -1
  24. package/commands/qc-plan.md +42 -7
  25. package/commands/qc-report.md +42 -7
  26. package/commands/qc-review.md +42 -7
  27. package/commands/qc-run-test.md +62 -18
  28. package/commands/qc-run-test.tmpl +2 -1
  29. package/commands/refine-prd.md +42 -7
  30. package/commands/report-bug.md +42 -7
  31. package/commands/review-code.md +42 -7
  32. package/commands/review-context.md +42 -7
  33. package/commands/review-tech-docs.md +45 -9
  34. package/commands/review-tech-docs.tmpl +3 -2
  35. package/commands/setup-ai-first.md +37 -4
  36. package/commands/setup-ai-first.tmpl +2 -2
  37. package/commands/sync.md +35 -2
  38. package/commands/update-framework.md +35 -2
  39. package/commands/validate-traces.md +85 -40
  40. package/commands/validate-traces.tmpl +43 -33
  41. package/core/FRAMEWORK_VERSION +1 -1
  42. package/core/commands/debug.md +42 -7
  43. package/core/commands/define-product.md +42 -7
  44. package/core/commands/dev-gen-test.md +60 -17
  45. package/core/commands/dev-run-test.md +61 -18
  46. package/core/commands/dev-smoke-test.md +42 -7
  47. package/core/commands/fix-bug.md +42 -7
  48. package/core/commands/generate-bdd.md +67 -21
  49. package/core/commands/generate-code.md +113 -35
  50. package/core/commands/generate-design-spec.md +42 -7
  51. package/core/commands/generate-prd.md +42 -7
  52. package/core/commands/generate-spec-manifest.md +42 -7
  53. package/core/commands/generate-tech-docs.md +229 -20
  54. package/core/commands/learn.md +42 -7
  55. package/core/commands/map-testids.md +564 -0
  56. package/core/commands/propose-scenario.md +42 -7
  57. package/core/commands/qc-analyze.md +42 -7
  58. package/core/commands/qc-design-test.md +44 -8
  59. package/core/commands/qc-plan.md +42 -7
  60. package/core/commands/qc-report.md +42 -7
  61. package/core/commands/qc-review.md +42 -7
  62. package/core/commands/qc-run-test.md +62 -18
  63. package/core/commands/refine-prd.md +42 -7
  64. package/core/commands/report-bug.md +42 -7
  65. package/core/commands/review-code.md +42 -7
  66. package/core/commands/review-context.md +42 -7
  67. package/core/commands/review-tech-docs.md +45 -9
  68. package/core/commands/setup-ai-first.md +37 -4
  69. package/core/commands/sync.md +35 -2
  70. package/core/commands/update-framework.md +35 -2
  71. package/core/commands/validate-traces.md +85 -40
  72. package/core/modules/qc-playwright/stack-profile.yaml +1 -0
  73. package/core/skills/code/SKILL.md +77 -9
  74. package/core/skills/debug/SKILL.md +112 -11
  75. package/core/skills/design-spec/SKILL.md +42 -7
  76. package/core/skills/discovery/SKILL.md +42 -7
  77. package/core/skills/prd/SKILL.md +70 -4
  78. package/core/skills/setup-ai-first/SKILL.md +35 -2
  79. package/core/skills/spec/SKILL.md +70 -4
  80. package/core/skills/test/SKILL.md +119 -16
  81. package/core/steps/context-loader.md +7 -5
  82. package/core/steps/report-footer.md +35 -2
  83. package/core/steps/trace-mirror.md +18 -10
  84. package/core/templates/project-context.yaml +8 -5
  85. package/docs/01-getting-started/core-concepts.md +7 -7
  86. package/docs/01-getting-started/installation.md +2 -2
  87. package/docs/01-getting-started/quickstart.md +1 -1
  88. package/docs/02-guides/README.md +1 -2
  89. package/docs/02-guides/developer/README.md +1 -1
  90. package/docs/02-guides/developer/bdd-and-trace.md +10 -8
  91. package/docs/02-guides/developer/commands.md +3 -3
  92. package/docs/02-guides/developer/scenarios.md +26 -14
  93. package/docs/02-guides/developer/workflow.md +80 -20
  94. package/docs/02-guides/product-owner/README.md +6 -4
  95. package/docs/02-guides/product-owner/commands.md +1 -1
  96. package/docs/02-guides/product-owner/scenarios.md +80 -1
  97. package/docs/02-guides/tester/README.md +12 -11
  98. package/docs/02-guides/tester/bug-reporting.md +1 -1
  99. package/docs/02-guides/{qc-automation.md → tester/qc-automation.md} +14 -6
  100. package/docs/02-guides/tester/reading-specs.md +4 -4
  101. package/docs/02-guides/tester/scenarios.md +5 -5
  102. package/docs/02-guides/tester/spec-manifest.md +17 -12
  103. package/docs/02-guides/tester/test-checklist.md +3 -3
  104. package/docs/02-guides/tester/workflow.md +8 -11
  105. package/docs/03-concepts/architecture.md +5 -4
  106. package/docs/03-concepts/pipeline.md +18 -6
  107. package/docs/03-concepts/traceability.md +17 -17
  108. package/docs/04-operations/README.md +1 -1
  109. package/docs/04-operations/bug-flow.md +4 -4
  110. package/docs/04-operations/sync-and-update.md +163 -38
  111. package/docs/05-reference/README.md +3 -0
  112. package/docs/05-reference/command-cheatsheet.md +147 -0
  113. package/docs/05-reference/commands.md +72 -69
  114. package/docs/05-reference/modules.md +2 -2
  115. package/docs/05-reference/trace-schema.md +15 -14
  116. package/docs/README.md +3 -5
  117. package/modules/qc-playwright/stack-profile.yaml +1 -0
  118. package/package.json +1 -1
  119. package/skills/code/SKILL.md +77 -9
  120. package/skills/debug/SKILL.md +112 -11
  121. package/skills/design-spec/SKILL.md +42 -7
  122. package/skills/discovery/SKILL.md +42 -7
  123. package/skills/prd/SKILL.md +70 -4
  124. package/skills/setup-ai-first/SKILL.md +35 -2
  125. package/skills/spec/SKILL.md +70 -4
  126. package/skills/test/SKILL.md +119 -16
  127. package/steps/context-loader.md +7 -5
  128. package/steps/report-footer.md +35 -2
  129. package/steps/trace-mirror.md +18 -10
  130. package/templates/project-context.yaml +8 -5
@@ -172,7 +172,7 @@ If `services` section is present:
172
172
  - If `$ARGUMENTS` contains a path, extract the segment after `prd_dir`
173
173
 
174
174
  **2. Route to service** — if active domain matches a key in `services`:
175
- - Override `paths.specs_dir` → `services.{domain}.specs_dir`
175
+ - 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.
176
176
  - 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.
177
177
  - Store `active_service` = `services.{domain}.path`
178
178
  - Store `active_service_module` = `services.{domain}.module`
@@ -183,6 +183,7 @@ If `services` section is present:
183
183
  - Set `active_service = unresolved`
184
184
 
185
185
  **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
186
+ - 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`.)*
186
187
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
187
188
  - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
188
189
  - 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.)*
@@ -192,8 +193,9 @@ If `services` section is present:
192
193
  - Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
193
194
  - Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
194
195
  - Override `paths.prd_change_requests_dir` → `{spec_source}/feedback/prd-change-requests`
196
+ - 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`.)*
195
197
 
196
- > **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.
198
+ > **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.
197
199
 
198
200
  ---
199
201
 
@@ -213,12 +215,12 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
213
215
  |----------|--------|
214
216
  | `conventions.test_command` | service's `conventions.test_command` |
215
217
  | `conventions.build_command` | service's `conventions.build_command` |
216
- | `paths.trace_dir` | `{active_service}/{service paths.trace_dir}` default: `{active_service}/.trace` |
217
- | `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
218
+ | `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`). |
219
+ | `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. |
218
220
 
219
221
  **3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
220
222
  - Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
221
- - File write operations (test files, trace TSVs) use paths **relative to** `service_root`
223
+ - **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/`).
222
224
 
223
225
  **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).
224
226
 
@@ -855,21 +857,29 @@ Leave all other columns unchanged (including `dev_selftest_at`, which `/dev-run-
855
857
  # Refresh Living Docs panel mirror *(local, umbrella mode)*
856
858
 
857
859
  *Skip entirely in single-service mode (no `services` and no `setup.spec_source`) — there
858
- the service `.trace/` IS the panel location, so nothing to mirror.*
860
+ the repo's own `.trace/` IS the panel location, so nothing to mirror.*
859
861
 
860
- After updating the authoritative service TSV(s) at `{paths.trace_dir}`:
862
+ After updating the authoritative TSV(s) at `{paths.trace_dir}`:
861
863
 
862
- 1. Resolve `panel_mirror = ./.trace` at the **current workspace root** (where this command runs).
864
+ **When `setup.spec_source` is set (consolidated trace the common case):**
865
+ `{paths.trace_dir}` resolves to `{spec_source}/.trace` — the single authoritative location.
866
+ This command runs from `service_root`, so the write is **cross-repo into the spec submodule**;
867
+ commit/push the spec submodule for the trace update (same as `feedback/`).
868
+ 1. Resolve `panel_mirror = ./.trace` at the **current workspace root**.
863
869
  2. If `panel_mirror` resolves to a different path than `{paths.trace_dir}`, copy each
864
- just-updated `{UC-ID}.tsv` → `{panel_mirror}/{service-name}/{UC-ID}.tsv`
865
- (create the dir; overwrite). Use `active_service` for `{service-name}`.
870
+ just-updated `{UC-ID}.tsv` → `{panel_mirror}/{UC-ID}.tsv` (create the dir; overwrite).
871
+ No per-service namespacing — there is one trace set; the owning service is carried in each
872
+ row's `@trace.service`.
873
+
874
+ **Legacy (no `spec_source` — per-service trace):**
875
+ Copy each just-updated `{UC-ID}.tsv` → `{panel_mirror}/{service-name}/{UC-ID}.tsv`
876
+ (namespaced by `active_service`).
866
877
 
867
878
  This keeps the open workspace's Living Docs panel current **between syncs** — it is a
868
- **local convenience mirror only**. The *canonical* report in the spec module
869
- (`{spec_source}/.living-docs/`) and the merged `trace-report.json` are rebuilt by
870
- `/sync` or `/validate-traces` (those need every service's data, so a single per-UC
871
- command cannot produce them). For orchestrated commands, do this once in the orchestrator
872
- after all sub-agents return — not inside each sub-agent.
879
+ **local convenience mirror only**. The merged `trace-report.json` (canonical, in
880
+ `{spec_source}/.living-docs/`) is rebuilt by `/sync` or `/validate-traces`. For orchestrated
881
+ commands, do this once in the orchestrator after all sub-agents return — not inside each
882
+ sub-agent.
873
883
 
874
884
 
875
885
  ---
@@ -898,6 +908,36 @@ Output Artifacts:
898
908
 
899
909
  If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
900
910
 
911
+ ## Pipeline Position
912
+
913
+ Print a one-line map of the pipeline with the CURRENT command's phase marked `◀ bạn ở đây`,
914
+ so the user always sees where this command sits in the end-to-end flow:
915
+
916
+ ```
917
+ Discovery → PRD → [Design Spec] → BDD → Tech Design → Code → Dev Self-Check → QC → Trace Audit
918
+ ```
919
+
920
+ Find the current command in this phase legend and mark **its** phase in the map above:
921
+
922
+ | Phase | Commands |
923
+ |-------|----------|
924
+ | Discovery | `/define-product` |
925
+ | PRD | `/generate-prd` · `/refine-prd` · `/review-context` (PRD) |
926
+ | Design Spec | `/generate-design-spec` |
927
+ | BDD | `/generate-bdd` · `/review-context` (BDD) |
928
+ | Tech Design | `/generate-tech-docs` · `/map-testids` · `/review-tech-docs` |
929
+ | Code | `/generate-code` · `/review-code` |
930
+ | Dev Self-Check | `/dev-gen-test` · `/dev-run-test` · `/dev-smoke-test` |
931
+ | QC | `/qc-analyze` · `/qc-plan` · `/qc-design-test` · `/qc-review` · `/qc-run-test` · `/qc-report` |
932
+ | Trace Audit | `/validate-traces` |
933
+
934
+ For a **review command**, also append the 3-step review loop with the current step marked, e.g.:
935
+ `Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume`.
936
+
937
+ **Cross-cutting commands** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
938
+ `/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) sit outside the linear pipeline —
939
+ **omit the Pipeline line entirely** for these (do not force-fit them onto the map).
940
+
901
941
  ## Next Command Suggestion
902
942
 
903
943
  Suggest the logical next command based on workflow phase:
@@ -939,10 +979,13 @@ Suggest the logical next command based on workflow phase:
939
979
  Format the footer as:
940
980
  ```
941
981
  ---
942
- Status : {badge}
982
+ Status : {badge}
943
983
  {Output Artifacts block}
944
- Next : {suggested command with example arguments}
984
+ Pipeline : Discovery PRD [BDD ◀ bạn ở đây] → Tech Design → Code → Dev Self-Check → QC → Trace Audit
985
+ (review cmd) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
986
+ Next : {suggested command with example arguments}
945
987
  ```
988
+ *(Omit the `Pipeline` line for cross-cutting commands listed above.)*
946
989
 
947
990
 
948
991
  ```
@@ -172,7 +172,7 @@ If `services` section is present:
172
172
  - If `$ARGUMENTS` contains a path, extract the segment after `prd_dir`
173
173
 
174
174
  **2. Route to service** — if active domain matches a key in `services`:
175
- - Override `paths.specs_dir` → `services.{domain}.specs_dir`
175
+ - 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.
176
176
  - 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.
177
177
  - Store `active_service` = `services.{domain}.path`
178
178
  - Store `active_service_module` = `services.{domain}.module`
@@ -183,6 +183,7 @@ If `services` section is present:
183
183
  - Set `active_service = unresolved`
184
184
 
185
185
  **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
186
+ - 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`.)*
186
187
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
187
188
  - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
188
189
  - 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.)*
@@ -192,8 +193,9 @@ If `services` section is present:
192
193
  - Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
193
194
  - Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
194
195
  - Override `paths.prd_change_requests_dir` → `{spec_source}/feedback/prd-change-requests`
196
+ - 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`.)*
195
197
 
196
- > **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.
198
+ > **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.
197
199
 
198
200
  ---
199
201
 
@@ -213,12 +215,12 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
213
215
  |----------|--------|
214
216
  | `conventions.test_command` | service's `conventions.test_command` |
215
217
  | `conventions.build_command` | service's `conventions.build_command` |
216
- | `paths.trace_dir` | `{active_service}/{service paths.trace_dir}` default: `{active_service}/.trace` |
217
- | `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
218
+ | `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`). |
219
+ | `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. |
218
220
 
219
221
  **3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
220
222
  - Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
221
- - File write operations (test files, trace TSVs) use paths **relative to** `service_root`
223
+ - **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/`).
222
224
 
223
225
  **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).
224
226
 
@@ -564,7 +566,7 @@ the Living Docs report at the spec module (via `/sync` + `/validate-traces`). Th
564
566
  files themselves stay in the service — only the run *status* is reported.
565
567
 
566
568
  Update `{paths.trace_dir}/{UC-ID}.tsv` — for each scenario row (matched by `sc_id` via its
567
- test's `@trace.verifies={UC-ID}-SC{N}` tag):
569
+ test's `@trace.verifies={UC-ID}-SC{N}` tag). *(Umbrella + `spec_source`: `trace_dir` is `{spec_source}/.trace` — tests run from `service_root` but the `dev_selftest` update writes into the **spec repo**; commit/push the spec submodule for it.)*
568
570
 
569
571
  | Column | Value |
570
572
  |--------|-------|
@@ -581,21 +583,29 @@ signals. `dev_selftest`/`dev_selftest_at` are also orthogonal to `status`
581
583
  # Refresh Living Docs panel mirror *(local, umbrella mode)*
582
584
 
583
585
  *Skip entirely in single-service mode (no `services` and no `setup.spec_source`) — there
584
- the service `.trace/` IS the panel location, so nothing to mirror.*
586
+ the repo's own `.trace/` IS the panel location, so nothing to mirror.*
585
587
 
586
- After updating the authoritative service TSV(s) at `{paths.trace_dir}`:
588
+ After updating the authoritative TSV(s) at `{paths.trace_dir}`:
587
589
 
588
- 1. Resolve `panel_mirror = ./.trace` at the **current workspace root** (where this command runs).
590
+ **When `setup.spec_source` is set (consolidated trace the common case):**
591
+ `{paths.trace_dir}` resolves to `{spec_source}/.trace` — the single authoritative location.
592
+ This command runs from `service_root`, so the write is **cross-repo into the spec submodule**;
593
+ commit/push the spec submodule for the trace update (same as `feedback/`).
594
+ 1. Resolve `panel_mirror = ./.trace` at the **current workspace root**.
589
595
  2. If `panel_mirror` resolves to a different path than `{paths.trace_dir}`, copy each
590
- just-updated `{UC-ID}.tsv` → `{panel_mirror}/{service-name}/{UC-ID}.tsv`
591
- (create the dir; overwrite). Use `active_service` for `{service-name}`.
596
+ just-updated `{UC-ID}.tsv` → `{panel_mirror}/{UC-ID}.tsv` (create the dir; overwrite).
597
+ No per-service namespacing — there is one trace set; the owning service is carried in each
598
+ row's `@trace.service`.
599
+
600
+ **Legacy (no `spec_source` — per-service trace):**
601
+ Copy each just-updated `{UC-ID}.tsv` → `{panel_mirror}/{service-name}/{UC-ID}.tsv`
602
+ (namespaced by `active_service`).
592
603
 
593
604
  This keeps the open workspace's Living Docs panel current **between syncs** — it is a
594
- **local convenience mirror only**. The *canonical* report in the spec module
595
- (`{spec_source}/.living-docs/`) and the merged `trace-report.json` are rebuilt by
596
- `/sync` or `/validate-traces` (those need every service's data, so a single per-UC
597
- command cannot produce them). For orchestrated commands, do this once in the orchestrator
598
- after all sub-agents return — not inside each sub-agent.
605
+ **local convenience mirror only**. The merged `trace-report.json` (canonical, in
606
+ `{spec_source}/.living-docs/`) is rebuilt by `/sync` or `/validate-traces`. For orchestrated
607
+ commands, do this once in the orchestrator after all sub-agents return — not inside each
608
+ sub-agent.
599
609
 
600
610
 
601
611
  ## Output
@@ -622,6 +632,36 @@ Output Artifacts:
622
632
 
623
633
  If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
624
634
 
635
+ ## Pipeline Position
636
+
637
+ Print a one-line map of the pipeline with the CURRENT command's phase marked `◀ bạn ở đây`,
638
+ so the user always sees where this command sits in the end-to-end flow:
639
+
640
+ ```
641
+ Discovery → PRD → [Design Spec] → BDD → Tech Design → Code → Dev Self-Check → QC → Trace Audit
642
+ ```
643
+
644
+ Find the current command in this phase legend and mark **its** phase in the map above:
645
+
646
+ | Phase | Commands |
647
+ |-------|----------|
648
+ | Discovery | `/define-product` |
649
+ | PRD | `/generate-prd` · `/refine-prd` · `/review-context` (PRD) |
650
+ | Design Spec | `/generate-design-spec` |
651
+ | BDD | `/generate-bdd` · `/review-context` (BDD) |
652
+ | Tech Design | `/generate-tech-docs` · `/map-testids` · `/review-tech-docs` |
653
+ | Code | `/generate-code` · `/review-code` |
654
+ | Dev Self-Check | `/dev-gen-test` · `/dev-run-test` · `/dev-smoke-test` |
655
+ | QC | `/qc-analyze` · `/qc-plan` · `/qc-design-test` · `/qc-review` · `/qc-run-test` · `/qc-report` |
656
+ | Trace Audit | `/validate-traces` |
657
+
658
+ For a **review command**, also append the 3-step review loop with the current step marked, e.g.:
659
+ `Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume`.
660
+
661
+ **Cross-cutting commands** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
662
+ `/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) sit outside the linear pipeline —
663
+ **omit the Pipeline line entirely** for these (do not force-fit them onto the map).
664
+
625
665
  ## Next Command Suggestion
626
666
 
627
667
  Suggest the logical next command based on workflow phase:
@@ -663,10 +703,13 @@ Suggest the logical next command based on workflow phase:
663
703
  Format the footer as:
664
704
  ```
665
705
  ---
666
- Status : {badge}
706
+ Status : {badge}
667
707
  {Output Artifacts block}
668
- Next : {suggested command with example arguments}
708
+ Pipeline : Discovery PRD [BDD ◀ bạn ở đây] → Tech Design → Code → Dev Self-Check → QC → Trace Audit
709
+ (review cmd) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
710
+ Next : {suggested command with example arguments}
669
711
  ```
712
+ *(Omit the `Pipeline` line for cross-cutting commands listed above.)*
670
713
 
671
714
 
672
715
  ```
@@ -168,7 +168,7 @@ If `services` section is present:
168
168
  - If `$ARGUMENTS` contains a path, extract the segment after `prd_dir`
169
169
 
170
170
  **2. Route to service** — if active domain matches a key in `services`:
171
- - Override `paths.specs_dir` → `services.{domain}.specs_dir`
171
+ - 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.
172
172
  - 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.
173
173
  - Store `active_service` = `services.{domain}.path`
174
174
  - Store `active_service_module` = `services.{domain}.module`
@@ -179,6 +179,7 @@ If `services` section is present:
179
179
  - Set `active_service = unresolved`
180
180
 
181
181
  **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
182
+ - 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`.)*
182
183
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
183
184
  - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
184
185
  - 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 +189,9 @@ If `services` section is present:
188
189
  - Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
189
190
  - Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
190
191
  - Override `paths.prd_change_requests_dir` → `{spec_source}/feedback/prd-change-requests`
192
+ - 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
193
 
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.
194
+ > **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
195
 
194
196
  ---
195
197
 
@@ -209,12 +211,12 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
209
211
  |----------|--------|
210
212
  | `conventions.test_command` | service's `conventions.test_command` |
211
213
  | `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) |
214
+ | `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`). |
215
+ | `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
216
 
215
217
  **3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
216
218
  - 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`
219
+ - **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
220
 
219
221
  **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
222
 
@@ -604,6 +606,36 @@ Output Artifacts:
604
606
 
605
607
  If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
606
608
 
609
+ ## Pipeline Position
610
+
611
+ Print a one-line map of the pipeline with the CURRENT command's phase marked `◀ bạn ở đây`,
612
+ so the user always sees where this command sits in the end-to-end flow:
613
+
614
+ ```
615
+ Discovery → PRD → [Design Spec] → BDD → Tech Design → Code → Dev Self-Check → QC → Trace Audit
616
+ ```
617
+
618
+ Find the current command in this phase legend and mark **its** phase in the map above:
619
+
620
+ | Phase | Commands |
621
+ |-------|----------|
622
+ | Discovery | `/define-product` |
623
+ | PRD | `/generate-prd` · `/refine-prd` · `/review-context` (PRD) |
624
+ | Design Spec | `/generate-design-spec` |
625
+ | BDD | `/generate-bdd` · `/review-context` (BDD) |
626
+ | Tech Design | `/generate-tech-docs` · `/map-testids` · `/review-tech-docs` |
627
+ | Code | `/generate-code` · `/review-code` |
628
+ | Dev Self-Check | `/dev-gen-test` · `/dev-run-test` · `/dev-smoke-test` |
629
+ | QC | `/qc-analyze` · `/qc-plan` · `/qc-design-test` · `/qc-review` · `/qc-run-test` · `/qc-report` |
630
+ | Trace Audit | `/validate-traces` |
631
+
632
+ For a **review command**, also append the 3-step review loop with the current step marked, e.g.:
633
+ `Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume`.
634
+
635
+ **Cross-cutting commands** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
636
+ `/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) sit outside the linear pipeline —
637
+ **omit the Pipeline line entirely** for these (do not force-fit them onto the map).
638
+
607
639
  ## Next Command Suggestion
608
640
 
609
641
  Suggest the logical next command based on workflow phase:
@@ -645,10 +677,13 @@ Suggest the logical next command based on workflow phase:
645
677
  Format the footer as:
646
678
  ```
647
679
  ---
648
- Status : {badge}
680
+ Status : {badge}
649
681
  {Output Artifacts block}
650
- Next : {suggested command with example arguments}
682
+ Pipeline : Discovery PRD [BDD ◀ bạn ở đây] → Tech Design → Code → Dev Self-Check → QC → Trace Audit
683
+ (review cmd) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
684
+ Next : {suggested command with example arguments}
651
685
  ```
686
+ *(Omit the `Pipeline` line for cross-cutting commands listed above.)*
652
687
 
653
688
 
654
689
  ```
@@ -166,7 +166,7 @@ If `services` section is present:
166
166
  - If `$ARGUMENTS` contains a path, extract the segment after `prd_dir`
167
167
 
168
168
  **2. Route to service** — if active domain matches a key in `services`:
169
- - Override `paths.specs_dir` → `services.{domain}.specs_dir`
169
+ - 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
170
  - 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
171
  - Store `active_service` = `services.{domain}.path`
172
172
  - Store `active_service_module` = `services.{domain}.module`
@@ -177,6 +177,7 @@ If `services` section is present:
177
177
  - Set `active_service = unresolved`
178
178
 
179
179
  **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
180
+ - 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
181
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
181
182
  - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
182
183
  - 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.)*
@@ -186,8 +187,9 @@ If `services` section is present:
186
187
  - Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
187
188
  - Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
188
189
  - Override `paths.prd_change_requests_dir` → `{spec_source}/feedback/prd-change-requests`
190
+ - 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`.)*
189
191
 
190
- > **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.
192
+ > **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.
191
193
 
192
194
  ---
193
195
 
@@ -207,12 +209,12 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
207
209
  |----------|--------|
208
210
  | `conventions.test_command` | service's `conventions.test_command` |
209
211
  | `conventions.build_command` | service's `conventions.build_command` |
210
- | `paths.trace_dir` | `{active_service}/{service paths.trace_dir}` default: `{active_service}/.trace` |
211
- | `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
212
+ | `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`). |
213
+ | `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. |
212
214
 
213
215
  **3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
214
216
  - Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
215
- - File write operations (test files, trace TSVs) use paths **relative to** `service_root`
217
+ - **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/`).
216
218
 
217
219
  **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).
218
220
 
@@ -639,6 +641,36 @@ Output Artifacts:
639
641
 
640
642
  If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
641
643
 
644
+ ## Pipeline Position
645
+
646
+ Print a one-line map of the pipeline with the CURRENT command's phase marked `◀ bạn ở đây`,
647
+ so the user always sees where this command sits in the end-to-end flow:
648
+
649
+ ```
650
+ Discovery → PRD → [Design Spec] → BDD → Tech Design → Code → Dev Self-Check → QC → Trace Audit
651
+ ```
652
+
653
+ Find the current command in this phase legend and mark **its** phase in the map above:
654
+
655
+ | Phase | Commands |
656
+ |-------|----------|
657
+ | Discovery | `/define-product` |
658
+ | PRD | `/generate-prd` · `/refine-prd` · `/review-context` (PRD) |
659
+ | Design Spec | `/generate-design-spec` |
660
+ | BDD | `/generate-bdd` · `/review-context` (BDD) |
661
+ | Tech Design | `/generate-tech-docs` · `/map-testids` · `/review-tech-docs` |
662
+ | Code | `/generate-code` · `/review-code` |
663
+ | Dev Self-Check | `/dev-gen-test` · `/dev-run-test` · `/dev-smoke-test` |
664
+ | QC | `/qc-analyze` · `/qc-plan` · `/qc-design-test` · `/qc-review` · `/qc-run-test` · `/qc-report` |
665
+ | Trace Audit | `/validate-traces` |
666
+
667
+ For a **review command**, also append the 3-step review loop with the current step marked, e.g.:
668
+ `Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume`.
669
+
670
+ **Cross-cutting commands** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
671
+ `/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) sit outside the linear pipeline —
672
+ **omit the Pipeline line entirely** for these (do not force-fit them onto the map).
673
+
642
674
  ## Next Command Suggestion
643
675
 
644
676
  Suggest the logical next command based on workflow phase:
@@ -680,10 +712,13 @@ Suggest the logical next command based on workflow phase:
680
712
  Format the footer as:
681
713
  ```
682
714
  ---
683
- Status : {badge}
715
+ Status : {badge}
684
716
  {Output Artifacts block}
685
- Next : {suggested command with example arguments}
717
+ Pipeline : Discovery PRD [BDD ◀ bạn ở đây] → Tech Design → Code → Dev Self-Check → QC → Trace Audit
718
+ (review cmd) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
719
+ Next : {suggested command with example arguments}
686
720
  ```
721
+ *(Omit the `Pipeline` line for cross-cutting commands listed above.)*
687
722
 
688
723
 
689
724
  ```