@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,29 +1,29 @@
|
|
|
1
|
-
# /generate-tech-docs —
|
|
1
|
+
# /generate-tech-docs — Sinh Technical Design Document
|
|
2
2
|
|
|
3
3
|
## Gate
|
|
4
4
|
{{include:steps/gate.md}}
|
|
5
5
|
|
|
6
|
-
*
|
|
6
|
+
*Lưu ý: Với lệnh này, target ở Bước 1 là một file `.feature` hoặc UC-ID. Nếu `$ARGUMENTS` là UC-ID trần, định vị feature bằng cách glob `{paths.specs_dir}/{domain}/*/bdd/**/{UC-ID}*.feature` (wildcard `*` cho prd-slug chưa biết, `**` đệ quy cho thư mục con `web/`·`app/`·`system/` — BE tech-doc phân giải từ BDD `system/`); lấy `domain` + `prd_slug` từ path khớp. Mọi output bên dưới dùng `{prd-slug}` đã phân giải đó.*
|
|
7
7
|
|
|
8
|
-
**Quality Gate**:
|
|
8
|
+
**Quality Gate**: Trước khi sinh, kiểm tra file BDD findings:
|
|
9
9
|
|
|
10
|
-
1.
|
|
11
|
-
2. **
|
|
10
|
+
1. Tìm `{paths.refinement_dir}/{uc-id}-review-bdd-findings.yaml`.
|
|
11
|
+
2. **Nếu file không tồn tại** → cảnh báo và hỏi:
|
|
12
12
|
```
|
|
13
|
-
⚠️ /review-context
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
⚠️ /review-context chưa chạy cho file feature này.
|
|
14
|
+
Khuyến nghị: chạy /review-context {feature-file} trước để kiểm tra chất lượng BDD.
|
|
15
|
+
Tiếp tục mà không review? (Y/N)
|
|
16
16
|
```
|
|
17
|
-
- Y →
|
|
18
|
-
- N →
|
|
19
|
-
3. **
|
|
20
|
-
|
|
17
|
+
- Y → tiếp tục (chấp nhận rủi ro)
|
|
18
|
+
- N → dừng; chạy `/review-context {feature-file}` trước
|
|
19
|
+
3. **Nếu file tồn tại** → kiểm tra các finding critical `status: "pending"` chưa giải quyết.
|
|
20
|
+
Nếu có → **HALT** và in:
|
|
21
21
|
```
|
|
22
22
|
❌ Quality Gate Failed — {feature-file}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
Phát hiện finding BDD critical chưa giải quyết.
|
|
24
|
+
Chạy: /review-context --fix {feature-file} ← auto-fix những gì có thể
|
|
25
|
+
Rồi: /review-context --resume {feature-file} ← áp dụng các finding được chấp nhận còn lại
|
|
26
|
+
Rồi chạy lại: /generate-tech-docs {feature-file}
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
## Context
|
|
@@ -31,74 +31,74 @@
|
|
|
31
31
|
|
|
32
32
|
---
|
|
33
33
|
|
|
34
|
-
## Step 0 —
|
|
34
|
+
## Step 0 — Phát hiện Platform & Route Output
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
Đọc `@trace.platform` từ header file feature (`web` | `app` | `system`). Nếu vắng, fallback về `platform_type` từ context (`web-frontend`/`mobile` → FE; `backend` → BE).
|
|
37
37
|
|
|
38
38
|
| Platform | `active_tech_design` | Output file |
|
|
39
39
|
|----------|----------------------|-------------|
|
|
40
|
-
| `system` / backend | **`be`** —
|
|
41
|
-
| `web` / `app` (web-frontend / mobile) | **`fe`** —
|
|
40
|
+
| `system` / backend | **`be`** — **API contract** liên team (authoritative) | `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design.md` |
|
|
41
|
+
| `web` / `app` (web-frontend / mobile) | **`fe`** — **client technical design** (tiêu thụ BE contract) | `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design-{platform}.md` |
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
Lưu `active_tech_design` và `tech_design_path`. Hậu tố `-{platform}` (giống design-spec) giữ doc FE không đụng độ BE contract — cả hai sống trong spec repo dùng chung khi `spec_source` được set.
|
|
44
44
|
|
|
45
45
|
---
|
|
46
46
|
|
|
47
47
|
## Step 0.5 — FE/App Precondition Gate
|
|
48
48
|
|
|
49
|
-
*
|
|
49
|
+
*Bỏ qua toàn bộ step này cho BE (`active_tech_design = be`).*
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
Một FE/App technical design là artifact **dẫn xuất**: layer tích hợp API của nó map lên BE contract đã chốt, và state/error model đến từ system behavior. Cả hai input upstream PHẢI tồn tại trước — **HALT** nếu thiếu một trong hai:
|
|
52
52
|
|
|
53
|
-
1. **System BDD** —
|
|
54
|
-
|
|
53
|
+
1. **System BDD** — định vị `{paths.specs_dir}/{domain}/{prd-slug}/bdd/system/{TICKET-ID}*.feature`.
|
|
54
|
+
Nếu không tìm thấy → HALT:
|
|
55
55
|
```
|
|
56
|
-
❌
|
|
57
|
-
|
|
58
|
-
→ PO/BE: /generate-bdd {prd-file} (
|
|
56
|
+
❌ Không thể sinh FE tech-design — không tìm thấy System BDD cho {TICKET-ID}.
|
|
57
|
+
FE design cần behavior mức system (đối diện BE) trước.
|
|
58
|
+
→ PO/BE: /generate-bdd {prd-file} (sinh BDD platform `system/`)
|
|
59
59
|
```
|
|
60
|
-
2. **BE tech-docs (API contract)** —
|
|
61
|
-
-
|
|
60
|
+
2. **BE tech-docs (API contract)** — định vị doc BE `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design.md` và đọc `@trace.status` của nó.
|
|
61
|
+
- Không tìm thấy → HALT:
|
|
62
62
|
```
|
|
63
|
-
❌
|
|
64
|
-
|
|
65
|
-
→ BE: /generate-tech-docs {system .feature} → /review-tech-docs (approve) → publish
|
|
63
|
+
❌ Không thể sinh FE tech-design — không tìm thấy BE API contract.
|
|
64
|
+
Layer tích hợp FE map tới BE contract; nó phải tồn tại trước.
|
|
65
|
+
→ BE: /generate-tech-docs {system .feature} → /review-tech-docs (approve) → publish lên spec repo
|
|
66
66
|
```
|
|
67
|
-
-
|
|
67
|
+
- Tìm thấy nhưng `@trace.status` ≠ `approved` → WARN và hỏi:
|
|
68
68
|
```
|
|
69
|
-
⚠️ BE contract {UC-ID}-tech-design.md
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
⚠️ BE contract {UC-ID}-tech-design.md đang status: {status} (chưa approved) — nó còn có thể đổi.
|
|
70
|
+
Thiết kế FE integration dựa trên contract chưa chốt có rủi ro rework.
|
|
71
|
+
Vẫn tiếp tục? (Y/N)
|
|
72
72
|
```
|
|
73
|
-
- Y →
|
|
73
|
+
- Y → tiếp tục (chấp nhận rủi ro) · N → dừng, chờ BE approve.
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
Lưu `system_bdd_path` và `be_contract_path` — chúng là input chính cho FE §3/§4 bên dưới.
|
|
76
76
|
|
|
77
77
|
---
|
|
78
78
|
|
|
79
79
|
## Brownfield Check
|
|
80
80
|
|
|
81
|
-
*BE (`active_tech_design = be`)
|
|
81
|
+
*Chỉ BE (`active_tech_design = be`) — với FE thì "existing contract" là doc BE đã nạp ở Step 0.5.*
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
Đọc header file `.feature` nguồn tìm `@trace.api_source`.
|
|
84
|
+
Cũng kiểm tra bảng Metadata của PRD nguồn tìm `| **API Source** | existing |`.
|
|
85
85
|
|
|
86
86
|
| Value | Mode |
|
|
87
87
|
|-------|------|
|
|
88
88
|
| `existing` | **Reverse-document** — API đã tồn tại; mô tả lại as-is, note gaps, không cần design mới |
|
|
89
89
|
| absent / other | **Greenfield** — thiết kế API từ đầu |
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
Lưu `active_mode = {reverse-document | greenfield}`.
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
Nếu `active_mode = reverse-document` → nạp bảng "Existing API Contract" từ PRD làm input cho §2.
|
|
94
94
|
|
|
95
95
|
---
|
|
96
96
|
|
|
97
97
|
## CHECKPOINT — Tech Design Plan
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
Trước khi sinh, quét file feature lấy số scenario, các BR tham chiếu, và entity. Hiện plan cho `active_tech_design` đã phân giải và chờ Y:
|
|
100
100
|
|
|
101
|
-
**
|
|
101
|
+
**Nếu `active_tech_design = be`:**
|
|
102
102
|
```
|
|
103
103
|
Tech Design Plan — {UC-ID} (BE · API contract)
|
|
104
104
|
──────────────────────────────────────────────────────
|
|
@@ -110,12 +110,12 @@ Scenarios: {N} scenarios
|
|
|
110
110
|
BDD ver : {trace.bdd_version}
|
|
111
111
|
Output : {paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design.md
|
|
112
112
|
|
|
113
|
-
|
|
113
|
+
Section cần sinh:
|
|
114
114
|
§1 Overview
|
|
115
115
|
§2 API Endpoints ({Reverse-document: mô tả lại từ PRD contract | Greenfield: infer từ scenarios})
|
|
116
|
-
§3 Data Model ({
|
|
116
|
+
§3 Data Model ({entity từ core-entities.md liên quan UC này})
|
|
117
117
|
§4 Service Flow
|
|
118
|
-
§5 Business Rules ({N}
|
|
118
|
+
§5 Business Rules ({N} BR từ header feature)
|
|
119
119
|
§6 Error Handling
|
|
120
120
|
§7 Database Changes
|
|
121
121
|
§8 Caching Strategy
|
|
@@ -124,7 +124,7 @@ Sections to generate:
|
|
|
124
124
|
Proceed? (Y/N)
|
|
125
125
|
```
|
|
126
126
|
|
|
127
|
-
**
|
|
127
|
+
**Nếu `active_tech_design = fe`:**
|
|
128
128
|
```
|
|
129
129
|
Tech Design Plan — {UC-ID} (FE · {platform} · client design)
|
|
130
130
|
──────────────────────────────────────────────────────
|
|
@@ -135,32 +135,32 @@ Inputs : System BDD → {system_bdd_path}
|
|
|
135
135
|
Scenarios : {N} FE scenarios | BDD ver: {trace.bdd_version}
|
|
136
136
|
Output : {paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design-{platform}.md
|
|
137
137
|
|
|
138
|
-
|
|
139
|
-
§1 Overview (
|
|
140
|
-
§2 Component Architecture (tree + reuse
|
|
141
|
-
§2b Test Selectors (
|
|
138
|
+
Section cần sinh:
|
|
139
|
+
§1 Overview (scope FE của UC này)
|
|
140
|
+
§2 Component Architecture (tree + reuse từ figma-components catalog)
|
|
141
|
+
§2b Test Selectors (test-id ổn định cho element có action — QC contract, attr theo platform)
|
|
142
142
|
§3 State Management (store/slices/state shape ← System BDD Then-clauses)
|
|
143
|
-
§4 API Integration Layer (port/adapter:
|
|
143
|
+
§4 API Integration Layer (port/adapter: mỗi BE endpoint → FE service → DTO/model)
|
|
144
144
|
§5 Routing / Navigation
|
|
145
145
|
§6 Data Fetching & Client Caching (query keys, invalidation, optimistic updates)
|
|
146
|
-
§7 Error & Loading States (
|
|
146
|
+
§7 Error & Loading States (theo từng scenario)
|
|
147
147
|
§8 Cross-Cutting (auth token, i18n, feature flags)
|
|
148
|
-
{§9 Offline / platform specifics — app
|
|
148
|
+
{§9 Offline / platform specifics — chỉ app}
|
|
149
149
|
──────────────────────────────────────────────────────
|
|
150
150
|
Proceed? (Y/N)
|
|
151
151
|
```
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
Chờ "Y" rõ ràng trước khi sinh.
|
|
154
154
|
|
|
155
155
|
---
|
|
156
156
|
|
|
157
157
|
## Generate
|
|
158
158
|
|
|
159
|
-
|
|
159
|
+
Sinh document cho `active_tech_design` đã phân giải.
|
|
160
160
|
|
|
161
161
|
### Path A — BE API contract (`active_tech_design = be`)
|
|
162
162
|
|
|
163
|
-
|
|
163
|
+
Ghi `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design.md`:
|
|
164
164
|
|
|
165
165
|
```markdown
|
|
166
166
|
# Technical Design — {UC-ID}: {Feature}
|
|
@@ -168,10 +168,10 @@ Write `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design.m
|
|
|
168
168
|
---
|
|
169
169
|
@trace.id: {UC-ID}
|
|
170
170
|
@trace.domain: {domain}
|
|
171
|
-
@trace.service: {
|
|
172
|
-
@trace.module: {
|
|
171
|
+
@trace.service: {đọc @trace.service từ header file .feature}
|
|
172
|
+
@trace.module: {đọc @trace.module từ header file .feature}
|
|
173
173
|
@trace.prd: {TICKET-ID}
|
|
174
|
-
@trace.bdd_version: {
|
|
174
|
+
@trace.bdd_version: {đọc @trace.bdd_version từ header file .feature}
|
|
175
175
|
@trace.revision: 1
|
|
176
176
|
@trace.status: draft
|
|
177
177
|
@trace.api_source: {existing | —}
|
|
@@ -193,7 +193,7 @@ Write `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design.m
|
|
|
193
193
|
|
|
194
194
|
## §3. Data Model
|
|
195
195
|
|
|
196
|
-
|
|
196
|
+
Các entity chính và quan hệ.
|
|
197
197
|
|
|
198
198
|
## §4. Service Flow
|
|
199
199
|
|
|
@@ -201,7 +201,7 @@ Key entities and relationships.
|
|
|
201
201
|
|
|
202
202
|
## §5. Business Rules Implementation
|
|
203
203
|
|
|
204
|
-
| BR-ID | Rule |
|
|
204
|
+
| BR-ID | Rule | Cách implement |
|
|
205
205
|
|-------|------|-------------------------|
|
|
206
206
|
| {UC-ID}-BR1 | {rule} | {approach} |
|
|
207
207
|
|
|
@@ -213,15 +213,15 @@ Key entities and relationships.
|
|
|
213
213
|
|
|
214
214
|
## §7. Database Changes
|
|
215
215
|
|
|
216
|
-
Migration
|
|
216
|
+
Migration script hoặc thay đổi schema.
|
|
217
217
|
|
|
218
218
|
## §8. Caching Strategy
|
|
219
219
|
|
|
220
|
-
|
|
220
|
+
Cache gì, TTL, trigger invalidation.
|
|
221
221
|
|
|
222
222
|
## §9. Cross-Service Dependencies
|
|
223
223
|
|
|
224
|
-
|
|
224
|
+
Lời gọi ngoài, event phát ra/tiêu thụ.
|
|
225
225
|
|
|
226
226
|
## Changelog
|
|
227
227
|
|
|
@@ -232,7 +232,7 @@ External calls, events produced/consumed.
|
|
|
232
232
|
|
|
233
233
|
### Path B — FE/App client technical design (`active_tech_design = fe`)
|
|
234
234
|
|
|
235
|
-
|
|
235
|
+
Ghi `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design-{platform}.md`. Layer tích hợp §4 map **trực tiếp lên BE contract** đã nạp ở Step 0.5 — mỗi FE service method phải trace tới một endpoint có thật trong `{be_contract_path}` (không bịa endpoint). State và error model ở §3/§7 dẫn xuất từ mệnh đề `Then` của **System BDD**.
|
|
236
236
|
|
|
237
237
|
```markdown
|
|
238
238
|
# FE Technical Design — {UC-ID} ({platform}): {Feature}
|
|
@@ -241,12 +241,12 @@ Write `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design-{
|
|
|
241
241
|
@trace.id: {UC-ID}
|
|
242
242
|
@trace.domain: {domain}
|
|
243
243
|
@trace.platform: {web | app}
|
|
244
|
-
@trace.service: {
|
|
245
|
-
@trace.module: {
|
|
244
|
+
@trace.service: {đọc @trace.service từ header file .feature}
|
|
245
|
+
@trace.module: {đọc @trace.module — vd react / nextjs / vue / angular / flutter}
|
|
246
246
|
@trace.prd: {TICKET-ID}
|
|
247
|
-
@trace.bdd_version: {
|
|
247
|
+
@trace.bdd_version: {đọc @trace.bdd_version từ header file .feature FE}
|
|
248
248
|
@trace.system_bdd: {system_bdd_path}
|
|
249
|
-
@trace.be_contract: {UC-ID}-tech-design.md #
|
|
249
|
+
@trace.be_contract: {UC-ID}-tech-design.md # BE API contract mà design này tiêu thụ
|
|
250
250
|
@trace.testid_attr: {data-testid (web) | testID (react-native) | Key/Semantics (flutter) | accessibilityIdentifier (native-ios)}
|
|
251
251
|
@trace.revision: 1
|
|
252
252
|
@trace.status: draft
|
|
@@ -314,8 +314,8 @@ Query keys, cache invalidation triggers, optimistic updates, refetch policy (cli
|
|
|
314
314
|
|
|
315
315
|
Auth token injection/refresh, i18n keys, feature flags, analytics events.
|
|
316
316
|
|
|
317
|
-
{## §9. Offline / Platform Specifics — app
|
|
318
|
-
{
|
|
317
|
+
{## §9. Offline / Platform Specifics — chỉ app}
|
|
318
|
+
{Hành vi cached-data, banner offline, background sync, platform permission.}
|
|
319
319
|
|
|
320
320
|
## Changelog
|
|
321
321
|
|
|
@@ -324,32 +324,32 @@ Auth token injection/refresh, i18n keys, feature flags, analytics events.
|
|
|
324
324
|
| 1 | {YYYY-MM-DD} | Initial FE design from {UC-ID} ({platform}) BDD v{bdd_version}, mapping BE contract {UC-ID}-tech-design.md |
|
|
325
325
|
```
|
|
326
326
|
|
|
327
|
-
## Publish —
|
|
327
|
+
## Publish — chia sẻ doc (umbrella + spec repo dùng chung)
|
|
328
328
|
|
|
329
|
-
|
|
329
|
+
Nếu `paths.tech_docs_dir` phân giải **dưới `setup.spec_source`** (vd `{spec_source}/specs/{domain}/{prd-slug}/tech-docs`), doc vừa được ghi **bên trong spec submodule**. Publish nó (commit 2 tầng) để cả team đọc qua `/sync` — doc BE là **API contract** liên team; doc FE là **client design** mà các FE/App dev khác (và reviewer) tiêu thụ:
|
|
330
330
|
|
|
331
331
|
```bash
|
|
332
332
|
cd {spec_source}
|
|
333
333
|
git add {tech_design_path} # be: {UC-ID}-tech-design.md · fe: {UC-ID}-tech-design-{platform}.md
|
|
334
334
|
git commit -m "docs({UC-ID}): {be: tech design / API contract | fe: FE tech design ({platform})}"
|
|
335
|
-
git push origin {spec_branch} #
|
|
335
|
+
git push origin {spec_branch} # branch mà đồng đội track trong .gitmodules
|
|
336
336
|
cd -
|
|
337
337
|
git add {spec_source} && git commit -m "chore: bump spec pointer ({UC-ID} {be|fe} tech design)"
|
|
338
338
|
```
|
|
339
339
|
|
|
340
|
-
|
|
340
|
+
Nếu `tech_docs_dir` là **local** — tức không có `setup.spec_source` (single-repo, hoặc repo BE đa-service thuần không có spec module dùng chung) — bỏ qua bước này; không cần publish liên-repo. Khi nào `spec_source` được set, tech-docs route vào spec submodule và bước publish này áp dụng.
|
|
341
341
|
|
|
342
342
|
## Output
|
|
343
343
|
|
|
344
344
|
{{include:steps/report-footer.md}}
|
|
345
345
|
|
|
346
346
|
```
|
|
347
|
-
/generate-tech-docs
|
|
347
|
+
/generate-tech-docs Hoàn tất — {UC-ID} ({active_tech_design: BE API contract | FE {platform} client design})
|
|
348
348
|
File: {tech_design_path}
|
|
349
349
|
Next: /review-tech-docs {tech_design_path}
|
|
350
|
-
← SA/Lead review
|
|
351
|
-
→
|
|
352
|
-
→
|
|
350
|
+
← cần SA/Lead review trước khi sinh code
|
|
351
|
+
→ nếu nó sống trong spec repo dùng chung: commit + push lên spec submodule (xem Publish ở trên) để đồng đội `/sync` đọc được
|
|
352
|
+
→ sau khi approved:
|
|
353
353
|
BE → /generate-code {system .feature}
|
|
354
|
-
FE → /generate-code {web|app .feature} --phase=integration (
|
|
354
|
+
FE → /generate-code {web|app .feature} --phase=integration (wire API thật theo §4 của doc này)
|
|
355
355
|
```
|