@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,185 +1,185 @@
1
1
  # /review-tech-docs — Review Technical Design Document
2
2
 
3
- **READ-ONLY analysis mode writes a findings file, does NOT modify the target.**
4
- **Use `--resume` to apply accepted findings.**
3
+ **Chế độ phân tích READ-ONLY — ghi file findings, KHÔNG sửa target.**
4
+ **Dùng `--resume` để áp dụng các finding được chấp nhận.**
5
5
 
6
6
  ## Gate
7
7
  {{include:steps/gate.md}}
8
8
 
9
- *Note: For this command, the target in Step 1 is a tech-design `.md` file in `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/`.
10
- If `$ARGUMENTS` contains `--resume` → skip to Resume Mode below.*
9
+ *Lưu ý: Với lệnh này, target Bước 1 một file tech-design `.md` trong `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/`.
10
+ Nếu `$ARGUMENTS` chứa `--resume` → bỏ qua sang Resume Mode bên dưới.*
11
11
 
12
12
  ## Context
13
13
  {{include:steps/context-loader.md}}
14
14
 
15
15
  ---
16
16
 
17
- ## Load Review Materials
17
+ ## Nạp tài liệu Review
18
18
 
19
- After loading base context, read the following in order:
19
+ Sau khi nạp context nền, đọc các thứ sau theo thứ tự:
20
20
 
21
- 1. **Target tech-doc** — read fully. Extract from header:
21
+ 1. **Tech-doc target** — đọc đầy đủ. Trích từ header:
22
22
  - `@trace.id` → UC-ID
23
23
  - `@trace.domain` → domain
24
- - `@trace.prd` → source PRD ticket ID
25
- - `@trace.status` → current status (draft / in-review / approved)
24
+ - `@trace.prd` → ticket ID của PRD nguồn
25
+ - `@trace.status` → status hiện tại (draft / in-review / approved)
26
26
 
27
- 2. **Source feature file** — load `{paths.specs_dir}/{domain}/{prd-slug}/bdd/{UC-ID}*.feature` if exists.
27
+ 2. **File feature nguồn** — nạp `{paths.specs_dir}/{domain}/{prd-slug}/bdd/{UC-ID}*.feature` nếu tồn tại.
28
28
 
29
- 3. **Other tech-docs in same domain** — list and load all `.md` files in
30
- `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/` excluding the target. Used for conflict checking (T4).
29
+ 3. **Các tech-doc khác cùng domain** — liệt nạp mọi file `.md` trong
30
+ `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/` trừ target. Dùng để check conflict (T4).
31
31
 
32
- 4. **Architecture reference** — re-confirm CLAUDE.md §2: layer order, architectural rules.
32
+ 4. **Tham chiếu kiến trúc** — xác nhận lại CLAUDE.md §2: thứ tự layer, quy tắc kiến trúc.
33
33
 
34
- 5. **Core entities** — already loaded in context (Step 6 of context-loader).
34
+ 5. **Core entities** — đã nạp trong context (Bước 6 của context-loader).
35
35
 
36
- Derive findings filename:
36
+ Suy ra tên file findings:
37
37
  `{paths.refinement_dir}/{uc-id}-tech-review-findings.yaml`
38
38
 
39
39
  ---
40
40
 
41
41
  ## Review Dimensions
42
42
 
43
- ### T1 — Architecture Alignment *(always CRITICAL if violated)*
43
+ ### T1 — Architecture Alignment *(luôn CRITICAL nếu vi phạm)*
44
44
 
45
- Cross-reference the proposed design against CLAUDE.md §2 rules:
45
+ Đối chiếu design đề xuất với quy tắc CLAUDE.md §2:
46
46
 
47
- | Violation type | Severity |
47
+ | Loại vi phạm | Severity |
48
48
  |----------------|----------|
49
- | Controller calls Repository directly (layer skip) | Critical |
50
- | Business logic in Controller or DTO | Critical |
51
- | Forbidden pattern from §3 | Critical |
52
- | Dependency going upstream (Service → Controller DTO) | Critical |
53
- | Transaction annotation on wrong layer | Major |
54
- | Missing separation (no Facade when arch requires it) | Major |
55
-
56
- For each finding:
49
+ | Controller gọi Repository trực tiếp (skip layer) | Critical |
50
+ | Business logic trong Controller hoặc DTO | Critical |
51
+ | Pattern bị cấm từ §3 | Critical |
52
+ | Phụ thuộc đi ngược upstream (Service → Controller DTO) | Critical |
53
+ | Annotation transaction sai layer | Major |
54
+ | Thiếu tách lớp (không Facade khi kiến trúc yêu cầu) | Major |
55
+
56
+ Với mỗi finding:
57
57
  ```
58
- Component: {class or method name}
58
+ Component: {tên class hoặc method}
59
59
  Violates: "{rule text}" (CLAUDE.md §2)
60
- Fix: {which layer/component should own this instead}
60
+ Fix: {layer/component nào nên sở hữu cái này}
61
61
  ```
62
- → **Not auto-fixable.** Human must decide structural fix. Note required in Review Board.
62
+ → **Không auto-fix.** Người phải quyết định fix cấu trúc. Bắt buộc note trong Review Board.
63
63
 
64
64
  ### T2 — Entity Consistency
65
65
 
66
- Using the loaded core-entities catalog:
66
+ Dùng catalog core-entities đã nạp:
67
67
 
68
- | Issue | Severity | Auto-fixable? |
68
+ | Vấn đề | Severity | Auto-fixable? |
69
69
  |-------|----------|---------------|
70
- | Entity mentioned not in core-entities.md | Major | No — human confirms if DTO or domain entity |
71
- | Field name differs from core-entities.md | Major | Yes — rename to canonical |
72
- | Relationship described differently | Major | No — human decides |
73
- | New entity introduced but not in core-entities.md | Minor | No — add to core-entities first |
70
+ | Entity được nhắc nhưng không có trong core-entities.md | Major | No — người confirm DTO hay domain entity |
71
+ | Tên field khác core-entities.md | Major | Yes — đổi về canonical |
72
+ | Quan hệ được mô tả khác đi | Major | No — người quyết định |
73
+ | Entity mới được đưa ra nhưng chưa có trong core-entities.md | Minor | No — thêm vào core-entities trước |
74
74
 
75
75
  ### T3 — BDD Traceability
76
76
 
77
- Cross-reference against the source `.feature` file:
77
+ Đối chiếu với file `.feature` nguồn:
78
78
 
79
- | Issue | Severity | Auto-fixable? |
79
+ | Vấn đề | Severity | Auto-fixable? |
80
80
  |-------|----------|---------------|
81
- | Tech-doc proposes behavior not in any BDD scenario | Major | No — create scenario first |
82
- | Tech-doc contradicts a BDD scenario | Critical | No — resolve conflict first |
83
- | UC scenario has no corresponding design decision | Minor | Yes — add missing design note |
81
+ | Tech-doc đề xuất behavior không trong scenario BDD nào | Major | No — tạo scenario trước |
82
+ | Tech-doc mâu thuẫn một scenario BDD | Critical | No — giải quyết conflict trước |
83
+ | Scenario UC không design decision tương ứng | Minor | Yes — thêm design note còn thiếu |
84
84
 
85
85
  ### T4 — Domain Conflict Check
86
86
 
87
- Compare against other tech-docs in `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/`:
87
+ So với các tech-doc khác trong `{paths.tech_docs_dir}/{domain}/{prd-slug}/tech-docs/`:
88
88
 
89
- | Issue | Severity | Auto-fixable? |
89
+ | Vấn đề | Severity | Auto-fixable? |
90
90
  |-------|----------|---------------|
91
- | Same endpoint defined with different request/response | Critical | No — human resolves |
92
- | Same service method with different behavior | Critical | No — human resolves |
93
- | Entity status transitions differ between docs | Critical | No — human resolves |
94
- | Overlapping responsibility (both docs claim ownership of same logic) | Major | No — human resolves |
91
+ | Cùng endpoint định nghĩa với request/response khác | Critical | No — người giải quyết |
92
+ | Cùng service method với behavior khác | Critical | No — người giải quyết |
93
+ | Status transition của entity khác nhau giữa các doc | Critical | No — người giải quyết |
94
+ | Trách nhiệm chồng lấn (cả hai doc nhận sở hữu cùng logic) | Major | No — người giải quyết |
95
95
 
96
96
  ### T5 — Internal Consistency
97
97
 
98
- Within the tech-doc itself:
98
+ Trong nội bộ tech-doc:
99
99
 
100
100
  | Check | Severity | Auto-fixable? |
101
101
  |-------|----------|---------------|
102
- | Sequence diagram shows different flow than written description | Major | No |
103
- | API spec return type differs from code sketch | Major | Yes — align one to the other |
104
- | Section references a component/concept never defined later | Minor | Yes — add definition |
105
- | Assumption stated but no design addresses it | Minor | Yes — add note or remove assumption |
102
+ | Sequence diagram thể hiện flow khác phần tả viết | Major | No |
103
+ | API spec return type khác code sketch | Major | Yes — căn chỉnh cái này theo cái kia |
104
+ | Section tham chiếu một component/concept không bao giờ được định nghĩa sau đó | Minor | Yes — thêm định nghĩa |
105
+ | Assumption được nêu nhưng không design nào xử lý nó | Minor | Yes — thêm note hoặc bỏ assumption |
106
106
 
107
107
  ### T6 — Structural Completeness
108
108
 
109
- Check all standard sections are present and non-empty:
109
+ Kiểm tra tất cả section chuẩn mặt và không rỗng:
110
110
 
111
111
  | Section | Missing severity |
112
112
  |---------|-----------------|
113
113
  | Header (`@trace.id`, `@trace.prd`, `@trace.domain`, `@trace.status`) | Major |
114
114
  | Overview / Context | Major |
115
- | Architecture Decision with rationale | Major |
116
- | Component Diagram or Layer Description | Major |
117
- | Sequence Diagram or Flow Steps | Major |
118
- | API Contract (if HTTP-facing) | Major |
119
- | Data Model Changes (if entity changes) | Major |
115
+ | Architecture Decision kèm do | Major |
116
+ | Component Diagram hoặc Layer Description | Major |
117
+ | Sequence Diagram hoặc Flow Steps | Major |
118
+ | API Contract (nếu hướng HTTP) | Major |
119
+ | Data Model Changes (nếu entity đổi) | Major |
120
120
  | Error Handling Strategy | Major |
121
121
  | Open Questions / Assumptions | Minor |
122
122
 
123
- All T6 missing-section findings are **auto-fixable**: AI adds skeleton section with prompts.
123
+ Mọi finding section-thiếu T6 đều **auto-fixable**: AI thêm skeleton section kèm prompt.
124
124
 
125
125
  ### T7 — Cross-Team API Contract Review
126
126
 
127
- *Only applies when ALL of the following are true:*
128
- *1. Source BDD has `@trace.platform: system`.*
129
- *2. Tech-doc header does NOT have `@trace.api_source: existing`.*
127
+ *Chỉ áp dụng khi TẤT CẢ điều sau đúng:*
128
+ *1. BDD nguồn `@trace.platform: system`.*
129
+ *2. Header tech-doc KHÔNG `@trace.api_source: existing`.*
130
130
 
131
- *If `@trace.api_source: existing` → **skip T7 entirely**. Contract đã được PO xác định trong PRD — không có API design mới để đồng thuận.*
131
+ *Nếu `@trace.api_source: existing` → **skip T7 hoàn toàn**. Contract đã được PO xác định trong PRD — không có API design mới để đồng thuận.*
132
132
 
133
- This dimension ensures FE, App, and BE teams all agree on the API contract before implementation starts.
133
+ Dimension này đảm bảo team FE, App, BE đều đồng thuận API contract trước khi bắt đầu implement.
134
134
 
135
- **Step 1 — Check sign-off status in tech-doc header:**
135
+ **Step 1 — Check status sign-off trong header tech-doc:**
136
136
 
137
- Read the `@trace.sign_off` block in the tech doc header. If absentadd it as a finding (auto-fixable: add skeleton).
137
+ Đọc block `@trace.sign_off` trong header tech doc. Nếu vắngthêm như một finding (auto-fixable: thêm skeleton).
138
138
 
139
139
  ```yaml
140
140
  # @trace.sign_off:
141
- # be_team: pending # author — set to "done" when BE satisfied with design
142
- # fe_team: pending # FE/Web — must confirm contract matches web BDD expectations
143
- # app_team: pending # App — must confirm contract matches app BDD expectations (if applicable)
144
- # sa: pending # SA/Tech Lead — final approval
141
+ # be_team: pending # author — set "done" khi BE hài lòng với design
142
+ # fe_team: pending # FE/Web — phải confirm contract khớp expectation của web BDD
143
+ # app_team: pending # App — phải confirm contract khớp expectation của app BDD (nếu áp dụng)
144
+ # sa: pending # SA/Tech Lead — approval cuối
145
145
  ```
146
146
 
147
147
  **Step 2 — Contract vs BDD cross-check:**
148
148
 
149
- Load the web and app BDDs for this TICKET-ID (from `{paths.specs_dir}/{domain}/{prd-slug}/bdd/web/` and `{paths.specs_dir}/{domain}/{prd-slug}/bdd/app/` in the spec submodule or spec repo).
149
+ Nạp web app BDD cho TICKET-ID này (từ `{paths.specs_dir}/{domain}/{prd-slug}/bdd/web/` `{paths.specs_dir}/{domain}/{prd-slug}/bdd/app/` trong spec submodule hoặc spec repo).
150
150
 
151
- For each platform BDD, verify the tech doc's API contract satisfies the BDD's `Then` clauses:
151
+ Với mỗi platform BDD, kiểm tra API contract của tech doc thoả các mệnh đề `Then` của BDD không:
152
152
 
153
153
  | Check | Severity |
154
154
  |---|---|
155
- | Response fields in API contract don't cover what web BDD `Then` expects | Critical |
156
- | Response fields in API contract don't cover what app BDD `Then` expects | Critical |
157
- | Error response shape doesn't match what platform BDDs expect | Major |
158
- | System BDD `@system.resolution` annotation contradicts the API contract design | Critical |
155
+ | Field response trong API contract không phủ những web BDD `Then` mong | Critical |
156
+ | Field response trong API contract không phủ những app BDD `Then` mong | Critical |
157
+ | Shape error response không khớp những các platform BDD mong | Major |
158
+ | Annotation `@system.resolution` của System BDD mâu thuẫn với design API contract | Critical |
159
159
 
160
- **Step 3 — Pending sign-off report:**
160
+ **Step 3 — Report sign-off pending:**
161
161
 
162
- After the review, list which sign-offs are still `pending`:
162
+ Sau review, liệt các sign-off còn `pending`:
163
163
 
164
164
  ```
165
- Pending sign-offs before tech docs can be approved:
166
- fe_team — FE/Web team must confirm API contract matches web BDD expectations
167
- app_team — App team must confirm API contract matches app BDD expectations
168
- sa — SA/Tech Lead final approval
165
+ Sign-off pending trước khi tech docs được approve:
166
+ fe_team — team FE/Web phải confirm API contract khớp expectation web BDD
167
+ app_team — team App phải confirm API contract khớp expectation app BDD
168
+ sa — SA/Tech Lead approval cuối
169
169
 
170
- Once sign-offs are collected update @trace.sign_off in tech doc header, then re-run /review-tech-docs.
171
- Tech docs cannot be set to "approved" while any required sign-off is pending.
170
+ Khi thu đủ sign-off cập nhật @trace.sign_off trong header tech doc, rồi chạy lại /review-tech-docs.
171
+ Tech docs không thể set "approved" khi còn bất kỳ sign-off bắt buộc nào pending.
172
172
  ```
173
173
 
174
174
  **Approval gate:**
175
- - If `be_team: done` AND `fe_team: done` AND `app_team: done` (or N/A) AND `sa: done` → tech docs may be set to `approved`
176
- - Otherwise → `@trace.status` stays `in-review` — `generate-code` is blocked
175
+ - Nếu `be_team: done` `fe_team: done` `app_team: done` (hoặc N/A) `sa: done` → tech docs thể set `approved`
176
+ - Ngược lại → `@trace.status` giữ `in-review` — `generate-code` bị chặn
177
177
 
178
178
  ---
179
179
 
180
- ## Write Findings File
180
+ ## Ghi File Findings
181
181
 
182
- After running all checks, write findings to `{paths.refinement_dir}/{uc-id}-tech-review-findings.yaml`:
182
+ Sau khi chạy hết các check, ghi findings vào `{paths.refinement_dir}/{uc-id}-tech-review-findings.yaml`:
183
183
 
184
184
  ```yaml
185
185
  source_file: "{absolute path to tech-doc}"
@@ -188,25 +188,25 @@ domain: "{domain}"
188
188
  generated_at: "{ISO datetime}"
189
189
  review_type: "tech-design"
190
190
  status: "pending_review"
191
- is_system_bdd: {true | false} # true if source BDD has @trace.platform: system
191
+ is_system_bdd: {true | false} # true nếu BDD nguồn @trace.platform: system
192
192
 
193
- sign_off: # only present when is_system_bdd: true
194
- be_team: pending # read from @trace.sign_off in tech-doc header
193
+ sign_off: # chỉ khi is_system_bdd: true
194
+ be_team: pending # đọc từ @trace.sign_off trong header tech-doc
195
195
  fe_team: pending
196
- app_team: pending # "n/a" if project has no app platform
196
+ app_team: pending # "n/a" nếu dự án không platform app
197
197
  sa: pending
198
- sign_off_gate: blocked # blocked | ready — "ready" only when all required are "done"
198
+ sign_off_gate: blocked # blocked | ready — "ready" chỉ khi tất cả bắt buộc là "done"
199
199
 
200
200
  findings:
201
201
  - id: "F001"
202
202
  check_id: "T1" # T1–T7
203
203
  severity: "critical" # critical | major | minor
204
- section: "{section heading or component name where issue was found}"
205
- uc_id: "{UC-ID}" # same as top-level uc_id (the UC this tech-doc designs)
206
- quote: "{verbatim snippet copied EXACTLY from the tech-doc at the issue location, ≤120 chars}"
207
- finding: "{clear description of the violation or gap}"
208
- suggestion: "{specific fix — AI applies this in --resume if accepted}"
209
- auto_fixable: false # true = AI can apply; false = human must write decision in note
204
+ section: "{section heading hoặc tên component nơi tìm thấy lỗi}"
205
+ uc_id: "{UC-ID}" # giống uc_id top-level (UC tech-doc này thiết kế)
206
+ quote: "{trích đoạn nguyên văn copy CHÍNH XÁC từ tech-doc tại vị trí lỗi, ≤120 ký tự}"
207
+ finding: "{ tả ràng vi phạm hoặc gap}"
208
+ suggestion: "{bản fix cụ thể — AI áp dụng khi --resume nếu được chấp nhận}"
209
+ auto_fixable: false # true = AI áp dụng được; false = người phải ghi quyết định trong note
210
210
  status: "pending" # pending | accepted | modified | rejected | deferred
211
211
 
212
212
  summary:
@@ -218,82 +218,82 @@ summary:
218
218
  sign_off_gate: "{blocked — pending: fe_team, app_team, sa | ready}"
219
219
  ```
220
220
 
221
- > **Locator fields (`quote` + `uc_id`) — required for Review Board source-jump.**
222
- > For every finding, copy a short **verbatim** `quote` straight from the tech-doc at the exact spot
223
- > the issue occursdo NOT paraphrase; it is matched against the document to locate the line.
224
- > These let a reviewer click a finding in the Review Board and jump to the precise source location.
221
+ > **Field định vị (`quote` + `uc_id`) — bắt buộc cho source-jump của Review Board.**
222
+ > Với mỗi finding, copy một đoạn `quote` **nguyên văn** thẳng từ tech-doc tại đúng chỗ
223
+ > lỗi xảy raKHÔNG diễn giải lại; được so khớp với tài liệu để định vị dòng.
224
+ > Field này cho phép reviewer click một finding trong Review Board nhảy tới đúng vị trí nguồn.
225
225
 
226
226
  ## Report
227
227
 
228
228
  {{include:steps/report-footer.md}}
229
229
 
230
230
  ```
231
- /review-tech-docs Complete — {target file}
231
+ /review-tech-docs Hoàn tất — {target file}
232
232
  UC: {UC-ID} | Domain: {domain}
233
233
  Findings: {total} | 🔴 Critical: {N} | 🟡 Major: {N} | 🟢 Minor: {N}
234
234
  Auto-fixable: {N} | Needs human decision: {N}
235
235
 
236
- Sign-off gate (system BDD only):
236
+ Sign-off gate (chỉ system BDD):
237
237
  be_team : {done | pending}
238
238
  fe_team : {done | pending} ← {name / "needs sign-off" }
239
239
  app_team : {done | pending | n/a}
240
240
  sa : {done | pending}
241
241
  Gate : {🔒 BLOCKED — pending: fe_team, sa | ✅ READY}
242
242
 
243
- Findings file: {paths.refinement_dir}/{uc-id}-tech-review-findings.yaml
244
- Next: Open in Review Board → Accept/Modify/Reject each finding
245
- Then run: /review-tech-docs --resume {tech-design-file}
246
- After all sign-offs collected update @trace.sign_off in tech doc, re-run review
243
+ File findings: {paths.refinement_dir}/{uc-id}-tech-review-findings.yaml
244
+ Next: Mở trong Review Board → Accept/Modify/Reject từng finding
245
+ Rồi chạy: /review-tech-docs --resume {tech-design-file}
246
+ Sau khi thu đủ sign-offcập nhật @trace.sign_off trong tech doc, chạy lại review
247
247
  ```
248
248
 
249
249
  ---
250
250
 
251
- ## Resume Mode — Apply Accepted Findings
251
+ ## Resume Mode — Áp dụng các Finding được chấp nhận
252
252
 
253
- *Triggered when `$ARGUMENTS` contains `--resume`.*
254
- *Example: `/review-tech-docs --resume {paths.tech_docs_dir}/payment/{prd-slug}/tech-docs/PAY-UC1-tech-design.md`*
253
+ *Kích hoạt khi `$ARGUMENTS` chứa `--resume`.*
254
+ * dụ: `/review-tech-docs --resume {paths.tech_docs_dir}/payment/{prd-slug}/tech-docs/PAY-UC1-tech-design.md`*
255
255
 
256
- ### Phase 1 — Read accepted findings
256
+ ### Phase 1 — Đọc các finding được chấp nhận
257
257
 
258
- 1. Derive findings file from target: `{paths.refinement_dir}/{uc-id}-tech-review-findings.yaml`
259
- 2. Read the file. Collect findings where `status: "accepted"` or `status: "modified"`.
260
- 3. If nonereport "No accepted findings. File unchanged." and stop.
258
+ 1. Suy ra file findings từ target: `{paths.refinement_dir}/{uc-id}-tech-review-findings.yaml`
259
+ 2. Đọc file. Gom các finding `status: "accepted"` hoặc `status: "modified"`.
260
+ 3. Nếu không báo "No accepted findings. File unchanged." dừng.
261
261
 
262
- ### Phase 2 — Apply fixes
262
+ ### Phase 2 — Áp dụng fix
263
263
 
264
- Apply in order: critical → major → minor.
264
+ Áp dụng theo thứ tự: critical → major → minor.
265
265
 
266
- | check_id | What to do |
266
+ | check_id | Làm |
267
267
  |----------|-----------|
268
- | T1 (Architecture) | Apply the structural fix from finding note — move logic to correct layer, update component description |
269
- | T2 (Field name) | Rename field to canonical name from core-entities.md throughout the document |
270
- | T3 (Missing design note) | Add design decision note for the uncovered scenario |
271
- | T5 (Internal inconsistency) | Align the conflicting sections to the decision stated in the note |
272
- | T6 (Missing section) | Add skeleton section with placeholder prompts for the tech lead to fill |
268
+ | T1 (Architecture) | Áp dụng fix cấu trúc từ note finding chuyển logic về đúng layer, cập nhật mô tả component |
269
+ | T2 (Tên field) | Đổi field về tên canonical từ core-entities.md xuyên suốt tài liệu |
270
+ | T3 (Thiếu design note) | Thêm design decision note cho scenario chưa phủ |
271
+ | T5 (Internal inconsistency) | Căn chỉnh các section mâu thuẫn theo quyết định nêu trong note |
272
+ | T6 (Thiếu section) | Thêm skeleton section với prompt placeholder cho tech lead điền |
273
273
 
274
- **T1, T2, T4 findings with `auto_fixable: false`:** require a human-written resolution in the
275
- Review Board "Modify" note. Apply exactly what the note says. Do not invent the fix.
274
+ **Finding T1, T2, T4 `auto_fixable: false`:** cần một resolution do người viết trong
275
+ note "Modify" của Review Board. Áp dụng đúng những note nói. Đừng bịa fix.
276
276
 
277
- ### Phase 3 — Update header + TSV + Report
277
+ ### Phase 3 — Cập nhật header + TSV + Report
278
278
 
279
- Edit the tech-doc file directly:
280
- 1. Find `@trace.revision:` in the header — increment its integer value by 1.
281
- 2. Find `@trace.status:` in the header:
282
- - If sign_off_gate = `ready` (all sign-offs done) → set to `approved`
283
- - Otherwise → set to `in-review` (blocks `/generate-code`)
284
- 3. If `@trace.sign_off` block is absent and this is a system BDD tech doc add it with all values `pending`.
279
+ Sửa file tech-doc trực tiếp:
280
+ 1. Tìm `@trace.revision:` trong header — tăng giá trị integer lên 1.
281
+ 2. Tìm `@trace.status:` trong header:
282
+ - Nếu sign_off_gate = `ready` (tất cả sign-off done) → set `approved`
283
+ - Ngược lại → set `in-review` (chặn `/generate-code`)
284
+ 3. Nếu block `@trace.sign_off` vắng đây tech doc system BDD thêm với tất cả giá trị `pending`.
285
285
 
286
- Write both changes to the file.
286
+ Ghi cả hai thay đổi vào file.
287
287
 
288
- Then update `{paths.trace_dir}/{domain}/{prd-slug}/{UC-ID}.tsv` — pick the column by which tech-doc was reviewed (read the filename):
289
- - **BE contract** (`{UC-ID}-tech-design.md`) → set `tech_doc_revision` to the new `@trace.revision` integer for all rows of this UC.
290
- - **FE tech-design** (`{UC-ID}-tech-design-{platform}.md`) → set `fe_tech_doc_revision` instead, for the rows of this UC on that platform (leave `tech_doc_revision` untouched).
291
- - Set `last_updated` to today's date (`YYYY-MM-DD`) for all rows of this UC.
288
+ Rồi cập nhật `{paths.trace_dir}/{domain}/{prd-slug}/{UC-ID}.tsv` — chọn cột theo tech-doc nào được review (đọc tên file):
289
+ - **BE contract** (`{UC-ID}-tech-design.md`) → set `tech_doc_revision` thành integer `@trace.revision` mới cho mọi row của UC này.
290
+ - **FE tech-design** (`{UC-ID}-tech-design-{platform}.md`) → set `fe_tech_doc_revision` thay vì cái kia, cho các row của UC này trên platform đó (giữ nguyên `tech_doc_revision`).
291
+ - Set `last_updated` thành ngày hôm nay (`YYYY-MM-DD`) cho mọi row của UC này.
292
292
 
293
- Print the report after all file writes are complete.
293
+ In report sau khi hoàn tất mọi lần ghi file.
294
294
 
295
295
  ```
296
- /review-tech-docs --resume Applied — {target file}
296
+ /review-tech-docs --resume Đã áp dụng — {target file}
297
297
  UC: {UC-ID}
298
298
 
299
299
  Applied : {N} findings ({critical} critical, {major} major, {minor} minor)
@@ -306,12 +306,12 @@ Changes:
306
306
  Revision : {old} → {new}
307
307
  Status : {approved | in-review}
308
308
 
309
- Sign-off : {✅ All done — status set to approved
310
- | 🔒 Pending: fe_team, sa — status set to in-review
311
- Update @trace.sign_off in tech doc when each team confirms, then re-run /review-tech-docs}
309
+ Sign-off : {✅ Tất cả done — status set approved
310
+ | 🔒 Pending: fe_team, sa — status set in-review
311
+ Cập nhật @trace.sign_off trong tech doc khi mỗi team confirm, rồi chạy lại /review-tech-docs}
312
312
 
313
- Re-run /review-tech-docs {file} to confirm 0 remaining critical findings.
314
- Next: {/generate-code {feature-file} ← only if status = approved
315
- | Collect pending sign-offsupdate @trace.sign_off → re-run /review-tech-docs}
316
- if the tech-doc lives in the shared spec repo: commit + push it to the spec submodule so FE/App `/sync` the updated contract
313
+ Chạy lại /review-tech-docs {file} để xác nhận 0 finding critical còn lại.
314
+ Next: {/generate-code {feature-file} ← chỉ khi status = approved
315
+ | Thu các sign-off pending cập nhật @trace.sign_off → chạy lại /review-tech-docs}
316
+ nếu tech-doc sống trong spec repo dùng chung: commit + push lên spec submodule để FE/App `/sync` contract đã cập nhật
317
317
  ```