@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,9 +1,9 @@
1
- # /generate-code — Generate Implementation Code
1
+ # /generate-code — Sinh Implementation Code
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 UC-ID, find the matching feature file by globbing `{paths.specs_dir}/{domain}/*/bdd/**/{UC-ID}*.feature` (wildcard `*` for the unknown prd-slug, recursive `**` to cover the `web/`·`app/`·`system/` platform subfolders); take `domain` + `prd_slug` from the matched path. Also check `{paths.trace_dir}/{domain}/{prd-slug}/{UC-ID}.tsv` for drift (new vs drifted vs synced).*
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, tìm file feature khớp bằng cách glob `{paths.specs_dir}/{domain}/*/bdd/**/{UC-ID}*.feature` (wildcard `*` cho prd-slug chưa biết, `**` đệ quy để phủ các thư mục con platform `web/`·`app/`·`system/`); lấy `domain` + `prd_slug` từ path khớp. Cũng kiểm tra `{paths.trace_dir}/{domain}/{prd-slug}/{UC-ID}.tsv` tìm drift (new vs drifted vs synced).*
7
7
 
8
8
  ## Context
9
9
  {{include:steps/context-loader.md}}
@@ -12,303 +12,301 @@
12
12
 
13
13
  ## Scope Lock
14
14
 
15
- This command is strictly scoped to the **single feature file** passed as `$ARGUMENTS`:
15
+ Lệnh này giới hạn nghiêm ngặt trong **một file feature** được truyền qua `$ARGUMENTS`:
16
16
 
17
- - Feature file: `{exact path from $ARGUMENTS}`
18
- - UC: `{UC-ID}` (read from `@trace.id` in that file's header)
17
+ - File feature: `{path chính xác từ $ARGUMENTS}`
18
+ - UC: `{UC-ID}` (đọc từ `@trace.id` trong header file đó)
19
19
 
20
- **Do NOT read or implement scenarios from any other `.feature` file** in the same domain folder, even if they share the same entity, domain concept, or service name.
20
+ **KHÔNG đọc hay implement scenario từ bất kỳ file `.feature` nào khác** trong cùng folder domain, kể cả khi chúng dùng chung entity, khái niệm domain, hay tên service.
21
21
 
22
22
  ---
23
23
 
24
- ## Context Load (additional)
24
+ ## Context Load (bổ sung)
25
25
 
26
- Read:
27
- 1. The scoped `.feature` file only
28
- 2. Tech-doc at `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design.md` (if exists)
26
+ Đọc:
27
+ 1. Chỉ file `.feature` đã giới hạn scope
28
+ 2. Tech-doc tại `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design.md` (nếu tồn tại)
29
29
  3. CLAUDE.md §architecture + §coding_standards
30
- 4. **(FE/App only)** Design Spec at `{paths.specs_dir}/{domain}/{prd-slug}/design-spec/{TICKET-ID}-design-spec-*{slug}.md` (if exists) — source of screens, component inventory, and the per-screen Figma frame links.
30
+ 4. **(chỉ FE/App)** Design Spec tại `{paths.specs_dir}/{domain}/{prd-slug}/design-spec/{TICKET-ID}-design-spec-*{slug}.md` (nếu tồn tại) — nguồn của màn hình, component inventory, link Figma frame từng-màn.
31
31
 
32
32
  ---
33
33
 
34
34
  ## Phase Detection
35
35
 
36
- Parse `$ARGUMENTS` for a `--phase` flag:
36
+ Parse `$ARGUMENTS` tìm flag `--phase`:
37
37
 
38
- | Flag | Meaning |
38
+ | Flag | Ý nghĩa |
39
39
  |---|---|
40
- | `--phase=ui` | FE Phase 1 — generate UI + mock API layer from System BDD contract |
41
- | `--phase=integration` | FE Phase 2 — replace mock adapter with real API calls from tech docs |
42
- | *(none)* | Default — full implementation (BE or full-stack without mock split) |
43
-
44
- **If `--phase` is set — confirm platform:**
45
- Read `@trace.platform` from the feature file header.
46
- - If `system` → warn: "`--phase` flag is not applicable for system BDD (BE-facing). Proceeding with default mode." Treat as no flag.
47
- - If `web` or `app` → continue with phase logic below.
48
-
49
- **If `--phase=ui`:**
50
- Resolve the **mock shape source** (hybrid — prefer the real contract, fall back to System BDD):
51
- - **BE contract** `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design.md` — if it exists, the mock adapter's port/DTO **shape** (request/response fields, types, error codes) comes from here → `mock_source = contract`. Most accurate; no shape rework at integration.
52
- - **System BDD** `{paths.specs_dir}/{domain}/{prd-slug}/bdd/system/{TICKET-ID}*.feature` — always load `Then` clauses for **behavior + fixture values**. If no BE contract, the shape is inferred from these too → `mock_source = system-bdd`, and WARN:
40
+ | `--phase=ui` | FE Phase 1 — sinh UI + layer mock API từ System BDD contract |
41
+ | `--phase=integration` | FE Phase 2 — thay mock adapter bằng lời gọi API thật từ tech docs |
42
+ | *(không có)* | Default — full implementation (BE hoặc full-stack không tách mock) |
43
+
44
+ **Nếu `--phase` được set — xác nhận platform:**
45
+ Đọc `@trace.platform` từ header file feature.
46
+ - Nếu `system` → cảnh báo: "Flag `--phase` không áp dụng cho system BDD (hướng BE). Tiếp tục với chế độ default." Coi như không flag.
47
+ - Nếu `web` hoặc `app` → tiếp tục logic phase bên dưới.
48
+
49
+ **Nếu `--phase=ui`:**
50
+ Phân giải **nguồn shape của mock** (hybrid — ưu tiên contract thật, fallback về System BDD):
51
+ - **BE contract** `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design.md` — nếu tồn tại, **shape** port/DTO của mock adapter (field request/response, type, error code) lấy từ đây → `mock_source = contract`. Chính xác nhất; không phải rework shape lúc integration.
52
+ - **System BDD** `{paths.specs_dir}/{domain}/{prd-slug}/bdd/system/{TICKET-ID}*.feature` — luôn nạp mệnh đề `Then` để lấy **behavior + giá trị fixture**. Nếu không BE contract, shape cũng được infer từ đây → `mock_source = system-bdd`, WARN:
53
53
  ```
54
- ⚠ BE contract not found mock shape inferred from System BDD only.
55
- System BDD describes behavior, not full request/response shape — the mock
56
- may differ from the real API; expect adjustment at --phase=integration.
57
- (Recommended: have BE publish {prd-slug}/tech-docs/{UC-ID}-tech-design.md first for an accurate mock.)
54
+ Không tìm thấy BE contract shape mock được infer chỉ từ System BDD.
55
+ System BDD tả behavior, không phải full request/response shape — mock
56
+ thể khác API thật; dự kiến điều chỉnh ở --phase=integration.
57
+ (Khuyến nghị: để BE publish {prd-slug}/tech-docs/{UC-ID}-tech-design.md trước để mock chính xác.)
58
58
  ```
59
- - If System BDD is also missing warn "System BDD not found mock layer will use placeholder fixtures." Continue.
59
+ - Nếu System BDD cũng thiếucảnh báo "Không tìm thấy System BDD layer mock sẽ dùng fixture placeholder." Tiếp tục.
60
60
 
61
- Store `mock_source` (`contract` | `system-bdd`) for the mock tags below.
61
+ Lưu `mock_source` (`contract` | `system-bdd`) cho các tag mock bên dưới.
62
62
 
63
- **Then run the Figma Dev Mode MCP Check below** before generating any UI — the Design
64
- Spec's frame links are the visual contract, and the local MCP reads them with far more
65
- fidelity than a plain web link.
63
+ **Rồi chạy Figma Dev Mode MCP Check bên dưới** trước khi sinh UI — link frame của Design
64
+ Spec visual contract, MCP local đọc chúng với độ trung thực cao hơn nhiều so với link web trần.
66
65
 
67
66
  ---
68
67
 
69
- ## Figma Dev Mode MCP Check *(FE/App UI generation only)*
68
+ ## Figma Dev Mode MCP Check *(chỉ sinh UI FE/App)*
70
69
 
71
- *Run this only when `platform` is `web`/`app` AND generating UI (`--phase=ui`, or default
72
- mode for an FE/App feature). Skip entirely for BE / `system` platform.*
70
+ *Chỉ chạy khi `platform` `web`/`app` đang sinh UI (`--phase=ui`, hoặc chế độ default
71
+ cho feature FE/App). Bỏ qua hoàn toàn với BE / platform `system`.*
73
72
 
74
- The PO authored the Design Spec from **Figma web links** (read-only, limited). For
75
- codegen, the **local Figma Dev Mode MCP server** (built into the Figma **desktop app**)
76
- gives far more: exact layout, design **variables/tokens**, **Code Connect** component
77
- mappings, selection context, and code snippetsthings a web URL alone cannot return.
73
+ PO viết Design Spec từ **link web Figma** (read-only, giới hạn). Để codegen,
74
+ **Figma Dev Mode MCP server local** (tích hợp trong **app desktop** Figma) cho nhiều hơn
75
+ nhiều: layout chính xác, **variable/token** design, mapping component **Code Connect**,
76
+ selection context, code snippetnhững thứ một URL web đơn không trả về được.
78
77
 
79
- **Step 1 — Detect the local MCP.** Check whether a Figma Dev Mode MCP server is connected
80
- (a `get_design_context` / `get_code` style Figma tool is available via MCP).
78
+ **Step 1 — Phát hiện MCP local.** Kiểm tra xem Figma Dev Mode MCP server kết nối không
79
+ (một Figma tool kiểu `get_design_context` / `get_code` sẵn qua MCP).
81
80
 
82
- **Step 2 — If NOT connectedsuggest the dev enable it, then wait:**
81
+ **Step 2 — Nếu CHƯA kết nối gợi ý dev bật nó, rồi chờ:**
83
82
 
84
83
  ```
85
- 🎨 Figma Dev Mode MCP not detected.
86
- For accurate FE code (real tokens, components, Code Connect), use the LOCAL server:
87
-
88
- 1. Open the Figma DESKTOP app (not the browser)
89
- 2. Open the file/frame for this feature
90
- 3. Enable the Dev Mode MCP server:
91
- Figma menu → Preferences → "Enable Dev Mode MCP Server"
92
- (requires Dev or Full seat; server runs at http://127.0.0.1:3845)
93
- 4. Make sure this MCP server is added in your Claude Code MCP config
94
- 5. Select the frame for the screen you're implementing, then continue
95
-
96
- Type C to continue once enabled, or S to skip (fall back to web links + text spec).
84
+ 🎨 Không phát hiện Figma Dev Mode MCP.
85
+ Để code FE chính xác (token, component, Code Connect thật), dùng server LOCAL:
86
+
87
+ 1. Mở app Figma DESKTOP (không phải browser)
88
+ 2. Mở file/frame của feature này
89
+ 3. Bật Dev Mode MCP server:
90
+ Menu Figma → Preferences → "Enable Dev Mode MCP Server"
91
+ (cần Dev hoặc Full seat; server chạy http://127.0.0.1:3845)
92
+ 4. Đảm bảo MCP server này đã được thêm vào config MCP của Claude Code
93
+ 5. Chọn frame của màn bạn đang implement, rồi tiếp tục
94
+
95
+ C để tiếp tục khi đã bật, hoặc S để skip (fallback về link web + text spec).
97
96
  ```
98
97
 
99
- - `C` → re-detect; if now connectedproceed using the local MCP.
100
- - `S` → proceed in **fallback mode**: use the Design Spec's web frame links + textual spec
101
- only; add a ⚠️ note in the final report that UI was generated without local Figma fidelity.
98
+ - `C` → phát hiện lại; nếu giờ đã kết nối tiếp tục dùng MCP local.
99
+ - `S` → tiếp tục **fallback mode**: chỉ dùng link frame web + text spec của Design Spec;
100
+ thêm note ⚠️ trong report cuối rằng UI được sinh không độ trung thực Figma local.
102
101
 
103
- **Step 3 — When the local MCP IS connected:** for each screen being implemented, pull the
104
- selected frame via the Figma MCP and ground the UI on the returned layout, variables, and
105
- Code Connect mappings. Prefer Code-Connect-mapped components over inventing markup; use the
106
- real token names, not hardcoded values.
102
+ **Step 3 — Khi MCP local ĐÃ kết nối:** với mỗi màn đang implement, pull frame được chọn
103
+ qua Figma MCP ground UI trên layout, variable, và mapping Code Connect trả về. Ưu tiên
104
+ component được map Code-Connect hơn bịa markup; dùng tên token thật, không phải giá trị hardcode.
107
105
 
108
- **If `--phase=integration`:**
109
- Resolve the design that drives the adapter (two layers):
110
- - **FE tech-design** (preferredthe port→endpoint→DTO mapping): `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design-{platform}.md` §4, produced by `/generate-tech-docs` (FE path).
111
- - **BE API contract** (endpoint/shape source): `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design.md`.
106
+ **Nếu `--phase=integration`:**
107
+ Phân giải design điều khiển adapter (hai tầng):
108
+ - **FE tech-design** (ưu tiên mapping port→endpoint→DTO): `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design-{platform}.md` §4, sinh bởi `/generate-tech-docs` (path FE).
109
+ - **BE API contract** (nguồn endpoint/shape): `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design.md`.
112
110
 
113
- Read `@trace.status` of whichever drives the adapter (the FE doc if present, else the BE contract).
114
- If `draft` or `in-review` → warn:
111
+ Đọc `@trace.status` của cái nào điều khiển adapter (doc FE nếu có, else BE contract).
112
+ Nếu `draft` hoặc `in-review` → cảnh báo:
115
113
  ```
116
- ⚠ Tech design for {UC-ID} ({platform}) is {status}.
117
- Contract / adapter mapping may still change.
118
- Proceedingensure BE endpoint is deployed or confirm the mapping manually.
114
+ ⚠ Tech design cho {UC-ID} ({platform}) đang {status}.
115
+ Contract / mapping adapter còn thể đổi.
116
+ Tiếp tục đảm bảo BE endpoint đã deploy hoặc confirm mapping thủ công.
119
117
  ```
120
- If the FE tech-design is **missing** → warn: "No FE tech-design found falling back to the BE contract directly (adapter mapping inferred). Recommended: run `/generate-tech-docs {web|app .feature}` first."
121
- Locate existing mock adapter from `--phase=ui` run (search for `{UC-ID}MockApiAdapter` in `{paths.src_dir}/{domain}/`).
122
- If not foundwarn: "Mock adapter not foundgenerating real API adapter from scratch using tech-doc contract."
118
+ Nếu FE tech-design **thiếu** → cảnh báo: "Không tìm thấy FE tech-design — fallback về BE contract trực tiếp (mapping adapter được infer). Khuyến nghị: chạy `/generate-tech-docs {web|app .feature}` trước."
119
+ Định vị mock adapter sẵn từ lần chạy `--phase=ui` (tìm `{UC-ID}MockApiAdapter` trong `{paths.src_dir}/{domain}/`).
120
+ Nếu không tìm thấy cảnh báo: "Không tìm thấy mock adapter sinh real API adapter từ đầu dùng contract tech-doc."
123
121
 
124
122
  ---
125
123
 
126
124
  ## Read Trace State
127
125
 
128
- Read `{paths.trace_dir}/{domain}/{prd-slug}/{UC-ID}.tsv` if it exists. For each scenario row, note its current `status`:
126
+ Đọc `{paths.trace_dir}/{domain}/{prd-slug}/{UC-ID}.tsv` nếu tồn tại. Với mỗi scenario row, ghi nhận `status` hiện tại:
129
127
 
130
- | Status | Meaning | Action in this run |
128
+ | Status | Ý nghĩa | Hành động trong lần chạy này |
131
129
  |--------|---------|-------------------|
132
- | `UNTRACKED` | `implemented_by == —` | Generate — scenario has no code yet |
133
- | `DRIFT` | `spec_ver != gen_ver` | Regenerate — scenario updated since last codegen |
134
- | `OK` | implemented + tested | Skip unless explicitly re-generating |
135
- | `GAP` | implemented, no tests | Skip codegen — already coded; run `/dev-gen-test` instead |
130
+ | `UNTRACKED` | `implemented_by == —` | Generate — scenario chưa code |
131
+ | `DRIFT` | `spec_ver != gen_ver` | Regenerate — scenario đã cập nhật từ lần codegen trước |
132
+ | `OK` | đã implement + test | Skip trừ khi gen lại tường minh |
133
+ | `GAP` | đã implement, chưa test | Skip codegen — đã code rồi; chạy `/dev-gen-test` thay |
136
134
 
137
- Use these statuses to populate the **Scenarios** count in the CHECKPOINT plan (`{X} new, {Y} drifted, {Z} synced-skip`).
138
- If `.tsv` does not existtreat all scenarios as `UNTRACKED`.
135
+ Dùng các status này để điền số **Scenarios** trong plan CHECKPOINT (`{X} new, {Y} drifted, {Z} synced-skip`).
136
+ Nếu `.tsv` không tồn tạicoi mọi scenario `UNTRACKED`.
139
137
 
140
138
  ---
141
139
 
142
140
  ## File Scan
143
141
 
144
- Before generating, determine which files will be needed for this UC's scenarios. Check whether each file already exists on disk.
142
+ Trước khi sinh, xác định file nào cần cho các scenario của UC này. Kiểm tra mỗi file đã tồn tại trên disk chưa.
145
143
 
146
- Classify each file:
144
+ Phân loại mỗi file:
147
145
 
148
- | Status | Meaning | Action |
146
+ | Status | Ý nghĩa | Hành động |
149
147
  |--------|---------|--------|
150
- | `CREATE` | File does not exist | Generate full new file |
151
- | `EXTEND` | File exists, new methods needed | Add new methods onlydo NOT rewrite existing code |
152
- | `SKIP` | File exists and already covers all UC scenarios | Leave untouched |
148
+ | `CREATE` | File chưa tồn tại | Sinh file mới đầy đủ |
149
+ | `EXTEND` | File tồn tại, cần method mới | Chỉ thêm method mớiKHÔNG viết lại code có sẵn |
150
+ | `SKIP` | File tồn tại đã phủ tất cả scenario của UC | Để nguyên |
153
151
 
154
- > **EXTEND rule:** Read the existing file fully. Locate the correct class/interface. Add only the methods required by `{UC-ID}` scenarios. Preserve all existing methods, fields, and annotations exactly as-is. Attach `@trace.implements={UC-ID}-SC{N}` on each new method.
152
+ > **Quy tắc EXTEND:** Đọc file sẵn đầy đủ. Định vị đúng class/interface. Chỉ thêm các method scenario `{UC-ID}` cần. Giữ nguyên mọi method, field, annotation hiện y như cũ. Gắn `@trace.implements={UC-ID}-SC{N}` lên mỗi method mới.
155
153
 
156
154
  ---
157
155
 
158
156
  ## CHECKPOINT — Code Generation Plan
159
157
 
160
- Before generating any code, show:
158
+ Trước khi sinh code, hiện:
161
159
 
162
160
  ```
163
161
  Code Generation Plan — {UC-ID}
164
162
  ──────────────────────────────────────────────────────
165
163
  Feature : {name}
166
- Ticket : {TICKET_ID if known}
164
+ Ticket : {TICKET_ID nếu biết}
167
165
  Domain : {domain}
168
- UC : {UC-ID} onlyother feature files in this folder are NOT read
166
+ UC : chỉ {UC-ID} ← các file feature khác trong folder này KHÔNG được đọc
169
167
  Tech : {language} / {framework}
170
- Phase : {UI — mock layer | Integration — real API | Default — full} ← omit if no --phase flag
168
+ Phase : {UI — mock layer | Integration — real API | Default — full} ← bỏ nếu không có flag --phase
171
169
  Scenarios: {N} total ({X} new, {Y} drifted, {Z} synced-skip)
172
- Layer : {from CLAUDE.md §2}
170
+ Layer : {từ CLAUDE.md §2}
173
171
 
174
172
  Files:
175
- CREATE {N} new files
173
+ CREATE {N} file mới
176
174
  + {path/FileName.ext}
177
- EXTEND {M} existing files (add methods only)
178
- ~ {path/FileName.ext} — adding: {methodA}, {methodB}
179
- SKIP {K} files (no change needed)
175
+ EXTEND {M} file có sẵn (chỉ thêm method)
176
+ ~ {path/FileName.ext} — thêm: {methodA}, {methodB}
177
+ SKIP {K} file (không cần đổi)
180
178
  = {path/FileName.ext}
181
179
  ──────────────────────────────────────────────────────
182
180
  Proceed? (Y/N)
183
181
  ```
184
182
 
185
- Wait for explicit "Y" before generating.
183
+ Chờ "Y" ràng trước khi sinh.
186
184
 
187
185
  ## Branch
188
186
  ```bash
189
187
  git checkout -b feature/{TICKET_ID}-{slug}
190
188
  ```
191
189
 
192
- ## Generate (layer order from CLAUDE.md §2)
190
+ ## Generate (thứ tự layer từ CLAUDE.md §2)
193
191
 
194
- Default order (override from CLAUDE.md if different):
195
- DTOs → Entity/Model → Repository → Service interface → Service impl → Facade (if applicable) → Controller
192
+ Thứ tự mặc định (override từ CLAUDE.md nếu khác):
193
+ DTOs → Entity/Model → Repository → Service interface → Service impl → Facade (nếu áp dụng) → Controller
196
194
 
197
- **For `CREATE` files:** generate the full file.
195
+ **Với file `CREATE`:** sinh file đầy đủ.
198
196
 
199
- **For `EXTEND` files:** open the existing file add only the new methods for `{UC-ID}` → do not touch anything else.
197
+ **Với file `EXTEND`:** mở file sẵnchỉ thêm method mới cho `{UC-ID}` → không đụng khác.
200
198
 
201
- **Traceability tags on controller/handler (adapt to your language's comment syntax):**
199
+ **Tag traceability trên controller/handler (theo pháp comment của ngôn ngữ bạn):**
202
200
  ```
203
201
  @trace.implements={UC-ID}-SC{N}
204
- @trace.prd_version={read @trace.prd_version from the .feature file header}
205
- @trace.bdd_version={read @trace.bdd_version from the .feature file header}
206
- @trace.tech_doc_revision={read @trace.revision from tech-doc header, or omit if no tech-doc}
202
+ @trace.prd_version={đọc @trace.prd_version từ header file .feature}
203
+ @trace.bdd_version={đọc @trace.bdd_version từ header file .feature}
204
+ @trace.tech_doc_revision={đọc @trace.revision từ header tech-doc, hoặc bỏ nếu không tech-doc}
207
205
  @trace.source={paths.specs_dir}/{domain}/{prd-slug}/bdd/{UC-ID}-{slug}.feature
208
206
  ```
209
207
 
210
- `@trace.prd_version` records which PRD version this code was written against.
211
- `@trace.bdd_version` records which BDD version this code was generated from.
212
- `@trace.tech_doc_revision` records which tech-design revision this code follows.
213
- `/validate-traces` will flag drift if any upstream artifact is updated to a newer version.
208
+ `@trace.prd_version` ghi code này được viết theo version PRD nào.
209
+ `@trace.bdd_version` ghi code này được sinh từ version BDD nào.
210
+ `@trace.tech_doc_revision` ghi code này theo revision tech-design nào.
211
+ `/validate-traces` sẽ gắn cờ drift nếu bất kỳ artifact upstream nào được cập nhật lên version mới hơn.
214
212
 
215
- > **Entry-point rule:** `@trace.implements` must appear on the **entry-point layer** as defined in `CLAUDE.md §2`. For REST APIs → Controller. For event-driven modules → event handler / consumer class. For context-engineering → the prompt orchestration function. Never put it only on an inner layer.
213
+ > **Quy tắc entry-point:** `@trace.implements` phải xuất hiện **layer entry-point** như định nghĩa trong `CLAUDE.md §2`. Với REST API → Controller. Với module event-driven → event handler / consumer class. Với context-engineering → hàm orchestration prompt. Không bao giờ chỉ đặt layer trong.
216
214
 
217
- ### Test Selectors — emit stable element IDs *(FE/App UI only)*
215
+ ### Test Selectors — emit element ID ổn định *(chỉ UI FE/App)*
218
216
 
219
- *Applies when `platform` is `web`/`app` and generating UI (`--phase=ui`, or default FE/App mode). Skip for BE.*
217
+ *Áp dụng khi `platform` `web`/`app` đang sinh UI (`--phase=ui`, hoặc chế độ default FE/App). Bỏ qua với BE.*
220
218
 
221
- Every **actionable** element (button, input, link, select, toggle, form-submit) MUST carry a **stable test-id** so QC locates it directly (no runtime scan):
219
+ Mỗi element **có action** (button, input, link, select, toggle, form-submit) PHẢI mang một **test-id ổn định** để QC định vị trực tiếp (không scan runtime):
222
220
 
223
- 1. **Source the id.** If the FE tech-design `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design-{platform}.md` exists, take ids **verbatim** from its §2b Test Selectors table (the contract). If it does not exist yet (e.g. `--phase=ui` before the FE tech-design), **generate ids by the convention** `{uc-lower}-{screen}-{element}-{type}` (e.g. `ft001-login-submit-btn`) so QC still has stable handlesthey will be reconciled to the tech-design's §2b at integration.
224
- 2. **Emit via the platform attribute** (from `@trace.testid_attr`, or by module):
221
+ 1. **Nguồn id.** Nếu FE tech-design `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design-{platform}.md` tồn tại, lấy id **nguyên văn** từ bảng §2b Test Selectors của (contract). Nếu chưa tồn tại (vd `--phase=ui` trước FE tech-design), **sinh id theo quy ước** `{uc-lower}-{screen}-{element}-{type}` (vd `ft001-login-submit-btn`) để QC vẫn handle ổn định chúng sẽ được đối chiếu với §2b của tech-design lúc integration.
222
+ 2. **Emit qua attribute platform** (từ `@trace.testid_attr`, hoặc theo module):
225
223
  - web (`react`/`nextjs`/`vue`/`angular`) → `data-testid="..."`
226
224
  - React Native → `testID="..."`
227
- - Flutter → `Key('...')` (+ `Semantics(identifier: '...')` where the action needs it)
225
+ - Flutter → `Key('...')` (+ `Semantics(identifier: '...')` khi action cần)
228
226
  - native iOS → `accessibilityIdentifier = "..."`
229
- 3. Only actionable elements; do not spam ids on static text. Keep ids identical to the tech-design map so QC Page Objects match on the first try.
230
- 4. **Reused catalog component?** Pass the id via its **forwarding prop** (see the catalog `## Test-ID Forwarding` section e.g. `<Button testId="ft001-login-submit-btn">`), not a raw attribute. If the component does not forward a test-id, or you are backfilling **existing/brownfield** screens (not freshly generated here), that is `/map-testids {UC-ID}`'s job run it instead of editing shared components inline.
227
+ 3. Chỉ element có action; đừng spam id lên text tĩnh. Giữ id giống hệt map của tech-design để QC Page Object khớp ngay lần đầu.
228
+ 4. **Component catalog tái dùng?** Truyền id qua **forwarding prop** của nó (xem section catalog `## Test-ID Forwarding` — vd `<Button testId="ft001-login-submit-btn">`), không phải attribute thô. Nếu component không forward test-id, hoặc bạn đang backfill màn **existing/brownfield** (không phải sinh mới ở đây), đó việc của `/map-testids {UC-ID}` — chạy thay sửa component dùng chung inline.
231
229
 
232
- ## Mock API Layer (`--phase=ui` only)
230
+ ## Mock API Layer (chỉ `--phase=ui`)
233
231
 
234
- *Skip this section entirely if `--phase` is not `ui`.*
232
+ *Bỏ qua hoàn toàn section này nếu `--phase` không phải `ui`.*
235
233
 
236
- Build the mock from the `mock_source` resolved in Phase Detection — **shape** from the BE contract when present, **fixture values + behavior** always from System BDD `Then` clauses:
234
+ Dựng mock từ `mock_source` đã phân giải ở Phase Detection — **shape** từ BE contract khi có, **giá trị fixture + behavior** luôn từ mệnh đề `Then` của System BDD:
237
235
 
238
- 1. **Define the port shape** `{UC-ID}ApiPort` (request/response DTOs + error codes):
239
- - `mock_source = contract` → field names / types / error codes taken **verbatim from the BE contract** §2 (API Endpoints) / §3 (Data Model) — the real shape.
240
- - `mock_source = system-bdd` → shape **inferred** from System BDD `Then` clauses (provisionalsee warning above).
241
- 2. **Extract fixture data** per scenario from System BDD `Then` clauses — success + error responses (BDD is the source of truth for *values / behavior*, regardless of shape source).
242
- 3. **Generate mock adapter** at `{paths.src_dir}/{domain}/{UC-ID}MockApiAdapter.{ext}`:
243
- - Implements interface `{UC-ID}ApiPort` (same interface the real adapter will implement)
244
- - Each method returns fixture data matching the BDD `Then` clause, in the port shape
245
- - Include both success and error states (map to error scenarios in BDD)
246
- - Traceability tags:
236
+ 1. **Định nghĩa shape port** `{UC-ID}ApiPort` (DTO request/response + error code):
237
+ - `mock_source = contract` → tên field / type / error code lấy **nguyên văn từ BE contract** §2 (API Endpoints) / §3 (Data Model) — shape thật.
238
+ - `mock_source = system-bdd` → shape **infer** từ mệnh đề `Then` của System BDD (tạmxem cảnh báo ở trên).
239
+ 2. **Trích dữ liệu fixture** theo từng scenario từ mệnh đề `Then` của System BDD response success + error (BDD source of truth cho *giá trị / behavior*, bất kể nguồn shape).
240
+ 3. **Sinh mock adapter** tại `{paths.src_dir}/{domain}/{UC-ID}MockApiAdapter.{ext}`:
241
+ - Implements interface `{UC-ID}ApiPort` (cùng interface real adapter sẽ implement)
242
+ - Mỗi method trả về fixture data khớp mệnh đề `Then` của BDD, theo shape của port
243
+ - Gồm cả trạng thái success error (map sang các error scenario trong BDD)
244
+ - Tag traceability:
247
245
  ```
248
246
  @trace.mock_for={UC-ID}
249
247
  @trace.mock_source={contract | system-bdd}
250
248
  @trace.system_bdd={paths.specs_dir}/{domain}/{prd-slug}/bdd/system/{UC-ID}*.feature
251
- {@trace.be_contract={UC-ID}-tech-design.md # only when mock_source=contract}
249
+ {@trace.be_contract={UC-ID}-tech-design.md # chỉ khi mock_source=contract}
252
250
  ```
253
- 4. **Wire into service/hook layer** via environment flag or DI:
251
+ 4. **Wire vào layer service/hook** qua environment flag hoặc DI:
254
252
  ```
255
253
  const adapter = IS_MOCK ? new {UC-ID}MockApiAdapter() : new {UC-ID}ApiAdapter()
256
254
  ```
257
- - `IS_MOCK` defaults to `true` in development/test env until real adapter is generated.
255
+ - `IS_MOCK` mặc định `true` môi trường development/test cho tới khi real adapter được sinh.
258
256
 
259
- > Tester uses the mock adapter to test all FE scenarios without waiting for BE to **deploy**.
260
- > Shape comes from the BE contract when available (accurate, no integration rework); else from System BDD (provisionaladjust at `--phase=integration`). Fixture *values* always come from System BDD — BDD is the source of truth for behavior.
257
+ > Tester dùng mock adapter để test mọi FE scenario không cần đợi BE **deploy**.
258
+ > Shape lấy từ BE contract khi (chính xác, không rework integration); else từ System BDD (tạmđiều chỉnh `--phase=integration`). Giá trị fixture luôn từ System BDD — BDD source of truth cho behavior.
261
259
 
262
260
  ---
263
261
 
264
- ## Integration Phase (`--phase=integration` only)
262
+ ## Integration Phase (chỉ `--phase=integration`)
265
263
 
266
- *Skip this section entirely if `--phase` is not `integration`.*
264
+ *Bỏ qua hoàn toàn section này nếu `--phase` không phải `integration`.*
267
265
 
268
- 1. **Read the integration design.** Prefer the FE tech-design §4 (port→endpoint→DTO→error mapping) at `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design-{platform}.md`, using the BE API contract `{UC-ID}-tech-design.md` as the endpoint / request-response / error-code source. If no FE tech-design exists, extract endpoints + shapes + error codes directly from the BE contract.
269
- 2. **Read existing mock adapter** interface (`{UC-ID}ApiPort`) from the `--phase=ui` output.
270
- 3. **Generate real API adapter** at `{paths.src_dir}/{domain}/{UC-ID}ApiAdapter.{ext}`:
271
- - Implements the same `{UC-ID}ApiPort` interface as mock adapter
272
- - Makes real HTTP calls to endpoints from tech-doc contract
273
- - Maps response fields to the same shapes the mock adapter returned
274
- - Traceability tags:
266
+ 1. **Đọc integration design.** Ưu tiên FE tech-design §4 (mapping port→endpoint→DTO→error) tại `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design-{platform}.md`, dùng BE API contract `{UC-ID}-tech-design.md` làm nguồn endpoint / request-response / error-code. Nếu không FE tech-design, trích endpoint + shape + error code trực tiếp từ BE contract.
267
+ 2. **Đọc mock adapter có sẵn** interface (`{UC-ID}ApiPort`) từ output `--phase=ui`.
268
+ 3. **Sinh real API adapter** tại `{paths.src_dir}/{domain}/{UC-ID}ApiAdapter.{ext}`:
269
+ - Implements cùng interface `{UC-ID}ApiPort` như mock adapter
270
+ - Gọi HTTP thật tới endpoint từ contract tech-doc
271
+ - Map field response sang cùng shape mock adapter trả về
272
+ - Tag traceability:
275
273
  ```
276
274
  @trace.implements={UC-ID}-SC{N}
277
- @trace.tech_doc_revision={read from tech-doc header}
275
+ @trace.tech_doc_revision={đọc từ header tech-doc}
278
276
  ```
279
- 4. **Flip wire-up**: switch DI binding / env flag so service/hook uses `{UC-ID}ApiAdapter` (real) instead of mock.
280
- 5. **Do NOT delete mock adapter** — keep it for unit testing.
277
+ 4. **Lật wire-up**: chuyển DI binding / env flag để service/hook dùng `{UC-ID}ApiAdapter` (thật) thay mock.
278
+ 5. **KHÔNG xoá mock adapter** — giữ lại cho unit test.
281
279
 
282
280
  ---
283
281
 
284
- ## Self-Review (3 rounds)
285
- - [ ] Every scenario has a corresponding endpoint
286
- - [ ] @trace.implements on every endpoint
287
- - [ ] Architecture layer rules respected (CLAUDE.md §2)
288
- - [ ] Error handling matches CLAUDE.md §5
289
- - [ ] No magic numbers, no debug logging
282
+ ## Self-Review (3 vòng)
283
+ - [ ] Mỗi scenario endpoint tương ứng
284
+ - [ ] @trace.implements trên mọi endpoint
285
+ - [ ] Tôn trọng quy tắc layer kiến trúc (CLAUDE.md §2)
286
+ - [ ] Error handling khớp CLAUDE.md §5
287
+ - [ ] Không magic number, không debug logging
290
288
 
291
289
  ## Build Verify
292
290
  ```bash
293
- {conventions.build_command} # from project-context.yaml, max 3 retries
291
+ {conventions.build_command} # từ project-context.yaml, tối đa 3 retry
294
292
  ```
295
293
 
296
294
  ## Write Trace State
297
295
 
298
- Update `{paths.trace_dir}/{domain}/{prd-slug}/{UC-ID}.tsv` — for each implemented scenario, find the existing row by `sc_id` and update only these columns. *(Umbrella + `spec_source`: `trace_dir` resolves to `{spec_source}/.trace` — this command runs from `service_root` but writes the trace row into the **spec repo** (cross-repo); commit/push the spec submodule for the trace update, alongside the 2-tier code push.)*
296
+ Cập nhật `{paths.trace_dir}/{domain}/{prd-slug}/{UC-ID}.tsv` — với mỗi scenario đã implement, tìm row sẵn theo `sc_id` chỉ cập nhật các cột sau. *(Umbrella + `spec_source`: `trace_dir` phân giải về `{spec_source}/.trace` — lệnh này chạy từ `service_root` nhưng ghi trace row vào **spec repo** (liên-repo); commit/push spec submodule cho lần cập nhật trace, cùng với push code 2 tầng.)*
299
297
 
300
- | Column | Value |
298
+ | Cột | Giá trị |
301
299
  |--------|-------|
302
- | `gen_ver` | copy `spec_ver` from the current `.tsv` row (= scenario version at time of codegen) |
300
+ | `gen_ver` | copy `spec_ver` từ row `.tsv` hiện tại (= version scenario tại thời điểm codegen) |
303
301
  | `implemented_by` | `{ControllerClass}.{methodName}` |
304
- | `bdd_version` | `@trace.bdd_version` from `.feature` header |
305
- | `tech_doc_revision` | `@trace.revision` from the **BE** contract `{UC-ID}-tech-design.md`, or `—` if none |
306
- | `fe_tech_doc_revision` | `@trace.revision` from the **FE** tech-design `{UC-ID}-tech-design-{platform}.md` when generating FE with `--phase=integration` (the doc whose §4 drove this adapter); `—` for BE, or for FE `--phase=ui` / no FE tech-design |
307
- | `fe_phase` | `ui` if `--phase=ui` \| `integrated` if `--phase=integration` \| `—` if no phase flag |
308
- | `last_updated` | today `YYYY-MM-DD` |
302
+ | `bdd_version` | `@trace.bdd_version` từ header `.feature` |
303
+ | `tech_doc_revision` | `@trace.revision` từ **BE** contract `{UC-ID}-tech-design.md`, hoặc `—` nếu không |
304
+ | `fe_tech_doc_revision` | `@trace.revision` từ **FE** tech-design `{UC-ID}-tech-design-{platform}.md` khi sinh FE với `--phase=integration` (doc §4 điều khiển adapter này); `—` cho BE, hoặc cho FE `--phase=ui` / không FE tech-design |
305
+ | `fe_phase` | `ui` nếu `--phase=ui` \| `integrated` nếu `--phase=integration` \| `—` nếu không flag phase |
306
+ | `last_updated` | hôm nay `YYYY-MM-DD` |
309
307
 
310
- Leave all other columns (`sc_title`, `spec_ver`, `prd_version`, `prd_status`, `uc_status`, `test_count`, `test_classes`, `dev_selftest`, `dev_selftest_at`, `qc_status`, `qc_run_at`, `qc_owner`, `qc_blocked_by`) unchanged.
311
- `status` is computed by `/validate-traces` — do not set here.
308
+ Giữ nguyên mọi cột khác (`sc_title`, `spec_ver`, `prd_version`, `prd_status`, `uc_status`, `test_count`, `test_classes`, `dev_selftest`, `dev_selftest_at`, `qc_status`, `qc_run_at`, `qc_owner`, `qc_blocked_by`).
309
+ `status` được tính bởi `/validate-traces` — không set ở đây.
312
310
 
313
311
  ## Refresh Panel Mirror
314
312
  {{include:steps/trace-mirror.md}}
@@ -324,26 +322,26 @@ git commit -m "{commit_format}: {description}"
324
322
  {{include:steps/report-footer.md}}
325
323
 
326
324
  ```
327
- /generate-code Complete — {UC-ID}
325
+ /generate-code Hoàn tất — {UC-ID}
328
326
  Files: created={N}, extended={M}, skipped={K} | Build: SUCCESS
329
327
  Branch: feature/{TICKET_ID}-{slug}
330
328
  Phase : {UI (mock layer) | Integration (real API) | Default (full)}
331
329
  fe_phase : {ui | integrated | —}
332
- Figma : {local Dev Mode MCP (grounded) | ⚠️ web links + text spec only (no local MCP) | n/a for BE} ← FE/App UI only
330
+ Figma : {Dev Mode MCP local (grounded) | ⚠️ chỉ link web + text spec (không MCP local) | n/a cho BE} ← chỉ UI FE/App
333
331
 
334
332
  Next:
335
- --phase=ui done:
336
- Notify tester: FE is testable via mock adapter
337
- Collect BE sign-offs → /review-tech-docs {tech-design-file}
338
- When BE ready → /generate-code {feature-file} --phase=integration
333
+ --phase=ui xong:
334
+ Báo tester: FE test được qua mock adapter
335
+ Thu sign-off BE → /review-tech-docs {tech-design-file}
336
+ Khi BE sẵn sàng → /generate-code {feature-file} --phase=integration
339
337
 
340
- --phase=integration done:
341
- → /review-code {UC-ID} ← code review required
342
- → /dev-gen-test {UC-ID} ← integration test suite
338
+ --phase=integration xong:
339
+ → /review-code {UC-ID} ← cần code review
340
+ → /dev-gen-test {UC-ID} ← bộ integration test
343
341
 
344
- Default (no phase flag):
345
- → /review-code {UC-ID} ← code review required before tests
342
+ Default (không flag phase):
343
+ → /review-code {UC-ID} ← cần code review trước khi test
346
344
  → /dev-gen-test {UC-ID}
347
345
 
348
- 📊 Living Docs: run /validate-traces (or /sync) to push this trace to the spec-module dashboard.
346
+ 📊 Living Docs: chạy /validate-traces (hoặc /sync) để push trace này lên dashboard spec-module.
349
347
  ```