@edupia-tutor/spec-driven-docs 0.14.0 → 0.14.2
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/bin/index.js +12 -1
- package/commands/debug.md +436 -436
- package/commands/debug.tmpl +111 -111
- package/commands/define-product.md +350 -345
- package/commands/define-product.tmpl +69 -64
- package/commands/dev-gen-test.md +365 -365
- package/commands/dev-gen-test.tmpl +63 -63
- package/commands/dev-run-test.md +376 -376
- package/commands/dev-run-test.tmpl +74 -74
- package/commands/dev-smoke-test.md +341 -341
- package/commands/dev-smoke-test.tmpl +60 -60
- package/commands/fix-bug.md +403 -403
- package/commands/fix-bug.tmpl +78 -78
- package/commands/generate-bdd.md +513 -513
- package/commands/generate-bdd.tmpl +211 -211
- package/commands/generate-code.md +481 -483
- package/commands/generate-code.tmpl +179 -181
- package/commands/generate-design-spec.md +497 -497
- package/commands/generate-design-spec.tmpl +220 -220
- package/commands/generate-prd.md +452 -400
- package/commands/generate-prd.tmpl +50 -200
- package/commands/generate-spec-manifest.md +340 -340
- package/commands/generate-spec-manifest.tmpl +59 -59
- package/commands/generate-tech-docs.md +365 -365
- package/commands/generate-tech-docs.tmpl +84 -84
- package/commands/learn.md +347 -347
- package/commands/learn.tmpl +22 -22
- package/commands/map-testids.md +322 -322
- package/commands/map-testids.tmpl +41 -41
- package/commands/propose-scenario.md +335 -335
- package/commands/propose-scenario.tmpl +54 -54
- package/commands/qc-analyze.md +323 -324
- package/commands/qc-analyze.tmpl +42 -43
- package/commands/qc-design-test.md +304 -304
- package/commands/qc-design-test.tmpl +23 -23
- package/commands/qc-plan.md +297 -297
- package/commands/qc-plan.tmpl +16 -16
- package/commands/qc-report.md +302 -302
- package/commands/qc-report.tmpl +21 -21
- package/commands/qc-review.md +298 -298
- package/commands/qc-review.tmpl +17 -17
- package/commands/qc-run-test.md +337 -337
- package/commands/qc-run-test.tmpl +35 -35
- package/commands/refine-prd.md +428 -430
- package/commands/refine-prd.tmpl +62 -62
- package/commands/report-bug.md +351 -351
- package/commands/report-bug.tmpl +70 -70
- package/commands/review-code.md +364 -364
- package/commands/review-code.tmpl +39 -39
- package/commands/review-context.md +578 -580
- package/commands/review-context.tmpl +212 -212
- package/commands/review-tech-docs.md +427 -427
- package/commands/review-tech-docs.tmpl +146 -146
- package/commands/setup-ai-first.md +239 -239
- package/commands/setup-ai-first.tmpl +133 -133
- package/commands/sync.md +145 -145
- package/commands/sync.tmpl +93 -93
- package/commands/update-framework.md +88 -88
- package/commands/update-framework.tmpl +36 -36
- package/commands/validate-traces.md +381 -381
- package/commands/validate-traces.tmpl +100 -100
- package/core/FRAMEWORK_VERSION +1 -1
- package/core/commands/debug.md +436 -436
- package/core/commands/define-product.md +350 -345
- package/core/commands/dev-gen-test.md +365 -365
- package/core/commands/dev-run-test.md +376 -376
- package/core/commands/dev-smoke-test.md +341 -341
- package/core/commands/fix-bug.md +403 -403
- package/core/commands/generate-bdd.md +513 -513
- package/core/commands/generate-code.md +481 -483
- package/core/commands/generate-design-spec.md +497 -497
- package/core/commands/generate-prd.md +452 -400
- package/core/commands/generate-spec-manifest.md +340 -340
- package/core/commands/generate-tech-docs.md +365 -365
- package/core/commands/learn.md +347 -347
- package/core/commands/map-testids.md +322 -322
- package/core/commands/propose-scenario.md +335 -335
- package/core/commands/qc-analyze.md +323 -324
- package/core/commands/qc-design-test.md +304 -304
- package/core/commands/qc-plan.md +297 -297
- package/core/commands/qc-report.md +302 -302
- package/core/commands/qc-review.md +298 -298
- package/core/commands/qc-run-test.md +337 -337
- package/core/commands/refine-prd.md +428 -430
- package/core/commands/report-bug.md +351 -351
- package/core/commands/review-code.md +364 -364
- package/core/commands/review-context.md +578 -580
- package/core/commands/review-tech-docs.md +427 -427
- package/core/commands/setup-ai-first.md +239 -239
- package/core/commands/sync.md +145 -145
- package/core/commands/update-framework.md +88 -88
- package/core/commands/validate-traces.md +381 -381
- package/core/skills/code/SKILL.md +389 -389
- package/core/skills/debug/SKILL.md +391 -391
- package/core/skills/design-spec/SKILL.md +318 -318
- package/core/skills/discovery/SKILL.md +7 -547
- package/core/skills/prd/SKILL.md +298 -394
- package/core/skills/setup-ai-first/SKILL.md +80 -80
- package/core/skills/spec/SKILL.md +178 -178
- package/core/skills/test/SKILL.md +604 -604
- package/core/steps/capture-lesson.md +44 -44
- package/core/steps/context-loader.md +175 -175
- package/core/steps/gate.md +54 -54
- package/core/steps/report-footer.md +52 -52
- package/core/steps/review-fanout.md +85 -87
- package/core/steps/spawn-agent.md +45 -45
- package/core/steps/trace-mirror.md +21 -21
- package/core/templates/architecture.template.md +37 -37
- package/core/templates/design-spec.template.md +77 -77
- package/core/templates/platform-guide.template.md +47 -47
- package/core/templates/prd.template.md +107 -232
- package/core/templates/product-definition.template.md +101 -88
- package/core/templates/project-context.yaml +2 -2
- package/docs/01-getting-started/core-concepts.md +1 -1
- package/docs/01-getting-started/quickstart.md +7 -7
- package/docs/02-guides/developer/bdd-and-trace.md +1 -1
- package/docs/02-guides/developer/scenarios.md +5 -5
- package/docs/02-guides/product-owner/handoff-checklist.md +1 -1
- package/docs/02-guides/product-owner/scenarios.md +23 -23
- package/docs/02-guides/tester/bug-reporting.md +2 -2
- package/docs/02-guides/tester/reading-specs.md +2 -2
- package/docs/02-guides/tester/scenarios.md +1 -1
- package/docs/02-guides/tester/spec-manifest.md +3 -3
- package/docs/02-guides/tester/workflow.md +1 -1
- package/docs/03-concepts/architecture.md +3 -3
- package/docs/03-concepts/pipeline.md +3 -3
- package/docs/04-operations/publishing.md +20 -3
- package/docs/04-operations/sync-and-update.md +5 -5
- package/docs/05-reference/command-cheatsheet.md +2 -2
- package/docs/05-reference/commands.md +8 -8
- package/package.json +1 -1
- package/scripts/migrate-specs.js +5 -3
- package/scripts/rename-prd-files.js +174 -0
- package/skills/code/SKILL.md +389 -389
- package/skills/code/SKILL.tmpl +56 -56
- package/skills/debug/SKILL.md +391 -391
- package/skills/debug/SKILL.tmpl +60 -60
- package/skills/design-spec/SKILL.md +318 -318
- package/skills/design-spec/SKILL.tmpl +37 -37
- package/skills/discovery/SKILL.md +7 -547
- package/skills/discovery/SKILL.tmpl +7 -140
- package/skills/prd/SKILL.md +298 -394
- package/skills/prd/SKILL.tmpl +40 -151
- package/skills/setup-ai-first/SKILL.md +80 -80
- package/skills/setup-ai-first/SKILL.tmpl +28 -28
- package/skills/spec/SKILL.md +178 -178
- package/skills/spec/SKILL.tmpl +20 -20
- package/skills/test/SKILL.md +604 -604
- package/skills/test/SKILL.tmpl +44 -44
- package/steps/capture-lesson.md +44 -44
- package/steps/context-loader.md +175 -175
- package/steps/gate.md +54 -54
- package/steps/report-footer.md +52 -52
- package/steps/review-fanout.md +85 -87
- package/steps/spawn-agent.md +45 -45
- package/steps/trace-mirror.md +21 -21
- package/templates/architecture.template.md +37 -37
- package/templates/design-spec.template.md +77 -77
- package/templates/platform-guide.template.md +47 -47
- package/templates/prd.template.md +107 -232
- package/templates/product-definition.template.md +101 -88
- package/templates/project-context.yaml +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# /generate-bdd —
|
|
1
|
+
# /generate-bdd — Sinh BDD Feature Files
|
|
2
2
|
|
|
3
3
|
## Gate
|
|
4
4
|
{{include:steps/gate.md}}
|
|
@@ -6,57 +6,57 @@
|
|
|
6
6
|
## Context
|
|
7
7
|
{{include:steps/context-loader.md}}
|
|
8
8
|
|
|
9
|
-
> **
|
|
9
|
+
> **Proposal của tester (input tuỳ chọn):** trước khi sinh, kiểm tra `{paths.bdd_proposals_dir}/` (mặc định `{spec_source}/feedback/bdd-proposals/`) tìm các scenario mà tester đề xuất qua `/propose-scenario` ứng với AC của UC này. Đưa vào những cái PO/Dev đã chấp nhận — rồi draft của tester được xoá/lưu trữ khỏi `feedback/`. Bỏ qua nếu folder rỗng.
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
## Repo Mode
|
|
13
|
+
## Phát hiện Repo Mode
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Sau khi nạp context, xác định chế độ hoạt động:
|
|
16
16
|
|
|
17
|
-
- **Spec repo mode**: `project-context.yaml`
|
|
18
|
-
- **Umbrella mode**: `project-context.yaml`
|
|
17
|
+
- **Spec repo mode**: `project-context.yaml` KHÔNG có section `services` HOẶC `setup.mode: spec`
|
|
18
|
+
- **Umbrella mode**: `project-context.yaml` CÓ section `services` VÀ `setup.mode: umbrella`
|
|
19
19
|
|
|
20
|
-
→ Spec repo mode →
|
|
21
|
-
→ Umbrella mode →
|
|
20
|
+
→ Spec repo mode → tới **Platform Selection** bên dưới (bỏ qua Service Detection)
|
|
21
|
+
→ Umbrella mode → tới **Service Detection** bên dưới (bỏ qua Platform Selection)
|
|
22
22
|
|
|
23
23
|
---
|
|
24
24
|
|
|
25
|
-
## Platform Selection (Spec Repo Mode
|
|
25
|
+
## Platform Selection (chỉ Spec Repo Mode)
|
|
26
26
|
|
|
27
|
-
*
|
|
27
|
+
*Bỏ qua section này nếu đang chạy umbrella mode.*
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
Hỏi người dùng chọn platform target:
|
|
30
30
|
|
|
31
31
|
```
|
|
32
|
-
|
|
32
|
+
BDD này dành cho platform nào?
|
|
33
33
|
1. web — FE/Web (React, Next.js, Angular, Vue, Nuxt)
|
|
34
34
|
2. app — Mobile (Flutter, React Native, iOS, Android)
|
|
35
|
-
3. system — System/BE BDD (
|
|
35
|
+
3. system — System/BE BDD (tổng hợp từ web + app BDD có sẵn)
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
Chờ người dùng chọn. Set `active_platform` = giá trị đã chọn.
|
|
39
39
|
|
|
40
40
|
**Output path (spec repo mode):**
|
|
41
41
|
`{paths.specs_dir}/{domain}/{prd-slug}/bdd/{active_platform}/{TICKET-ID}-UC{N}-{slug}.feature`
|
|
42
42
|
|
|
43
|
-
**
|
|
43
|
+
**Từ vựng theo platform:**
|
|
44
44
|
|
|
45
45
|
| Platform | "user action" | "type/input" | "observe" | "navigate" |
|
|
46
46
|
|---|---|---|---|---|
|
|
47
47
|
| web | "clicks" | "types into" / "enters" | "sees" / "the page shows" | "navigates to" / "goes to" |
|
|
48
48
|
| app | "taps" | "enters" / "inputs" | "sees" / "the screen shows" | "navigates to" / "opens" |
|
|
49
|
-
| system | N/A —
|
|
49
|
+
| system | N/A — dùng business event | — | "the system returns" / "receives response" | — |
|
|
50
50
|
|
|
51
51
|
---
|
|
52
52
|
|
|
53
53
|
## System BDD Synthesis (active_platform = system)
|
|
54
54
|
|
|
55
|
-
*
|
|
55
|
+
*Chỉ áp dụng khi platform = system. Bỏ qua với web và app.*
|
|
56
56
|
|
|
57
57
|
### Step S0 — Brownfield Check
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
Kiểm tra bảng Metadata của PRD nguồn tìm `| **API Source** | existing |`.
|
|
60
60
|
|
|
61
61
|
**Nếu `API Source: existing`:**
|
|
62
62
|
- API contract đã được PO ghi trong phần "Existing API Contract" của PRD.
|
|
@@ -69,47 +69,47 @@ Check the source PRD Metadata table for `| **API Source** | existing |`.
|
|
|
69
69
|
|
|
70
70
|
---
|
|
71
71
|
|
|
72
|
-
### Step S1 — Scan
|
|
72
|
+
### Step S1 — Scan các BDD FE/App có sẵn
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
- Web
|
|
76
|
-
- App
|
|
74
|
+
Tìm các BDD có sẵn cho TICKET-ID này:
|
|
75
|
+
- Web BDD: `{paths.specs_dir}/{domain}/{prd-slug}/bdd/web/{TICKET-ID}-*.feature`
|
|
76
|
+
- App BDD: `{paths.specs_dir}/{domain}/{prd-slug}/bdd/app/{TICKET-ID}-*.feature`
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
Phân loại feature:
|
|
79
79
|
|
|
80
|
-
|
|
|
80
|
+
| Điều kiện | Mode |
|
|
81
81
|
|---|---|
|
|
82
|
-
|
|
|
83
|
-
|
|
|
84
|
-
|
|
|
85
|
-
|
|
|
82
|
+
| Tìm thấy cả web + app BDD | **Multi-platform** — tổng hợp từ cả hai |
|
|
83
|
+
| Chỉ tìm thấy web BDD | **Web-only** — tổng hợp từ web |
|
|
84
|
+
| Chỉ tìm thấy app BDD | **App-only** — tổng hợp từ app |
|
|
85
|
+
| Không tìm thấy FE/App BDD | **Backend-only** — gen trực tiếp từ PRD |
|
|
86
86
|
|
|
87
87
|
---
|
|
88
88
|
|
|
89
|
-
### Step S2 —
|
|
89
|
+
### Step S2 — Trích contract kỳ vọng theo từng platform
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
- **Triggers**:
|
|
93
|
-
- **Expected response data**:
|
|
94
|
-
- **Error signals**:
|
|
95
|
-
- **Business rules**:
|
|
91
|
+
Với mỗi file BDD tìm thấy, trích:
|
|
92
|
+
- **Triggers**: hành động người dùng nào gọi backend? (map sang event "request" logic)
|
|
93
|
+
- **Expected response data**: mỗi mệnh đề `Then` cần field/shape gì từ hệ thống?
|
|
94
|
+
- **Error signals**: backend phải báo hiệu các trạng thái lỗi nào?
|
|
95
|
+
- **Business rules**: mỗi platform giả định hệ thống thực thi các invariant nào?
|
|
96
96
|
|
|
97
97
|
---
|
|
98
98
|
|
|
99
|
-
### Step S3 — Cross-Platform Conflict Check (multi-platform mode
|
|
99
|
+
### Step S3 — Cross-Platform Conflict Check (chỉ multi-platform mode)
|
|
100
100
|
|
|
101
|
-
*
|
|
101
|
+
*Bỏ qua nếu web-only, app-only, hoặc backend-only.*
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
So sánh các contract đã trích giữa các platform. Gắn cờ conflict nếu bất kỳ cái nào khác nhau:
|
|
104
104
|
|
|
105
|
-
|
|
|
105
|
+
| Loại conflict | Ví dụ |
|
|
106
106
|
|---|---|
|
|
107
|
-
| **Response shape mismatch** | Web
|
|
108
|
-
| **Error semantics mismatch** | Web
|
|
109
|
-
| **Business rule contradiction** | Web BDD
|
|
110
|
-
| **Data field conflict** | Web
|
|
107
|
+
| **Response shape mismatch** | Web mong `{ token, redirect_url }`, App mong `{ token, user_profile }` |
|
|
108
|
+
| **Error semantics mismatch** | Web mong HTTP 423 cho lock, App mong custom error code `ACC_LOCKED` |
|
|
109
|
+
| **Business rule contradiction** | Web BDD nói "lock sau 5 lần", App BDD nói "lock sau 3 lần" |
|
|
110
|
+
| **Data field conflict** | Web mong `expires_in: seconds`, App mong `expires_at: ISO timestamp` |
|
|
111
111
|
|
|
112
|
-
**
|
|
112
|
+
**Nếu phát hiện conflict → CHECKPOINT (bắt buộc, không bỏ qua được):**
|
|
113
113
|
|
|
114
114
|
```
|
|
115
115
|
⚠️ CROSS-PLATFORM CONTRACT CONFLICT
|
|
@@ -122,103 +122,103 @@ Conflict 1: Response shape mismatch
|
|
|
122
122
|
|
|
123
123
|
Resolution options:
|
|
124
124
|
A — Union response
|
|
125
|
-
BE
|
|
126
|
-
|
|
127
|
-
B — Platform hint
|
|
128
|
-
Client
|
|
129
|
-
|
|
130
|
-
C —
|
|
131
|
-
POST /auth/login/web
|
|
132
|
-
|
|
133
|
-
D — Custom:
|
|
125
|
+
BE trả về tất cả field: { token, redirect_url, user_profile }
|
|
126
|
+
Client bỏ qua field không dùng. Đơn giản, hơi over-fetch.
|
|
127
|
+
B — Platform hint trong request
|
|
128
|
+
Client gửi X-Platform: web|app trong header, BE tuỳ biến response.
|
|
129
|
+
Response gọn hơn, nhiều BE logic hơn.
|
|
130
|
+
C — Endpoint riêng
|
|
131
|
+
POST /auth/login/web và POST /auth/login/app
|
|
132
|
+
Linh hoạt tối đa, nhiều endpoint phải bảo trì hơn.
|
|
133
|
+
D — Custom: mô tả cách của bạn
|
|
134
134
|
──────────────────────────────────────────────────────────────────
|
|
135
|
-
|
|
135
|
+
Chọn resolution cho mỗi conflict (A/B/C/D):
|
|
136
136
|
```
|
|
137
137
|
|
|
138
|
-
|
|
138
|
+
Chờ PO giải quyết từng conflict. Ghi mỗi quyết định thành annotation `# @system.resolution:` trong file system BDD được gen.
|
|
139
139
|
|
|
140
|
-
**
|
|
140
|
+
**Nếu không có conflict → tới Step S4 trực tiếp.**
|
|
141
141
|
|
|
142
142
|
---
|
|
143
143
|
|
|
144
|
-
### Step S4 —
|
|
144
|
+
### Step S4 — Sinh các scenario System BDD
|
|
145
145
|
|
|
146
|
-
|
|
146
|
+
Sinh scenario dựa trên mode và các conflict đã giải quyết:
|
|
147
147
|
|
|
148
|
-
- **Multi-platform**:
|
|
149
|
-
- **Web-only / App-only**:
|
|
150
|
-
- **Backend-only**:
|
|
148
|
+
- **Multi-platform**: tổng hợp từ cả contract web + app, áp dụng các resolution đã chọn
|
|
149
|
+
- **Web-only / App-only**: suy ra từ contract của một platform
|
|
150
|
+
- **Backend-only**: suy ra trực tiếp từ AC/BR của PRD dùng ngôn ngữ business event (không phải HTTP)
|
|
151
151
|
|
|
152
|
-
|
|
152
|
+
Từ vựng step của System BDD (luôn dùng — bất kể từ vựng FE/App):
|
|
153
153
|
- Triggers: "the system receives {event}" / "a {actor} submits {action}"
|
|
154
154
|
- Assertions: "the system returns {data}" / "the system signals {error}" / "the system stores {state}"
|
|
155
|
-
-
|
|
155
|
+
- KHÔNG dùng từ UI (click, tap, see, navigate) trong system BDD
|
|
156
156
|
|
|
157
|
-
**
|
|
158
|
-
- System BDD
|
|
159
|
-
-
|
|
157
|
+
**Nếu multi-platform với resolution A (union):**
|
|
158
|
+
- System BDD thể hiện contract response đầy đủ: tất cả field từ mọi platform
|
|
159
|
+
- Thêm comment: `# @system.resolution: union — clients receive all fields`
|
|
160
160
|
|
|
161
|
-
**
|
|
162
|
-
-
|
|
163
|
-
-
|
|
161
|
+
**Nếu resolution B (platform hint):**
|
|
162
|
+
- Viết `Scenario Outline` riêng dùng Examples table cho biến thể response `web` vs `app`
|
|
163
|
+
- Thêm comment: `# @system.resolution: platform-hint — X-Platform header determines response shape`
|
|
164
164
|
|
|
165
|
-
**
|
|
166
|
-
-
|
|
167
|
-
-
|
|
165
|
+
**Nếu resolution C (endpoint riêng):**
|
|
166
|
+
- Viết Scenario riêng cho mỗi endpoint
|
|
167
|
+
- Ghi rõ việc tách endpoint trong phần SCOPE
|
|
168
168
|
|
|
169
169
|
---
|
|
170
170
|
|
|
171
|
-
## Service Detection (Umbrella Mode
|
|
171
|
+
## Service Detection (chỉ Umbrella Mode)
|
|
172
172
|
|
|
173
|
-
*
|
|
173
|
+
*Bỏ qua section này nếu đang chạy spec repo mode.*
|
|
174
174
|
|
|
175
|
-
|
|
175
|
+
Đọc bảng Metadata của PRD tìm row `| **Service** |` và `| **Module** |`.
|
|
176
176
|
|
|
177
|
-
|
|
|
177
|
+
| Điều kiện | Hành động |
|
|
178
178
|
|---|---|
|
|
179
|
-
| PRD
|
|
180
|
-
| PRD
|
|
181
|
-
|
|
|
179
|
+
| PRD có row `Service` VÀ giá trị không phải "default" | Dùng làm `active_service` + `active_module`. Nạp catalog cho module đó. |
|
|
180
|
+
| PRD không có row `Service` VÀ `services` được định nghĩa trong project-context.yaml | Hỏi: "BDD này dành cho service nào?" (liệt kê service, chờ chọn) |
|
|
181
|
+
| Dự án single-service (không có mảng `services`) | `active_service = "default"`, `active_module = tech_stack.module` |
|
|
182
182
|
|
|
183
183
|
**Output path (umbrella mode):**
|
|
184
184
|
- `active_service = "default"` → `{paths.specs_dir}/{domain}/{prd-slug}/bdd/{TICKET-ID}-UC{N}-{slug}.feature`
|
|
185
185
|
- `active_service ≠ "default"` → `{paths.specs_dir}/{domain}/{prd-slug}/bdd/{active_service}/{TICKET-ID}-UC{N}-{slug}.feature`
|
|
186
186
|
|
|
187
|
-
**
|
|
187
|
+
**Từ vựng theo platform** — điều chỉnh cách viết step BDD theo `active_module`:
|
|
188
188
|
|
|
189
189
|
| Platform type | Modules | "click" | "type" | "see" | "navigate" |
|
|
190
190
|
|---|---|---|---|---|---|
|
|
191
191
|
| Web | react, nextjs, vue, nuxt, angular | "clicks" | "types into" / "enters" | "sees" / "the page shows" | "navigates to" / "goes to" |
|
|
192
192
|
| Mobile | flutter, react-native, ios-swiftui, android-compose | "taps" | "enters" / "inputs" | "sees" / "the screen shows" | "navigates to" / "opens" |
|
|
193
|
-
| Backend / API | java-spring, golang, dotnet, php-laravel | *(
|
|
193
|
+
| Backend / API | java-spring, golang, dotnet, php-laravel | *(không có UI step — dùng)* "submits a request" / "calls the API" | — | "receives response" / "the system returns" | — |
|
|
194
194
|
|
|
195
|
-
|
|
195
|
+
Áp dụng từ vựng này âm thầm khi viết step Gherkin. KHÔNG trộn từ web và mobile trong cùng một file feature.
|
|
196
196
|
|
|
197
197
|
---
|
|
198
198
|
|
|
199
199
|
## Orchestration Check
|
|
200
200
|
|
|
201
|
-
*
|
|
201
|
+
*Bỏ qua section này nếu đã ở sub-agent mode (Step 0 của Gate đã kích hoạt).*
|
|
202
202
|
|
|
203
|
-
|
|
203
|
+
Sau khi nạp context, kiểm tra PRD target có đủ lớn để cần sub-agent không:
|
|
204
204
|
|
|
205
|
-
1.
|
|
206
|
-
2.
|
|
207
|
-
3.
|
|
208
|
-
-
|
|
209
|
-
-
|
|
210
|
-
-
|
|
211
|
-
-
|
|
212
|
-
- **
|
|
213
|
-
4.
|
|
205
|
+
1. Đếm các heading `#### {TICKET-ID}-UC` trong PRD → **UC count**.
|
|
206
|
+
2. Đếm tổng số dòng trong PRD → **line count**.
|
|
207
|
+
3. Nếu **UC count > 3** HOẶC **line count > 300**:
|
|
208
|
+
- Chuyển sang orchestration mode — theo `steps/spawn-agent.md`.
|
|
209
|
+
- Session chính trở thành orchestrator: spawn 1 sub-agent cho mỗi UC.
|
|
210
|
+
- Mỗi sub-agent chạy `/generate-bdd` với payload `_agent_mode: true`.
|
|
211
|
+
- Thu thập kết quả và hiện report đã merge.
|
|
212
|
+
- **KHÔNG tiếp tục các bước bên dưới.**
|
|
213
|
+
4. Nếu UC count ≤ 3 VÀ line count ≤ 300 → tiếp tục Version Check bên dưới (single-session mode).
|
|
214
214
|
|
|
215
215
|
---
|
|
216
216
|
|
|
217
217
|
## Sub-Agent Return Format
|
|
218
218
|
|
|
219
|
-
*
|
|
219
|
+
*Section này áp dụng khi chạy như sub-agent (Gate Step 0 phát hiện `_agent_mode: true`).*
|
|
220
220
|
|
|
221
|
-
|
|
221
|
+
Sau khi sinh tất cả file `.feature` và `.tsv` cho UC được giao, trả về JSON kết quả có cấu trúc (theo `steps/spawn-agent.md` Step E):
|
|
222
222
|
|
|
223
223
|
```json
|
|
224
224
|
{ "uc_id": "{TICKET-ID}-UC{N}", "files_created": ["path/to/file1", "path/to/file2"], "status": "success | error", "errors": [] }
|
|
@@ -228,83 +228,83 @@ After generating all `.feature` and `.tsv` files for the assigned UC, return the
|
|
|
228
228
|
|
|
229
229
|
## Version Check
|
|
230
230
|
|
|
231
|
-
|
|
231
|
+
Trước khi sinh, kiểm tra các file `.feature` có sẵn cho PRD này:
|
|
232
232
|
|
|
233
|
-
1.
|
|
233
|
+
1. Phân giải search path theo mode:
|
|
234
234
|
- **Spec repo mode**: `{paths.specs_dir}/{domain}/{prd-slug}/bdd/{active_platform}/{TICKET-ID}-UC*.feature`
|
|
235
|
-
- **Umbrella mode**: `{paths.specs_dir}/{domain}/{prd-slug}/bdd/{TICKET-ID}-UC*.feature` (
|
|
236
|
-
2.
|
|
237
|
-
|
|
238
|
-
**
|
|
239
|
-
|
|
240
|
-
**
|
|
241
|
-
-
|
|
242
|
-
-
|
|
243
|
-
-
|
|
244
|
-
-
|
|
245
|
-
1.
|
|
246
|
-
2.
|
|
235
|
+
- **Umbrella mode**: `{paths.specs_dir}/{domain}/{prd-slug}/bdd/{TICKET-ID}-UC*.feature` (hoặc với `{active_service}/` nếu multi-service)
|
|
236
|
+
2. Đọc `| **Version** |` hiện tại của PRD từ metadata (vd: `1.2`).
|
|
237
|
+
|
|
238
|
+
**Nếu không có file feature nào** → gen mới, tiếp tục bình thường. Dùng version PRD làm `@trace.prd_version`.
|
|
239
|
+
|
|
240
|
+
**Nếu tìm thấy file feature có sẵn**:
|
|
241
|
+
- Đọc `# @trace.prd_version:` từ header file feature có sẵn.
|
|
242
|
+
- So với version PRD hiện tại.
|
|
243
|
+
- Nếu **giống** → hỏi: "BDD đã sinh từ PRD v{version}. Gen lại? (Y/N)"
|
|
244
|
+
- Nếu **khác** (PRD đã cập nhật):
|
|
245
|
+
1. Đọc `## Changelog` từ PRD — trích tất cả row mới hơn `@trace.prd_version` của BDD hiện có.
|
|
246
|
+
2. Hiện CHECKPOINT:
|
|
247
247
|
```
|
|
248
|
-
⚠️ PRD version drift
|
|
249
|
-
BDD
|
|
250
|
-
PRD
|
|
248
|
+
⚠️ Phát hiện PRD version drift
|
|
249
|
+
BDD được sinh từ PRD v{old}
|
|
250
|
+
PRD giờ ở v{new}
|
|
251
251
|
|
|
252
|
-
|
|
252
|
+
Thay đổi kể từ v{old}:
|
|
253
253
|
{changelog rows}
|
|
254
254
|
|
|
255
255
|
Options:
|
|
256
|
-
Y —
|
|
257
|
-
F —
|
|
258
|
-
N —
|
|
256
|
+
Y — chỉ cập nhật các scenario bị ảnh hưởng
|
|
257
|
+
F — gen lại toàn bộ scenario
|
|
258
|
+
N — huỷ
|
|
259
259
|
```
|
|
260
|
-
3.
|
|
260
|
+
3. Tiếp tục theo lựa chọn của người dùng.
|
|
261
261
|
|
|
262
262
|
---
|
|
263
263
|
|
|
264
|
-
## BDD Writing Rules (R1-R10 — enforce
|
|
264
|
+
## BDD Writing Rules (R1-R10 — enforce nghiêm)
|
|
265
265
|
|
|
266
|
-
| Rule | Name |
|
|
266
|
+
| Rule | Name | Yêu cầu |
|
|
267
267
|
|------|------|-------------|
|
|
268
|
-
| R1 | Given/When/Then Semantics | Given=state, When=action, Then=outcome.
|
|
269
|
-
| R2 | One Behavior Per Scenario | 1 SC = 1 behavior.
|
|
270
|
-
| R3 | Ubiquitous Language |
|
|
271
|
-
| R4 | Outside-in Naming | SC
|
|
272
|
-
| R5 | Declarative over Imperative |
|
|
273
|
-
| R6 | Observable Outcomes Only | Then
|
|
274
|
-
| R7 | Key Examples / Concrete |
|
|
275
|
-
| R8 | Independence | SC
|
|
276
|
-
| R9 | Test Data Completeness | Data table
|
|
277
|
-
| R10 | Scope Boundary Explicit | Cross-UC reference
|
|
278
|
-
|
|
279
|
-
## Project Compliance (fail review
|
|
268
|
+
| R1 | Given/When/Then Semantics | Given=state, When=action, Then=outcome. Mỗi SC cần đủ G/W/T. |
|
|
269
|
+
| R2 | One Behavior Per Scenario | 1 SC = 1 behavior. KHÔNG chain When→Then→When→Then. |
|
|
270
|
+
| R3 | Ubiquitous Language | KHÔNG dùng UI selector / tên API / tech term trong step. |
|
|
271
|
+
| R4 | Outside-in Naming | Tên SC mô tả business outcome. Không "click" / "(Case X)" / tên component. |
|
|
272
|
+
| R5 | Declarative over Imperative | Mô tả WHAT (ý định nghiệp vụ), KHÔNG phải HOW (cơ chế UI). |
|
|
273
|
+
| R6 | Observable Outcomes Only | Then khẳng định outcome quan sát được. Không phải trạng thái UI trung gian / internal state. |
|
|
274
|
+
| R7 | Key Examples / Concrete | Dùng giá trị cụ thể. Không "valid data" mơ hồ. |
|
|
275
|
+
| R8 | Independence | SC chạy độc lập. Không phụ thuộc state từ SC khác. |
|
|
276
|
+
| R9 | Test Data Completeness | Data table có đủ field để suy ra Then kỳ vọng. |
|
|
277
|
+
| R10 | Scope Boundary Explicit | Cross-UC reference dùng cách diễn đạt navigation + comment Note. |
|
|
278
|
+
|
|
279
|
+
## Project Compliance (fail review nếu thiếu — C.1-C.5)
|
|
280
280
|
|
|
281
281
|
| Check | Rule |
|
|
282
282
|
|-------|------|
|
|
283
|
-
| C.1 Wireframe Coverage |
|
|
284
|
-
| C.2 PRD Traceability |
|
|
285
|
-
| C.3 Business Dictionary |
|
|
286
|
-
| C.4 Banned Terms | 0 banned
|
|
287
|
-
| C.5 NHÓM Grouping | Feature ≥3
|
|
283
|
+
| C.1 Wireframe Coverage | Mỗi component/action trong Wireframe có ≥1 SC. |
|
|
284
|
+
| C.2 PRD Traceability | Mỗi AC và mỗi BR (gồm từng bullet logic) map tới ≥1 SC. |
|
|
285
|
+
| C.3 Business Dictionary | Dùng đúng canonical term từ business-dictionary.md. |
|
|
286
|
+
| C.4 Banned Terms | 0 banned term trong file — grep trước khi gen. |
|
|
287
|
+
| C.5 NHÓM Grouping | Feature ≥3 SC → PHẢI có NHÓM grouping theo business theme. |
|
|
288
288
|
|
|
289
289
|
---
|
|
290
290
|
|
|
291
|
-
## NHÓM Grouping Convention (C.5 —
|
|
291
|
+
## NHÓM Grouping Convention (C.5 — bắt buộc cho ≥3 scenario)
|
|
292
292
|
|
|
293
|
-
|
|
293
|
+
Gom theo business theme, KHÔNG theo happy/negative/edge.
|
|
294
294
|
|
|
295
|
-
Format header (
|
|
295
|
+
Format header (thụt 2 space, cùng cấp với Background):
|
|
296
296
|
```
|
|
297
297
|
# ==========================================================
|
|
298
|
-
# NHÓM N: <Business theme> (<BR refs
|
|
298
|
+
# NHÓM N: <Business theme> (<BR refs nếu áp dụng>)
|
|
299
299
|
# ==========================================================
|
|
300
300
|
```
|
|
301
301
|
|
|
302
302
|
Rules:
|
|
303
|
-
-
|
|
304
|
-
-
|
|
305
|
-
-
|
|
303
|
+
- Đánh số tuần tự NHÓM 1 → N. SC ID tuần tự xuyên suốt lifecycle (không reset theo từng NHÓM).
|
|
304
|
+
- Mỗi NHÓM có thể chứa @happy + @edge + @negative cùng theme.
|
|
305
|
+
- SC trong NHÓM không cần theo thứ tự ID (NHÓM 2 có thể chứa SC4, SC8, SC11 nếu cùng theme).
|
|
306
306
|
|
|
307
|
-
|
|
307
|
+
Pattern gợi ý (điều chỉnh theo UC):
|
|
308
308
|
- `Init / Save success — valid data combinations`
|
|
309
309
|
- `Validation / Block when invalid`
|
|
310
310
|
- `Error handling — API fail / system error`
|
|
@@ -316,7 +316,7 @@ Suggested patterns (adjust per UC):
|
|
|
316
316
|
|
|
317
317
|
## UC Decomposition
|
|
318
318
|
|
|
319
|
-
|
|
319
|
+
Với mỗi UC trong PRD, trình bày outline SC **trước khi sinh**:
|
|
320
320
|
```
|
|
321
321
|
{TICKET-ID}-UC1: {Use Case Name}
|
|
322
322
|
NHÓM 1: {Theme} (BR1, BR2)
|
|
@@ -329,52 +329,52 @@ For each UC in the PRD, present the SC outline **before generating**:
|
|
|
329
329
|
BRs covered: {TICKET-ID}-UC1-BR1, BR2, BR3
|
|
330
330
|
```
|
|
331
331
|
|
|
332
|
-
CHECKPOINT: "
|
|
332
|
+
CHECKPOINT: "Outline này đúng chưa? Bạn muốn thêm hay bớt SC nào không?" → **Chờ confirm trước khi sinh.**
|
|
333
333
|
|
|
334
334
|
---
|
|
335
335
|
|
|
336
336
|
## Generate
|
|
337
337
|
|
|
338
|
-
**Output path
|
|
338
|
+
**Output path theo mode:**
|
|
339
339
|
- **Spec repo mode**: `{paths.specs_dir}/{domain}/{prd-slug}/bdd/{active_platform}/{TICKET-ID}-UC{N}-{slug}.feature`
|
|
340
340
|
- **Umbrella mode (single-service)**: `{paths.specs_dir}/{domain}/{prd-slug}/bdd/{TICKET-ID}-UC{N}-{slug}.feature`
|
|
341
341
|
- **Umbrella mode (multi-service)**: `{paths.specs_dir}/{domain}/{prd-slug}/bdd/{active_service}/{TICKET-ID}-UC{N}-{slug}.feature`
|
|
342
342
|
|
|
343
|
-
|
|
343
|
+
Với mỗi UC, ghi vào path đã phân giải ở trên. Dùng từ vựng cho active platform (từ Platform Selection hoặc Service Detection).
|
|
344
344
|
|
|
345
345
|
```gherkin
|
|
346
346
|
# ============================================================
|
|
347
347
|
# @trace.id: {TICKET-ID}-UC{N}
|
|
348
348
|
# @trace.title: <Feature name>
|
|
349
|
-
# @trace.revision: 1 ←
|
|
349
|
+
# @trace.revision: 1 ← field tĩnh; dùng @trace.bdd_version để theo dõi version (tăng bởi /review-context --fix hoặc --resume)
|
|
350
350
|
# @trace.domain: <domain>
|
|
351
|
-
# @trace.platform: {active_platform — web | app | system | (
|
|
352
|
-
# @trace.service: {active_service —
|
|
353
|
-
# @trace.module: {active_module
|
|
351
|
+
# @trace.platform: {active_platform — web | app | system | (bỏ trong umbrella mode)}
|
|
352
|
+
# @trace.service: {active_service — bỏ trong spec repo mode}
|
|
353
|
+
# @trace.module: {active_module trong umbrella mode; "unknown" trong spec repo mode}
|
|
354
354
|
# @trace.status: draft
|
|
355
355
|
# @trace.author: AI-generated
|
|
356
356
|
# @trace.created_at: {YYYY-MM-DD}
|
|
357
357
|
# @trace.prd: {TICKET-ID}
|
|
358
|
-
# @trace.prd_version: {
|
|
359
|
-
# @trace.bdd_version: {1.0
|
|
358
|
+
# @trace.prd_version: {đọc từ metadata PRD "| **Version** |"}
|
|
359
|
+
# @trace.bdd_version: {1.0 nếu gen mới; tăng 0.1 khi gen lại — vd 1.0 → 1.1}
|
|
360
360
|
# @trace.business_rules: {TICKET-ID}-UC{N}-BR1, {TICKET-ID}-UC{N}-BR2
|
|
361
361
|
# @trace.dataset: {domain}.testdata.yaml
|
|
362
362
|
# ============================================================
|
|
363
363
|
|
|
364
364
|
# === CONTEXT ===
|
|
365
|
-
# Actor: <
|
|
366
|
-
# Screens: <
|
|
367
|
-
# Entities: <business
|
|
368
|
-
# Pre-state: <
|
|
365
|
+
# Actor: <vai trò thực hiện hành động, vd: Consumer, Staff, System>
|
|
366
|
+
# Screens: <các màn liên quan, vd: Cart → Confirm Order → Order Detail>
|
|
367
|
+
# Entities: <business entity, vd: Order, OrderItem, Consumer>
|
|
368
|
+
# Pre-state: <state dùng chung trước khi vào các scenario>
|
|
369
369
|
|
|
370
370
|
# === SCOPE ===
|
|
371
|
-
# In: <
|
|
372
|
-
# Out: <
|
|
371
|
+
# In: <UC này phủ gì>
|
|
372
|
+
# Out: <cái gì KHÔNG thuộc UC này — link tới UC/feature khác (R10)>
|
|
373
373
|
|
|
374
374
|
# === BUSINESS DEFINITION ===
|
|
375
|
-
#
|
|
376
|
-
# <Term 1>:
|
|
377
|
-
# <Term 2>:
|
|
375
|
+
# Tham chiếu nhanh các term dùng trong feature này. Chi tiết SoT: business-dictionary.md
|
|
376
|
+
# <Term 1>: <định nghĩa ngắn>
|
|
377
|
+
# <Term 2>: <định nghĩa ngắn>
|
|
378
378
|
|
|
379
379
|
Feature: <Feature name>
|
|
380
380
|
As a <role>
|
|
@@ -382,29 +382,29 @@ Feature: <Feature name>
|
|
|
382
382
|
So that <business value>
|
|
383
383
|
|
|
384
384
|
Background:
|
|
385
|
-
Given <
|
|
385
|
+
Given <precondition dùng chung — dùng alias từ dataset, không phải ID kỹ thuật>
|
|
386
386
|
|
|
387
387
|
# ==========================================================
|
|
388
388
|
# NHÓM 1: <Business theme> (<BR refs>)
|
|
389
389
|
# ==========================================================
|
|
390
390
|
|
|
391
|
-
# Side-effects: <
|
|
391
|
+
# Side-effects: <liệt kê ngắn các Then side-effect cần verify>
|
|
392
392
|
# @trace.scenario: {TICKET-ID}-UC{N}-SC1
|
|
393
393
|
# @trace.sc_version: 1.0
|
|
394
394
|
# @trace.business_rules: {TICKET-ID}-UC{N}-BR1
|
|
395
395
|
@happy
|
|
396
|
-
Scenario: <
|
|
397
|
-
Given <input state — alias
|
|
396
|
+
Scenario: <mô tả business outcome — dùng động từ chính xác: create/receive/assign/block>
|
|
397
|
+
Given <input state — alias từ dataset>
|
|
398
398
|
When <single action>
|
|
399
399
|
Then <main observable outcome>
|
|
400
|
-
And <side-effect 1
|
|
400
|
+
And <side-effect 1 khai báo trong header>
|
|
401
401
|
|
|
402
402
|
# Side-effects: <...>
|
|
403
403
|
# @trace.scenario: {TICKET-ID}-UC{N}-SC2
|
|
404
404
|
# @trace.sc_version: 1.0
|
|
405
405
|
# @trace.business_rules: {TICKET-ID}-UC{N}-BR1
|
|
406
406
|
@happy @alternative
|
|
407
|
-
Scenario: <
|
|
407
|
+
Scenario: <cùng theme NHÓM 1 nhưng path khác — vd: giá trị enum khác>
|
|
408
408
|
Given <state>
|
|
409
409
|
When <action>
|
|
410
410
|
Then <outcome>
|
|
@@ -418,85 +418,85 @@ Feature: <Feature name>
|
|
|
418
418
|
# @trace.sc_version: 1.0
|
|
419
419
|
# @trace.business_rules: {TICKET-ID}-UC{N}-BR2
|
|
420
420
|
@edge
|
|
421
|
-
Scenario: <boundary / error
|
|
421
|
+
Scenario: <scenario boundary / error>
|
|
422
422
|
Given <state>
|
|
423
423
|
When <action>
|
|
424
424
|
Then <expected error handling>
|
|
425
425
|
```
|
|
426
426
|
|
|
427
|
-
### Coverage Matrix & Pre-merge Checklist *(
|
|
427
|
+
### Coverage Matrix & Pre-merge Checklist *(thêm vào cuối mỗi file)*
|
|
428
428
|
|
|
429
429
|
```gherkin
|
|
430
430
|
# === PRD COVERAGE (C.1 + C.2) ===
|
|
431
431
|
# AC mapping:
|
|
432
432
|
# AC1 (...) → SC1, SC2
|
|
433
433
|
# AC2 (...) → SC3
|
|
434
|
-
# BR mapping (
|
|
434
|
+
# BR mapping (mỗi bullet PHẢI có ≥1 SC — C.2):
|
|
435
435
|
# {TICKET-ID}-UC{N}-BR1 (...) → SC1, SC2
|
|
436
436
|
# {TICKET-ID}-UC{N}-BR2 (...) → SC3
|
|
437
|
-
# Wireframe mapping (
|
|
437
|
+
# Wireframe mapping (mỗi component/action ≥1 SC — C.1):
|
|
438
438
|
# Screen "<screen name>":
|
|
439
439
|
# [x] <action 1> → SC1
|
|
440
440
|
# [x] <action 2> → SC2
|
|
441
441
|
# [ ] <action 3> → MISSING ← BLOCK MERGE
|
|
442
442
|
|
|
443
443
|
# === PRE-MERGE CHECKLIST ===
|
|
444
|
-
# - [ ]
|
|
445
|
-
# - [ ] Coverage Matrix: 0 MISSING
|
|
446
|
-
# - [ ]
|
|
447
|
-
# - [ ] 0 banned
|
|
448
|
-
# - [ ] Feature ≥3
|
|
449
|
-
# - [ ]
|
|
450
|
-
# - [ ]
|
|
444
|
+
# - [ ] Mỗi SC có Side-effects + @trace.scenario + @trace.sc_version + @trace.business_rules
|
|
445
|
+
# - [ ] Coverage Matrix: 0 dòng MISSING (C.1)
|
|
446
|
+
# - [ ] Mỗi AC/BR map tới ≥1 SC (C.2)
|
|
447
|
+
# - [ ] 0 banned term (C.4) — grep file trước khi merge
|
|
448
|
+
# - [ ] Feature ≥3 SC có NHÓM grouping theo business theme (C.5)
|
|
449
|
+
# - [ ] Nếu popup/modal: khai báo Popup/Modal Lifecycle trong BUSINESS DEFINITION
|
|
450
|
+
# - [ ] Nếu display logic ≥2 chiều: Display Logic Matrix trong BUSINESS DEFINITION
|
|
451
451
|
```
|
|
452
452
|
|
|
453
453
|
---
|
|
454
454
|
|
|
455
455
|
## Write Trace State
|
|
456
456
|
|
|
457
|
-
|
|
457
|
+
Sau khi sinh tất cả file `.feature`, tạo hoặc cập nhật `{paths.trace_dir}/{domain}/{prd-slug}/{UC-ID}.tsv` cho mỗi UC.
|
|
458
458
|
|
|
459
|
-
> **Umbrella + `spec_source`:**
|
|
459
|
+
> **Umbrella + `spec_source`:** cả file `.feature` **và** trace `.tsv` đều ghi vào **spec repo** (`{spec_source}/specs/{domain}/{prd-slug}/bdd/…` và `{spec_source}/.trace/{domain}/{prd-slug}/…`, do context-loader phân giải) — một thao tác ghi **single-repo**, commit/push vào spec submodule. (Trace được gộp trong spec repo để PM quản lý mọi status ở một chỗ; các lệnh phía code cập nhật liên-repo sau.)
|
|
460
460
|
|
|
461
|
-
**TSV
|
|
461
|
+
**Cột TSV (tab-separated, một header row + một data row cho mỗi scenario):**
|
|
462
462
|
```
|
|
463
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
|
|
464
464
|
```
|
|
465
465
|
|
|
466
466
|
**Rules:**
|
|
467
|
-
-
|
|
468
|
-
-
|
|
469
|
-
- SC
|
|
470
|
-
- SC
|
|
471
|
-
- SC
|
|
472
|
-
- SC
|
|
467
|
+
- Nếu file chưa tồn tại → tạo với header row + tất cả scenario row.
|
|
468
|
+
- Nếu file tồn tại (gen lại) → với mỗi SC trong `.feature` mới:
|
|
469
|
+
- SC đã có trong `.tsv` VÀ `spec_ver` không đổi → chỉ cập nhật: `sc_title`, `prd_version`, `bdd_version`, `prd_status`, `uc_status`, `last_updated`. Giữ nguyên các cột khác.
|
|
470
|
+
- SC đã có trong `.tsv` VÀ `spec_ver` đổi (scenario bị sửa) → cập nhật: `sc_title`, `spec_ver`, `prd_version`, `bdd_version`, `prd_status`, `uc_status`, `last_updated` VÀ set `status = DRIFT` ngay (để TSV phản ánh drift mà không cần đợi `/validate-traces`). Giữ nguyên `gen_ver`, `implemented_by`, `test_count`, `test_classes`, `tech_doc_revision`, `fe_tech_doc_revision`.
|
|
471
|
+
- SC mới (thêm trong lần gen lại này) → append row mới 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` đều set `—`.
|
|
472
|
+
- SC không còn trong `.feature` (bị xoá) → xoá row của nó.
|
|
473
473
|
|
|
474
|
-
**
|
|
474
|
+
**Giá trị ghi cho mỗi scenario:**
|
|
475
475
|
|
|
476
|
-
|
|
|
476
|
+
| Cột | Giá trị |
|
|
477
477
|
|--------|-------|
|
|
478
478
|
| `sc_id` | `{UC-ID}-SC{N}` |
|
|
479
|
-
| `sc_title` |
|
|
480
|
-
| `spec_ver` | `@trace.sc_version`
|
|
481
|
-
| `gen_ver` | `—` (
|
|
479
|
+
| `sc_title` | text title của scenario |
|
|
480
|
+
| `spec_ver` | `@trace.sc_version` của scenario này |
|
|
481
|
+
| `gen_ver` | `—` (chưa gen) |
|
|
482
482
|
| `implemented_by` | `—` |
|
|
483
483
|
| `test_count` | `—` |
|
|
484
484
|
| `test_classes` | `—` |
|
|
485
|
-
| `dev_selftest` | `—` (
|
|
485
|
+
| `dev_selftest` | `—` (chưa chạy test) |
|
|
486
486
|
| `dev_selftest_at` | `—` |
|
|
487
|
-
| `qc_status` | `—` (
|
|
487
|
+
| `qc_status` | `—` (kết quả QC automation chính thức — set bởi `/qc-run-test`) |
|
|
488
488
|
| `qc_run_at` | `—` |
|
|
489
|
-
| `qc_owner` | `—` (
|
|
490
|
-
| `qc_blocked_by` | `—` (
|
|
491
|
-
| `prd_version` | `@trace.prd_version`
|
|
492
|
-
| `bdd_version` | `@trace.bdd_version`
|
|
493
|
-
| `tech_doc_revision` | `—` (
|
|
494
|
-
| `fe_tech_doc_revision` | `—` (FE client tech-design
|
|
495
|
-
| `prd_status` |
|
|
496
|
-
| `uc_status` | `draft`
|
|
497
|
-
| `fe_phase` | `—` (set
|
|
489
|
+
| `qc_owner` | `—` (SC chưa pass đang chờ ai: `dev` / `po` — set bởi `/qc-run-test` + `/report-bug`) |
|
|
490
|
+
| `qc_blocked_by` | `—` (`BUG-{id}` / `GAP-{id}` liên kết — set bởi `/qc-run-test` + `/report-bug`) |
|
|
491
|
+
| `prd_version` | `@trace.prd_version` từ header `.feature` |
|
|
492
|
+
| `bdd_version` | `@trace.bdd_version` từ header `.feature` |
|
|
493
|
+
| `tech_doc_revision` | `—` (revision API contract BE — set bởi `/generate-code` + `/review-tech-docs`) |
|
|
494
|
+
| `fe_tech_doc_revision` | `—` (revision FE client tech-design `{UC-ID}-tech-design-{platform}.md` — set bởi `/generate-code --phase=integration` + `/review-tech-docs` trên doc FE) |
|
|
495
|
+
| `prd_status` | đọc `\| **Status** \|` từ metadata PRD |
|
|
496
|
+
| `uc_status` | `draft` cho UC mới; giữ giá trị hiện có khi gen lại |
|
|
497
|
+
| `fe_phase` | `—` (set bởi `/generate-code --phase` khi FE implement) |
|
|
498
498
|
| `status` | `UNTRACKED` |
|
|
499
|
-
| `last_updated` |
|
|
499
|
+
| `last_updated` | hôm nay `YYYY-MM-DD` |
|
|
500
500
|
|
|
501
501
|
## Refresh Panel Mirror
|
|
502
502
|
{{include:steps/trace-mirror.md}}
|
|
@@ -506,7 +506,7 @@ sc_id\tsc_title\tspec_ver\tgen_ver\timplemented_by\ttest_count\ttest_classes\tde
|
|
|
506
506
|
{{include:steps/report-footer.md}}
|
|
507
507
|
|
|
508
508
|
```
|
|
509
|
-
/generate-bdd
|
|
509
|
+
/generate-bdd Hoàn tất
|
|
510
510
|
|
|
511
511
|
[Spec repo mode — platform: {active_platform}]
|
|
512
512
|
Files:
|
|
@@ -516,9 +516,9 @@ Trace:
|
|
|
516
516
|
{paths.trace_dir}/{domain}/{prd-slug}/{TICKET-ID}-UC1.tsv ({N} rows)
|
|
517
517
|
{paths.trace_dir}/{domain}/{prd-slug}/{TICKET-ID}-UC2.tsv ({N} rows)
|
|
518
518
|
Next (spec repo):
|
|
519
|
-
→
|
|
520
|
-
→
|
|
521
|
-
→
|
|
519
|
+
→ Chạy /generate-bdd lại cho các platform khác (web → app → system)
|
|
520
|
+
→ Sau khi gen hết platform: commit + push + báo team dev
|
|
521
|
+
→ Team dev đọc BDD từ spec submodule — không chạy /generate-bdd ở phía họ
|
|
522
522
|
|
|
523
523
|
[Umbrella mode — service: {active_service}]
|
|
524
524
|
Files:
|
|
@@ -526,9 +526,9 @@ Files:
|
|
|
526
526
|
Trace:
|
|
527
527
|
{paths.trace_dir}/{domain}/{prd-slug}/{TICKET-ID}-UC1.tsv ({N} rows)
|
|
528
528
|
Next (umbrella):
|
|
529
|
-
→ /review-context {feature-file}
|
|
529
|
+
→ /review-context {feature-file} để kiểm tra coverage
|
|
530
530
|
→ /generate-tech-docs {feature-file}
|
|
531
531
|
→ /generate-code {feature-file}
|
|
532
532
|
|
|
533
|
-
📊 Living Docs:
|
|
533
|
+
📊 Living Docs: chạy /validate-traces (hoặc /sync) để push trace này lên dashboard spec-module.
|
|
534
534
|
```
|