@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
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
# Command Reference
|
|
4
4
|
|
|
5
|
-
> Mọi slash command của framework, gom theo phase. Mỗi command kèm **
|
|
5
|
+
> Mọi slash command của framework, gom theo phase. Mỗi command kèm **Cách dùng (ví dụ cụ thể)**, **Output**, và **When to use**. Phần cuối mô tả **Command Internals** — kiến trúc step file dùng chung bởi mọi command.
|
|
6
|
+
>
|
|
7
|
+
> Ví dụ dùng chung một feature xuyên suốt: domain `auth`, ticket `FEAT-01`, use case `FEAT-01-UC1` (đăng nhập). Thay bằng file/UC-ID của bạn.
|
|
6
8
|
|
|
7
9
|
---
|
|
8
10
|
|
|
@@ -18,7 +20,7 @@
|
|
|
18
20
|
- [Phase 6 — Dev Self-Check](#phase-6--dev-self-check)
|
|
19
21
|
- [Phase 6b — QC Automation (official QC suite)](#phase-6b--qc-automation-official-qc-suite)
|
|
20
22
|
- [Phase 7 — Traceability Audit](#phase-7--traceability-audit)
|
|
21
|
-
- [Phase 8 — Tester Feedback](#phase-8--tester-feedback)
|
|
23
|
+
- [Phase 8 — Tester / QC Feedback](#phase-8--tester--qc-feedback)
|
|
22
24
|
- [Debugging & Cross-cutting](#debugging--cross-cutting)
|
|
23
25
|
- [Command Internals — Step Architecture](#command-internals--step-architecture)
|
|
24
26
|
|
|
@@ -28,13 +30,13 @@
|
|
|
28
30
|
|
|
29
31
|
## Setup & Maintenance
|
|
30
32
|
|
|
31
|
-
| Command |
|
|
32
|
-
|
|
33
|
-
| `/setup-ai-first` |
|
|
34
|
-
| `/sync` |
|
|
35
|
-
| `/update-framework` |
|
|
36
|
-
| `/sync-figma-components {module}` |
|
|
37
|
-
| `/sync-figma-tokens {url?}` |
|
|
33
|
+
| Command | Cách dùng (ví dụ) | Output | When to use |
|
|
34
|
+
|---------|-------------------|--------|-------------|
|
|
35
|
+
| `/setup-ai-first` | `/setup-ai-first` | Project structure + config files | First-time project setup |
|
|
36
|
+
| `/sync` | `/sync` | Git pull + submodule update + Living Docs sync | **Daily driver** — đồng bộ *nội dung* project (code/specs trong submodule) |
|
|
37
|
+
| `/update-framework` | `/update-framework` | Refreshed `.agent/` command files from npm | **Occasionally** — nâng cấp *bản thân framework* khi có version mới |
|
|
38
|
+
| `/sync-figma-components {module}` | `/sync-figma-components react` | Updated `figma-components/{module}.md` | After Figma design system changes |
|
|
39
|
+
| `/sync-figma-tokens {url?}` | `/sync-figma-tokens` *(hoặc kèm URL Figma)* | Updated `figma-tokens.md` | After design token changes |
|
|
38
40
|
|
|
39
41
|
> **`/sync` vs `/update-framework` là hai thứ khác nhau:**
|
|
40
42
|
> - `/sync` cập nhật **nội dung project** — pull code/specs mới từ git remote + refresh Living Docs. Nguồn = git remotes của bạn. Chạy thường xuyên.
|
|
@@ -44,30 +46,30 @@
|
|
|
44
46
|
|
|
45
47
|
## Phase 1 — Discovery
|
|
46
48
|
|
|
47
|
-
| Command |
|
|
48
|
-
|
|
49
|
-
| `/define-product` |
|
|
49
|
+
| Command | Cách dùng (ví dụ) | Output | When to use |
|
|
50
|
+
|---------|-------------------|--------|-------------|
|
|
51
|
+
| `/define-product` | `/define-product` | `specs/product-definition/{TICKET-ID}-{slug}.md` | Starting any new feature. AI dẫn PO qua 7 phase Q&A có cấu trúc — không cần spec viết sẵn. |
|
|
50
52
|
|
|
51
53
|
---
|
|
52
54
|
|
|
53
55
|
## Phase 2 — PRD
|
|
54
56
|
|
|
55
|
-
| Command |
|
|
56
|
-
|
|
57
|
-
| `/generate-prd` | product-definition
|
|
58
|
-
| `/refine-prd` | prd
|
|
59
|
-
| `/refine-prd --resume` | prd
|
|
60
|
-
| `/review-context` (PRD) | prd
|
|
61
|
-
| `/review-context --fix` | prd
|
|
62
|
-
| `/review-context --resume` | prd
|
|
57
|
+
| Command | Cách dùng (ví dụ) | Output | When to use |
|
|
58
|
+
|---------|-------------------|--------|-------------|
|
|
59
|
+
| `/generate-prd` | `/generate-prd specs/product-definition/FEAT-01-login.md` | `specs/prd/{domain}/{TICKET-ID}-{slug}.md` | After define-product. Thêm `API Source: existing` + section "Existing API Contract" cho feature brownfield. |
|
|
60
|
+
| `/refine-prd` | `/refine-prd specs/prd/auth/FEAT-01-login.md` | `.agent/review/{prd-slug}-findings.yaml` | After generate-prd — fan-out 4 review lens + completeness-critic loop, mở Review Board. |
|
|
61
|
+
| `/refine-prd --resume` | `/refine-prd --resume specs/prd/auth/FEAT-01-login.md` | Applied findings + bumped version | Sau khi review trong Review Board (nút ⚡ Apply tự chạy lệnh này). |
|
|
62
|
+
| `/review-context` (PRD) | `/review-context specs/prd/auth/FEAT-01-login.md` | `.agent/review/{prd-slug}-review-context-findings.yaml` | Quality gate bắt buộc trước Phase 3. Checks: banned terms (P1), ambiguity (P2), conflicts (P3), completeness (P4). |
|
|
63
|
+
| `/review-context --fix` | `/review-context --fix specs/prd/auth/FEAT-01-login.md` | Applies all auto-fixable findings immediately | Dev quick-fix, không cần Review Board. |
|
|
64
|
+
| `/review-context --resume` | `/review-context --resume specs/prd/auth/FEAT-01-login.md` | Applies accepted findings + bump version | PO/SA review — human quyết từng finding. |
|
|
63
65
|
|
|
64
66
|
---
|
|
65
67
|
|
|
66
68
|
## Phase 2b — Design Spec (FE/App)
|
|
67
69
|
|
|
68
|
-
| Command |
|
|
69
|
-
|
|
70
|
-
| `/generate-design-spec` | prd
|
|
70
|
+
| Command | Cách dùng (ví dụ) | Output | When to use |
|
|
71
|
+
|---------|-------------------|--------|-------------|
|
|
72
|
+
| `/generate-design-spec` | `/generate-design-spec specs/prd/auth/FEAT-01-login.md` | `specs/design-spec/{domain}/{TICKET-ID}-design-spec-{platform}.md` | FE/App: sau khi PRD approved, trước BDD. PO phải cấp **node-level Figma frame link** (URL có `?node-id=`) cho mỗi screen; AI fetch từng frame qua Figma MCP. Screen thiếu link → ❌ Missing, spec ở draft và chặn sign-off + `/generate-bdd`. |
|
|
71
73
|
|
|
72
74
|
> BE teams bỏ qua Phase 2b — đọc PRD trực tiếp rồi `/generate-bdd`.
|
|
73
75
|
|
|
@@ -75,33 +77,34 @@
|
|
|
75
77
|
|
|
76
78
|
## Phase 3 — BDD Spec
|
|
77
79
|
|
|
78
|
-
| Command |
|
|
79
|
-
|
|
80
|
-
| `/generate-bdd` | prd
|
|
81
|
-
| `/review-context` (BDD) | feature
|
|
82
|
-
| `/review-context --fix` | feature
|
|
83
|
-
| `/review-context --resume` | feature
|
|
80
|
+
| Command | Cách dùng (ví dụ) | Output | When to use |
|
|
81
|
+
|---------|-------------------|--------|-------------|
|
|
82
|
+
| `/generate-bdd` | `/generate-bdd specs/prd/auth/FEAT-01-login.md` | `specs/bdd/{domain}/{UC-ID}.feature` (multi-service: `{domain}/{service}/{UC-ID}.feature`) | After PRD approved (+ Design Spec sign-off cho FE/App). Đọc Service/Module từ PRD metadata, áp platform vocabulary, hiện SC outline chờ confirm. **Thứ tự outside-in: web → app → system**; `system` **tổng hợp từ web+app BDD** (web&app lệch contract → CHECKPOINT chọn union/platform-hint/separate-endpoints, ghi `@system.resolution:`; chỉ-BE → từ PRD). PRD lớn (>3 UC hoặc >300 dòng) → orchestration mode (1 sub-agent / UC). |
|
|
83
|
+
| `/review-context` (BDD) | `/review-context specs/bdd/auth/system/FEAT-01-UC1-login.feature` | `.agent/review/{uc-id}-review-bdd-findings.yaml` | Quality gate bắt buộc trước Phase 4. Checks: PRD coverage (mỗi AC + BR → ≥1 SC), Gherkin R1–R10, compliance C1–C5. |
|
|
84
|
+
| `/review-context --fix` | `/review-context --fix specs/bdd/auth/web/FEAT-01-UC1-login.feature` | Auto-fix terminology, metadata, coverage matrix | Dev quick-fix. |
|
|
85
|
+
| `/review-context --resume` | `/review-context --resume specs/bdd/auth/system/FEAT-01-UC1-login.feature` | Applies accepted findings + bump bdd_version | SA review. |
|
|
84
86
|
|
|
85
87
|
---
|
|
86
88
|
|
|
87
89
|
## Phase 4 — Tech Design
|
|
88
90
|
|
|
89
|
-
| Command |
|
|
90
|
-
|
|
91
|
-
| `/generate-tech-docs` | feature
|
|
92
|
-
| `/
|
|
93
|
-
| `/review-tech-docs
|
|
91
|
+
| Command | Cách dùng (ví dụ) | Output | When to use |
|
|
92
|
+
|---------|-------------------|--------|-------------|
|
|
93
|
+
| `/generate-tech-docs` | `/generate-tech-docs specs/bdd/auth/system/FEAT-01-UC1-login.feature` | **BE** (`system`): `tech-docs/{domain}/{UC-ID}-tech-design.md` (API contract) · **FE/App** (`web`/`app`): `{UC-ID}-tech-design-{platform}.md` (client design) | After BDD approved. **Platform-aware** (`@trace.platform`): BE = API contract; FE/App = client design (components/state/API-integration/routing + **§2b Test Selectors**: test-id ổn định cho element có action → QC locate khỏi scan) — **GATED**: HALT nếu thiếu System BDD hoặc BE contract approved. Brownfield (`@trace.api_source: existing`) → reverse-document (BE). |
|
|
94
|
+
| `/map-testids {UC-ID}` | `/map-testids FEAT-01-UC1` | Cập nhật FE tech-design §2b Test Selectors + patch forwarding/usage-site + ghi `figma-components/{module}.md` | FE/App, cho component **reuse** / code **có sẵn** (brownfield): reverse-document id đang có, gán id còn thiếu, đảm bảo component dùng chung forward được test-id. Bổ trợ cho `/generate-tech-docs` (chỉ gán id cho code mới). |
|
|
95
|
+
| `/review-tech-docs` | `/review-tech-docs tech-docs/auth/FEAT-01-UC1-tech-design.md` | `.agent/review/{uc-id}-tech-review-findings.yaml` | After generate-tech-docs — mở Review Board. |
|
|
96
|
+
| `/review-tech-docs --resume` | `/review-tech-docs --resume tech-docs/auth/FEAT-01-UC1-tech-design.md` | Applies accepted findings + bump revision | Sau khi review trong Review Board. |
|
|
94
97
|
|
|
95
98
|
---
|
|
96
99
|
|
|
97
100
|
## Phase 5 — Code
|
|
98
101
|
|
|
99
|
-
| Command |
|
|
100
|
-
|
|
101
|
-
| `/generate-code` | feature
|
|
102
|
-
| `/generate-code --phase=ui` | feature
|
|
103
|
-
| `/generate-code --phase=integration` | feature
|
|
104
|
-
| `/review-code` |
|
|
102
|
+
| Command | Cách dùng (ví dụ) | Output | When to use |
|
|
103
|
+
|---------|-------------------|--------|-------------|
|
|
104
|
+
| `/generate-code` | `/generate-code specs/bdd/auth/system/FEAT-01-UC1-login.feature` | `src/...` (tags `@trace.implements`) | After tech-design approved. Default = full impl/BE. |
|
|
105
|
+
| `/generate-code --phase=ui` | `/generate-code --phase=ui specs/bdd/auth/web/FEAT-01-UC1-login.feature` | UI + mock API adapter | FE: BE chưa sẵn sàng — sinh UI + mock adapter. Mock **shape**: BE contract nếu có (chuẩn) → else System BDD + warn; fixture values luôn từ System BDD. Tester test FE ngay được. |
|
|
106
|
+
| `/generate-code --phase=integration` | `/generate-code --phase=integration specs/bdd/auth/web/FEAT-01-UC1-login.feature` | Wires real API | FE: sau khi T7 sign-off gate approved — thay mock adapter bằng real API calls. |
|
|
107
|
+
| `/review-code` | `/review-code FEAT-01-UC1` | Review report: Critical / Major / Minor | After generate-code. Check: mỗi scenario có endpoint, trace tags, layer rules, error handling khớp CLAUDE.md §5. Fix CRITICAL + MAJOR trước khi merge. |
|
|
105
108
|
|
|
106
109
|
---
|
|
107
110
|
|
|
@@ -109,56 +112,56 @@
|
|
|
109
112
|
|
|
110
113
|
> Đây là **developer self-check / smoke** — dev tự kiểm tra code mình vừa sinh ra. **Không phải** official QC suite (đó là Phase 6b `/qc-*`). Signal = `dev_selftest`, tách biệt với `qc_status`.
|
|
111
114
|
|
|
112
|
-
| Command |
|
|
113
|
-
|
|
114
|
-
| `/dev-gen-test` | feature
|
|
115
|
-
| `/dev-run-test` |
|
|
116
|
-
| `/dev-smoke-test` |
|
|
115
|
+
| Command | Cách dùng (ví dụ) | Output | When to use |
|
|
116
|
+
|---------|-------------------|--------|-------------|
|
|
117
|
+
| `/dev-gen-test` | `/dev-gen-test specs/bdd/auth/system/FEAT-01-UC1-login.feature` | `src/test/...` (tags `@trace.verifies`) | After generate-code. Tự chọn test framework đúng platform. |
|
|
118
|
+
| `/dev-run-test` | `/dev-run-test FEAT-01-UC1` | Self-check report — ghi `dev_selftest` (pass/fail/not_run) + `dev_selftest_at` vào trace TSV | After dev-gen-test. |
|
|
119
|
+
| `/dev-smoke-test` | `/dev-smoke-test FEAT-01-UC1` | Live endpoint check | Optional — sau deploy. |
|
|
117
120
|
|
|
118
121
|
---
|
|
119
122
|
|
|
120
123
|
## Phase 6b — QC Automation (official QC suite)
|
|
121
124
|
|
|
122
|
-
> Pipeline `/qc-*` **là** official QC suite. Chạy **theo thứ tự** sau khi BDD approved (`/review-context` (BDD) APPROVED). Tách biệt hoàn toàn với dev self-check: QC sở hữu `qc_status`, dev sở hữu `dev_selftest`. `/qc-run-test` & `/qc-report` dùng module `qc-playwright`, độc lập với dev implementation module. Xem [../02-guides/qc-automation.md](../02-guides/qc-automation.md).
|
|
125
|
+
> Pipeline `/qc-*` **là** official QC suite. Chạy **theo thứ tự** sau khi BDD approved (`/review-context` (BDD) APPROVED). Tách biệt hoàn toàn với dev self-check: QC sở hữu `qc_status`, dev sở hữu `dev_selftest`. `/qc-run-test` & `/qc-report` dùng module `qc-playwright`, độc lập với dev implementation module. Xem [../02-guides/tester/qc-automation.md](../02-guides/tester/qc-automation.md).
|
|
123
126
|
|
|
124
|
-
| Command |
|
|
125
|
-
|
|
126
|
-
| `/qc-analyze` |
|
|
127
|
-
| `/qc-plan` |
|
|
128
|
-
| `/qc-design-test` |
|
|
129
|
-
| `/qc-review` |
|
|
130
|
-
| `/qc-run-test` |
|
|
131
|
-
| `/qc-report` |
|
|
127
|
+
| Command | Cách dùng (ví dụ) | Output | When to use |
|
|
128
|
+
|---------|-------------------|--------|-------------|
|
|
129
|
+
| `/qc-analyze` | `/qc-analyze FEAT-01-UC1` | **2 file** trong `{qc_dir}/{UC-ID}/` (mặc định `docs/`): `REQUIREMENT_ANALYSIS.md` (gộp requirement + BR + data-flow + AC) + `DOC_GAPS.md` | After BDD approved — đầu pipeline QC. |
|
|
130
|
+
| `/qc-plan` | `/qc-plan FEAT-01-UC1` | `{qc_dir}/{UC-ID}/TEST_PLAN.md` (scope, layers, priorities, questions-for-dev) | After `/qc-analyze`. |
|
|
131
|
+
| `/qc-design-test` | `/qc-design-test FEAT-01-UC1` | `{qc_dir}/{UC-ID}/test-cases/*.Test.md` mapped to `{UC-ID}-SC{N}` | After `/qc-plan`. |
|
|
132
|
+
| `/qc-review` | `/qc-review FEAT-01-UC1` | Verdict APPROVED / NEEDS_FIX + findings (**inline — không sinh file**) | After `/qc-design-test` (test-case) hoặc `/qc-run-test` (script). |
|
|
133
|
+
| `/qc-run-test` | `/qc-run-test FEAT-01-UC1` | Script Python (`pages/`, `tests/`) + ghi `qc_status` (pass/fail/skip/not_run) + `qc_run_at` vào trace TSV, keyed by `@trace.verifies={UC-ID}-SC{N}` | After `/qc-review`. |
|
|
134
|
+
| `/qc-report` | `/qc-report FEAT-01-UC1` | QC report `reports/<feature>/report.html` (Playwright Trace + pytest-html) | After `/qc-run-test`. |
|
|
132
135
|
|
|
133
136
|
---
|
|
134
137
|
|
|
135
138
|
## Phase 7 — Traceability Audit
|
|
136
139
|
|
|
137
|
-
| Command |
|
|
138
|
-
|
|
139
|
-
| `/validate-traces {domain}` |
|
|
140
|
+
| Command | Cách dùng (ví dụ) | Output | When to use |
|
|
141
|
+
|---------|-------------------|--------|-------------|
|
|
142
|
+
| `/validate-traces {domain}` | `/validate-traces auth` *(hoặc `/validate-traces FEAT-01-UC1`)* | Coverage matrix + drift report + `trace-report.json` | Anytime — verify traceability. Đọc mọi `.trace/{UC-ID}.tsv` rồi tính status OK / DRIFT / GAP / UNTRACKED. |
|
|
140
143
|
|
|
141
144
|
---
|
|
142
145
|
|
|
143
146
|
## Phase 8 — Tester / QC Feedback
|
|
144
147
|
|
|
145
|
-
> Cả hai đều **read-only trên canonical specs/code**. Chúng chỉ ghi vào `feedback/` của shared spec repo và **commit + push** → PO/Dev thấy qua `/sync`. Tester/QC không bao giờ sửa `.feature` trực tiếp. QC cũng dùng hai lệnh này: `/qc-run-test` FAIL = product-gap và `/qc-analyze` DOC_GAPS blocker đều route sang `/report-bug` hoặc `/propose-scenario` (xem [../02-guides/qc-automation.md](../02-guides/qc-automation.md)).
|
|
148
|
+
> Cả hai đều **read-only trên canonical specs/code**. Chúng chỉ ghi vào `feedback/` của shared spec repo và **commit + push** → PO/Dev thấy qua `/sync`. Tester/QC không bao giờ sửa `.feature` trực tiếp. QC cũng dùng hai lệnh này: `/qc-run-test` FAIL = product-gap và `/qc-analyze` DOC_GAPS blocker đều route sang `/report-bug` hoặc `/propose-scenario` (xem [../02-guides/tester/qc-automation.md](../02-guides/tester/qc-automation.md)).
|
|
146
149
|
|
|
147
|
-
| Command |
|
|
148
|
-
|
|
149
|
-
| `/report-bug {UC-ID} {desc}` |
|
|
150
|
-
| `/propose-scenario {UC-ID} {desc}` |
|
|
150
|
+
| Command | Cách dùng (ví dụ) | Output | When to use |
|
|
151
|
+
|---------|-------------------|--------|-------------|
|
|
152
|
+
| `/report-bug {UC-ID} {desc}` | `/report-bug FEAT-01-UC1 "nhập sai mật khẩu vẫn đăng nhập được"` | `{spec_repo}/feedback/bug-reports/{BUG-ID}.md` + spec context + layer classification | Tester hoặc QC tìm thấy bug (gồm QC product-gap). Phân loại layer (Code/BDD/PRD/Design/Env) để route. |
|
|
153
|
+
| `/propose-scenario {UC-ID} {desc}` | `/propose-scenario FEAT-01-UC1 "khoá tài khoản sau 5 lần sai mật khẩu"` | `{spec_repo}/feedback/bdd-proposals/{UC-ID}-*.md` draft Gherkin | Tester hoặc QC tìm thấy edge case BDD chưa cover. Map vào PRD AC sẵn có, hoặc emit PRD change request nếu hành vi thực sự mới. |
|
|
151
154
|
|
|
152
155
|
---
|
|
153
156
|
|
|
154
157
|
## Debugging & Cross-cutting
|
|
155
158
|
|
|
156
|
-
| Command |
|
|
157
|
-
|
|
158
|
-
| `/fix-bug {BUG-ID\|ticket\|desc}` |
|
|
159
|
-
| `/debug` |
|
|
160
|
-
| `/learn {text}` | "AI
|
|
161
|
-
| `/generate-spec-manifest` |
|
|
159
|
+
| Command | Cách dùng (ví dụ) | Output | When to use |
|
|
160
|
+
|---------|-------------------|--------|-------------|
|
|
161
|
+
| `/fix-bug {BUG-ID\|ticket\|desc}` | `/fix-bug BUG-012` *(hoặc ticket / mô tả lỗi)* | Code fix trên branch + regression test; nếu nhận `{BUG-ID}` → set report State `🟢 Open` → `🟡 Fixed` (QC re-verify pass mới → `🟢 Closed`) | Khi tìm thấy bug/ticket, hoặc route một filed bug report. |
|
|
162
|
+
| `/debug` | `/debug "NullPointerException ở LoginService"` | Debug session | Deep debugging. |
|
|
163
|
+
| `/learn {text}` | `/learn "AI hay dùng var, phải dùng const"` | Appends guardrail vào project lessons file | Khi AI lặp lại lỗi bạn muốn chặn. |
|
|
164
|
+
| `/generate-spec-manifest` | `/generate-spec-manifest` | `spec-manifest.yaml` | Sinh manifest làm entry point cho external/tester agents. |
|
|
162
165
|
|
|
163
166
|
> **Project Lessons:** lessons lưu ở `paths.lessons_file` (default `specs/domain-knowledge/lessons-learned.md`; per-service `.agent/project-lessons.md` trong umbrella mode). Context-loader **Step 6.7** load mọi lesson đầu **mỗi** command như hard constraint. Đây là *project memory*, không phải fine-tuning model.
|
|
164
167
|
|
|
@@ -195,7 +198,7 @@ Load context theo thứ tự ưu tiên nghiêm ngặt (anti-lost-in-middle: fact
|
|
|
195
198
|
| Step | Priority | What loads |
|
|
196
199
|
|------|----------|-----------|
|
|
197
200
|
| 1 | PROJECT-CONFIG | `project-context.yaml` → stack, conventions, domains, services, paths |
|
|
198
|
-
| 1.5 | SERVICE ROUTING | *(umbrella only)* detect active domain, route `
|
|
201
|
+
| 1.5 | SERVICE ROUTING | *(umbrella only)* detect active domain, route `trace_dir` (+ code) → service submodule, store `service_root`. Khi `spec_source` set: `specs_dir` (BDD) / `tech_docs_dir` / PRD / design-spec / domain-knowledge / feedback → **spec repo** (cross-team), KHÔNG per-service |
|
|
199
202
|
| 1.6 | SERVICE CONVENTIONS | *(umbrella only)* load `{service_root}/.agent/project-context.yaml` → override `test_command`, `build_command`, `paths.trace_dir` |
|
|
200
203
|
| 2 | PROJECT-CONFIG | `.agent/modules/{module}/stack-profile.yaml` → framework-specific layer patterns |
|
|
201
204
|
| 3 | **CRITICAL** | `CLAUDE.md` → architecture layers, coding standards, naming |
|
|
@@ -58,7 +58,7 @@ Ví dụ adapt theo platform type:
|
|
|
58
58
|
|
|
59
59
|
## qc-playwright — QC automation stack
|
|
60
60
|
|
|
61
|
-
`qc-playwright` là **stack QC automation độc lập** với dev implementation module. Nó power native QC pipeline (`/qc-run-test`, `/qc-report`) và được chọn qua `tech_stack.qc_module` hoặc per `/qc-*` run — không phụ thuộc vào stack dev (java-spring, react, flutter…). Per-layer guides nằm ở `skills/qc/<stage>/`. Xem [../02-guides/qc-automation.md](../02-guides/qc-automation.md).
|
|
61
|
+
`qc-playwright` là **stack QC automation độc lập** với dev implementation module. Nó power native QC pipeline (`/qc-run-test`, `/qc-report`) và được chọn qua `tech_stack.qc_module` hoặc per `/qc-*` run — không phụ thuộc vào stack dev (java-spring, react, flutter…). Per-layer guides nằm ở `skills/qc/<stage>/`. Xem [../02-guides/tester/qc-automation.md](../02-guides/tester/qc-automation.md).
|
|
62
62
|
|
|
63
63
|
**Stack** (từ `modules/qc-playwright/stack-profile.yaml`): Python 3 + pytest-playwright + Page Object Model. Report = Playwright Trace + pytest-html (**không** dùng Allure, không hand-written dashboard, không `record_video`).
|
|
64
64
|
|
|
@@ -107,4 +107,4 @@ reports/ test-results/ ← generated (gitignored): html report, trace.zip,
|
|
|
107
107
|
|
|
108
108
|
---
|
|
109
109
|
|
|
110
|
-
*Xem thêm:* [Trace TSV Schema](trace-schema.md) (`qc_status` vs `dev_selftest`) · [Command Reference](commands.md) (pipeline `/qc-*`) · [02 · Guides · QC Automation](../02-guides/qc-automation.md).
|
|
110
|
+
*Xem thêm:* [Trace TSV Schema](trace-schema.md) (`qc_status` vs `dev_selftest`) · [Command Reference](commands.md) (pipeline `/qc-*`) · [02 · Guides · QC Automation](../02-guides/tester/qc-automation.md).
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
Tab-separated, một header row + một data row mỗi scenario. Header chính xác (từ `generate-bdd.tmpl`):
|
|
23
23
|
|
|
24
24
|
```
|
|
25
|
-
sc_id sc_title spec_ver gen_ver implemented_by test_count test_classes dev_selftest dev_selftest_at qc_status qc_run_at qc_owner qc_blocked_by prd_version bdd_version tech_doc_revision prd_status uc_status fe_phase status last_updated
|
|
25
|
+
sc_id sc_title spec_ver gen_ver implemented_by test_count test_classes dev_selftest dev_selftest_at qc_status qc_run_at qc_owner qc_blocked_by prd_version bdd_version tech_doc_revision fe_tech_doc_revision prd_status uc_status fe_phase status last_updated
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
22 cột, theo đúng thứ tự trên.
|
|
29
29
|
|
|
30
30
|
---
|
|
31
31
|
|
|
@@ -48,18 +48,19 @@ sc_id sc_title spec_ver gen_ver implemented_by test_count test_classes dev_selft
|
|
|
48
48
|
| 13 | `qc_blocked_by` | Artifact liên quan: `BUG-{id}` / `GAP-{id}` / `—` | `—` | **qc-run-test** / **report-bug** |
|
|
49
49
|
| 14 | `prd_version` | `@trace.prd_version` từ `.feature` header | từ `.feature` | generate-bdd |
|
|
50
50
|
| 15 | `bdd_version` | `@trace.bdd_version` từ `.feature` header | từ `.feature` | generate-bdd |
|
|
51
|
-
| 16 | `tech_doc_revision` |
|
|
52
|
-
| 17 | `
|
|
53
|
-
| 18 | `
|
|
54
|
-
| 19 | `
|
|
55
|
-
| 20 | `
|
|
56
|
-
| 21 | `
|
|
51
|
+
| 16 | `tech_doc_revision` | **BE** API-contract revision tại thời điểm codegen | `—` | generate-code / review-tech-docs (BE doc) |
|
|
52
|
+
| 17 | `fe_tech_doc_revision` | **FE** client tech-design revision (`{UC-ID}-tech-design-{platform}.md`) tại thời điểm FE integration | `—` | generate-code `--phase=integration` / review-tech-docs (FE doc) |
|
|
53
|
+
| 18 | `prd_status` | `\| **Status** \|` từ PRD metadata | từ PRD | generate-bdd |
|
|
54
|
+
| 19 | `uc_status` | Trạng thái UC: `draft` / `approved` / … | `draft` (UC mới) | generate-bdd |
|
|
55
|
+
| 20 | `fe_phase` | FE phase khi implement (`ui` / `integration`) | `—` | generate-code `--phase` |
|
|
56
|
+
| 21 | `status` | Trạng thái tổng hợp: `OK` / `DRIFT` / `GAP` / `UNTRACKED` | `UNTRACKED` | validate-traces |
|
|
57
|
+
| 22 | `last_updated` | Ngày update gần nhất (`YYYY-MM-DD`) | today | mọi command ghi row |
|
|
57
58
|
|
|
58
59
|
> **`qc_owner` / `qc_blocked_by` (PM "waiting-on" view):** dành cho PO kiêm PM xem **case nào đang chờ ai**. `/qc-run-test` set khi ghi `qc_status`: product-gap FAIL → `qc_owner=dev`; `skip`/`not_run` do `DOC_GAPS` 🔴 Blocker mở → `qc_owner=po` + `qc_blocked_by=GAP-{id}`; `pass` → cả hai về `—`. `/report-bug` backfill `qc_blocked_by=BUG-{id}` (+ `qc_owner` theo layer) cho SC khớp. `/validate-traces` tổng hợp `waiting_dev` / `waiting_po` cho dashboard.
|
|
59
60
|
|
|
60
|
-
> **Re-generation rules (generate-bdd):** SC đã có trong TSV & `spec_ver` không đổi → chỉ update `sc_title`, `prd_version`, `bdd_version`, `prd_status`, `uc_status`, `last_updated`. Nếu `spec_ver` đổi → thêm `spec_ver` và set `status = DRIFT` ngay. SC mới → append với `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` = `—`. SC bị xóa khỏi `.feature` → xóa row.
|
|
61
|
+
> **Re-generation rules (generate-bdd):** SC đã có trong TSV & `spec_ver` không đổi → chỉ update `sc_title`, `prd_version`, `bdd_version`, `prd_status`, `uc_status`, `last_updated`. Nếu `spec_ver` đổi → thêm `spec_ver` và set `status = DRIFT` ngay. SC mới → append với `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` = `—`. SC bị xóa khỏi `.feature` → xóa row.
|
|
61
62
|
|
|
62
|
-
> **Backward-compat:** TSV cũ
|
|
63
|
+
> **Backward-compat:** TSV cũ thiếu cột mới ở header → `/validate-traces` đọc thành giá trị rỗng, không lỗi: `qc_owner`/`qc_blocked_by` (trước 19 cột) → `null`; `fe_tech_doc_revision` (trước 22 cột) → `0`. Lần `/generate-bdd` re-gen kế tiếp tự nâng header lên 22 cột.
|
|
63
64
|
|
|
64
65
|
---
|
|
65
66
|
|
|
@@ -91,7 +92,7 @@ Trace TSV mang **hai cột tín hiệu độc lập** — không bao giờ trộ
|
|
|
91
92
|
| 3 | `DRIFT` | `spec_ver != gen_ver` (scenario đổi sau lần codegen gần nhất) |
|
|
92
93
|
| 4 | `OK` | tất cả: `spec_ver == gen_ver`, `implemented_by != —`, `test_count > 0` |
|
|
93
94
|
|
|
94
|
-
Ngoài ra `/validate-traces` còn flag **`PRD_DRIFT`** (PRD version trong code/TSV trễ hơn PRD file hiện tại) và **`
|
|
95
|
+
Ngoài ra `/validate-traces` còn flag **`PRD_DRIFT`** (PRD version trong code/TSV trễ hơn PRD file hiện tại), **`TECHDOC_DRIFT`** (code BE sinh từ BE-contract revision cũ — so `tech_doc_revision`), và **`FE_TECHDOC_DRIFT`** (FE integration code sinh từ FE tech-design revision cũ — so `fe_tech_doc_revision`).
|
|
95
96
|
|
|
96
97
|
---
|
|
97
98
|
|
|
@@ -141,11 +142,11 @@ Per-scenario trong file: `# @trace.scenario: {UC-ID}-SC{N}`, `# @trace.sc_versio
|
|
|
141
142
|
- `generated_at`, `domain`
|
|
142
143
|
- `summary` — aggregates: `total_prds`, `approved_prds`, `total_ucs`, `approved_ucs`, `draft_ucs`, `total_scs`, `coded_scs`, `tested_scs`, `code_coverage_pct`, `test_coverage_pct`, `drift_count`, `gap_count`, `untracked_count`, `dev_selftest_passing/failing/not_run`, `qc_passing/failing/skipped/not_run`, `waiting_dev`, `waiting_po`, `tech_docs_count`
|
|
143
144
|
- `prds[]` → `ucs[]` → `scenarios[]` — mỗi scenario có đầy đủ các trường của TSV row (gồm `dev_selftest`, `dev_selftest_at`, `qc_status`, `qc_run_at`)
|
|
144
|
-
- `issues` — phân loại: `drift`, `gap`, `untracked`, `prd_version_drift`, `techdoc_drift`, mỗi entry kèm `fix` command gợi ý
|
|
145
|
+
- `issues` — phân loại: `drift`, `gap`, `untracked`, `prd_version_drift`, `techdoc_drift`, `fe_techdoc_drift` (kèm `platform`), mỗi entry kèm `fix` command gợi ý
|
|
145
146
|
|
|
146
|
-
**TSV `"—"` → JSON mapping:** `implemented_by: "—"` → `null` · `test_count: "—"` → `0` · `test_classes: "—"` → `[]` · `tech_doc_revision: "—"` → `0` · `dev_selftest: "—"` → `"not_run"` · `dev_selftest_at: "—"` → `null` · `qc_status: "—"` → `"not_run"` · `qc_run_at: "—"` → `null`.
|
|
147
|
+
**TSV `"—"` → JSON mapping:** `implemented_by: "—"` → `null` · `test_count: "—"` → `0` · `test_classes: "—"` → `[]` · `tech_doc_revision: "—"` → `0` · `fe_tech_doc_revision: "—"` → `0` · `dev_selftest: "—"` → `"not_run"` · `dev_selftest_at: "—"` → `null` · `qc_status: "—"` → `"not_run"` · `qc_run_at: "—"` → `null`.
|
|
147
148
|
|
|
148
|
-
> **Umbrella mode:**
|
|
149
|
+
> **Umbrella mode:** khi `spec_source` set, `.trace/*.tsv` authoritative nằm **một chỗ** ở `{spec_source}/.trace/` (committed — PM quản lý tập trung; mỗi scenario mang `@trace.service`). `/validate-traces` (hoặc `/sync`) sinh `trace-report.json` vào `{spec_source}/.living-docs/` + mirror `./.trace/trace-report.json` ở workspace hiện tại — cả hai generated, gitignore. (Không có `spec_source` → `.trace` per-service.)
|
|
149
150
|
|
|
150
151
|
---
|
|
151
152
|
|
package/docs/README.md
CHANGED
|
@@ -10,8 +10,7 @@ Tài liệu được chia theo **vai trò** và **chủ đề**. Bắt đầu
|
|
|
10
10
|
| Người mới / cài đặt lần đầu | [01 · Getting Started](01-getting-started/) |
|
|
11
11
|
| Product Owner | [Guide · Product Owner](02-guides/product-owner/README.md) |
|
|
12
12
|
| Developer | [Guide · Developer](02-guides/developer/README.md) |
|
|
13
|
-
| Tester | [Guide · Tester](02-guides/tester/README.md) |
|
|
14
|
-
| QC Automation | [Guide · QC Automation](02-guides/qc-automation.md) |
|
|
13
|
+
| QC / Tester (QA) | [Guide · Tester / QA](02-guides/tester/README.md) — gồm cả pipeline QC tự động (`/qc-*`) |
|
|
15
14
|
| Muốn hiểu kiến trúc | [03 · Concepts](03-concepts/) |
|
|
16
15
|
| Vận hành / admin | [04 · Operations](04-operations/) |
|
|
17
16
|
| Tra cứu lệnh | [05 · Reference](05-reference/) |
|
|
@@ -28,8 +27,7 @@ Tài liệu được chia theo **vai trò** và **chủ đề**. Bắt đầu
|
|
|
28
27
|
### 02 · [Guides (theo vai trò)](02-guides/)
|
|
29
28
|
- [Product Owner](02-guides/product-owner/README.md) — define-product, PRD, design-spec, review
|
|
30
29
|
- [Developer](02-guides/developer/README.md) — BDD, tech-docs, code, dev self-check
|
|
31
|
-
- [Tester](02-guides/tester/README.md) — spec-manifest, report-bug, propose-scenario, Living Docs
|
|
32
|
-
- [QC Automation](02-guides/qc-automation.md) — pipeline `/qc-*`, qc_status
|
|
30
|
+
- [Tester / QA](02-guides/tester/README.md) — spec-manifest, report-bug, propose-scenario, Living Docs, và **chương [QC Automation](02-guides/tester/qc-automation.md)** (pipeline `/qc-*`, `qc_status`)
|
|
33
31
|
|
|
34
32
|
### 03 · [Concepts](03-concepts/)
|
|
35
33
|
- [Architecture](03-concepts/architecture.md) — layers, modules, plug-in system
|
|
@@ -48,4 +46,4 @@ Tài liệu được chia theo **vai trò** và **chủ đề**. Bắt đầu
|
|
|
48
46
|
|
|
49
47
|
---
|
|
50
48
|
|
|
51
|
-
*Mỗi file có breadcrumb điều hướng ở đầu. Phiên bản framework: xem
|
|
49
|
+
*Mỗi file có breadcrumb điều hướng ở đầu. Phiên bản framework mới nhất: xem trên [npm](https://www.npmjs.com/package/@anhth2/spec-driven-dev-plugin).*
|
|
@@ -19,6 +19,7 @@ architecture:
|
|
|
19
19
|
- "Each test independent via pytest-playwright fixtures (page / logged_in_page / …)"
|
|
20
20
|
- "Page Object extends slim BasePage; split 3 layers: locators _x(), actions verb_noun(), assertions assert_x() using expect()"
|
|
21
21
|
- "Locator priority: data-testid → role → label/text → CSS → avoid XPath"
|
|
22
|
+
- "test-id values come from the FE tech-design §2b Test Selectors contract ({UC-ID}-tech-design-{platform}.md) — prefer them (no runtime scan); fall back to role/text only when an actionable element has no test-id there, and note the gap"
|
|
22
23
|
- "Group tests by (role, account) so login/logout never interleaves across roles"
|
|
23
24
|
- "Cover 100% of TCs in the .Test.md — every TC ends Pass/Fail/Skip, none left Draft"
|
|
24
25
|
folder_structure: |
|
package/package.json
CHANGED
package/skills/code/SKILL.md
CHANGED
|
@@ -193,7 +193,7 @@ If `services` section is present:
|
|
|
193
193
|
- If `$ARGUMENTS` contains a path, extract the segment after `prd_dir`
|
|
194
194
|
|
|
195
195
|
**2. Route to service** — if active domain matches a key in `services`:
|
|
196
|
-
- Override `paths.specs_dir` → `services.{domain}.specs_dir`
|
|
196
|
+
- 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.
|
|
197
197
|
- 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.
|
|
198
198
|
- Store `active_service` = `services.{domain}.path`
|
|
199
199
|
- Store `active_service_module` = `services.{domain}.module`
|
|
@@ -204,6 +204,7 @@ If `services` section is present:
|
|
|
204
204
|
- Set `active_service = unresolved`
|
|
205
205
|
|
|
206
206
|
**4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
|
|
207
|
+
- 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`.)*
|
|
207
208
|
- Override `paths.prd_dir` → `{spec_source}/specs/prd`
|
|
208
209
|
- Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
|
|
209
210
|
- 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.)*
|
|
@@ -213,8 +214,9 @@ If `services` section is present:
|
|
|
213
214
|
- Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
|
|
214
215
|
- Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
|
|
215
216
|
- Override `paths.prd_change_requests_dir` → `{spec_source}/feedback/prd-change-requests`
|
|
217
|
+
- 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`.)*
|
|
216
218
|
|
|
217
|
-
> **Why under `spec_source`:** PRD, design-spec, domain knowledge, the **API contract (tech-docs)**,
|
|
219
|
+
> **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.
|
|
218
220
|
|
|
219
221
|
---
|
|
220
222
|
|
|
@@ -234,12 +236,12 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
|
|
|
234
236
|
|----------|--------|
|
|
235
237
|
| `conventions.test_command` | service's `conventions.test_command` |
|
|
236
238
|
| `conventions.build_command` | service's `conventions.build_command` |
|
|
237
|
-
| `paths.trace_dir` | `{active_service}/{service paths.trace_dir}`
|
|
238
|
-
| `paths.specs_dir` | `{active_service}/{service paths.specs_dir}`
|
|
239
|
+
| `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`). |
|
|
240
|
+
| `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. |
|
|
239
241
|
|
|
240
242
|
**3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
|
|
241
243
|
- Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
|
|
242
|
-
-
|
|
244
|
+
- **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/`).
|
|
243
245
|
|
|
244
246
|
**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).
|
|
245
247
|
|
|
@@ -518,6 +520,36 @@ Output Artifacts:
|
|
|
518
520
|
|
|
519
521
|
If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
|
|
520
522
|
|
|
523
|
+
## Pipeline Position
|
|
524
|
+
|
|
525
|
+
Print a one-line map of the pipeline with the CURRENT command's phase marked `◀ bạn ở đây`,
|
|
526
|
+
so the user always sees where this command sits in the end-to-end flow:
|
|
527
|
+
|
|
528
|
+
```
|
|
529
|
+
Discovery → PRD → [Design Spec] → BDD → Tech Design → Code → Dev Self-Check → QC → Trace Audit
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
Find the current command in this phase legend and mark **its** phase in the map above:
|
|
533
|
+
|
|
534
|
+
| Phase | Commands |
|
|
535
|
+
|-------|----------|
|
|
536
|
+
| Discovery | `/define-product` |
|
|
537
|
+
| PRD | `/generate-prd` · `/refine-prd` · `/review-context` (PRD) |
|
|
538
|
+
| Design Spec | `/generate-design-spec` |
|
|
539
|
+
| BDD | `/generate-bdd` · `/review-context` (BDD) |
|
|
540
|
+
| Tech Design | `/generate-tech-docs` · `/map-testids` · `/review-tech-docs` |
|
|
541
|
+
| Code | `/generate-code` · `/review-code` |
|
|
542
|
+
| Dev Self-Check | `/dev-gen-test` · `/dev-run-test` · `/dev-smoke-test` |
|
|
543
|
+
| QC | `/qc-analyze` · `/qc-plan` · `/qc-design-test` · `/qc-review` · `/qc-run-test` · `/qc-report` |
|
|
544
|
+
| Trace Audit | `/validate-traces` |
|
|
545
|
+
|
|
546
|
+
For a **review command**, also append the 3-step review loop with the current step marked, e.g.:
|
|
547
|
+
`Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume`.
|
|
548
|
+
|
|
549
|
+
**Cross-cutting commands** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
|
|
550
|
+
`/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) sit outside the linear pipeline —
|
|
551
|
+
**omit the Pipeline line entirely** for these (do not force-fit them onto the map).
|
|
552
|
+
|
|
521
553
|
## Next Command Suggestion
|
|
522
554
|
|
|
523
555
|
Suggest the logical next command based on workflow phase:
|
|
@@ -559,10 +591,13 @@ Suggest the logical next command based on workflow phase:
|
|
|
559
591
|
Format the footer as:
|
|
560
592
|
```
|
|
561
593
|
---
|
|
562
|
-
Status
|
|
594
|
+
Status : {badge}
|
|
563
595
|
{Output Artifacts block}
|
|
564
|
-
|
|
596
|
+
Pipeline : Discovery → PRD → [BDD ◀ bạn ở đây] → Tech Design → Code → Dev Self-Check → QC → Trace Audit
|
|
597
|
+
(review cmd) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
|
|
598
|
+
Next : {suggested command with example arguments}
|
|
565
599
|
```
|
|
600
|
+
*(Omit the `Pipeline` line for cross-cutting commands listed above.)*
|
|
566
601
|
|
|
567
602
|
|
|
568
603
|
---
|
|
@@ -643,6 +678,36 @@ Output Artifacts:
|
|
|
643
678
|
|
|
644
679
|
If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
|
|
645
680
|
|
|
681
|
+
## Pipeline Position
|
|
682
|
+
|
|
683
|
+
Print a one-line map of the pipeline with the CURRENT command's phase marked `◀ bạn ở đây`,
|
|
684
|
+
so the user always sees where this command sits in the end-to-end flow:
|
|
685
|
+
|
|
686
|
+
```
|
|
687
|
+
Discovery → PRD → [Design Spec] → BDD → Tech Design → Code → Dev Self-Check → QC → Trace Audit
|
|
688
|
+
```
|
|
689
|
+
|
|
690
|
+
Find the current command in this phase legend and mark **its** phase in the map above:
|
|
691
|
+
|
|
692
|
+
| Phase | Commands |
|
|
693
|
+
|-------|----------|
|
|
694
|
+
| Discovery | `/define-product` |
|
|
695
|
+
| PRD | `/generate-prd` · `/refine-prd` · `/review-context` (PRD) |
|
|
696
|
+
| Design Spec | `/generate-design-spec` |
|
|
697
|
+
| BDD | `/generate-bdd` · `/review-context` (BDD) |
|
|
698
|
+
| Tech Design | `/generate-tech-docs` · `/map-testids` · `/review-tech-docs` |
|
|
699
|
+
| Code | `/generate-code` · `/review-code` |
|
|
700
|
+
| Dev Self-Check | `/dev-gen-test` · `/dev-run-test` · `/dev-smoke-test` |
|
|
701
|
+
| QC | `/qc-analyze` · `/qc-plan` · `/qc-design-test` · `/qc-review` · `/qc-run-test` · `/qc-report` |
|
|
702
|
+
| Trace Audit | `/validate-traces` |
|
|
703
|
+
|
|
704
|
+
For a **review command**, also append the 3-step review loop with the current step marked, e.g.:
|
|
705
|
+
`Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume`.
|
|
706
|
+
|
|
707
|
+
**Cross-cutting commands** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
|
|
708
|
+
`/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) sit outside the linear pipeline —
|
|
709
|
+
**omit the Pipeline line entirely** for these (do not force-fit them onto the map).
|
|
710
|
+
|
|
646
711
|
## Next Command Suggestion
|
|
647
712
|
|
|
648
713
|
Suggest the logical next command based on workflow phase:
|
|
@@ -684,8 +749,11 @@ Suggest the logical next command based on workflow phase:
|
|
|
684
749
|
Format the footer as:
|
|
685
750
|
```
|
|
686
751
|
---
|
|
687
|
-
Status
|
|
752
|
+
Status : {badge}
|
|
688
753
|
{Output Artifacts block}
|
|
689
|
-
|
|
754
|
+
Pipeline : Discovery → PRD → [BDD ◀ bạn ở đây] → Tech Design → Code → Dev Self-Check → QC → Trace Audit
|
|
755
|
+
(review cmd) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
|
|
756
|
+
Next : {suggested command with example arguments}
|
|
690
757
|
```
|
|
758
|
+
*(Omit the `Pipeline` line for cross-cutting commands listed above.)*
|
|
691
759
|
|