@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.
- package/commands/debug.md +42 -7
- package/commands/define-product.md +42 -7
- package/commands/dev-gen-test.md +60 -17
- package/commands/dev-run-test.md +61 -18
- package/commands/dev-run-test.tmpl +1 -1
- package/commands/dev-smoke-test.md +42 -7
- package/commands/fix-bug.md +42 -7
- package/commands/generate-bdd.md +67 -21
- package/commands/generate-bdd.tmpl +7 -4
- package/commands/generate-code.md +113 -35
- package/commands/generate-code.tmpl +53 -18
- package/commands/generate-design-spec.md +42 -7
- package/commands/generate-prd.md +42 -7
- package/commands/generate-spec-manifest.md +42 -7
- package/commands/generate-tech-docs.md +229 -20
- package/commands/generate-tech-docs.tmpl +187 -13
- package/commands/learn.md +42 -7
- package/commands/map-testids.md +564 -0
- package/commands/map-testids.tmpl +81 -0
- package/commands/propose-scenario.md +42 -7
- package/commands/qc-analyze.md +42 -7
- package/commands/qc-design-test.md +44 -8
- package/commands/qc-design-test.tmpl +2 -1
- package/commands/qc-plan.md +42 -7
- package/commands/qc-report.md +42 -7
- package/commands/qc-review.md +42 -7
- package/commands/qc-run-test.md +62 -18
- package/commands/qc-run-test.tmpl +2 -1
- package/commands/refine-prd.md +42 -7
- package/commands/report-bug.md +42 -7
- package/commands/review-code.md +42 -7
- package/commands/review-context.md +42 -7
- package/commands/review-tech-docs.md +45 -9
- package/commands/review-tech-docs.tmpl +3 -2
- package/commands/setup-ai-first.md +37 -4
- package/commands/setup-ai-first.tmpl +2 -2
- package/commands/sync.md +35 -2
- package/commands/update-framework.md +35 -2
- package/commands/validate-traces.md +85 -40
- package/commands/validate-traces.tmpl +43 -33
- package/core/FRAMEWORK_VERSION +1 -1
- package/core/commands/debug.md +42 -7
- package/core/commands/define-product.md +42 -7
- package/core/commands/dev-gen-test.md +60 -17
- package/core/commands/dev-run-test.md +61 -18
- package/core/commands/dev-smoke-test.md +42 -7
- package/core/commands/fix-bug.md +42 -7
- package/core/commands/generate-bdd.md +67 -21
- package/core/commands/generate-code.md +113 -35
- package/core/commands/generate-design-spec.md +42 -7
- package/core/commands/generate-prd.md +42 -7
- package/core/commands/generate-spec-manifest.md +42 -7
- package/core/commands/generate-tech-docs.md +229 -20
- package/core/commands/learn.md +42 -7
- package/core/commands/map-testids.md +564 -0
- package/core/commands/propose-scenario.md +42 -7
- package/core/commands/qc-analyze.md +42 -7
- package/core/commands/qc-design-test.md +44 -8
- package/core/commands/qc-plan.md +42 -7
- package/core/commands/qc-report.md +42 -7
- package/core/commands/qc-review.md +42 -7
- package/core/commands/qc-run-test.md +62 -18
- package/core/commands/refine-prd.md +42 -7
- package/core/commands/report-bug.md +42 -7
- package/core/commands/review-code.md +42 -7
- package/core/commands/review-context.md +42 -7
- package/core/commands/review-tech-docs.md +45 -9
- package/core/commands/setup-ai-first.md +37 -4
- package/core/commands/sync.md +35 -2
- package/core/commands/update-framework.md +35 -2
- package/core/commands/validate-traces.md +85 -40
- package/core/modules/qc-playwright/stack-profile.yaml +1 -0
- package/core/skills/code/SKILL.md +77 -9
- package/core/skills/debug/SKILL.md +112 -11
- package/core/skills/design-spec/SKILL.md +42 -7
- package/core/skills/discovery/SKILL.md +42 -7
- package/core/skills/prd/SKILL.md +70 -4
- package/core/skills/setup-ai-first/SKILL.md +35 -2
- package/core/skills/spec/SKILL.md +70 -4
- package/core/skills/test/SKILL.md +119 -16
- package/core/steps/context-loader.md +7 -5
- package/core/steps/report-footer.md +35 -2
- package/core/steps/trace-mirror.md +18 -10
- package/core/templates/project-context.yaml +8 -5
- package/docs/01-getting-started/core-concepts.md +7 -7
- package/docs/01-getting-started/installation.md +2 -2
- package/docs/01-getting-started/quickstart.md +1 -1
- package/docs/02-guides/README.md +1 -2
- package/docs/02-guides/developer/README.md +1 -1
- package/docs/02-guides/developer/bdd-and-trace.md +10 -8
- package/docs/02-guides/developer/commands.md +3 -3
- package/docs/02-guides/developer/scenarios.md +26 -14
- package/docs/02-guides/developer/workflow.md +80 -20
- package/docs/02-guides/product-owner/README.md +6 -4
- package/docs/02-guides/product-owner/commands.md +1 -1
- package/docs/02-guides/product-owner/scenarios.md +80 -1
- package/docs/02-guides/tester/README.md +12 -11
- package/docs/02-guides/tester/bug-reporting.md +1 -1
- package/docs/02-guides/{qc-automation.md → tester/qc-automation.md} +14 -6
- package/docs/02-guides/tester/reading-specs.md +4 -4
- package/docs/02-guides/tester/scenarios.md +5 -5
- package/docs/02-guides/tester/spec-manifest.md +17 -12
- package/docs/02-guides/tester/test-checklist.md +3 -3
- package/docs/02-guides/tester/workflow.md +8 -11
- package/docs/03-concepts/architecture.md +5 -4
- package/docs/03-concepts/pipeline.md +18 -6
- package/docs/03-concepts/traceability.md +17 -17
- package/docs/04-operations/README.md +1 -1
- package/docs/04-operations/bug-flow.md +4 -4
- package/docs/04-operations/sync-and-update.md +163 -38
- package/docs/05-reference/README.md +3 -0
- package/docs/05-reference/command-cheatsheet.md +147 -0
- package/docs/05-reference/commands.md +72 -69
- package/docs/05-reference/modules.md +2 -2
- package/docs/05-reference/trace-schema.md +15 -14
- package/docs/README.md +3 -5
- package/modules/qc-playwright/stack-profile.yaml +1 -0
- package/package.json +1 -1
- package/skills/code/SKILL.md +77 -9
- package/skills/debug/SKILL.md +112 -11
- package/skills/design-spec/SKILL.md +42 -7
- package/skills/discovery/SKILL.md +42 -7
- package/skills/prd/SKILL.md +70 -4
- package/skills/setup-ai-first/SKILL.md +35 -2
- package/skills/spec/SKILL.md +70 -4
- package/skills/test/SKILL.md +119 -16
- package/steps/context-loader.md +7 -5
- package/steps/report-footer.md +35 -2
- package/steps/trace-mirror.md +18 -10
- package/templates/project-context.yaml +8 -5
package/commands/fix-bug.md
CHANGED
|
@@ -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)**,
|
|
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}`
|
|
211
|
-
| `paths.specs_dir` | `{active_service}/{service paths.specs_dir}`
|
|
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
|
-
-
|
|
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
|
|
715
|
+
Status : {badge}
|
|
684
716
|
{Output Artifacts block}
|
|
685
|
-
|
|
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
|
```
|
package/commands/generate-bdd.md
CHANGED
|
@@ -164,7 +164,7 @@ If `services` section is present:
|
|
|
164
164
|
- If `$ARGUMENTS` contains a path, extract the segment after `prd_dir`
|
|
165
165
|
|
|
166
166
|
**2. Route to service** — if active domain matches a key in `services`:
|
|
167
|
-
- Override `paths.specs_dir` → `services.{domain}.specs_dir`
|
|
167
|
+
- 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.
|
|
168
168
|
- 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.
|
|
169
169
|
- Store `active_service` = `services.{domain}.path`
|
|
170
170
|
- Store `active_service_module` = `services.{domain}.module`
|
|
@@ -175,6 +175,7 @@ If `services` section is present:
|
|
|
175
175
|
- Set `active_service = unresolved`
|
|
176
176
|
|
|
177
177
|
**4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
|
|
178
|
+
- 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`.)*
|
|
178
179
|
- Override `paths.prd_dir` → `{spec_source}/specs/prd`
|
|
179
180
|
- Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
|
|
180
181
|
- 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.)*
|
|
@@ -184,8 +185,9 @@ If `services` section is present:
|
|
|
184
185
|
- Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
|
|
185
186
|
- Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
|
|
186
187
|
- Override `paths.prd_change_requests_dir` → `{spec_source}/feedback/prd-change-requests`
|
|
188
|
+
- 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`.)*
|
|
187
189
|
|
|
188
|
-
> **Why under `spec_source`:** PRD, design-spec, domain knowledge, the **API contract (tech-docs)**,
|
|
190
|
+
> **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.
|
|
189
191
|
|
|
190
192
|
---
|
|
191
193
|
|
|
@@ -205,12 +207,12 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
|
|
|
205
207
|
|----------|--------|
|
|
206
208
|
| `conventions.test_command` | service's `conventions.test_command` |
|
|
207
209
|
| `conventions.build_command` | service's `conventions.build_command` |
|
|
208
|
-
| `paths.trace_dir` | `{active_service}/{service paths.trace_dir}`
|
|
209
|
-
| `paths.specs_dir` | `{active_service}/{service paths.specs_dir}`
|
|
210
|
+
| `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`). |
|
|
211
|
+
| `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. |
|
|
210
212
|
|
|
211
213
|
**3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
|
|
212
214
|
- Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
|
|
213
|
-
-
|
|
215
|
+
- **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/`).
|
|
214
216
|
|
|
215
217
|
**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).
|
|
216
218
|
|
|
@@ -837,17 +839,19 @@ Feature: <Feature name>
|
|
|
837
839
|
|
|
838
840
|
After generating all `.feature` files, create or update `{paths.trace_dir}/{UC-ID}.tsv` for each UC.
|
|
839
841
|
|
|
842
|
+
> **Umbrella + `spec_source`:** both the `.feature` files **and** the trace `.tsv` write to the **spec repo** (`{spec_source}/specs/bdd/…` and `{spec_source}/.trace/…`, resolved by context-loader) — a **single-repo** write, committed/pushed to the spec submodule. (Trace is consolidated in the spec repo so the PM manages all status in one place; code-side commands update it cross-repo later.)
|
|
843
|
+
|
|
840
844
|
**TSV columns (tab-separated, one header row + one data row per scenario):**
|
|
841
845
|
```
|
|
842
|
-
sc_id\tsc_title\tspec_ver\tgen_ver\timplemented_by\ttest_count\ttest_classes\tdev_selftest\tdev_selftest_at\tqc_status\tqc_run_at\tqc_owner\tqc_blocked_by\tprd_version\tbdd_version\ttech_doc_revision\tprd_status\tuc_status\tfe_phase\tstatus\tlast_updated
|
|
846
|
+
sc_id\tsc_title\tspec_ver\tgen_ver\timplemented_by\ttest_count\ttest_classes\tdev_selftest\tdev_selftest_at\tqc_status\tqc_run_at\tqc_owner\tqc_blocked_by\tprd_version\tbdd_version\ttech_doc_revision\tfe_tech_doc_revision\tprd_status\tuc_status\tfe_phase\tstatus\tlast_updated
|
|
843
847
|
```
|
|
844
848
|
|
|
845
849
|
**Rules:**
|
|
846
850
|
- If file does not exist → create with header row + all scenario rows.
|
|
847
851
|
- If file exists (re-generation) → for each SC in the new `.feature`:
|
|
848
852
|
- SC already in `.tsv` AND `spec_ver` is unchanged → update only: `sc_title`, `prd_version`, `bdd_version`, `prd_status`, `uc_status`, `last_updated`. Leave all other columns unchanged.
|
|
849
|
-
- SC already in `.tsv` AND `spec_ver` changed (scenario was modified) → update: `sc_title`, `spec_ver`, `prd_version`, `bdd_version`, `prd_status`, `uc_status`, `last_updated` AND set `status = DRIFT` immediately (so the TSV reflects drift without waiting for `/validate-traces`). Leave `gen_ver`, `implemented_by`, `test_count`, `test_classes`, `tech_doc_revision` unchanged.
|
|
850
|
-
- SC is new (added in this re-gen) → append new row with `gen_ver`, `implemented_by`, `test_count`, `test_classes`, `dev_selftest`, `dev_selftest_at`, `qc_status`, `qc_run_at`, `qc_owner`, `qc_blocked_by`, `tech_doc_revision` all set to `—`.
|
|
853
|
+
- SC already in `.tsv` AND `spec_ver` changed (scenario was modified) → update: `sc_title`, `spec_ver`, `prd_version`, `bdd_version`, `prd_status`, `uc_status`, `last_updated` AND set `status = DRIFT` immediately (so the TSV reflects drift without waiting for `/validate-traces`). Leave `gen_ver`, `implemented_by`, `test_count`, `test_classes`, `tech_doc_revision`, `fe_tech_doc_revision` unchanged.
|
|
854
|
+
- SC is new (added in this re-gen) → append new row with `gen_ver`, `implemented_by`, `test_count`, `test_classes`, `dev_selftest`, `dev_selftest_at`, `qc_status`, `qc_run_at`, `qc_owner`, `qc_blocked_by`, `tech_doc_revision`, `fe_tech_doc_revision` all set to `—`.
|
|
851
855
|
- SC no longer in `.feature` (removed) → delete its row.
|
|
852
856
|
|
|
853
857
|
**Values to write for each scenario:**
|
|
@@ -869,7 +873,8 @@ sc_id\tsc_title\tspec_ver\tgen_ver\timplemented_by\ttest_count\ttest_classes\tde
|
|
|
869
873
|
| `qc_blocked_by` | `—` (linked `BUG-{id}` / `GAP-{id}` — set by `/qc-run-test` + `/report-bug`) |
|
|
870
874
|
| `prd_version` | `@trace.prd_version` from `.feature` header |
|
|
871
875
|
| `bdd_version` | `@trace.bdd_version` from `.feature` header |
|
|
872
|
-
| `tech_doc_revision` | `—` |
|
|
876
|
+
| `tech_doc_revision` | `—` (BE API contract revision — set by `/generate-code` + `/review-tech-docs`) |
|
|
877
|
+
| `fe_tech_doc_revision` | `—` (FE client tech-design revision `{UC-ID}-tech-design-{platform}.md` — set by `/generate-code --phase=integration` + `/review-tech-docs` on an FE doc) |
|
|
873
878
|
| `prd_status` | read `\| **Status** \|` from PRD metadata |
|
|
874
879
|
| `uc_status` | `draft` for new UCs; keep existing value for re-gen |
|
|
875
880
|
| `fe_phase` | `—` (set by `/generate-code --phase` when FE implements) |
|
|
@@ -880,21 +885,29 @@ sc_id\tsc_title\tspec_ver\tgen_ver\timplemented_by\ttest_count\ttest_classes\tde
|
|
|
880
885
|
# Refresh Living Docs panel mirror *(local, umbrella mode)*
|
|
881
886
|
|
|
882
887
|
*Skip entirely in single-service mode (no `services` and no `setup.spec_source`) — there
|
|
883
|
-
the
|
|
888
|
+
the repo's own `.trace/` IS the panel location, so nothing to mirror.*
|
|
884
889
|
|
|
885
|
-
After updating the authoritative
|
|
890
|
+
After updating the authoritative TSV(s) at `{paths.trace_dir}`:
|
|
886
891
|
|
|
887
|
-
|
|
892
|
+
**When `setup.spec_source` is set (consolidated trace — the common case):**
|
|
893
|
+
`{paths.trace_dir}` resolves to `{spec_source}/.trace` — the single authoritative location.
|
|
894
|
+
This command runs from `service_root`, so the write is **cross-repo into the spec submodule**;
|
|
895
|
+
commit/push the spec submodule for the trace update (same as `feedback/`).
|
|
896
|
+
1. Resolve `panel_mirror = ./.trace` at the **current workspace root**.
|
|
888
897
|
2. If `panel_mirror` resolves to a different path than `{paths.trace_dir}`, copy each
|
|
889
|
-
just-updated `{UC-ID}.tsv` → `{panel_mirror}/{
|
|
890
|
-
|
|
898
|
+
just-updated `{UC-ID}.tsv` → `{panel_mirror}/{UC-ID}.tsv` (create the dir; overwrite).
|
|
899
|
+
No per-service namespacing — there is one trace set; the owning service is carried in each
|
|
900
|
+
row's `@trace.service`.
|
|
901
|
+
|
|
902
|
+
**Legacy (no `spec_source` — per-service trace):**
|
|
903
|
+
Copy each just-updated `{UC-ID}.tsv` → `{panel_mirror}/{service-name}/{UC-ID}.tsv`
|
|
904
|
+
(namespaced by `active_service`).
|
|
891
905
|
|
|
892
906
|
This keeps the open workspace's Living Docs panel current **between syncs** — it is a
|
|
893
|
-
**local convenience mirror only**. The
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
after all sub-agents return — not inside each sub-agent.
|
|
907
|
+
**local convenience mirror only**. The merged `trace-report.json` (canonical, in
|
|
908
|
+
`{spec_source}/.living-docs/`) is rebuilt by `/sync` or `/validate-traces`. For orchestrated
|
|
909
|
+
commands, do this once in the orchestrator after all sub-agents return — not inside each
|
|
910
|
+
sub-agent.
|
|
898
911
|
|
|
899
912
|
|
|
900
913
|
## Output
|
|
@@ -921,6 +934,36 @@ Output Artifacts:
|
|
|
921
934
|
|
|
922
935
|
If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
|
|
923
936
|
|
|
937
|
+
## Pipeline Position
|
|
938
|
+
|
|
939
|
+
Print a one-line map of the pipeline with the CURRENT command's phase marked `◀ bạn ở đây`,
|
|
940
|
+
so the user always sees where this command sits in the end-to-end flow:
|
|
941
|
+
|
|
942
|
+
```
|
|
943
|
+
Discovery → PRD → [Design Spec] → BDD → Tech Design → Code → Dev Self-Check → QC → Trace Audit
|
|
944
|
+
```
|
|
945
|
+
|
|
946
|
+
Find the current command in this phase legend and mark **its** phase in the map above:
|
|
947
|
+
|
|
948
|
+
| Phase | Commands |
|
|
949
|
+
|-------|----------|
|
|
950
|
+
| Discovery | `/define-product` |
|
|
951
|
+
| PRD | `/generate-prd` · `/refine-prd` · `/review-context` (PRD) |
|
|
952
|
+
| Design Spec | `/generate-design-spec` |
|
|
953
|
+
| BDD | `/generate-bdd` · `/review-context` (BDD) |
|
|
954
|
+
| Tech Design | `/generate-tech-docs` · `/map-testids` · `/review-tech-docs` |
|
|
955
|
+
| Code | `/generate-code` · `/review-code` |
|
|
956
|
+
| Dev Self-Check | `/dev-gen-test` · `/dev-run-test` · `/dev-smoke-test` |
|
|
957
|
+
| QC | `/qc-analyze` · `/qc-plan` · `/qc-design-test` · `/qc-review` · `/qc-run-test` · `/qc-report` |
|
|
958
|
+
| Trace Audit | `/validate-traces` |
|
|
959
|
+
|
|
960
|
+
For a **review command**, also append the 3-step review loop with the current step marked, e.g.:
|
|
961
|
+
`Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume`.
|
|
962
|
+
|
|
963
|
+
**Cross-cutting commands** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
|
|
964
|
+
`/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) sit outside the linear pipeline —
|
|
965
|
+
**omit the Pipeline line entirely** for these (do not force-fit them onto the map).
|
|
966
|
+
|
|
924
967
|
## Next Command Suggestion
|
|
925
968
|
|
|
926
969
|
Suggest the logical next command based on workflow phase:
|
|
@@ -962,10 +1005,13 @@ Suggest the logical next command based on workflow phase:
|
|
|
962
1005
|
Format the footer as:
|
|
963
1006
|
```
|
|
964
1007
|
---
|
|
965
|
-
Status
|
|
1008
|
+
Status : {badge}
|
|
966
1009
|
{Output Artifacts block}
|
|
967
|
-
|
|
1010
|
+
Pipeline : Discovery → PRD → [BDD ◀ bạn ở đây] → Tech Design → Code → Dev Self-Check → QC → Trace Audit
|
|
1011
|
+
(review cmd) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
|
|
1012
|
+
Next : {suggested command with example arguments}
|
|
968
1013
|
```
|
|
1014
|
+
*(Omit the `Pipeline` line for cross-cutting commands listed above.)*
|
|
969
1015
|
|
|
970
1016
|
|
|
971
1017
|
```
|
|
@@ -456,17 +456,19 @@ Feature: <Feature name>
|
|
|
456
456
|
|
|
457
457
|
After generating all `.feature` files, create or update `{paths.trace_dir}/{UC-ID}.tsv` for each UC.
|
|
458
458
|
|
|
459
|
+
> **Umbrella + `spec_source`:** both the `.feature` files **and** the trace `.tsv` write to the **spec repo** (`{spec_source}/specs/bdd/…` and `{spec_source}/.trace/…`, resolved by context-loader) — a **single-repo** write, committed/pushed to the spec submodule. (Trace is consolidated in the spec repo so the PM manages all status in one place; code-side commands update it cross-repo later.)
|
|
460
|
+
|
|
459
461
|
**TSV columns (tab-separated, one header row + one data row per scenario):**
|
|
460
462
|
```
|
|
461
|
-
sc_id\tsc_title\tspec_ver\tgen_ver\timplemented_by\ttest_count\ttest_classes\tdev_selftest\tdev_selftest_at\tqc_status\tqc_run_at\tqc_owner\tqc_blocked_by\tprd_version\tbdd_version\ttech_doc_revision\tprd_status\tuc_status\tfe_phase\tstatus\tlast_updated
|
|
463
|
+
sc_id\tsc_title\tspec_ver\tgen_ver\timplemented_by\ttest_count\ttest_classes\tdev_selftest\tdev_selftest_at\tqc_status\tqc_run_at\tqc_owner\tqc_blocked_by\tprd_version\tbdd_version\ttech_doc_revision\tfe_tech_doc_revision\tprd_status\tuc_status\tfe_phase\tstatus\tlast_updated
|
|
462
464
|
```
|
|
463
465
|
|
|
464
466
|
**Rules:**
|
|
465
467
|
- If file does not exist → create with header row + all scenario rows.
|
|
466
468
|
- If file exists (re-generation) → for each SC in the new `.feature`:
|
|
467
469
|
- SC already in `.tsv` AND `spec_ver` is unchanged → update only: `sc_title`, `prd_version`, `bdd_version`, `prd_status`, `uc_status`, `last_updated`. Leave all other columns unchanged.
|
|
468
|
-
- SC already in `.tsv` AND `spec_ver` changed (scenario was modified) → update: `sc_title`, `spec_ver`, `prd_version`, `bdd_version`, `prd_status`, `uc_status`, `last_updated` AND set `status = DRIFT` immediately (so the TSV reflects drift without waiting for `/validate-traces`). Leave `gen_ver`, `implemented_by`, `test_count`, `test_classes`, `tech_doc_revision` unchanged.
|
|
469
|
-
- SC is new (added in this re-gen) → append new row with `gen_ver`, `implemented_by`, `test_count`, `test_classes`, `dev_selftest`, `dev_selftest_at`, `qc_status`, `qc_run_at`, `qc_owner`, `qc_blocked_by`, `tech_doc_revision` all set to `—`.
|
|
470
|
+
- SC already in `.tsv` AND `spec_ver` changed (scenario was modified) → update: `sc_title`, `spec_ver`, `prd_version`, `bdd_version`, `prd_status`, `uc_status`, `last_updated` AND set `status = DRIFT` immediately (so the TSV reflects drift without waiting for `/validate-traces`). Leave `gen_ver`, `implemented_by`, `test_count`, `test_classes`, `tech_doc_revision`, `fe_tech_doc_revision` unchanged.
|
|
471
|
+
- SC is new (added in this re-gen) → append new row with `gen_ver`, `implemented_by`, `test_count`, `test_classes`, `dev_selftest`, `dev_selftest_at`, `qc_status`, `qc_run_at`, `qc_owner`, `qc_blocked_by`, `tech_doc_revision`, `fe_tech_doc_revision` all set to `—`.
|
|
470
472
|
- SC no longer in `.feature` (removed) → delete its row.
|
|
471
473
|
|
|
472
474
|
**Values to write for each scenario:**
|
|
@@ -488,7 +490,8 @@ sc_id\tsc_title\tspec_ver\tgen_ver\timplemented_by\ttest_count\ttest_classes\tde
|
|
|
488
490
|
| `qc_blocked_by` | `—` (linked `BUG-{id}` / `GAP-{id}` — set by `/qc-run-test` + `/report-bug`) |
|
|
489
491
|
| `prd_version` | `@trace.prd_version` from `.feature` header |
|
|
490
492
|
| `bdd_version` | `@trace.bdd_version` from `.feature` header |
|
|
491
|
-
| `tech_doc_revision` | `—` |
|
|
493
|
+
| `tech_doc_revision` | `—` (BE API contract revision — set by `/generate-code` + `/review-tech-docs`) |
|
|
494
|
+
| `fe_tech_doc_revision` | `—` (FE client tech-design revision `{UC-ID}-tech-design-{platform}.md` — set by `/generate-code --phase=integration` + `/review-tech-docs` on an FE doc) |
|
|
492
495
|
| `prd_status` | read `\| **Status** \|` from PRD metadata |
|
|
493
496
|
| `uc_status` | `draft` for new UCs; keep existing value for re-gen |
|
|
494
497
|
| `fe_phase` | `—` (set by `/generate-code --phase` when FE implements) |
|
|
@@ -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)**,
|
|
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}`
|
|
211
|
-
| `paths.specs_dir` | `{active_service}/{service paths.specs_dir}`
|
|
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
|
-
-
|
|
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
|
|
|
@@ -428,9 +430,18 @@ Read `@trace.platform` from the feature file header.
|
|
|
428
430
|
- If `web` or `app` → continue with phase logic below.
|
|
429
431
|
|
|
430
432
|
**If `--phase=ui`:**
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
433
|
+
Resolve the **mock shape source** (hybrid — prefer the real contract, fall back to System BDD):
|
|
434
|
+
- **BE contract** `{paths.tech_docs_dir}/{domain}/{UC-ID}-tech-design.md` — if it exists, the mock adapter's port/DTO **shape** (request/response fields, types, error codes) comes from here → `mock_source = contract`. Most accurate; no shape rework at integration.
|
|
435
|
+
- **System BDD** `{specs_dir}/{domain}/system/{TICKET-ID}*.feature` — always load `Then` clauses for **behavior + fixture values**. If no BE contract, the shape is inferred from these too → `mock_source = system-bdd`, and WARN:
|
|
436
|
+
```
|
|
437
|
+
⚠ BE contract not found — mock shape inferred from System BDD only.
|
|
438
|
+
System BDD describes behavior, not full request/response shape — the mock
|
|
439
|
+
may differ from the real API; expect adjustment at --phase=integration.
|
|
440
|
+
(Recommended: have BE publish {UC-ID}-tech-design.md first for an accurate mock.)
|
|
441
|
+
```
|
|
442
|
+
- If System BDD is also missing → warn "System BDD not found — mock layer will use placeholder fixtures." Continue.
|
|
443
|
+
|
|
444
|
+
Store `mock_source` (`contract` | `system-bdd`) for the mock tags below.
|
|
434
445
|
|
|
435
446
|
**Then run the Figma Dev Mode MCP Check below** before generating any UI — the Design
|
|
436
447
|
Spec's frame links are the visual contract, and the local MCP reads them with far more
|
|
@@ -478,13 +489,18 @@ Code Connect mappings. Prefer Code-Connect-mapped components over inventing mark
|
|
|
478
489
|
real token names, not hardcoded values.
|
|
479
490
|
|
|
480
491
|
**If `--phase=integration`:**
|
|
481
|
-
|
|
492
|
+
Resolve the design that drives the adapter (two layers):
|
|
493
|
+
- **FE tech-design** (preferred — the port→endpoint→DTO mapping): `{paths.tech_docs_dir}/{domain}/{UC-ID}-tech-design-{platform}.md` §4, produced by `/generate-tech-docs` (FE path).
|
|
494
|
+
- **BE API contract** (endpoint/shape source): `{paths.tech_docs_dir}/{domain}/{UC-ID}-tech-design.md`.
|
|
495
|
+
|
|
496
|
+
Read `@trace.status` of whichever drives the adapter (the FE doc if present, else the BE contract).
|
|
482
497
|
If `draft` or `in-review` → warn:
|
|
483
498
|
```
|
|
484
|
-
⚠ Tech
|
|
485
|
-
|
|
486
|
-
Proceeding — ensure BE endpoint is deployed or confirm
|
|
499
|
+
⚠ Tech design for {UC-ID} ({platform}) is {status}.
|
|
500
|
+
Contract / adapter mapping may still change.
|
|
501
|
+
Proceeding — ensure BE endpoint is deployed or confirm the mapping manually.
|
|
487
502
|
```
|
|
503
|
+
If the FE tech-design is **missing** → warn: "No FE tech-design found — falling back to the BE contract directly (adapter mapping inferred). Recommended: run `/generate-tech-docs {web|app .feature}` first."
|
|
488
504
|
Locate existing mock adapter from `--phase=ui` run (search for `{UC-ID}MockApiAdapter` in `{paths.src_dir}/{domain}/`).
|
|
489
505
|
If not found → warn: "Mock adapter not found — generating real API adapter from scratch using tech-doc contract."
|
|
490
506
|
|
|
@@ -581,30 +597,50 @@ DTOs → Entity/Model → Repository → Service interface → Service impl →
|
|
|
581
597
|
|
|
582
598
|
> **Entry-point rule:** `@trace.implements` must appear on the **entry-point layer** as defined in `CLAUDE.md §2`. For REST APIs → Controller. For event-driven modules → event handler / consumer class. For context-engineering → the prompt orchestration function. Never put it only on an inner layer.
|
|
583
599
|
|
|
600
|
+
### Test Selectors — emit stable element IDs *(FE/App UI only)*
|
|
601
|
+
|
|
602
|
+
*Applies when `platform` is `web`/`app` and generating UI (`--phase=ui`, or default FE/App mode). Skip for BE.*
|
|
603
|
+
|
|
604
|
+
Every **actionable** element (button, input, link, select, toggle, form-submit) MUST carry a **stable test-id** so QC locates it directly (no runtime scan):
|
|
605
|
+
|
|
606
|
+
1. **Source the id.** If the FE tech-design `{paths.tech_docs_dir}/{domain}/{UC-ID}-tech-design-{platform}.md` exists, take ids **verbatim** from its §2b Test Selectors table (the contract). If it does not exist yet (e.g. `--phase=ui` before the FE tech-design), **generate ids by the convention** `{uc-lower}-{screen}-{element}-{type}` (e.g. `ft001-login-submit-btn`) so QC still has stable handles — they will be reconciled to the tech-design's §2b at integration.
|
|
607
|
+
2. **Emit via the platform attribute** (from `@trace.testid_attr`, or by module):
|
|
608
|
+
- web (`react`/`nextjs`/`vue`/`angular`) → `data-testid="..."`
|
|
609
|
+
- React Native → `testID="..."`
|
|
610
|
+
- Flutter → `Key('...')` (+ `Semantics(identifier: '...')` where the action needs it)
|
|
611
|
+
- native iOS → `accessibilityIdentifier = "..."`
|
|
612
|
+
3. Only actionable elements; do not spam ids on static text. Keep ids identical to the tech-design map so QC Page Objects match on the first try.
|
|
613
|
+
4. **Reused catalog component?** Pass the id via its **forwarding prop** (see the catalog `## Test-ID Forwarding` section — e.g. `<Button testId="ft001-login-submit-btn">`), not a raw attribute. If the component does not forward a test-id, or you are backfilling **existing/brownfield** screens (not freshly generated here), that is `/map-testids {UC-ID}`'s job — run it instead of editing shared components inline.
|
|
614
|
+
|
|
584
615
|
## Mock API Layer (`--phase=ui` only)
|
|
585
616
|
|
|
586
617
|
*Skip this section entirely if `--phase` is not `ui`.*
|
|
587
618
|
|
|
588
|
-
|
|
619
|
+
Build the mock from the `mock_source` resolved in Phase Detection — **shape** from the BE contract when present, **fixture values + behavior** always from System BDD `Then` clauses:
|
|
589
620
|
|
|
590
|
-
1. **
|
|
591
|
-
|
|
621
|
+
1. **Define the port shape** `{UC-ID}ApiPort` (request/response DTOs + error codes):
|
|
622
|
+
- `mock_source = contract` → field names / types / error codes taken **verbatim from the BE contract** §2 (API Endpoints) / §3 (Data Model) — the real shape.
|
|
623
|
+
- `mock_source = system-bdd` → shape **inferred** from System BDD `Then` clauses (provisional — see warning above).
|
|
624
|
+
2. **Extract fixture data** per scenario from System BDD `Then` clauses — success + error responses (BDD is the source of truth for *values / behavior*, regardless of shape source).
|
|
625
|
+
3. **Generate mock adapter** at `{paths.src_dir}/{domain}/{UC-ID}MockApiAdapter.{ext}`:
|
|
592
626
|
- Implements interface `{UC-ID}ApiPort` (same interface the real adapter will implement)
|
|
593
|
-
- Each method returns fixture data matching the BDD `Then` clause
|
|
627
|
+
- Each method returns fixture data matching the BDD `Then` clause, in the port shape
|
|
594
628
|
- Include both success and error states (map to error scenarios in BDD)
|
|
595
629
|
- Traceability tags:
|
|
596
630
|
```
|
|
597
631
|
@trace.mock_for={UC-ID}
|
|
632
|
+
@trace.mock_source={contract | system-bdd}
|
|
598
633
|
@trace.system_bdd={paths.specs_dir}/{domain}/system/{UC-ID}*.feature
|
|
634
|
+
{@trace.be_contract={UC-ID}-tech-design.md # only when mock_source=contract}
|
|
599
635
|
```
|
|
600
|
-
|
|
636
|
+
4. **Wire into service/hook layer** via environment flag or DI:
|
|
601
637
|
```
|
|
602
638
|
const adapter = IS_MOCK ? new {UC-ID}MockApiAdapter() : new {UC-ID}ApiAdapter()
|
|
603
639
|
```
|
|
604
640
|
- `IS_MOCK` defaults to `true` in development/test env until real adapter is generated.
|
|
605
641
|
|
|
606
|
-
> Tester uses the mock adapter to test all FE scenarios without waiting for BE
|
|
607
|
-
>
|
|
642
|
+
> Tester uses the mock adapter to test all FE scenarios without waiting for BE to **deploy**.
|
|
643
|
+
> Shape comes from the BE contract when available (accurate, no integration rework); else from System BDD (provisional — adjust at `--phase=integration`). Fixture *values* always come from System BDD — BDD is the source of truth for behavior.
|
|
608
644
|
|
|
609
645
|
---
|
|
610
646
|
|
|
@@ -612,7 +648,7 @@ Using the System BDD `Then` clauses loaded in Phase Detection:
|
|
|
612
648
|
|
|
613
649
|
*Skip this section entirely if `--phase` is not `integration`.*
|
|
614
650
|
|
|
615
|
-
1. **Read tech-
|
|
651
|
+
1. **Read the integration design.** Prefer the FE tech-design §4 (port→endpoint→DTO→error mapping) at `{paths.tech_docs_dir}/{domain}/{UC-ID}-tech-design-{platform}.md`, using the BE API contract `{UC-ID}-tech-design.md` as the endpoint / request-response / error-code source. If no FE tech-design exists, extract endpoints + shapes + error codes directly from the BE contract.
|
|
616
652
|
2. **Read existing mock adapter** interface (`{UC-ID}ApiPort`) from the `--phase=ui` output.
|
|
617
653
|
3. **Generate real API adapter** at `{paths.src_dir}/{domain}/{UC-ID}ApiAdapter.{ext}`:
|
|
618
654
|
- Implements the same `{UC-ID}ApiPort` interface as mock adapter
|
|
@@ -642,39 +678,48 @@ Using the System BDD `Then` clauses loaded in Phase Detection:
|
|
|
642
678
|
|
|
643
679
|
## Write Trace State
|
|
644
680
|
|
|
645
|
-
Update `{paths.trace_dir}/{UC-ID}.tsv` — for each implemented scenario, find the existing row by `sc_id` and update only these columns
|
|
681
|
+
Update `{paths.trace_dir}/{UC-ID}.tsv` — for each implemented scenario, find the existing row by `sc_id` and update only these columns. *(Umbrella + `spec_source`: `trace_dir` resolves to `{spec_source}/.trace` — this command runs from `service_root` but writes the trace row into the **spec repo** (cross-repo); commit/push the spec submodule for the trace update, alongside the 2-tier code push.)*
|
|
646
682
|
|
|
647
683
|
| Column | Value |
|
|
648
684
|
|--------|-------|
|
|
649
685
|
| `gen_ver` | copy `spec_ver` from the current `.tsv` row (= scenario version at time of codegen) |
|
|
650
686
|
| `implemented_by` | `{ControllerClass}.{methodName}` |
|
|
651
687
|
| `bdd_version` | `@trace.bdd_version` from `.feature` header |
|
|
652
|
-
| `tech_doc_revision` | `@trace.revision` from tech-
|
|
688
|
+
| `tech_doc_revision` | `@trace.revision` from the **BE** contract `{UC-ID}-tech-design.md`, or `—` if none |
|
|
689
|
+
| `fe_tech_doc_revision` | `@trace.revision` from the **FE** tech-design `{UC-ID}-tech-design-{platform}.md` when generating FE with `--phase=integration` (the doc whose §4 drove this adapter); `—` for BE, or for FE `--phase=ui` / no FE tech-design |
|
|
653
690
|
| `fe_phase` | `ui` if `--phase=ui` \| `integrated` if `--phase=integration` \| `—` if no phase flag |
|
|
654
691
|
| `last_updated` | today `YYYY-MM-DD` |
|
|
655
692
|
|
|
656
|
-
Leave all other columns (`sc_title`, `spec_ver`, `prd_version`, `prd_status`, `uc_status`, `test_count`, `test_classes`, `dev_selftest`, `dev_selftest_at`, `qc_status`, `qc_run_at`) unchanged.
|
|
693
|
+
Leave all other columns (`sc_title`, `spec_ver`, `prd_version`, `prd_status`, `uc_status`, `test_count`, `test_classes`, `dev_selftest`, `dev_selftest_at`, `qc_status`, `qc_run_at`, `qc_owner`, `qc_blocked_by`) unchanged.
|
|
657
694
|
`status` is computed by `/validate-traces` — do not set here.
|
|
658
695
|
|
|
659
696
|
## Refresh Panel Mirror
|
|
660
697
|
# Refresh Living Docs panel mirror *(local, umbrella mode)*
|
|
661
698
|
|
|
662
699
|
*Skip entirely in single-service mode (no `services` and no `setup.spec_source`) — there
|
|
663
|
-
the
|
|
700
|
+
the repo's own `.trace/` IS the panel location, so nothing to mirror.*
|
|
664
701
|
|
|
665
|
-
After updating the authoritative
|
|
702
|
+
After updating the authoritative TSV(s) at `{paths.trace_dir}`:
|
|
666
703
|
|
|
667
|
-
|
|
704
|
+
**When `setup.spec_source` is set (consolidated trace — the common case):**
|
|
705
|
+
`{paths.trace_dir}` resolves to `{spec_source}/.trace` — the single authoritative location.
|
|
706
|
+
This command runs from `service_root`, so the write is **cross-repo into the spec submodule**;
|
|
707
|
+
commit/push the spec submodule for the trace update (same as `feedback/`).
|
|
708
|
+
1. Resolve `panel_mirror = ./.trace` at the **current workspace root**.
|
|
668
709
|
2. If `panel_mirror` resolves to a different path than `{paths.trace_dir}`, copy each
|
|
669
|
-
just-updated `{UC-ID}.tsv` → `{panel_mirror}/{
|
|
670
|
-
|
|
710
|
+
just-updated `{UC-ID}.tsv` → `{panel_mirror}/{UC-ID}.tsv` (create the dir; overwrite).
|
|
711
|
+
No per-service namespacing — there is one trace set; the owning service is carried in each
|
|
712
|
+
row's `@trace.service`.
|
|
713
|
+
|
|
714
|
+
**Legacy (no `spec_source` — per-service trace):**
|
|
715
|
+
Copy each just-updated `{UC-ID}.tsv` → `{panel_mirror}/{service-name}/{UC-ID}.tsv`
|
|
716
|
+
(namespaced by `active_service`).
|
|
671
717
|
|
|
672
718
|
This keeps the open workspace's Living Docs panel current **between syncs** — it is a
|
|
673
|
-
**local convenience mirror only**. The
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
after all sub-agents return — not inside each sub-agent.
|
|
719
|
+
**local convenience mirror only**. The merged `trace-report.json` (canonical, in
|
|
720
|
+
`{spec_source}/.living-docs/`) is rebuilt by `/sync` or `/validate-traces`. For orchestrated
|
|
721
|
+
commands, do this once in the orchestrator after all sub-agents return — not inside each
|
|
722
|
+
sub-agent.
|
|
678
723
|
|
|
679
724
|
|
|
680
725
|
## Commit
|
|
@@ -707,6 +752,36 @@ Output Artifacts:
|
|
|
707
752
|
|
|
708
753
|
If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
|
|
709
754
|
|
|
755
|
+
## Pipeline Position
|
|
756
|
+
|
|
757
|
+
Print a one-line map of the pipeline with the CURRENT command's phase marked `◀ bạn ở đây`,
|
|
758
|
+
so the user always sees where this command sits in the end-to-end flow:
|
|
759
|
+
|
|
760
|
+
```
|
|
761
|
+
Discovery → PRD → [Design Spec] → BDD → Tech Design → Code → Dev Self-Check → QC → Trace Audit
|
|
762
|
+
```
|
|
763
|
+
|
|
764
|
+
Find the current command in this phase legend and mark **its** phase in the map above:
|
|
765
|
+
|
|
766
|
+
| Phase | Commands |
|
|
767
|
+
|-------|----------|
|
|
768
|
+
| Discovery | `/define-product` |
|
|
769
|
+
| PRD | `/generate-prd` · `/refine-prd` · `/review-context` (PRD) |
|
|
770
|
+
| Design Spec | `/generate-design-spec` |
|
|
771
|
+
| BDD | `/generate-bdd` · `/review-context` (BDD) |
|
|
772
|
+
| Tech Design | `/generate-tech-docs` · `/map-testids` · `/review-tech-docs` |
|
|
773
|
+
| Code | `/generate-code` · `/review-code` |
|
|
774
|
+
| Dev Self-Check | `/dev-gen-test` · `/dev-run-test` · `/dev-smoke-test` |
|
|
775
|
+
| QC | `/qc-analyze` · `/qc-plan` · `/qc-design-test` · `/qc-review` · `/qc-run-test` · `/qc-report` |
|
|
776
|
+
| Trace Audit | `/validate-traces` |
|
|
777
|
+
|
|
778
|
+
For a **review command**, also append the 3-step review loop with the current step marked, e.g.:
|
|
779
|
+
`Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume`.
|
|
780
|
+
|
|
781
|
+
**Cross-cutting commands** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
|
|
782
|
+
`/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) sit outside the linear pipeline —
|
|
783
|
+
**omit the Pipeline line entirely** for these (do not force-fit them onto the map).
|
|
784
|
+
|
|
710
785
|
## Next Command Suggestion
|
|
711
786
|
|
|
712
787
|
Suggest the logical next command based on workflow phase:
|
|
@@ -748,10 +823,13 @@ Suggest the logical next command based on workflow phase:
|
|
|
748
823
|
Format the footer as:
|
|
749
824
|
```
|
|
750
825
|
---
|
|
751
|
-
Status
|
|
826
|
+
Status : {badge}
|
|
752
827
|
{Output Artifacts block}
|
|
753
|
-
|
|
828
|
+
Pipeline : Discovery → PRD → [BDD ◀ bạn ở đây] → Tech Design → Code → Dev Self-Check → QC → Trace Audit
|
|
829
|
+
(review cmd) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
|
|
830
|
+
Next : {suggested command with example arguments}
|
|
754
831
|
```
|
|
832
|
+
*(Omit the `Pipeline` line for cross-cutting commands listed above.)*
|
|
755
833
|
|
|
756
834
|
|
|
757
835
|
```
|