@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,40 +1,40 @@
1
- # /generate-design-spec — Generate Design Specification (FE / App)
1
+ # /generate-design-spec — Sinh Design Specification (FE / App)
2
2
 
3
3
  ## Gate
4
4
  {{include:steps/gate.md}}
5
5
 
6
- *Note: For this command, the target file is a Business PRD (`prd.md`) under `{paths.specs_dir}/{domain}/{prd-slug}/`. Resolve from `$ARGUMENTS` or list the directory and ask. Only FE and mobile PRDs are supported BE PRDs will be rejected at the Platform Check step.*
6
+ *Lưu ý: Với lệnh này, target file một Business PRD (`{TICKET-ID}-{prd-slug}.md` — file `.md` ở gốc feature folder) dưới `{paths.specs_dir}/{domain}/{prd-slug}/`. Phân giải từ `$ARGUMENTS` hoặc liệt thư mục và hỏi. Chỉ hỗ trợ PRD của FE mobile PRD của BE sẽ bị từ chối bước Platform Check.*
7
7
 
8
8
  ## Context
9
9
  {{include:steps/context-loader.md}}
10
10
 
11
- *Additional context for this command: Read the full target PRD. Extract: **TICKET-ID**, **domain**, **feature name**, **Service** and **Module** from PRD metadata (rows `| **Service** |` and `| **Module** |`), User Flow (Section 4a), and Wireframe screen names (Section 4b).*
11
+ *Context bổ sung cho lệnh này: Đọc toàn bộ PRD target. Trích xuất: **TICKET-ID**, **domain**, **tên feature**, **Service** **Module** từ metadata PRD (row `| **Service** |` `| **Module** |`), User Flow (Section 4a), tên màn hình Wireframe (Section 4b).*
12
12
 
13
- *Service extraction rules (same as /generate-prd):*
14
- - *If PRD metadata has `| **Service** |` → use as `active_service` and `| **Module** |` as `active_module`.*
15
- - *If absent AND `services` defined in `project-context.yaml` → ask: "Which service is this Design Spec for?" (list FE/App services only, wait for selection).*
16
- - *If single-service project → `active_service = "default"`, `active_module = tech_stack.module`.*
13
+ *Quy tắc trích xuất Service (giống /generate-prd):*
14
+ - *Nếu metadata PRD `| **Service** |` → dùng làm `active_service` `| **Module** |` làm `active_module`.*
15
+ - *Nếu vắng `services` được định nghĩa trong `project-context.yaml` → hỏi: "Design Spec này dành cho service nào?" (chỉ liệt kê service FE/App, chờ chọn).*
16
+ - *Nếu dự án single-service → `active_service = "default"`, `active_module = tech_stack.module`.*
17
17
 
18
18
  ---
19
19
 
20
20
  ## Platform Check
21
21
 
22
- Using `active_module` and `platform_type` derived from context loading:
22
+ Dùng `active_module` `platform_type` suy ra từ context loading:
23
23
 
24
- 1. If `platform_type = "backend"` → **STOP**. Output:
24
+ 1. Nếu `platform_type = "backend"` → **STOP**. Xuất:
25
25
  ```
26
- ❌ Design Spec is only for FE and mobile platforms.
27
- For BE services, API contracts belong in the Business PRD (Use Case → Business Logic section).
26
+ ❌ Design Spec chỉ dành cho platform FE mobile.
27
+ Với service BE, API contract thuộc về Business PRD (Use Case → section Business Logic).
28
28
  ```
29
29
 
30
- 2. If `platform_type = "web-frontend"` → set `active_platform = "web"`.
30
+ 2. Nếu `platform_type = "web-frontend"` → set `active_platform = "web"`.
31
31
 
32
- 3. If `platform_type = "mobile"`:
33
- - `flutter` or `react-native` → set `active_platform = "app"`
32
+ 3. Nếu `platform_type = "mobile"`:
33
+ - `flutter` hoặc `react-native` → set `active_platform = "app"`
34
34
  - `ios-swiftui` → set `active_platform = "app-ios"`
35
35
  - `android-compose` → set `active_platform = "app-android"`
36
36
 
37
- 4. If `platform_type = "unknown"` → ask: "Which platform is this Design Spec for?"
37
+ 4. Nếu `platform_type = "unknown"` → hỏi: "Design Spec này dành cho platform nào?"
38
38
  ```
39
39
  Options:
40
40
  1 — web (React / Next.js / Vue / Angular)
@@ -42,15 +42,15 @@ Using `active_module` and `platform_type` derived from context loading:
42
42
  3 — app-ios (iOS SwiftUI)
43
43
  4 — app-android (Android Compose)
44
44
  ```
45
- Wait for selection. Map choice to `active_platform` and infer `active_module` if possible.
45
+ Chờ chọn. Map lựa chọn sang `active_platform` suy ra `active_module` nếu được.
46
46
 
47
47
  ---
48
48
 
49
49
  ## Screen Discovery
50
50
 
51
- From the PRD's Section 4 (User Flow + Wireframe), extract all screen / page / modal names mentioned.
51
+ Từ Section 4 của PRD (User Flow + Wireframe), trích xuất mọi tên screen / page / modal được nhắc tới.
52
52
 
53
- Present the list and ask PO to confirm:
53
+ Trình bày danh sách hỏi PO xác nhận:
54
54
 
55
55
  ```
56
56
  Screens detected from PRD:
@@ -58,59 +58,59 @@ Screens detected from PRD:
58
58
  2. {Screen name 2}
59
59
  ...
60
60
 
61
- Are these all the screens for the {active_platform} platform?
62
- Add any missing, remove any that don't apply, or confirm with Y.
61
+ Đây đã đủ các màn cho platform {active_platform} chưa?
62
+ Thêm màn còn thiếu, bỏ màn không áp dụng, hoặc xác nhận bằng Y.
63
63
  ```
64
64
 
65
- Wait for confirmation. Store the confirmed list as `screen_list`.
65
+ Chờ xác nhận. Lưu danh sách đã xác nhận là `screen_list`.
66
66
 
67
67
  ---
68
68
 
69
- ## Figma Frame Links *(mandatoryone readable node-level link per screen)*
69
+ ## Figma Frame Links *(bắt buộc một link node-level đọc được cho mỗi màn)*
70
70
 
71
- A Design Spec is only as good as the design it points to. The AI **cannot read a plain
72
- file link** (`figma.com/design/{fileKey}/...` with no `node-id`) — it needs a
73
- **node-level link to each specific frame** so it can fetch that frame's real layout,
74
- components, and tokens via the Figma MCP. So collect one link **per screen**, not one
75
- link for the whole feature.
71
+ Một Design Spec chỉ tốt ngang với design trỏ tới. AI **không đọc được link file
72
+ trần** (`figma.com/design/{fileKey}/...` không `node-id`) — cần một
73
+ **link node-level tới từng frame cụ thể** để fetch layout, component, token thật của
74
+ frame đó qua Figma MCP. Vậy nên thu thập một link **mỗi màn**, không phải một
75
+ link cho cả feature.
76
76
 
77
- **Ask the PO, listing every screen in `screen_list`:**
77
+ **Hỏi PO, liệt mọi màn trong `screen_list`:**
78
78
 
79
79
  ```
80
- Paste the Figma frame link for each screen below.
80
+ Dán link Figma frame cho từng màn bên dưới.
81
81
 
82
- In Figma: select the frame → right-click → "Copy link to selection"
83
- (the URL must contain ?node-id=... — that is the per-frame link the AI can read)
82
+ Trong Figma: chọn frame → chuột phải → "Copy link to selection"
83
+ (URL phải chứa ?node-id=... — đó link per-frame AI đọc được)
84
84
 
85
85
  1. {Screen 1} : ____
86
86
  2. {Screen 2} : ____
87
87
  ...
88
88
 
89
- If a screen has no design yet, type none for that screen.
89
+ Nếu một màn chưa design, none cho màn đó.
90
90
  ```
91
91
 
92
- **For each answer:**
92
+ **Với mỗi câu trả lời:**
93
93
 
94
- 1. **Validate format** — the URL must match `figma.com/design/{fileKey}/...?node-id={nodeId}`.
95
- - Validstore as `figma_frames[{screen}] = {url}`, parse out `fileKey` + `nodeId`.
96
- - A file link with **no `node-id`** → reject it: "This link points to the whole file, not a frame. Re-copy via right-click → Copy link to selection." Re-ask for that screen.
97
- - `none` → `figma_frames[{screen}] = "TBD"`, mark that screen ❌ Missing.
94
+ 1. **Validate format** — URL phải khớp `figma.com/design/{fileKey}/...?node-id={nodeId}`.
95
+ - Hợp lệ lưu thành `figma_frames[{screen}] = {url}`, parse ra `fileKey` + `nodeId`.
96
+ - Link file **không `node-id`** → từ chối: "Link này trỏ tới cả file, không phải một frame. Copy lại qua chuột phải → Copy link to selection." Hỏi lại màn đó.
97
+ - `none` → `figma_frames[{screen}] = "TBD"`, đánh dấu màn đó ❌ Missing.
98
98
 
99
- 2. **Fetch the frame via Figma MCP** (only for valid links) — call `get_design_context`
100
- (and `get_screenshot` when useful) with the parsed `fileKey` + `nodeId` to read the
101
- real layout, component names, and design tokens. Ground every Screen Spec in this
102
- fetched data; do **not** invent layout the frame does not show. If a fetch fails
103
- (permission / not found) → treat that screen as ❌ Missing and note the fetch error.
99
+ 2. **Fetch frame qua Figma MCP** (chỉ với link hợp lệ) — gọi `get_design_context`
100
+ ( `get_screenshot` khi hữu ích) với `fileKey` + `nodeId` đã parse để đọc
101
+ layout, tên component, design token thật. Đặt mọi Screen Spec dựa trên dữ liệu
102
+ đã fetch này; **đừng** bịa layout frame không thể hiện. Nếu fetch thất bại
103
+ (permission / not found) → coi màn đó ❌ Missing ghi chú lỗi fetch.
104
104
 
105
- 3. Derive the feature-level `figma_url` = the file link (without `node-id`) shared by the
106
- frames, for the Metadata row. If frames span multiple files, list each.
105
+ 3. Suy ra `figma_url` mức feature = link file (không `node-id`) chung của các
106
+ frame, cho row Metadata. Nếu các frame trải nhiều file, liệt kê từng cái.
107
107
 
108
- **Mandatory gate (does not abort — produces a draft):**
109
- - If **any** screen is ❌ Missing → the spec is generated as a **draft** with those screens
110
- flagged, but `Status` stays `draft` and **sign-off / `/generate-bdd` is blocked** until
111
- every screen has a readable, fetched frame link. Record `missing_frames = [screens]`.
112
- - Add one AI Assumption per missing screen: "No readable Figma frame for {screen} — spec
113
- for this screen is text-only and must not be signed off until a `node-id` link is added."
108
+ **Gate bắt buộc (không abort — sinh ra draft):**
109
+ - Nếu **bất kỳ** màn nào ❌ Missing → spec được sinh dưới dạng **draft** với các màn đó
110
+ được gắn cờ, nhưng `Status` vẫn `draft` **sign-off / `/generate-bdd` bị chặn** cho tới khi
111
+ mọi màn link frame đọc được, đã fetch. Ghi `missing_frames = [screens]`.
112
+ - Thêm một AI Assumption cho mỗi màn thiếu: "Không Figma frame đọc được cho {screen} — spec
113
+ của màn này chỉ text không được sign off cho tới khi thêm link `node-id`."
114
114
 
115
115
  ---
116
116
 
@@ -124,58 +124,58 @@ Platform : {active_platform}
124
124
  Module : {active_module}
125
125
  Service : {active_service}
126
126
  Domain : {domain}
127
- Screens : {N} — {comma-separated screen_list}
128
- Figma : {linked}/{N} screens have readable frame links{; missing: comma-separated missing_frames}
127
+ Screens : {N} — {screen_list ngăn cách bởi dấu phẩy}
128
+ Figma : {linked}/{N} màn link frame đọc được{; missing: missing_frames ngăn cách bởi dấu phẩy}
129
129
  Output path : {paths.specs_dir}/{domain}/{prd-slug}/design-spec/{TICKET-ID}-design-spec-{active_platform}-{slug}.md
130
130
 
131
- {If missing_frames non-empty}:
132
- ⚠️ {count} screen(s) without a readable Figma frame linkthese will be generated as
133
- text-only drafts and the spec cannot be signed off until their node-id links are added.
131
+ {Nếu missing_frames khác rỗng}:
132
+ ⚠️ {count} màn không link Figma frame đọc được các màn này sẽ được sinh dưới dạng
133
+ draft chỉ-text spec không thể sign off cho tới khi thêm link node-id.
134
134
 
135
135
  Generate? (Y/N)
136
136
  ```
137
137
 
138
- Wait for explicit Y before proceeding.
138
+ Chờ Y ràng trước khi tiếp tục.
139
139
 
140
140
  ---
141
141
 
142
142
  ## Generation Rules
143
143
 
144
- Apply these rules consistently when generating all sections:
145
-
146
- **Component mapping (C.M — mandatory):**
147
- - For each component referenced, check `figma-components/{active_module}.md` (loaded in context).
148
- - ✅ Matched → use the exact `Code Component` and `Import Path` from the catalog.
149
- - ⚠️ Matched but `[TODO]` → mark the component cell as `[TODO — implementation pending]`.
150
- - ❌ Not in catalog → mark as `[NEW — confirm with designer before generating code]`.
151
- - Never invent component names or import paths.
152
-
153
- **Platform-adaptive sections:**
154
- - Section 3 (Interaction Patterns) and Section 4 (Platform Considerations) adapt to `active_platform`:
155
- - `web` → include responsive breakpoints, hover/focus states, keyboard navigation, accessibility.
156
- - `app` / `app-ios` / `app-android` → include gestures, safe area, minimum touch targets, navigation pattern, deep links, permissions, offline behavior.
157
- - Only generate the section relevant to `active_platform`. Omit the other platform's section entirely.
158
-
159
- **Figma grounding (mandatory):**
160
- - For every screen with a fetched frame (`figma_frames[screen]` is a valid link), base the
161
- Layout, Component Inventory, and Screen States on the **fetched Figma data** — real
162
- component names, real tokens, real frame structure. Do not contradict or invent layout.
163
- - Use the exact per-screen `figma_frames[screen]` URL in the Screen Inventory, each Screen
164
- Spec header, and the Figma Summary — never a synthetic `{figma_url}#screen1` fragment.
165
- - For ❌ Missing screens: generate a text-only draft from the PRD, prefix the Screen Spec
166
- with `> [DRAFT — no Figma frame; do not sign off]`, and leave the Figma cell as ❌ Missing.
167
-
168
- **Screen states (mandatory per screen):**
169
- - Every screen must document at minimum: `default`, `loading`, `error`.
170
- - Add `empty` when the screen can display zero-data state.
171
- - Add `success` when a completed action produces a distinct confirmation state.
172
- - If a state does not applymark `N/A` with a short reason.
144
+ Áp dụng các quy tắc này nhất quán khi sinh mọi section:
145
+
146
+ **Component mapping (C.M — bắt buộc):**
147
+ - Với mỗi component được tham chiếu, kiểm tra `figma-components/{active_module}.md` (đã nạp trong context).
148
+ - ✅ Matched → dùng đúng `Code Component` `Import Path` từ catalog.
149
+ - ⚠️ Matched nhưng `[TODO]` → đánh dấu ô component `[TODO — implementation pending]`.
150
+ - ❌ Không trong catalog → đánh dấu `[NEW — confirm with designer before generating code]`.
151
+ - Không bao giờ bịa tên component hay import path.
152
+
153
+ **Section thích ứng theo platform:**
154
+ - Section 3 (Interaction Patterns) Section 4 (Platform Considerations) thích ứng theo `active_platform`:
155
+ - `web` → gồm responsive breakpoint, trạng thái hover/focus, keyboard navigation, accessibility.
156
+ - `app` / `app-ios` / `app-android` → gồm gesture, safe area, touch target tối thiểu, navigation pattern, deep link, permission, hành vi offline.
157
+ - Chỉ sinh section liên quan tới `active_platform`. Bỏ hẳn section của platform kia.
158
+
159
+ **Figma grounding (bắt buộc):**
160
+ - Với mỗi màn frame đã fetch (`figma_frames[screen]` link hợp lệ), dựa Layout,
161
+ Component Inventory, Screen States trên **dữ liệu Figma đã fetch** — tên component thật,
162
+ token thật, cấu trúc frame thật. Đừng mâu thuẫn hay bịa layout.
163
+ - Dùng đúng URL `figma_frames[screen]` từng-màn trong Screen Inventory, header mỗi Screen
164
+ Spec, Figma Summary — không bao giờ dùng fragment giả `{figma_url}#screen1`.
165
+ - Với màn ❌ Missing: sinh draft chỉ-text từ PRD, thêm tiền tố vào Screen Spec
166
+ `> [DRAFT — no Figma frame; do not sign off]`, để ô Figma ❌ Missing.
167
+
168
+ **Screen states (bắt buộc mỗi màn):**
169
+ - Mỗi màn phải tả tối thiểu: `default`, `loading`, `error`.
170
+ - Thêm `empty` khi màn thể hiển thị trạng thái không dữ liệu.
171
+ - Thêm `success` khi một action hoàn tất tạo ra trạng thái xác nhận riêng biệt.
172
+ - Nếu một state không áp dụngđánh dấu `N/A` kèm do ngắn.
173
173
 
174
174
  ---
175
175
 
176
176
  ## Generate
177
177
 
178
- Write `{paths.specs_dir}/{domain}/{prd-slug}/design-spec/{TICKET-ID}-design-spec-{active_platform}-{slug}.md`:
178
+ Ghi `{paths.specs_dir}/{domain}/{prd-slug}/design-spec/{TICKET-ID}-design-spec-{active_platform}-{slug}.md`:
179
179
 
180
180
  ````markdown
181
181
  # {TICKET-ID} {Feature Name} — Design Spec [{active_platform}]
@@ -193,42 +193,42 @@ Write `{paths.specs_dir}/{domain}/{prd-slug}/design-spec/{TICKET-ID}-design-spec
193
193
  | **Module** | {active_module} |
194
194
  | **Service** | {active_service} |
195
195
  | **Domain** | {domain} |
196
- | **Business PRD** | [{TICKET-ID}]({relative-path-to-prd.md}) |
197
- | **Figma** | {figma_url — feature file link} ({linked}/{N} frames linked) |
198
- | **Author** | {PO name or "AI-assisted"} |
196
+ | **Business PRD** | [{TICKET-ID}](../{TICKET-ID}-{prd-slug}.md) |
197
+ | **Figma** | {figma_url — link file feature} ({linked}/{N} frame đã link) |
198
+ | **Author** | {tên PO hoặc "AI-assisted"} |
199
199
  | **Created** | {YYYY-MM-DD} |
200
200
  | **Updated** | {YYYY-MM-DD} |
201
201
 
202
202
  ---
203
203
 
204
- # 1. Screen Inventory
204
+ # 1. Danh mục màn hình (Screen Inventory)
205
205
 
206
- | # | Screen Name | Entry Point | Figma Frame | Notes |
206
+ | # | Tên màn hình | Điểm vào | Figma Frame | Ghi chú |
207
207
  |---|-------------|-------------|-------------|-------|
208
- | 1 | {Screen 1} | {how user arrivese.g., tap CTA on Home} | [Frame]({figma_frames[Screen 1]}) | |
209
- | 2 | {Screen 2} | {entry point} | [Frame]({figma_frames[Screen 2]}) / ❌ Missing | |
208
+ | 1 | {Màn hình 1} | {người dùng đến từ đâu vd: tap CTA Home} | [Frame]({figma_frames[Screen 1]}) | |
209
+ | 2 | {Màn hình 2} | {điểm vào} | [Frame]({figma_frames[Screen 2]}) / ❌ Missing | |
210
210
 
211
211
  ---
212
212
 
213
- # 2. Screen Specs
213
+ # 2. Đặc tả màn hình (Screen Specs)
214
214
 
215
215
  <!--
216
- Repeat this block for every screen in the Screen Inventory.
217
- Each screen must have: Layout, Component Inventory, Screen States, Actions & Navigation.
216
+ Lặp lại block này cho mỗi màn trong Screen Inventory.
217
+ Mỗi màn phải có: Layout, Component Inventory, Screen States, Actions & Navigation.
218
218
  -->
219
219
 
220
- ## Screen 1: {Screen Name}
220
+ ## Màn hình 1: {Tên màn hình}
221
221
 
222
- **Figma**: [{Frame name}]({figma_frames[Screen 1]}) <!-- ❌ Missing → prefix this screen with `> [DRAFT — no Figma frame; do not sign off]` -->
222
+ **Figma**: [{Tên frame}]({figma_frames[Screen 1]}) <!-- ❌ Missing → thêm tiền tố cho màn này `> [DRAFT — no Figma frame; do not sign off]` -->
223
223
 
224
224
  ### Layout
225
225
 
226
- {Describe the layout: grid columns, max-width container, section order, padding, key spacing values.
227
- Reference design tokens where applicable (e.g., `spacing.md = 16px`, `color.surface`).}
226
+ { tả layout: số cột grid, container max-width, thứ tự section, padding, giá trị spacing chính.
227
+ Tham chiếu design token nếu áp dụng được (vd: `spacing.md = 16px`, `color.surface`).}
228
228
 
229
229
  ### Component Inventory
230
230
 
231
- | Component (Figma) | Code Component | Import Path | States | Notes |
231
+ | Component (Figma) | Code Component | Import Path | States | Ghi chú |
232
232
  |---------------------|-----------------|------------------------|---------------------------------|--------------------|
233
233
  | {Figma/Button/Primary} | Button | @/components/ui/Button | default, loading, disabled | |
234
234
  | {Figma/Input/Text} | TextInput | @/components/ui/Input | default, focus, error, disabled | |
@@ -236,171 +236,171 @@ Write `{paths.specs_dir}/{domain}/{prd-slug}/design-spec/{TICKET-ID}-design-spec
236
236
 
237
237
  ### Screen States
238
238
 
239
- | State | Trigger | UI Behavior |
239
+ | State | Trigger | Hành vi UI |
240
240
  |-----------|-------------------------------------|--------------------------------------------------------------|
241
- | default | Screen loaded, data available | {Describe full rendered appearance} |
242
- | loading | API call in flight | {Skeleton layout / spinner position reference component} |
243
- | error | API failure or validation error | {Toast / inline message / error screenexact copy TBD} |
244
- | empty | API returns empty list / no data | {Empty state illustration + CTA text e.g., "No orders yet. Start shopping →"} |
245
- | success | Action completed (if applicable) | {Confirmation message / navigation / state change} |
241
+ | default | Màn đã load, dữ liệu | { tả toàn bộ giao diện đã render} |
242
+ | loading | API đang gọi | {Layout skeleton / vị trí spinner — tham chiếu component} |
243
+ | error | API thất bại hoặc lỗi validation | {Toast / message inline / màn lỗi — copy chính xác TBD} |
244
+ | empty | API trả về list rỗng / không dữ liệu | {Illustration empty state + text CTA — vd: "Chưa order. Bắt đầu mua sắm →"} |
245
+ | success | Action hoàn tất (nếu áp dụng) | {Message xác nhận / điều hướng / thay đổi trạng thái} |
246
246
 
247
247
  ### Actions & Navigation
248
248
 
249
- | Action | Trigger | Result |
249
+ | Action | Trigger | Kết quả |
250
250
  |-----------------|--------------------------------|-------------------------------------------------|
251
- | {Action name} | Tap/click {element name} | Navigate to {Screen N} / Open {Modal name} |
252
- | {Action name} | Swipe left on {list item} | Show delete confirmation |
253
- | {Back / Cancel} | Back gesture / Cancel button | Return to {previous screen} without saving |
251
+ | {Tên action} | Tap/click {tên phần tử} | Điều hướng tới {Màn hình N} / Mở {Tên modal} |
252
+ | {Tên action} | Swipe trái trên {list item} | Hiện xác nhận xoá |
253
+ | {Back / Cancel} | Cử chỉ back / nút Cancel | Quay lại {màn trước} không lưu |
254
254
 
255
255
  ---
256
256
 
257
- <!-- Repeat ## Screen N block for each additional screen -->
257
+ <!-- Lặp lại block ## Màn hình N cho mỗi màn bổ sung -->
258
258
 
259
259
  ---
260
260
 
261
- # 3. Interaction Patterns
261
+ # 3. Pattern tương tác (Interaction Patterns)
262
262
 
263
263
  <!--
264
- Web platform: include sections A + B. Remove section C.
265
- App platform: include section C. Remove sections A + B.
264
+ Platform web: gồm section A + B. Bỏ section C.
265
+ Platform app: gồm section C. Bỏ section A + B.
266
266
  -->
267
267
 
268
- <!-- ═══════════════════════════ WEB ONLY ═══════════════════════════ -->
268
+ <!-- ═══════════════════════════ CHỈ WEB ═══════════════════════════ -->
269
269
 
270
- ## A. Responsive Behavior *(web only)*
270
+ ## A. Hành vi Responsive *(chỉ web)*
271
271
 
272
- | Breakpoint | Width | Layout Changes |
272
+ | Breakpoint | Width | Thay đổi layout |
273
273
  |------------|------------|----------------------------------------------------|
274
- | Mobile | < 768px | {Single column, bottom navigation bar, CTA full-width} |
275
- | Tablet | 768–1279px | {2-column grid, sidebar collapsed, tab navigation} |
276
- | Desktop | ≥ 1280px | {Full layout, sidebar visible, max-width 1440px} |
274
+ | Mobile | < 768px | {1 cột, bottom navigation bar, CTA full-width} |
275
+ | Tablet | 768–1279px | {grid 2 cột, sidebar thu gọn, tab navigation} |
276
+ | Desktop | ≥ 1280px | {layout đầy đủ, sidebar hiển thị, max-width 1440px}|
277
277
 
278
- ## B. Hover / Focus / Keyboard *(web only)*
278
+ ## B. Hover / Focus / Keyboard *(chỉ web)*
279
279
 
280
- | Element | Hover state | Focus state | Keyboard shortcut |
280
+ | Phần tử | Trạng thái Hover | Trạng thái Focus | Phím tắt |
281
281
  |----------------|-------------------------------|---------------------------------|-------------------|
282
282
  | Primary button | Background → {color.hover} | Outline 2px {color.focus} | Enter / Space |
283
- | Text input | Border → {color.border.hover} | Border → {color.primary}, label floats | Tab to focus |
284
- | Dropdown | Background highlight | Same as hover + ring | Arrow keys to navigate |
283
+ | Text input | Border → {color.border.hover} | Border → {color.primary}, label nổi | Tab to focus |
284
+ | Dropdown | Highlight nền | Giống hover + ring | Phím mũi tên điều hướng |
285
285
 
286
- <!-- ═══════════════════════════ APP ONLY ═══════════════════════════ -->
286
+ <!-- ═══════════════════════════ CHỈ APP ═══════════════════════════ -->
287
287
 
288
- ## C. Gestures & Navigation *(app only)*
288
+ ## C. Cử chỉ & Điều hướng *(chỉ app)*
289
289
 
290
- | Gesture | Screen / Element | Behavior |
290
+ | Cử chỉ | Màn / Phần tử | Hành vi |
291
291
  |-------------------|---------------------------|-------------------------------------------------------|
292
- | Back gesture (iOS swipe-right / Android back) | All screens | {Return to previous screen / Show "Discard changes?" dialog} |
293
- | Pull-to-refresh | {Screen names} | Refresh data, spinner at top |
294
- | Swipe left on row | {List item name} | Reveal {Delete / Archive} action |
295
- | Long press | {Element name} | {Context menu / selection mode} |
296
- | Pinch / zoom | {Image viewer} | Scale image, double-tap to reset |
292
+ | Cử chỉ back (iOS swipe-right / Android back) | Mọi màn | {Quay lại màn trước / Hiện dialog "Discard changes?"} |
293
+ | Pull-to-refresh | {Tên màn} | Refresh dữ liệu, spinner trên cùng |
294
+ | Swipe trái trên row | {Tên list item} | Hiện action {Delete / Archive} |
295
+ | Long press | {Tên phần tử} | {Context menu / chế độ chọn} |
296
+ | Pinch / zoom | {Image viewer} | Scale ảnh, double-tap để reset |
297
297
 
298
- ### Navigation Pattern *(app only)*
298
+ ### Navigation Pattern *(chỉ app)*
299
299
 
300
300
  ```
301
- {Draw the navigation stack for this feature, e.g.:
301
+ {Vẽ navigation stack cho feature này, vd:
302
302
  BottomTab(Home) → FeatureListPage → FeatureDetailPage → EditPage
303
303
  BottomTab(Home) → FeatureListPage ↘ (modal) CreatePage
304
304
  }
305
305
  ```
306
306
 
307
- Entry: {how the user enters this feature — tab / deeplink / push from another screen}
308
- Exit: {how the user leaves — back stack / tab switch / deeplink out}
307
+ Entry: {người dùng vào feature này thế nào — tab / deeplink / push từ màn khác}
308
+ Exit: {người dùng rời thế nào — back stack / chuyển tab / deeplink out}
309
309
 
310
- ### Platform Conventions *(app only)*
310
+ ### Platform Conventions *(chỉ app)*
311
311
 
312
- | Aspect | iOS behavior | Android behavior |
312
+ | Khía cạnh | Hành vi iOS | Hành vi Android |
313
313
  |--------------------------|-----------------------------------------|-----------------------------------------|
314
- | Navigation bar | {Back button top-left, title centered} | {Up arrow top-left, title left-aligned} |
315
- | Sheet / bottom modal | {UISheetPresentation, grabber visible} | {BottomSheet, drag handle} |
316
- | Alert / confirm dialog | {UIAlertController, actions right-aligned} | {Material AlertDialog, actions left-aligned} |
314
+ | Navigation bar | {Nút back trên-trái, title canh giữa} | {Mũi tên Up trên-trái, title canh trái} |
315
+ | Sheet / bottom modal | {UISheetPresentation, hiện grabber} | {BottomSheet, drag handle} |
316
+ | Alert / confirm dialog | {UIAlertController, action canh phải} | {Material AlertDialog, action canh trái}|
317
317
  | Loading indicator | {UIActivityIndicatorView, center} | {CircularProgressIndicator} |
318
318
  | Toast / snackbar | {Custom toast, bottom center} | {Material Snackbar, bottom} |
319
319
 
320
320
  ---
321
321
 
322
- # 4. Platform Considerations
322
+ # 4. Cân nhắc theo Platform (Platform Considerations)
323
323
 
324
324
  <!--
325
- Web: include section A. App: include section B. Remove the non-applicable section.
325
+ Web: gồm section A. App: gồm section B. Bỏ section không áp dụng.
326
326
  -->
327
327
 
328
- <!-- ═══════════════════════════ WEB ONLY ═══════════════════════════ -->
328
+ <!-- ═══════════════════════════ CHỈ WEB ═══════════════════════════ -->
329
329
 
330
- ## A. Accessibility *(web only)*
330
+ ## A. Accessibility *(chỉ web)*
331
331
 
332
- - [ ] All interactive elements reachable via Tab key no keyboard traps
333
- - [ ] Focus trap inside modal dialogs (Tab cycles within modal only)
334
- - [ ] Icon-only buttons have `aria-label` describing the action
335
- - [ ] Dynamic content updates (loading → loaded) announce via `aria-live`
336
- - [ ] Color contrast meets WCAG AA: text ≥ 4.5:1, large text ≥ 3:1
337
- - [ ] Form inputs have visible labels (not placeholder-only)
338
- - [ ] Error messages linked to inputs via `aria-describedby`
332
+ - [ ] Mọi phần tử tương tác tới được bằng phím Tab — không keyboard trap
333
+ - [ ] Focus trap bên trong modal dialog (Tab chỉ chạy vòng trong modal)
334
+ - [ ] Nút chỉ-icon `aria-label` tả hành động
335
+ - [ ] Cập nhật nội dung động (loading → loaded) thông báo qua `aria-live`
336
+ - [ ] Tương phản màu đạt WCAG AA: text ≥ 4.5:1, text lớn ≥ 3:1
337
+ - [ ] Input form label hiển thị (không chỉ placeholder)
338
+ - [ ] Message lỗi liên kết với input qua `aria-describedby`
339
339
 
340
- <!-- ═══════════════════════════ APP ONLY ═══════════════════════════ -->
340
+ <!-- ═══════════════════════════ CHỉ APP ═══════════════════════════ -->
341
341
 
342
- ## B. Device & OS *(app only)*
342
+ ## B. Thiết bị & OS *(chỉ app)*
343
343
 
344
- - [ ] Safe area insets applied on all screens top (status bar) and bottom (home indicator)
345
- - [ ] Minimum touch target: 44×44pt (iOS) / 48×48dp (Android)
346
- - [ ] Tested on small screen: 375pt wide (iPhone SE) / 360dp wide (common Android)
347
- - [ ] Deep link entry: `{scheme}://{host}/{path}` → lands on {screen name} with {param} pre-filled
348
- - [ ] Permission gates: {list permissions needed — Camera / Location / Notification}
349
- - {Permission}: requested on {screen name} with rationale copy: "{copy TBD}"
350
- - [ ] Offline / no-network behavior:
351
- - {Screen name}: show cached data + offline banner
352
- - {Action name}: disable button, show tooltip "Requires connection"
353
- - [ ] Dark mode: all screens tested in dark mode — no hardcoded colors
344
+ - [ ] Áp dụng safe area insets mọi màntrên (status bar) dưới (home indicator)
345
+ - [ ] Touch target tối thiểu: 44×44pt (iOS) / 48×48dp (Android)
346
+ - [ ] Đã test trên màn nhỏ: rộng 375pt (iPhone SE) / rộng 360dp (Android phổ biến)
347
+ - [ ] Deep link entry: `{scheme}://{host}/{path}` → vào {tên màn} với {param} đã điền sẵn
348
+ - [ ] Permission gate: {liệt permission cần — Camera / Location / Notification}
349
+ - {Permission}: yêu cầu {tên màn} với copy lý do: "{copy TBD}"
350
+ - [ ] Hành vi offline / không mạng:
351
+ - {Tên màn}: hiện dữ liệu cache + banner offline
352
+ - {Tên action}: disable nút, hiện tooltip "Requires connection"
353
+ - [ ] Dark mode: mọi màn đã test dark mode — không màu hardcode
354
354
 
355
355
  ---
356
356
 
357
- # 5. AC-UI — Design Acceptance Criteria
357
+ # 5. AC-UI — Tiêu chí chấp nhận về Design
358
358
 
359
- > Reviewed and signed off by **PO + Designer** together before BDD generation.
360
- > These complement (not replace) the business-level AC in the [Business PRD]({prd-path}).
359
+ > Được **PO + Designer** cùng review và sign off trước khi sinh BDD.
360
+ > Bổ sung cho (không thay thế) AC mức nghiệp vụ trong [Business PRD]({prd-path}).
361
361
 
362
- | ID | Acceptance Criterion | Verified by |
362
+ | ID | Tiêu chí chấp nhận | Verified by |
363
363
  |--------|--------------------------------------------------------------------------------|-----------------|
364
- | AC-UI1 | All screens match approved Figma frames within design-system tolerances | Designer |
365
- | AC-UI2 | Loading skeleton/spinner appears within 200ms of initiating any API call | QA |
366
- | AC-UI3 | All error messages are visible, descriptive, and include a recovery action | PO |
367
- | AC-UI4 | Empty states include an illustration and a clear call-to-action | PO + Designer |
368
- | AC-UI5 | {Platform-specifice.g., web: "All screens pass WCAG AA contrast check"} | QA |
369
- | AC-UI6 | {Platform-specifice.g., app: "Back gesture on all screens returns to correct previous screen"} | QA |
370
- | AC-UI7 | {Feature-specific UI criterion from Business PRD wireframe section} | PO |
364
+ | AC-UI1 | Mọi màn khớp frame Figma đã duyệt trong dung sai design-system | Designer |
365
+ | AC-UI2 | Skeleton/spinner loading xuất hiện trong 200ms kể từ khi gọi API | QA |
366
+ | AC-UI3 | Mọi message lỗi đều hiển thị, rõ ràng, kèm action khôi phục | PO |
367
+ | AC-UI4 | Empty state illustration call-to-action rõ ràng | PO + Designer |
368
+ | AC-UI5 | {Riêng platform vd web: "Mọi màn pass kiểm tra tương phản WCAG AA"} | QA |
369
+ | AC-UI6 | {Riêng platform vd app: "Cử chỉ back mọi màn quay về đúng màn trước"} | QA |
370
+ | AC-UI7 | {Tiêu chí UI riêng của feature từ section wireframe của Business PRD} | PO |
371
371
 
372
372
  ---
373
373
 
374
374
  # Appendix
375
375
 
376
- ## Figma Summary
376
+ ## Tóm tắt Figma
377
377
 
378
- | Screen | Figma Frame | Link / Fetch Status |
378
+ | Màn hình | Figma Frame | Trạng thái Link / Fetch |
379
379
  |-----------------|--------------------------------------|--------------------------------------|
380
- | {Screen 1} | [Link]({figma_frames[Screen 1]}) | ✅ Linked & fetched |
381
- | {Screen 2} | — | ❌ Missing — no node-id link provided |
380
+ | {Màn hình 1} | [Link]({figma_frames[Screen 1]}) | ✅ Đã link & fetch |
381
+ | {Màn hình 2} | — | ❌ Missing — không có link node-id |
382
382
 
383
- ## Design Tokens Referenced
383
+ ## Design Token đã tham chiếu
384
384
 
385
- | Token | Value | Used in |
385
+ | Token | Value | Dùng |
386
386
  |-----------------------|---------------|---------------------------------|
387
- | `color.primary` | {#hex} | Primary buttons, links, active states |
388
- | `color.surface` | {#hex} | Card backgrounds |
389
- | `spacing.md` | {16px / 4} | Standard vertical gap |
390
- | `typography.heading2` | {font/size} | Screen titles |
387
+ | `color.primary` | {#hex} | Primary button, link, active state |
388
+ | `color.surface` | {#hex} | Nền card |
389
+ | `spacing.md` | {16px / 4} | Khoảng cách dọc tiêu chuẩn |
390
+ | `typography.heading2` | {font/size} | Title màn hình |
391
391
 
392
- ## References
392
+ ## Tài liệu tham khảo
393
393
 
394
- - [{TICKET-ID}]({prd-path}) — Business PRD (source of AC, UC, BR)
395
- - {[Other Design Spec](./other-ds.md) — if this feature shares screens}
394
+ - [{TICKET-ID}]({prd-path}) — Business PRD (nguồn của AC, UC, BR)
395
+ - {[Design Spec khác](./other-ds.md) — nếu feature này dùng chung màn}
396
396
 
397
- ## AI Assumptions
397
+ ## Giả định AI
398
398
 
399
- > Each assumption below was made because PO input was incomplete.
400
- > PO must review and confirm before sign-off.
399
+ > Mỗi giả định dưới đây được đưa ra vì input PO chưa đầy đủ.
400
+ > PO phải review confirm trước khi sign-off.
401
401
 
402
- - {Assumption 1 — [AI DRAFT]}
403
- - {One per ❌ Missing screen: "No readable Figma frame for {screen} — text-only draft; blocks sign-off until a node-id link is added."}
402
+ - {Giả định 1 — [AI DRAFT]}
403
+ - {Một dòng cho mỗi màn ❌ Missing: "Không Figma frame đọc được cho {screen} — draft chỉ-text; chặn sign-off cho tới khi thêm link node-id."}
404
404
 
405
405
  ---
406
406
 
@@ -412,27 +412,27 @@ Exit: {how the user leaves — back stack / tab switch / deeplink out}
412
412
 
413
413
  <!--
414
414
  NEXT STEPS:
415
- 1. Fill any Missing Figma frame links (node-id links) — re-run to fetch & ground them.
416
- 2. Share with Designer — verify Figma links, update component inventory.
417
- 3. PO + Designer sign off: change Status → "approved" (only allowed when 0 screens are ❌ Missing).
418
- 4. Run /generate-bdd "{prd-file}" — BDD uses AC-UI from this spec for FE scenarios.
415
+ 1. Điền các link Figma frame còn ❌ Missing (link node-id) — chạy lại để fetch & ground chúng.
416
+ 2. Chia sẻ với Designer — xác minh link Figma, cập nhật component inventory.
417
+ 3. PO + Designer sign off: đổi Status → "approved" (chỉ cho phép khi 0 màn ❌ Missing).
418
+ 4. Chạy /generate-bdd "{prd-file}" — BDD dùng AC-UI từ spec này cho FE scenario.
419
419
  -->
420
420
  ````
421
421
 
422
422
  ---
423
423
 
424
- ## Quality Checklist *(verify before writing)*
424
+ ## Quality Checklist *(kiểm tra trước khi ghi)*
425
425
 
426
- - [ ] Every screen in Screen Inventory has a complete Screen Spec in Section 2
427
- - [ ] Every screen has at minimum: default, loading, error states defined
428
- - [ ] All Figma components mapped in Component Inventory — unmapped flagged as `[NEW]` or `[TODO]`
429
- - [ ] Only the platform-relevant section generated in Section 3 (no web section in app docs, and vice versa)
430
- - [ ] Only the platform-relevant section generated in Section 4
431
- - [ ] AC-UI items are testable (clear pass/fail, not "looks good")
432
- - [ ] Business PRD cross-reference link is valid relative path
433
- - [ ] Every screen has a node-level Figma frame link (`?node-id=`) — and screens with a link were fetched via Figma MCP and used to ground the spec
434
- - [ ] Each ❌ Missing screen is flagged in-spec (`> [DRAFT — no Figma frame...]`), listed in Figma Summary, and has an AI Assumption
435
- - [ ] If any screen is ❌ Missing → Status stays `draft` and the Output below blocks `/generate-bdd`
426
+ - [ ] Mọi màn trong Screen Inventory Screen Spec đầy đủ ở Section 2
427
+ - [ ] Mọi màn tối thiểu các state: default, loading, error
428
+ - [ ] Mọi component Figma đã map trong Component Inventory — chưa map thì gắn cờ `[NEW]` hoặc `[TODO]`
429
+ - [ ] Chỉ sinh section liên quan platform ở Section 3 (không section web trong doc app, ngược lại)
430
+ - [ ] Chỉ sinh section liên quan platform ở Section 4
431
+ - [ ] Các mục AC-UI testable (pass/fail rõ ràng, không phải "looks good")
432
+ - [ ] Link cross-reference Business PRD relative path hợp lệ
433
+ - [ ] Mọi màn link Figma frame node-level (`?node-id=`) — các màn link đã được fetch qua Figma MCP dùng để ground spec
434
+ - [ ] Mỗi màn ❌ Missing được gắn cờ trong spec (`> [DRAFT — no Figma frame...]`), liệt trong Figma Summary, một AI Assumption
435
+ - [ ] Nếu bất kỳ màn nào ❌ Missing → Status giữ `draft` Output bên dưới chặn `/generate-bdd`
436
436
 
437
437
  ---
438
438
 
@@ -440,25 +440,25 @@ Exit: {how the user leaves — back stack / tab switch / deeplink out}
440
440
 
441
441
  {{include:steps/report-footer.md}}
442
442
 
443
- {If missing_frames is empty}:
443
+ {Nếu missing_frames rỗng}:
444
444
  ```
445
- /generate-design-spec Complete — {TICKET-ID} [{active_platform}]
445
+ /generate-design-spec Hoàn tất — {TICKET-ID} [{active_platform}]
446
446
  ---
447
- Status : ✅ Complete — all {N} screens linked & fetched from Figma
447
+ Status : ✅ Complete — cả {N} màn đã link & fetch từ Figma
448
448
  Output Artifacts:
449
449
  created {paths.specs_dir}/{domain}/{prd-slug}/design-spec/{TICKET-ID}-design-spec-{active_platform}-{slug}.md (v1.0)
450
- Next : Share with Designer → PO + Designer sign-off (Status: approved)
451
- → /generate-bdd {prd-file} (generates BDD per service; reads AC-UI from Design Spec)
450
+ Next : Chia sẻ với Designer → PO + Designer sign-off (Status: approved)
451
+ → /generate-bdd {prd-file} (sinh BDD theo service; đọc AC-UI từ Design Spec)
452
452
  ```
453
453
 
454
- {If missing_frames is non-empty}:
454
+ {Nếu missing_frames khác rỗng}:
455
455
  ```
456
- /generate-design-spec Complete (DRAFT) — {TICKET-ID} [{active_platform}]
456
+ /generate-design-spec Hoàn tất (DRAFT) — {TICKET-ID} [{active_platform}]
457
457
  ---
458
- Status : ⚠️ Warnings — {count} screen(s) without a readable Figma frame: {comma-separated missing_frames}
458
+ Status : ⚠️ Warnings — {count} màn không link Figma frame đọc được: {missing_frames ngăn cách bởi dấu phẩy}
459
459
  Output Artifacts:
460
460
  created {paths.specs_dir}/{domain}/{prd-slug}/design-spec/{TICKET-ID}-design-spec-{active_platform}-{slug}.md (v1.0, draft)
461
- Next : 🔒 Sign-off & /generate-bdd are BLOCKED until every screen has a node-id Figma link.
462
- 1. In Figma: select each missing frame → right-click → Copy link to selection
463
- 2. Re-run /generate-design-spec {prd-file} → AI fetches & grounds the new frames
461
+ Next : 🔒 Sign-off & /generate-bdd bị CHẶN cho tới khi mọi màn có link Figma node-id.
462
+ 1. Trong Figma: chọn mỗi frame còn thiếu chuột phải → Copy link to selection
463
+ 2. Chạy lại /generate-design-spec {prd-file} → AI fetch & ground các frame mới
464
464
  ```