@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
@@ -173,7 +173,7 @@ If `services` section is present:
173
173
  - If `$ARGUMENTS` contains a path, extract the segment after `prd_dir`
174
174
 
175
175
  **2. Route to service** — if active domain matches a key in `services`:
176
- - 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.
177
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.
178
178
  - Store `active_service` = `services.{domain}.path`
179
179
  - Store `active_service_module` = `services.{domain}.module`
@@ -184,6 +184,7 @@ If `services` section is present:
184
184
  - Set `active_service = unresolved`
185
185
 
186
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`.)*
187
188
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
188
189
  - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
189
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.)*
@@ -193,8 +194,9 @@ If `services` section is present:
193
194
  - Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
194
195
  - Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
195
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`.)*
196
198
 
197
- > **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.
198
200
 
199
201
  ---
200
202
 
@@ -214,12 +216,12 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
214
216
  |----------|--------|
215
217
  | `conventions.test_command` | service's `conventions.test_command` |
216
218
  | `conventions.build_command` | service's `conventions.build_command` |
217
- | `paths.trace_dir` | `{active_service}/{service paths.trace_dir}` default: `{active_service}/.trace` |
218
- | `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. |
219
221
 
220
222
  **3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
221
223
  - Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
222
- - 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/`).
223
225
 
224
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).
225
227
 
@@ -793,6 +795,36 @@ Output Artifacts:
793
795
 
794
796
  If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
795
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
+
796
828
  ## Next Command Suggestion
797
829
 
798
830
  Suggest the logical next command based on workflow phase:
@@ -834,10 +866,13 @@ Suggest the logical next command based on workflow phase:
834
866
  Format the footer as:
835
867
  ```
836
868
  ---
837
- Status : {badge}
869
+ Status : {badge}
838
870
  {Output Artifacts block}
839
- 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}
840
874
  ```
875
+ *(Omit the `Pipeline` line for cross-cutting commands listed above.)*
841
876
 
842
877
 
843
878
  ```
@@ -170,7 +170,7 @@ If `services` section is present:
170
170
  - If `$ARGUMENTS` contains a path, extract the segment after `prd_dir`
171
171
 
172
172
  **2. Route to service** — if active domain matches a key in `services`:
173
- - 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.
174
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.
175
175
  - Store `active_service` = `services.{domain}.path`
176
176
  - Store `active_service_module` = `services.{domain}.module`
@@ -181,6 +181,7 @@ If `services` section is present:
181
181
  - Set `active_service = unresolved`
182
182
 
183
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`.)*
184
185
  - Override `paths.prd_dir` → `{spec_source}/specs/prd`
185
186
  - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
186
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.)*
@@ -190,8 +191,9 @@ If `services` section is present:
190
191
  - Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
191
192
  - Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
192
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`.)*
193
195
 
194
- > **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.
195
197
 
196
198
  ---
197
199
 
@@ -211,12 +213,12 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
211
213
  |----------|--------|
212
214
  | `conventions.test_command` | service's `conventions.test_command` |
213
215
  | `conventions.build_command` | service's `conventions.build_command` |
214
- | `paths.trace_dir` | `{active_service}/{service paths.trace_dir}` default: `{active_service}/.trace` |
215
- | `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. |
216
218
 
217
219
  **3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
218
220
  - Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
219
- - 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/`).
220
222
 
221
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).
222
224
 
@@ -628,6 +630,36 @@ Output Artifacts:
628
630
 
629
631
  If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
630
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
+
631
663
  ## Next Command Suggestion
632
664
 
633
665
  Suggest the logical next command based on workflow phase:
@@ -669,10 +701,13 @@ Suggest the logical next command based on workflow phase:
669
701
  Format the footer as:
670
702
  ```
671
703
  ---
672
- Status : {badge}
704
+ Status : {badge}
673
705
  {Output Artifacts block}
674
- 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}
675
709
  ```
710
+ *(Omit the `Pipeline` line for cross-cutting commands listed above.)*
676
711
 
677
712
 
678
713
  ```
@@ -733,8 +768,9 @@ Edit the tech-doc file directly:
733
768
 
734
769
  Write both changes to the file.
735
770
 
736
- Then update `{paths.trace_dir}/{UC-ID}.tsv`:
737
- - 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).
738
774
  - Set `last_updated` to today's date (`YYYY-MM-DD`) for all rows of this UC.
739
775
 
740
776
  Print the report after all file writes are complete.
@@ -285,8 +285,9 @@ Edit the tech-doc file directly:
285
285
 
286
286
  Write both changes to the file.
287
287
 
288
- Then update `{paths.trace_dir}/{UC-ID}.tsv`:
289
- - Set `tech_doc_revision` column to the new `@trace.revision` integer for all rows of this UC.
288
+ Then update `{paths.trace_dir}/{UC-ID}.tsv` — pick the column by which tech-doc was reviewed (read the filename):
289
+ - **BE contract** (`{UC-ID}-tech-design.md`) → set `tech_doc_revision` to the new `@trace.revision` integer for all rows of this UC.
290
+ - **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).
290
291
  - Set `last_updated` to today's date (`YYYY-MM-DD`) for all rows of this UC.
291
292
 
292
293
  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
  ```
@@ -85,8 +85,8 @@ Create these directories (skip if they exist):
85
85
  | project_type | Create | Skip |
86
86
  |---|---|---|
87
87
  | **1 — Single-service** | Full structure above | — |
88
- | **2 — Umbrella** | `.agent/review/` only (at umbrella root) | Everything else — `specs/` dirs live inside service submodules |
89
- | **3 — PO Spec repo** | `specs/prd/`, `specs/design-spec/`, `specs/product-definition/`, `specs/domain-knowledge/`, `.agent/review/` | `specs/bdd/`, `specs/tech-docs/`, `.trace/` |
88
+ | **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/`** |
89
+ | **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) |
90
90
 
91
91
  ## Step 2 — Create CLAUDE.md
92
92
 
package/commands/sync.md CHANGED
@@ -324,6 +324,36 @@ Output Artifacts:
324
324
 
325
325
  If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
326
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
+
327
357
  ## Next Command Suggestion
328
358
 
329
359
  Suggest the logical next command based on workflow phase:
@@ -365,10 +395,13 @@ Suggest the logical next command based on workflow phase:
365
395
  Format the footer as:
366
396
  ```
367
397
  ---
368
- Status : {badge}
398
+ Status : {badge}
369
399
  {Output Artifacts block}
370
- 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}
371
403
  ```
404
+ *(Omit the `Pipeline` line for cross-cutting commands listed above.)*
372
405
 
373
406
 
374
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
  ```