@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.
Files changed (162) hide show
  1. package/bin/index.js +12 -1
  2. package/commands/debug.md +436 -436
  3. package/commands/debug.tmpl +111 -111
  4. package/commands/define-product.md +350 -345
  5. package/commands/define-product.tmpl +69 -64
  6. package/commands/dev-gen-test.md +365 -365
  7. package/commands/dev-gen-test.tmpl +63 -63
  8. package/commands/dev-run-test.md +376 -376
  9. package/commands/dev-run-test.tmpl +74 -74
  10. package/commands/dev-smoke-test.md +341 -341
  11. package/commands/dev-smoke-test.tmpl +60 -60
  12. package/commands/fix-bug.md +403 -403
  13. package/commands/fix-bug.tmpl +78 -78
  14. package/commands/generate-bdd.md +513 -513
  15. package/commands/generate-bdd.tmpl +211 -211
  16. package/commands/generate-code.md +481 -483
  17. package/commands/generate-code.tmpl +179 -181
  18. package/commands/generate-design-spec.md +497 -497
  19. package/commands/generate-design-spec.tmpl +220 -220
  20. package/commands/generate-prd.md +452 -400
  21. package/commands/generate-prd.tmpl +50 -200
  22. package/commands/generate-spec-manifest.md +340 -340
  23. package/commands/generate-spec-manifest.tmpl +59 -59
  24. package/commands/generate-tech-docs.md +365 -365
  25. package/commands/generate-tech-docs.tmpl +84 -84
  26. package/commands/learn.md +347 -347
  27. package/commands/learn.tmpl +22 -22
  28. package/commands/map-testids.md +322 -322
  29. package/commands/map-testids.tmpl +41 -41
  30. package/commands/propose-scenario.md +335 -335
  31. package/commands/propose-scenario.tmpl +54 -54
  32. package/commands/qc-analyze.md +323 -324
  33. package/commands/qc-analyze.tmpl +42 -43
  34. package/commands/qc-design-test.md +304 -304
  35. package/commands/qc-design-test.tmpl +23 -23
  36. package/commands/qc-plan.md +297 -297
  37. package/commands/qc-plan.tmpl +16 -16
  38. package/commands/qc-report.md +302 -302
  39. package/commands/qc-report.tmpl +21 -21
  40. package/commands/qc-review.md +298 -298
  41. package/commands/qc-review.tmpl +17 -17
  42. package/commands/qc-run-test.md +337 -337
  43. package/commands/qc-run-test.tmpl +35 -35
  44. package/commands/refine-prd.md +428 -430
  45. package/commands/refine-prd.tmpl +62 -62
  46. package/commands/report-bug.md +351 -351
  47. package/commands/report-bug.tmpl +70 -70
  48. package/commands/review-code.md +364 -364
  49. package/commands/review-code.tmpl +39 -39
  50. package/commands/review-context.md +578 -580
  51. package/commands/review-context.tmpl +212 -212
  52. package/commands/review-tech-docs.md +427 -427
  53. package/commands/review-tech-docs.tmpl +146 -146
  54. package/commands/setup-ai-first.md +239 -239
  55. package/commands/setup-ai-first.tmpl +133 -133
  56. package/commands/sync.md +145 -145
  57. package/commands/sync.tmpl +93 -93
  58. package/commands/update-framework.md +88 -88
  59. package/commands/update-framework.tmpl +36 -36
  60. package/commands/validate-traces.md +381 -381
  61. package/commands/validate-traces.tmpl +100 -100
  62. package/core/FRAMEWORK_VERSION +1 -1
  63. package/core/commands/debug.md +436 -436
  64. package/core/commands/define-product.md +350 -345
  65. package/core/commands/dev-gen-test.md +365 -365
  66. package/core/commands/dev-run-test.md +376 -376
  67. package/core/commands/dev-smoke-test.md +341 -341
  68. package/core/commands/fix-bug.md +403 -403
  69. package/core/commands/generate-bdd.md +513 -513
  70. package/core/commands/generate-code.md +481 -483
  71. package/core/commands/generate-design-spec.md +497 -497
  72. package/core/commands/generate-prd.md +452 -400
  73. package/core/commands/generate-spec-manifest.md +340 -340
  74. package/core/commands/generate-tech-docs.md +365 -365
  75. package/core/commands/learn.md +347 -347
  76. package/core/commands/map-testids.md +322 -322
  77. package/core/commands/propose-scenario.md +335 -335
  78. package/core/commands/qc-analyze.md +323 -324
  79. package/core/commands/qc-design-test.md +304 -304
  80. package/core/commands/qc-plan.md +297 -297
  81. package/core/commands/qc-report.md +302 -302
  82. package/core/commands/qc-review.md +298 -298
  83. package/core/commands/qc-run-test.md +337 -337
  84. package/core/commands/refine-prd.md +428 -430
  85. package/core/commands/report-bug.md +351 -351
  86. package/core/commands/review-code.md +364 -364
  87. package/core/commands/review-context.md +578 -580
  88. package/core/commands/review-tech-docs.md +427 -427
  89. package/core/commands/setup-ai-first.md +239 -239
  90. package/core/commands/sync.md +145 -145
  91. package/core/commands/update-framework.md +88 -88
  92. package/core/commands/validate-traces.md +381 -381
  93. package/core/skills/code/SKILL.md +389 -389
  94. package/core/skills/debug/SKILL.md +391 -391
  95. package/core/skills/design-spec/SKILL.md +318 -318
  96. package/core/skills/discovery/SKILL.md +7 -547
  97. package/core/skills/prd/SKILL.md +298 -394
  98. package/core/skills/setup-ai-first/SKILL.md +80 -80
  99. package/core/skills/spec/SKILL.md +178 -178
  100. package/core/skills/test/SKILL.md +604 -604
  101. package/core/steps/capture-lesson.md +44 -44
  102. package/core/steps/context-loader.md +175 -175
  103. package/core/steps/gate.md +54 -54
  104. package/core/steps/report-footer.md +52 -52
  105. package/core/steps/review-fanout.md +85 -87
  106. package/core/steps/spawn-agent.md +45 -45
  107. package/core/steps/trace-mirror.md +21 -21
  108. package/core/templates/architecture.template.md +37 -37
  109. package/core/templates/design-spec.template.md +77 -77
  110. package/core/templates/platform-guide.template.md +47 -47
  111. package/core/templates/prd.template.md +107 -232
  112. package/core/templates/product-definition.template.md +101 -88
  113. package/core/templates/project-context.yaml +2 -2
  114. package/docs/01-getting-started/core-concepts.md +1 -1
  115. package/docs/01-getting-started/quickstart.md +7 -7
  116. package/docs/02-guides/developer/bdd-and-trace.md +1 -1
  117. package/docs/02-guides/developer/scenarios.md +5 -5
  118. package/docs/02-guides/product-owner/handoff-checklist.md +1 -1
  119. package/docs/02-guides/product-owner/scenarios.md +23 -23
  120. package/docs/02-guides/tester/bug-reporting.md +2 -2
  121. package/docs/02-guides/tester/reading-specs.md +2 -2
  122. package/docs/02-guides/tester/scenarios.md +1 -1
  123. package/docs/02-guides/tester/spec-manifest.md +3 -3
  124. package/docs/02-guides/tester/workflow.md +1 -1
  125. package/docs/03-concepts/architecture.md +3 -3
  126. package/docs/03-concepts/pipeline.md +3 -3
  127. package/docs/04-operations/publishing.md +20 -3
  128. package/docs/04-operations/sync-and-update.md +5 -5
  129. package/docs/05-reference/command-cheatsheet.md +2 -2
  130. package/docs/05-reference/commands.md +8 -8
  131. package/package.json +1 -1
  132. package/scripts/migrate-specs.js +5 -3
  133. package/scripts/rename-prd-files.js +174 -0
  134. package/skills/code/SKILL.md +389 -389
  135. package/skills/code/SKILL.tmpl +56 -56
  136. package/skills/debug/SKILL.md +391 -391
  137. package/skills/debug/SKILL.tmpl +60 -60
  138. package/skills/design-spec/SKILL.md +318 -318
  139. package/skills/design-spec/SKILL.tmpl +37 -37
  140. package/skills/discovery/SKILL.md +7 -547
  141. package/skills/discovery/SKILL.tmpl +7 -140
  142. package/skills/prd/SKILL.md +298 -394
  143. package/skills/prd/SKILL.tmpl +40 -151
  144. package/skills/setup-ai-first/SKILL.md +80 -80
  145. package/skills/setup-ai-first/SKILL.tmpl +28 -28
  146. package/skills/spec/SKILL.md +178 -178
  147. package/skills/spec/SKILL.tmpl +20 -20
  148. package/skills/test/SKILL.md +604 -604
  149. package/skills/test/SKILL.tmpl +44 -44
  150. package/steps/capture-lesson.md +44 -44
  151. package/steps/context-loader.md +175 -175
  152. package/steps/gate.md +54 -54
  153. package/steps/report-footer.md +52 -52
  154. package/steps/review-fanout.md +85 -87
  155. package/steps/spawn-agent.md +45 -45
  156. package/steps/trace-mirror.md +21 -21
  157. package/templates/architecture.template.md +37 -37
  158. package/templates/design-spec.template.md +77 -77
  159. package/templates/platform-guide.template.md +47 -47
  160. package/templates/prd.template.md +107 -232
  161. package/templates/product-definition.template.md +101 -88
  162. package/templates/project-context.yaml +2 -2
@@ -1,29 +1,29 @@
1
- # /generate-tech-docs — Generate Technical Design Document
1
+ # /generate-tech-docs — Sinh Technical Design Document
2
2
 
3
3
  ## Gate
4
4
  {{include:steps/gate.md}}
5
5
 
6
- *Note: For this command, the target in Step 1 is a `.feature` file or UC-ID. If `$ARGUMENTS` is a bare UC-ID, locate the feature by globbing `{paths.specs_dir}/{domain}/*/bdd/**/{UC-ID}*.feature` (wildcard `*` for the unknown prd-slug, recursive `**` for the `web/`·`app/`·`system/` subfolders a BE tech-doc resolves from the `system/` BDD); take `domain` + `prd_slug` from the matched path. All outputs below then use that resolved `{prd-slug}`.*
6
+ *Lưu ý: Với lệnh này, target Bước 1 một file `.feature` hoặc UC-ID. Nếu `$ARGUMENTS` 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**: Before generating, check the BDD findings file:
8
+ **Quality Gate**: Trước khi sinh, kiểm tra file BDD findings:
9
9
 
10
- 1. Look for `{paths.refinement_dir}/{uc-id}-review-bdd-findings.yaml`.
11
- 2. **If file does not exist** → warn and ask:
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 has not been run for this feature file.
14
- Recommended: run /review-context {feature-file} first to verify BDD quality.
15
- Continue without review? (Y/N)
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 → proceed (accept risk)
18
- - N → stop; run `/review-context {feature-file}` first
19
- 3. **If file exists** → check for unresolved `status: "pending"` critical findings.
20
- If any found → **HALT** and print:
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 → **HALT** in:
21
21
  ```
22
22
  ❌ Quality Gate Failed — {feature-file}
23
- Unresolved critical BDD findings detected.
24
- Run: /review-context --fix {feature-file} ← auto-fix what's possible
25
- Then: /review-context --resume {feature-file} ← apply remaining accepted findings
26
- Then re-run: /generate-tech-docs {feature-file}
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 — Detect Platform & Route Output
34
+ ## Step 0 — Phát hiện Platform & Route Output
35
35
 
36
- Read `@trace.platform` from the feature file header (`web` | `app` | `system`). If absent, fall back to `platform_type` from context (`web-frontend`/`mobile` → FE; `backend` → BE).
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`** — the cross-team **API contract** (authoritative) | `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design.md` |
41
- | `web` / `app` (web-frontend / mobile) | **`fe`** — the **client technical design** (consumes the BE contract) | `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design-{platform}.md` |
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
- Store `active_tech_design` and `tech_design_path`. The `-{platform}` suffix (mirroring design-spec) keeps the FE doc from colliding with the BE contract — both live in the shared spec repo when `spec_source` is set.
43
+ Lưu `active_tech_design` `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
- *Skip this entire step for BE (`active_tech_design = be`).*
49
+ *Bỏ qua toàn bộ step này cho BE (`active_tech_design = be`).*
50
50
 
51
- An FE/App technical design is a **derived** artifact: its API-integration layer maps onto the locked BE contract, and its state/error model comes from the system behavior. Both upstream inputs MUST exist first — **HALT** if either is missing:
51
+ Một FE/App technical design artifact **dẫn xuất**: layer tích hợp API của map lên BE contract đã chốt, 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** — locate `{paths.specs_dir}/{domain}/{prd-slug}/bdd/system/{TICKET-ID}*.feature`.
54
- If not found → HALT:
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
- Cannot generate FE tech-design — System BDD not found for {TICKET-ID}.
57
- The FE design needs the system-level (BE-facing) behavior first.
58
- → PO/BE: /generate-bdd {prd-file} (produces the `system/` platform BDD)
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)** — locate the BE doc `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design.md` and read its `@trace.status`.
61
- - Not found → HALT:
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` đọc `@trace.status` của nó.
61
+ - Không tìm thấy → HALT:
62
62
  ```
63
- Cannot generate FE tech-design — BE API contract not found.
64
- The FE integration layer maps to the BE contract; it must exist first.
65
- → BE: /generate-tech-docs {system .feature} → /review-tech-docs (approve) → publish to spec repo
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; 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
- - Found but `@trace.status` ≠ `approved` → WARN and ask:
67
+ - Tìm thấy nhưng `@trace.status` ≠ `approved` → WARN hỏi:
68
68
  ```
69
- ⚠️ BE contract {UC-ID}-tech-design.md is status: {status} (not approved) — it may still change.
70
- Designing the FE integration against a non-final contract risks rework.
71
- Continue anyway? (Y/N)
69
+ ⚠️ BE contract {UC-ID}-tech-design.md đang status: {status} (chưa approved) — còn 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 → proceed (accept risk) · N → stop, wait for BE to approve.
73
+ - Y → tiếp tục (chấp nhận rủi ro) · N → dừng, chờ BE approve.
74
74
 
75
- Store `system_bdd_path` and `be_contract_path` — they are the primary inputs for the FE §3/§4 below.
75
+ Lưu `system_bdd_path` `be_contract_path` — chúng 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`) only for FE the "existing contract" is the BE doc loaded in Step 0.5.*
81
+ *Chỉ BE (`active_tech_design = be`) — với FE thì "existing contract" doc BE đã nạp Step 0.5.*
82
82
 
83
- Read the source `.feature` file header for `@trace.api_source`.
84
- Also check the source PRD Metadata table for `| **API Source** | existing |`.
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
- Store `active_mode = {reverse-document | greenfield}`.
91
+ Lưu `active_mode = {reverse-document | greenfield}`.
92
92
 
93
- If `active_mode = reverse-document` → load bảng "Existing API Contract" từ PRD làm input cho §2.
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
- Before generating, scan the feature file for scenario count, referenced BRs, and entities. Display the plan for the resolved `active_tech_design` and wait for Y:
99
+ Trước khi sinh, quét file feature lấy số scenario, các BR tham chiếu, entity. Hiện plan cho `active_tech_design` đã phân giải và chờ Y:
100
100
 
101
- **If `active_tech_design = be`:**
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
- Sections to generate:
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 ({entities from core-entities.md relevant to this UC})
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} BRs from feature header)
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
- **If `active_tech_design = fe`:**
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
- Sections to generate:
139
- §1 Overview (FE scope of this UC)
140
- §2 Component Architecture (tree + reuse from figma-components catalog)
141
- §2b Test Selectors (stable test-id cho element có action — QC contract, attr theo platform)
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: each BE endpoint → FE service → DTO/model)
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 (per scenario)
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 only}
148
+ {§9 Offline / platform specifics — chỉ app}
149
149
  ──────────────────────────────────────────────────────
150
150
  Proceed? (Y/N)
151
151
  ```
152
152
 
153
- Wait for explicit "Y" before generating.
153
+ Chờ "Y" ràng trước khi sinh.
154
154
 
155
155
  ---
156
156
 
157
157
  ## Generate
158
158
 
159
- Generate the document for the resolved `active_tech_design`.
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
- Write `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design.md`:
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: {read @trace.service from the .feature file header}
172
- @trace.module: {read @trace.module from the .feature file header}
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: {read @trace.bdd_version from the .feature file header}
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
- Key entities and relationships.
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 | Implementation approach |
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 scripts or schema changes.
216
+ Migration script hoặc thay đổi schema.
217
217
 
218
218
  ## §8. Caching Strategy
219
219
 
220
- What to cache, TTL, invalidation triggers.
220
+ Cache gì, TTL, trigger invalidation.
221
221
 
222
222
  ## §9. Cross-Service Dependencies
223
223
 
224
- External calls, events produced/consumed.
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
- Write `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design-{platform}.md`. The §4 integration layer maps **directly onto the BE contract** loaded in Step 0.5 — every FE service method must trace to a real endpoint in `{be_contract_path}` (no invented endpoints). State and error models in §3/§7 derive from the **System BDD** `Then` clauses.
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 thật trong `{be_contract_path}` (không bịa endpoint). State 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: {read @trace.service from the .feature file header}
245
- @trace.module: {read @trace.module — e.g. react / nextjs / vue / angular / flutter}
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: {read @trace.bdd_version from the FE .feature header}
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 # the BE API contract this design consumes
249
+ @trace.be_contract: {UC-ID}-tech-design.md # BE API contract 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 only}
318
- {Cached-data behavior, offline banner, background sync, platform permissions.}
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 — share the doc (umbrella + shared spec repo)
327
+ ## Publish — chia sẻ doc (umbrella + spec repo dùng chung)
328
328
 
329
- If `paths.tech_docs_dir` resolved **under `setup.spec_source`** (e.g. `{spec_source}/specs/{domain}/{prd-slug}/tech-docs`), the doc was just written **inside the spec submodule**. Publish it (2-layer commit) so the rest of the team reads it via `/sync` — the BE doc is the cross-team **API contract**; the FE doc is the **client design** other FE/App devs (and reviewers) consume:
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 (commit 2 tầng) để cả team đọc qua `/sync` — doc BE **API contract** liên team; doc FE **client design** các FE/App dev khác ( 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} # the branch teammates track in .gitmodules
335
+ git push origin {spec_branch} # branch đồ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
- If `tech_docs_dir` is **local** — i.e. no `setup.spec_source` (single-repo, or a pure multi-service BE repo with no shared spec module) — skip this; no cross-repo publish needed. Whenever `spec_source` is set, tech-docs route to the spec submodule and this publish step applies.
340
+ Nếu `tech_docs_dir` **local** — tức không `setup.spec_source` (single-repo, hoặc repo BE đa-service thuần không 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 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 Complete — {UC-ID} ({active_tech_design: BE API contract | FE {platform} client design})
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 required before code generation
351
- if it lives in the shared spec repo: commit + push to the spec submodule (see Publish above) so teammates `/sync` can read it
352
- after approved:
350
+ cần SA/Lead review trước khi sinh code
351
+ nếu 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 (wires real API per §4 of this doc)
354
+ FE → /generate-code {web|app .feature} --phase=integration (wire API thật theo §4 của doc này)
355
355
  ```