@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,185 +1,185 @@
|
|
|
1
1
|
# /review-tech-docs — Review Technical Design Document
|
|
2
2
|
|
|
3
|
-
**READ-ONLY
|
|
4
|
-
**
|
|
3
|
+
**Chế độ phân tích READ-ONLY — ghi file findings, KHÔNG sửa target.**
|
|
4
|
+
**Dùng `--resume` để áp dụng các finding được chấp nhận.**
|
|
5
5
|
|
|
6
6
|
## Gate
|
|
7
7
|
{{include:steps/gate.md}}
|
|
8
8
|
|
|
9
|
-
*
|
|
10
|
-
|
|
9
|
+
*Lưu ý: Với lệnh này, target ở Bước 1 là một file tech-design `.md` trong `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/`.
|
|
10
|
+
Nếu `$ARGUMENTS` chứa `--resume` → bỏ qua sang Resume Mode bên dưới.*
|
|
11
11
|
|
|
12
12
|
## Context
|
|
13
13
|
{{include:steps/context-loader.md}}
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## Nạp tài liệu Review
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Sau khi nạp context nền, đọc các thứ sau theo thứ tự:
|
|
20
20
|
|
|
21
|
-
1. **
|
|
21
|
+
1. **Tech-doc target** — đọc đầy đủ. Trích từ header:
|
|
22
22
|
- `@trace.id` → UC-ID
|
|
23
23
|
- `@trace.domain` → domain
|
|
24
|
-
- `@trace.prd` →
|
|
25
|
-
- `@trace.status` →
|
|
24
|
+
- `@trace.prd` → ticket ID của PRD nguồn
|
|
25
|
+
- `@trace.status` → status hiện tại (draft / in-review / approved)
|
|
26
26
|
|
|
27
|
-
2. **
|
|
27
|
+
2. **File feature nguồn** — nạp `{paths.specs_dir}/{domain}/{prd-slug}/bdd/{UC-ID}*.feature` nếu tồn tại.
|
|
28
28
|
|
|
29
|
-
3. **
|
|
30
|
-
`{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/`
|
|
29
|
+
3. **Các tech-doc khác cùng domain** — liệt kê và nạp mọi file `.md` trong
|
|
30
|
+
`{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/` trừ target. Dùng để check conflict (T4).
|
|
31
31
|
|
|
32
|
-
4. **
|
|
32
|
+
4. **Tham chiếu kiến trúc** — xác nhận lại CLAUDE.md §2: thứ tự layer, quy tắc kiến trúc.
|
|
33
33
|
|
|
34
|
-
5. **Core entities** —
|
|
34
|
+
5. **Core entities** — đã nạp trong context (Bước 6 của context-loader).
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
Suy ra tên file findings:
|
|
37
37
|
`{paths.refinement_dir}/{uc-id}-tech-review-findings.yaml`
|
|
38
38
|
|
|
39
39
|
---
|
|
40
40
|
|
|
41
41
|
## Review Dimensions
|
|
42
42
|
|
|
43
|
-
### T1 — Architecture Alignment *(
|
|
43
|
+
### T1 — Architecture Alignment *(luôn CRITICAL nếu vi phạm)*
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
Đối chiếu design đề xuất với quy tắc CLAUDE.md §2:
|
|
46
46
|
|
|
47
|
-
|
|
|
47
|
+
| Loại vi phạm | Severity |
|
|
48
48
|
|----------------|----------|
|
|
49
|
-
| Controller
|
|
50
|
-
| Business logic
|
|
51
|
-
|
|
|
52
|
-
|
|
|
53
|
-
|
|
|
54
|
-
|
|
|
55
|
-
|
|
56
|
-
|
|
49
|
+
| Controller gọi Repository trực tiếp (skip layer) | Critical |
|
|
50
|
+
| Business logic trong Controller hoặc DTO | Critical |
|
|
51
|
+
| Pattern bị cấm từ §3 | Critical |
|
|
52
|
+
| Phụ thuộc đi ngược upstream (Service → Controller DTO) | Critical |
|
|
53
|
+
| Annotation transaction sai layer | Major |
|
|
54
|
+
| Thiếu tách lớp (không có Facade khi kiến trúc yêu cầu) | Major |
|
|
55
|
+
|
|
56
|
+
Với mỗi finding:
|
|
57
57
|
```
|
|
58
|
-
Component: {class
|
|
58
|
+
Component: {tên class hoặc method}
|
|
59
59
|
Violates: "{rule text}" (CLAUDE.md §2)
|
|
60
|
-
Fix: {
|
|
60
|
+
Fix: {layer/component nào nên sở hữu cái này}
|
|
61
61
|
```
|
|
62
|
-
→ **
|
|
62
|
+
→ **Không auto-fix.** Người phải quyết định fix cấu trúc. Bắt buộc note trong Review Board.
|
|
63
63
|
|
|
64
64
|
### T2 — Entity Consistency
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
Dùng catalog core-entities đã nạp:
|
|
67
67
|
|
|
68
|
-
|
|
|
68
|
+
| Vấn đề | Severity | Auto-fixable? |
|
|
69
69
|
|-------|----------|---------------|
|
|
70
|
-
| Entity
|
|
71
|
-
|
|
|
72
|
-
|
|
|
73
|
-
|
|
|
70
|
+
| Entity được nhắc nhưng không có trong core-entities.md | Major | No — người confirm là DTO hay domain entity |
|
|
71
|
+
| Tên field khác core-entities.md | Major | Yes — đổi về canonical |
|
|
72
|
+
| Quan hệ được mô tả khác đi | Major | No — người quyết định |
|
|
73
|
+
| Entity mới được đưa ra nhưng chưa có trong core-entities.md | Minor | No — thêm vào core-entities trước |
|
|
74
74
|
|
|
75
75
|
### T3 — BDD Traceability
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
Đối chiếu với file `.feature` nguồn:
|
|
78
78
|
|
|
79
|
-
|
|
|
79
|
+
| Vấn đề | Severity | Auto-fixable? |
|
|
80
80
|
|-------|----------|---------------|
|
|
81
|
-
| Tech-doc
|
|
82
|
-
| Tech-doc
|
|
83
|
-
| UC
|
|
81
|
+
| Tech-doc đề xuất behavior không có trong scenario BDD nào | Major | No — tạo scenario trước |
|
|
82
|
+
| Tech-doc mâu thuẫn một scenario BDD | Critical | No — giải quyết conflict trước |
|
|
83
|
+
| Scenario UC không có design decision tương ứng | Minor | Yes — thêm design note còn thiếu |
|
|
84
84
|
|
|
85
85
|
### T4 — Domain Conflict Check
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
So với các tech-doc khác trong `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/`:
|
|
88
88
|
|
|
89
|
-
|
|
|
89
|
+
| Vấn đề | Severity | Auto-fixable? |
|
|
90
90
|
|-------|----------|---------------|
|
|
91
|
-
|
|
|
92
|
-
|
|
|
93
|
-
|
|
|
94
|
-
|
|
|
91
|
+
| Cùng endpoint định nghĩa với request/response khác | Critical | No — người giải quyết |
|
|
92
|
+
| Cùng service method với behavior khác | Critical | No — người giải quyết |
|
|
93
|
+
| Status transition của entity khác nhau giữa các doc | Critical | No — người giải quyết |
|
|
94
|
+
| Trách nhiệm chồng lấn (cả hai doc nhận sở hữu cùng logic) | Major | No — người giải quyết |
|
|
95
95
|
|
|
96
96
|
### T5 — Internal Consistency
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
Trong nội bộ tech-doc:
|
|
99
99
|
|
|
100
100
|
| Check | Severity | Auto-fixable? |
|
|
101
101
|
|-------|----------|---------------|
|
|
102
|
-
| Sequence diagram
|
|
103
|
-
| API spec return type
|
|
104
|
-
| Section
|
|
105
|
-
| Assumption
|
|
102
|
+
| Sequence diagram thể hiện flow khác phần mô tả viết | Major | No |
|
|
103
|
+
| API spec return type khác code sketch | Major | Yes — căn chỉnh cái này theo cái kia |
|
|
104
|
+
| Section tham chiếu một component/concept không bao giờ được định nghĩa sau đó | Minor | Yes — thêm định nghĩa |
|
|
105
|
+
| Assumption được nêu nhưng không design nào xử lý nó | Minor | Yes — thêm note hoặc bỏ assumption |
|
|
106
106
|
|
|
107
107
|
### T6 — Structural Completeness
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
Kiểm tra tất cả section chuẩn có mặt và không rỗng:
|
|
110
110
|
|
|
111
111
|
| Section | Missing severity |
|
|
112
112
|
|---------|-----------------|
|
|
113
113
|
| Header (`@trace.id`, `@trace.prd`, `@trace.domain`, `@trace.status`) | Major |
|
|
114
114
|
| Overview / Context | Major |
|
|
115
|
-
| Architecture Decision
|
|
116
|
-
| Component Diagram
|
|
117
|
-
| Sequence Diagram
|
|
118
|
-
| API Contract (
|
|
119
|
-
| Data Model Changes (
|
|
115
|
+
| Architecture Decision kèm lý do | Major |
|
|
116
|
+
| Component Diagram hoặc Layer Description | Major |
|
|
117
|
+
| Sequence Diagram hoặc Flow Steps | Major |
|
|
118
|
+
| API Contract (nếu hướng HTTP) | Major |
|
|
119
|
+
| Data Model Changes (nếu entity đổi) | Major |
|
|
120
120
|
| Error Handling Strategy | Major |
|
|
121
121
|
| Open Questions / Assumptions | Minor |
|
|
122
122
|
|
|
123
|
-
→
|
|
123
|
+
→ Mọi finding section-thiếu T6 đều **auto-fixable**: AI thêm skeleton section kèm prompt.
|
|
124
124
|
|
|
125
125
|
### T7 — Cross-Team API Contract Review
|
|
126
126
|
|
|
127
|
-
*
|
|
128
|
-
*1.
|
|
129
|
-
*2.
|
|
127
|
+
*Chỉ áp dụng khi TẤT CẢ điều sau đúng:*
|
|
128
|
+
*1. BDD nguồn có `@trace.platform: system`.*
|
|
129
|
+
*2. Header tech-doc KHÔNG có `@trace.api_source: existing`.*
|
|
130
130
|
|
|
131
|
-
*
|
|
131
|
+
*Nếu `@trace.api_source: existing` → **skip T7 hoàn toàn**. Contract đã được PO xác định trong PRD — không có API design mới để đồng thuận.*
|
|
132
132
|
|
|
133
|
-
|
|
133
|
+
Dimension này đảm bảo team FE, App, và BE đều đồng thuận API contract trước khi bắt đầu implement.
|
|
134
134
|
|
|
135
|
-
**Step 1 — Check sign-off
|
|
135
|
+
**Step 1 — Check status sign-off trong header tech-doc:**
|
|
136
136
|
|
|
137
|
-
|
|
137
|
+
Đọc block `@trace.sign_off` trong header tech doc. Nếu vắng → thêm như một finding (auto-fixable: thêm skeleton).
|
|
138
138
|
|
|
139
139
|
```yaml
|
|
140
140
|
# @trace.sign_off:
|
|
141
|
-
# be_team: pending # author — set
|
|
142
|
-
# fe_team: pending # FE/Web —
|
|
143
|
-
# app_team: pending # App —
|
|
144
|
-
# sa: pending # SA/Tech Lead —
|
|
141
|
+
# be_team: pending # author — set "done" khi BE hài lòng với design
|
|
142
|
+
# fe_team: pending # FE/Web — phải confirm contract khớp expectation của web BDD
|
|
143
|
+
# app_team: pending # App — phải confirm contract khớp expectation của app BDD (nếu áp dụng)
|
|
144
|
+
# sa: pending # SA/Tech Lead — approval cuối
|
|
145
145
|
```
|
|
146
146
|
|
|
147
147
|
**Step 2 — Contract vs BDD cross-check:**
|
|
148
148
|
|
|
149
|
-
|
|
149
|
+
Nạp web và app BDD cho TICKET-ID này (từ `{paths.specs_dir}/{domain}/{prd-slug}/bdd/web/` và `{paths.specs_dir}/{domain}/{prd-slug}/bdd/app/` trong spec submodule hoặc spec repo).
|
|
150
150
|
|
|
151
|
-
|
|
151
|
+
Với mỗi platform BDD, kiểm tra API contract của tech doc có thoả các mệnh đề `Then` của BDD không:
|
|
152
152
|
|
|
153
153
|
| Check | Severity |
|
|
154
154
|
|---|---|
|
|
155
|
-
|
|
|
156
|
-
|
|
|
157
|
-
|
|
|
158
|
-
|
|
|
155
|
+
| Field response trong API contract không phủ những gì web BDD `Then` mong | Critical |
|
|
156
|
+
| Field response trong API contract không phủ những gì app BDD `Then` mong | Critical |
|
|
157
|
+
| Shape error response không khớp những gì các platform BDD mong | Major |
|
|
158
|
+
| Annotation `@system.resolution` của System BDD mâu thuẫn với design API contract | Critical |
|
|
159
159
|
|
|
160
|
-
**Step 3 —
|
|
160
|
+
**Step 3 — Report sign-off pending:**
|
|
161
161
|
|
|
162
|
-
|
|
162
|
+
Sau review, liệt kê các sign-off còn `pending`:
|
|
163
163
|
|
|
164
164
|
```
|
|
165
|
-
⏳
|
|
166
|
-
fe_team — FE/Web
|
|
167
|
-
app_team — App
|
|
168
|
-
sa — SA/Tech Lead
|
|
165
|
+
⏳ Sign-off pending trước khi tech docs được approve:
|
|
166
|
+
fe_team — team FE/Web phải confirm API contract khớp expectation web BDD
|
|
167
|
+
app_team — team App phải confirm API contract khớp expectation app BDD
|
|
168
|
+
sa — SA/Tech Lead approval cuối
|
|
169
169
|
|
|
170
|
-
|
|
171
|
-
Tech docs
|
|
170
|
+
Khi thu đủ sign-off → cập nhật @trace.sign_off trong header tech doc, rồi chạy lại /review-tech-docs.
|
|
171
|
+
Tech docs không thể set "approved" khi còn bất kỳ sign-off bắt buộc nào pending.
|
|
172
172
|
```
|
|
173
173
|
|
|
174
174
|
**Approval gate:**
|
|
175
|
-
-
|
|
176
|
-
-
|
|
175
|
+
- Nếu `be_team: done` VÀ `fe_team: done` VÀ `app_team: done` (hoặc N/A) VÀ `sa: done` → tech docs có thể set `approved`
|
|
176
|
+
- Ngược lại → `@trace.status` giữ `in-review` — `generate-code` bị chặn
|
|
177
177
|
|
|
178
178
|
---
|
|
179
179
|
|
|
180
|
-
##
|
|
180
|
+
## Ghi File Findings
|
|
181
181
|
|
|
182
|
-
|
|
182
|
+
Sau khi chạy hết các check, ghi findings vào `{paths.refinement_dir}/{uc-id}-tech-review-findings.yaml`:
|
|
183
183
|
|
|
184
184
|
```yaml
|
|
185
185
|
source_file: "{absolute path to tech-doc}"
|
|
@@ -188,25 +188,25 @@ domain: "{domain}"
|
|
|
188
188
|
generated_at: "{ISO datetime}"
|
|
189
189
|
review_type: "tech-design"
|
|
190
190
|
status: "pending_review"
|
|
191
|
-
is_system_bdd: {true | false} # true
|
|
191
|
+
is_system_bdd: {true | false} # true nếu BDD nguồn có @trace.platform: system
|
|
192
192
|
|
|
193
|
-
sign_off: #
|
|
194
|
-
be_team: pending #
|
|
193
|
+
sign_off: # chỉ có khi is_system_bdd: true
|
|
194
|
+
be_team: pending # đọc từ @trace.sign_off trong header tech-doc
|
|
195
195
|
fe_team: pending
|
|
196
|
-
app_team: pending # "n/a"
|
|
196
|
+
app_team: pending # "n/a" nếu dự án không có platform app
|
|
197
197
|
sa: pending
|
|
198
|
-
sign_off_gate: blocked # blocked | ready — "ready"
|
|
198
|
+
sign_off_gate: blocked # blocked | ready — "ready" chỉ khi tất cả bắt buộc là "done"
|
|
199
199
|
|
|
200
200
|
findings:
|
|
201
201
|
- id: "F001"
|
|
202
202
|
check_id: "T1" # T1–T7
|
|
203
203
|
severity: "critical" # critical | major | minor
|
|
204
|
-
section: "{section heading
|
|
205
|
-
uc_id: "{UC-ID}" #
|
|
206
|
-
quote: "{
|
|
207
|
-
finding: "{
|
|
208
|
-
suggestion: "{
|
|
209
|
-
auto_fixable: false # true = AI
|
|
204
|
+
section: "{section heading hoặc tên component nơi tìm thấy lỗi}"
|
|
205
|
+
uc_id: "{UC-ID}" # giống uc_id top-level (UC mà tech-doc này thiết kế)
|
|
206
|
+
quote: "{trích đoạn nguyên văn copy CHÍNH XÁC từ tech-doc tại vị trí lỗi, ≤120 ký tự}"
|
|
207
|
+
finding: "{mô tả rõ ràng vi phạm hoặc gap}"
|
|
208
|
+
suggestion: "{bản fix cụ thể — AI áp dụng khi --resume nếu được chấp nhận}"
|
|
209
|
+
auto_fixable: false # true = AI áp dụng được; false = người phải ghi quyết định trong note
|
|
210
210
|
status: "pending" # pending | accepted | modified | rejected | deferred
|
|
211
211
|
|
|
212
212
|
summary:
|
|
@@ -218,82 +218,82 @@ summary:
|
|
|
218
218
|
sign_off_gate: "{blocked — pending: fe_team, app_team, sa | ready}"
|
|
219
219
|
```
|
|
220
220
|
|
|
221
|
-
> **
|
|
222
|
-
>
|
|
223
|
-
>
|
|
224
|
-
>
|
|
221
|
+
> **Field định vị (`quote` + `uc_id`) — bắt buộc cho source-jump của Review Board.**
|
|
222
|
+
> Với mỗi finding, copy một đoạn `quote` **nguyên văn** thẳng từ tech-doc tại đúng chỗ
|
|
223
|
+
> lỗi xảy ra — KHÔNG diễn giải lại; nó được so khớp với tài liệu để định vị dòng.
|
|
224
|
+
> Field này cho phép reviewer click một finding trong Review Board và nhảy tới đúng vị trí nguồn.
|
|
225
225
|
|
|
226
226
|
## Report
|
|
227
227
|
|
|
228
228
|
{{include:steps/report-footer.md}}
|
|
229
229
|
|
|
230
230
|
```
|
|
231
|
-
/review-tech-docs
|
|
231
|
+
/review-tech-docs Hoàn tất — {target file}
|
|
232
232
|
UC: {UC-ID} | Domain: {domain}
|
|
233
233
|
Findings: {total} | 🔴 Critical: {N} | 🟡 Major: {N} | 🟢 Minor: {N}
|
|
234
234
|
Auto-fixable: {N} | Needs human decision: {N}
|
|
235
235
|
|
|
236
|
-
Sign-off gate (system BDD
|
|
236
|
+
Sign-off gate (chỉ system BDD):
|
|
237
237
|
be_team : {done | pending}
|
|
238
238
|
fe_team : {done | pending} ← {name / "needs sign-off" }
|
|
239
239
|
app_team : {done | pending | n/a}
|
|
240
240
|
sa : {done | pending}
|
|
241
241
|
Gate : {🔒 BLOCKED — pending: fe_team, sa | ✅ READY}
|
|
242
242
|
|
|
243
|
-
|
|
244
|
-
Next:
|
|
245
|
-
|
|
246
|
-
|
|
243
|
+
File findings: {paths.refinement_dir}/{uc-id}-tech-review-findings.yaml
|
|
244
|
+
Next: Mở trong Review Board → Accept/Modify/Reject từng finding
|
|
245
|
+
Rồi chạy: /review-tech-docs --resume {tech-design-file}
|
|
246
|
+
Sau khi thu đủ sign-off → cập nhật @trace.sign_off trong tech doc, chạy lại review
|
|
247
247
|
```
|
|
248
248
|
|
|
249
249
|
---
|
|
250
250
|
|
|
251
|
-
## Resume Mode —
|
|
251
|
+
## Resume Mode — Áp dụng các Finding được chấp nhận
|
|
252
252
|
|
|
253
|
-
*
|
|
254
|
-
*
|
|
253
|
+
*Kích hoạt khi `$ARGUMENTS` chứa `--resume`.*
|
|
254
|
+
*Ví dụ: `/review-tech-docs --resume {paths.tech_docs_dir}/payment/{prd-slug}/tech-docs/PAY-UC1-tech-design.md`*
|
|
255
255
|
|
|
256
|
-
### Phase 1 —
|
|
256
|
+
### Phase 1 — Đọc các finding được chấp nhận
|
|
257
257
|
|
|
258
|
-
1.
|
|
259
|
-
2.
|
|
260
|
-
3.
|
|
258
|
+
1. Suy ra file findings từ target: `{paths.refinement_dir}/{uc-id}-tech-review-findings.yaml`
|
|
259
|
+
2. Đọc file. Gom các finding có `status: "accepted"` hoặc `status: "modified"`.
|
|
260
|
+
3. Nếu không có → báo "No accepted findings. File unchanged." và dừng.
|
|
261
261
|
|
|
262
|
-
### Phase 2 —
|
|
262
|
+
### Phase 2 — Áp dụng fix
|
|
263
263
|
|
|
264
|
-
|
|
264
|
+
Áp dụng theo thứ tự: critical → major → minor.
|
|
265
265
|
|
|
266
|
-
| check_id |
|
|
266
|
+
| check_id | Làm gì |
|
|
267
267
|
|----------|-----------|
|
|
268
|
-
| T1 (Architecture) |
|
|
269
|
-
| T2 (
|
|
270
|
-
| T3 (
|
|
271
|
-
| T5 (Internal inconsistency) |
|
|
272
|
-
| T6 (
|
|
268
|
+
| T1 (Architecture) | Áp dụng fix cấu trúc từ note finding — chuyển logic về đúng layer, cập nhật mô tả component |
|
|
269
|
+
| T2 (Tên field) | Đổi field về tên canonical từ core-entities.md xuyên suốt tài liệu |
|
|
270
|
+
| T3 (Thiếu design note) | Thêm design decision note cho scenario chưa phủ |
|
|
271
|
+
| T5 (Internal inconsistency) | Căn chỉnh các section mâu thuẫn theo quyết định nêu trong note |
|
|
272
|
+
| T6 (Thiếu section) | Thêm skeleton section với prompt placeholder cho tech lead điền |
|
|
273
273
|
|
|
274
|
-
**T1, T2, T4
|
|
275
|
-
|
|
274
|
+
**Finding T1, T2, T4 có `auto_fixable: false`:** cần một resolution do người viết trong
|
|
275
|
+
note "Modify" của Review Board. Áp dụng đúng những gì note nói. Đừng bịa fix.
|
|
276
276
|
|
|
277
|
-
### Phase 3 —
|
|
277
|
+
### Phase 3 — Cập nhật header + TSV + Report
|
|
278
278
|
|
|
279
|
-
|
|
280
|
-
1.
|
|
281
|
-
2.
|
|
282
|
-
-
|
|
283
|
-
-
|
|
284
|
-
3.
|
|
279
|
+
Sửa file tech-doc trực tiếp:
|
|
280
|
+
1. Tìm `@trace.revision:` trong header — tăng giá trị integer lên 1.
|
|
281
|
+
2. Tìm `@trace.status:` trong header:
|
|
282
|
+
- Nếu sign_off_gate = `ready` (tất cả sign-off done) → set `approved`
|
|
283
|
+
- Ngược lại → set `in-review` (chặn `/generate-code`)
|
|
284
|
+
3. Nếu block `@trace.sign_off` vắng và đây là tech doc system BDD → thêm nó với tất cả giá trị `pending`.
|
|
285
285
|
|
|
286
|
-
|
|
286
|
+
Ghi cả hai thay đổi vào file.
|
|
287
287
|
|
|
288
|
-
|
|
289
|
-
- **BE contract** (`{UC-ID}-tech-design.md`) → set `tech_doc_revision`
|
|
290
|
-
- **FE tech-design** (`{UC-ID}-tech-design-{platform}.md`) → set `fe_tech_doc_revision`
|
|
291
|
-
- Set `last_updated`
|
|
288
|
+
Rồi cập nhật `{paths.trace_dir}/{domain}/{prd-slug}/{UC-ID}.tsv` — chọn cột theo tech-doc nào được review (đọc tên file):
|
|
289
|
+
- **BE contract** (`{UC-ID}-tech-design.md`) → set `tech_doc_revision` thành integer `@trace.revision` mới cho mọi row của UC này.
|
|
290
|
+
- **FE tech-design** (`{UC-ID}-tech-design-{platform}.md`) → set `fe_tech_doc_revision` thay vì cái kia, cho các row của UC này trên platform đó (giữ nguyên `tech_doc_revision`).
|
|
291
|
+
- Set `last_updated` thành ngày hôm nay (`YYYY-MM-DD`) cho mọi row của UC này.
|
|
292
292
|
|
|
293
|
-
|
|
293
|
+
In report sau khi hoàn tất mọi lần ghi file.
|
|
294
294
|
|
|
295
295
|
```
|
|
296
|
-
/review-tech-docs --resume
|
|
296
|
+
/review-tech-docs --resume Đã áp dụng — {target file}
|
|
297
297
|
UC: {UC-ID}
|
|
298
298
|
|
|
299
299
|
Applied : {N} findings ({critical} critical, {major} major, {minor} minor)
|
|
@@ -306,12 +306,12 @@ Changes:
|
|
|
306
306
|
Revision : {old} → {new}
|
|
307
307
|
Status : {approved | in-review}
|
|
308
308
|
|
|
309
|
-
Sign-off : {✅
|
|
310
|
-
| 🔒 Pending: fe_team, sa — status set
|
|
311
|
-
|
|
309
|
+
Sign-off : {✅ Tất cả done — status set approved
|
|
310
|
+
| 🔒 Pending: fe_team, sa — status set in-review
|
|
311
|
+
Cập nhật @trace.sign_off trong tech doc khi mỗi team confirm, rồi chạy lại /review-tech-docs}
|
|
312
312
|
|
|
313
|
-
|
|
314
|
-
Next: {/generate-code {feature-file} ←
|
|
315
|
-
|
|
|
316
|
-
→
|
|
313
|
+
Chạy lại /review-tech-docs {file} để xác nhận 0 finding critical còn lại.
|
|
314
|
+
Next: {/generate-code {feature-file} ← chỉ khi status = approved
|
|
315
|
+
| Thu các sign-off pending → cập nhật @trace.sign_off → chạy lại /review-tech-docs}
|
|
316
|
+
→ nếu tech-doc sống trong spec repo dùng chung: commit + push lên spec submodule để FE/App `/sync` contract đã cập nhật
|
|
317
317
|
```
|