@edupia-tutor/spec-driven-docs 0.14.0 → 0.14.1

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 (141) hide show
  1. package/commands/debug.md +435 -435
  2. package/commands/debug.tmpl +111 -111
  3. package/commands/define-product.md +330 -327
  4. package/commands/define-product.tmpl +50 -47
  5. package/commands/dev-gen-test.md +364 -364
  6. package/commands/dev-gen-test.tmpl +63 -63
  7. package/commands/dev-run-test.md +375 -375
  8. package/commands/dev-run-test.tmpl +74 -74
  9. package/commands/dev-smoke-test.md +340 -340
  10. package/commands/dev-smoke-test.tmpl +60 -60
  11. package/commands/fix-bug.md +402 -402
  12. package/commands/fix-bug.tmpl +78 -78
  13. package/commands/generate-bdd.md +512 -512
  14. package/commands/generate-bdd.tmpl +211 -211
  15. package/commands/generate-code.md +480 -482
  16. package/commands/generate-code.tmpl +179 -181
  17. package/commands/generate-design-spec.md +495 -495
  18. package/commands/generate-design-spec.tmpl +219 -219
  19. package/commands/generate-prd.md +445 -396
  20. package/commands/generate-prd.tmpl +45 -198
  21. package/commands/generate-spec-manifest.md +337 -337
  22. package/commands/generate-spec-manifest.tmpl +57 -57
  23. package/commands/generate-tech-docs.md +364 -364
  24. package/commands/generate-tech-docs.tmpl +84 -84
  25. package/commands/learn.md +346 -346
  26. package/commands/learn.tmpl +22 -22
  27. package/commands/map-testids.md +321 -321
  28. package/commands/map-testids.tmpl +41 -41
  29. package/commands/propose-scenario.md +334 -334
  30. package/commands/propose-scenario.tmpl +54 -54
  31. package/commands/qc-analyze.md +322 -323
  32. package/commands/qc-analyze.tmpl +42 -43
  33. package/commands/qc-design-test.md +303 -303
  34. package/commands/qc-design-test.tmpl +23 -23
  35. package/commands/qc-plan.md +296 -296
  36. package/commands/qc-plan.tmpl +16 -16
  37. package/commands/qc-report.md +301 -301
  38. package/commands/qc-report.tmpl +21 -21
  39. package/commands/qc-review.md +297 -297
  40. package/commands/qc-review.tmpl +17 -17
  41. package/commands/qc-run-test.md +336 -336
  42. package/commands/qc-run-test.tmpl +35 -35
  43. package/commands/refine-prd.md +426 -428
  44. package/commands/refine-prd.tmpl +61 -61
  45. package/commands/report-bug.md +350 -350
  46. package/commands/report-bug.tmpl +70 -70
  47. package/commands/review-code.md +363 -363
  48. package/commands/review-code.tmpl +39 -39
  49. package/commands/review-context.md +577 -579
  50. package/commands/review-context.tmpl +212 -212
  51. package/commands/review-tech-docs.md +426 -426
  52. package/commands/review-tech-docs.tmpl +146 -146
  53. package/commands/setup-ai-first.md +237 -237
  54. package/commands/setup-ai-first.tmpl +131 -131
  55. package/commands/sync.md +145 -145
  56. package/commands/sync.tmpl +93 -93
  57. package/commands/update-framework.md +88 -88
  58. package/commands/update-framework.tmpl +36 -36
  59. package/commands/validate-traces.md +379 -379
  60. package/commands/validate-traces.tmpl +99 -99
  61. package/core/FRAMEWORK_VERSION +1 -1
  62. package/core/commands/debug.md +435 -435
  63. package/core/commands/define-product.md +330 -327
  64. package/core/commands/dev-gen-test.md +364 -364
  65. package/core/commands/dev-run-test.md +375 -375
  66. package/core/commands/dev-smoke-test.md +340 -340
  67. package/core/commands/fix-bug.md +402 -402
  68. package/core/commands/generate-bdd.md +512 -512
  69. package/core/commands/generate-code.md +480 -482
  70. package/core/commands/generate-design-spec.md +495 -495
  71. package/core/commands/generate-prd.md +445 -396
  72. package/core/commands/generate-spec-manifest.md +337 -337
  73. package/core/commands/generate-tech-docs.md +364 -364
  74. package/core/commands/learn.md +346 -346
  75. package/core/commands/map-testids.md +321 -321
  76. package/core/commands/propose-scenario.md +334 -334
  77. package/core/commands/qc-analyze.md +322 -323
  78. package/core/commands/qc-design-test.md +303 -303
  79. package/core/commands/qc-plan.md +296 -296
  80. package/core/commands/qc-report.md +301 -301
  81. package/core/commands/qc-review.md +297 -297
  82. package/core/commands/qc-run-test.md +336 -336
  83. package/core/commands/refine-prd.md +426 -428
  84. package/core/commands/report-bug.md +350 -350
  85. package/core/commands/review-code.md +363 -363
  86. package/core/commands/review-context.md +577 -579
  87. package/core/commands/review-tech-docs.md +426 -426
  88. package/core/commands/setup-ai-first.md +237 -237
  89. package/core/commands/sync.md +145 -145
  90. package/core/commands/update-framework.md +88 -88
  91. package/core/commands/validate-traces.md +379 -379
  92. package/core/skills/code/SKILL.md +388 -388
  93. package/core/skills/debug/SKILL.md +390 -390
  94. package/core/skills/design-spec/SKILL.md +316 -316
  95. package/core/skills/discovery/SKILL.md +7 -547
  96. package/core/skills/prd/SKILL.md +298 -394
  97. package/core/skills/setup-ai-first/SKILL.md +79 -79
  98. package/core/skills/spec/SKILL.md +176 -176
  99. package/core/skills/test/SKILL.md +602 -602
  100. package/core/steps/capture-lesson.md +44 -44
  101. package/core/steps/context-loader.md +174 -174
  102. package/core/steps/gate.md +54 -54
  103. package/core/steps/report-footer.md +52 -52
  104. package/core/steps/review-fanout.md +85 -87
  105. package/core/steps/spawn-agent.md +45 -45
  106. package/core/steps/trace-mirror.md +21 -21
  107. package/core/templates/architecture.template.md +37 -37
  108. package/core/templates/design-spec.template.md +77 -77
  109. package/core/templates/platform-guide.template.md +47 -47
  110. package/core/templates/prd.template.md +106 -231
  111. package/core/templates/product-definition.template.md +101 -88
  112. package/docs/04-operations/publishing.md +20 -3
  113. package/package.json +1 -1
  114. package/skills/code/SKILL.md +388 -388
  115. package/skills/code/SKILL.tmpl +56 -56
  116. package/skills/debug/SKILL.md +390 -390
  117. package/skills/debug/SKILL.tmpl +60 -60
  118. package/skills/design-spec/SKILL.md +316 -316
  119. package/skills/design-spec/SKILL.tmpl +36 -36
  120. package/skills/discovery/SKILL.md +7 -547
  121. package/skills/discovery/SKILL.tmpl +7 -140
  122. package/skills/prd/SKILL.md +298 -394
  123. package/skills/prd/SKILL.tmpl +40 -151
  124. package/skills/setup-ai-first/SKILL.md +79 -79
  125. package/skills/setup-ai-first/SKILL.tmpl +27 -27
  126. package/skills/spec/SKILL.md +176 -176
  127. package/skills/spec/SKILL.tmpl +18 -18
  128. package/skills/test/SKILL.md +602 -602
  129. package/skills/test/SKILL.tmpl +44 -44
  130. package/steps/capture-lesson.md +44 -44
  131. package/steps/context-loader.md +174 -174
  132. package/steps/gate.md +54 -54
  133. package/steps/report-footer.md +52 -52
  134. package/steps/review-fanout.md +85 -87
  135. package/steps/spawn-agent.md +45 -45
  136. package/steps/trace-mirror.md +21 -21
  137. package/templates/architecture.template.md +37 -37
  138. package/templates/design-spec.template.md +77 -77
  139. package/templates/platform-guide.template.md +47 -47
  140. package/templates/prd.template.md +106 -231
  141. package/templates/product-definition.template.md +101 -88
@@ -1,206 +1,206 @@
1
- # /debug — Quick Debug Analysis
1
+ # /debug — Phân tích Debug nhanh
2
2
 
3
- Use for: IDE errors, test failures, strange behavior, or "why does this code do X?"
4
- Different from `/fix-bug`: analysis only, no full workflow, no ticket needed.
3
+ Dùng cho: lỗi IDE, test fail, hành vi lạ, hoặc "tại sao code này làm X?"
4
+ Khác `/fix-bug`: chỉ phân tích, không full workflow, không cần ticket.
5
5
 
6
6
  ## Gate
7
7
  {{include:steps/gate.md}}
8
8
 
9
- *Note: For this command, the target in Step 1 is user-provided input (stack trace, test failure output, file path + description, or code question). No file discovery neededgo straight to context loading.*
9
+ *Lưu ý: Với lệnh này, target Bước 1 input người dùng cung cấp (stack trace, output test fail, file path + tả, hoặc câu hỏi code). Không cần tìm fileđi thẳng sang context loading.*
10
10
 
11
11
  ## Context
12
12
  {{include:steps/context-loader.md}}
13
13
 
14
14
  ---
15
15
 
16
- ## Step 1 — Classify debug type
16
+ ## Step 1 — Phân loại loại debug
17
17
 
18
- After loading context, display this prompt and wait for the user's choice:
18
+ Sau khi nạp context, hiện prompt này chờ user chọn:
19
19
 
20
20
  ```
21
21
  DEBUG SESSION
22
22
  ──────────────────────────────────────────────────────────────
23
- What's your situation?
23
+ Tình huống của bạn?
24
24
 
25
- 1 I already have a stack trace / error log → paste it
26
- 2 I need to reproduce the error first show me the run command
27
- 3 A test is failing I'll run tests, then paste output
28
- 4 Code question (no runtime needed) ask away
25
+ 1 Tôi đã stack trace / error log → dán
26
+ 2 Tôi cần reproduce lỗi trước chỉ tôi lệnh run
27
+ 3 Một test đang fail tôi sẽ chạy test, rồi dán output
28
+ 4 Câu hỏi về code (không cần runtime)hỏi luôn
29
29
  ──────────────────────────────────────────────────────────────
30
- Enter 1 / 2 / 3 / 4:
30
+ Nhập 1 / 2 / 3 / 4:
31
31
  ```
32
32
 
33
- Wait for the user's choice, then follow the corresponding path below.
33
+ Chờ user chọn, rồi theo path tương ứng bên dưới.
34
34
 
35
35
  ---
36
36
 
37
- ### Path 1 — Already have error output
37
+ ### Path 1 — Đã error output
38
38
 
39
- Ask:
39
+ Hỏi:
40
40
  ```
41
- Paste your stack trace / error log below:
41
+ Dán stack trace / error log của bạn bên dưới:
42
42
  ```
43
43
 
44
- Wait for input, then proceed to [Stack Trace Analysis](#stack-trace-analysis).
44
+ Chờ input, rồi sang [Stack Trace Analysis](#stack-trace-analysis).
45
45
 
46
46
  ---
47
47
 
48
- ### Path 2 — Need to reproduce first
48
+ ### Path 2 — Cần reproduce trước
49
49
 
50
- Display the run command from `conventions.service_run` in `project-context.yaml`:
50
+ Hiện lệnh run từ `conventions.service_run` trong `project-context.yaml`:
51
51
 
52
52
  ```
53
- Start your service first:
53
+ Khởi động service trước:
54
54
 
55
55
  {conventions.service_run}
56
56
 
57
- (If you use Docker: `docker compose up -d`, then verify with `docker compose ps`)
57
+ (Nếu dùng Docker: `docker compose up -d`, rồi verify với `docker compose ps`)
58
58
 
59
- Once the service is running:
60
- 1. Trigger the behavior that causes the error
61
- 2. Copy the full stack trace or error log
62
- 3. Paste it here
59
+ Khi service đang chạy:
60
+ 1. Trigger hành vi gây lỗi
61
+ 2. Copy full stack trace hoặc error log
62
+ 3. Dán vào đây
63
63
 
64
- Waiting for your error output...
64
+ Đang chờ error output của bạn...
65
65
  ```
66
66
 
67
- Wait for the user to paste the error, then proceed to [Stack Trace Analysis](#stack-trace-analysis).
67
+ Chờ user dán lỗi, rồi sang [Stack Trace Analysis](#stack-trace-analysis).
68
68
 
69
- If `conventions.service_run` is not set → show:
69
+ Nếu `conventions.service_run` chưa set → hiện:
70
70
  ```
71
- ⚠️ service_run is not configured in .agent/project-context.yaml.
72
- Add it so this command can show the correct start command:
71
+ ⚠️ service_run chưa được cấu hình trong .agent/project-context.yaml.
72
+ Thêm để lệnh này hiện đúng lệnh khởi động:
73
73
 
74
74
  conventions:
75
75
  service_run: "mvn spring-boot:run" # or: npm run dev / go run . / etc.
76
76
  ```
77
- Then ask the user to start the service manually and paste the error when ready.
77
+ Rồi nhờ user khởi động service thủ công dán lỗi khi sẵn sàng.
78
78
 
79
79
  ---
80
80
 
81
- ### Path 3 — Test is failing
81
+ ### Path 3 — Test đang fail
82
82
 
83
- Display the test command from `conventions.test_command` in `project-context.yaml`:
83
+ Hiện lệnh test từ `conventions.test_command` trong `project-context.yaml`:
84
84
 
85
85
  ```
86
- Run your tests first:
86
+ Chạy test của bạn trước:
87
87
 
88
88
  {conventions.test_command}
89
89
 
90
- Once the run finishes, paste the full test failure output here.
90
+ Khi chạy xong, dán full output test fail vào đây.
91
91
 
92
- Waiting...
92
+ Đang chờ...
93
93
  ```
94
94
 
95
- Wait for the user to paste the failure output, then proceed to [Test Failure Analysis](#test-failure-analysis).
95
+ Chờ user dán output fail, rồi sang [Test Failure Analysis](#test-failure-analysis).
96
96
 
97
- If `conventions.test_command` is not set → show:
97
+ Nếu `conventions.test_command` chưa set → hiện:
98
98
  ```
99
- ⚠️ test_command is not configured in .agent/project-context.yaml.
100
- Add it so this command can show the correct test command:
99
+ ⚠️ test_command chưa được cấu hình trong .agent/project-context.yaml.
100
+ Thêm để lệnh này hiện đúng lệnh test:
101
101
 
102
102
  conventions:
103
103
  test_command: "mvn test" # or: npm test / go test ./... / etc.
104
104
  ```
105
- Then ask the user to run tests manually and paste the output when ready.
105
+ Rồi nhờ user chạy test thủ công dán output khi sẵn sàng.
106
106
 
107
107
  ---
108
108
 
109
- ### Path 4 — Code question
109
+ ### Path 4 — Câu hỏi code
110
110
 
111
- Ask:
111
+ Hỏi:
112
112
  ```
113
- Describe your question or paste the code snippet you're asking about:
113
+ tả câu hỏi của bạn hoặc dán code snippet bạn đang hỏi:
114
114
  ```
115
115
 
116
- Wait for input, then answer directly using loaded project context (architecture rules, layer order, coding standards from CLAUDE.md).
116
+ Chờ input, rồi trả lời trực tiếp dùng project context đã nạp (quy tắc kiến trúc, thứ tự layer, coding standards từ CLAUDE.md).
117
117
 
118
118
  ---
119
119
 
120
120
  ## Stack Trace Analysis
121
121
 
122
- Read from **bottom up** — `Caused by:` is the real root cause:
122
+ Đọc từ **dưới lên** — `Caused by:` root cause thật:
123
123
  ```
124
- Caused by: {RealException} ← start here
124
+ Caused by: {RealException} ← bắt đầu ở đây
125
125
  at {class}.{method}({file}:{line})
126
126
  ```
127
127
 
128
128
  ## Common Error Patterns
129
129
 
130
- Use `active_module` from context to select the relevant table.
130
+ Dùng `active_module` từ context để chọn bảng liên quan.
131
131
 
132
- ### If `platform_type = backend`
132
+ ### Nếu `platform_type = backend`
133
133
 
134
134
  #### java-spring / golang / dotnet / php-laravel
135
135
 
136
- | Error | Likely Cause | Fix Direction |
136
+ | Error | Nguyên nhân khả nghi | Hướng fix |
137
137
  |-------|-------------|---------------|
138
- | NullPointerException | Null object access; Optional not handled | Check Optional.orElseThrow, null guards |
139
- | ClassCastException | Wrong type assumption | Check type at assignment/return |
140
- | OutOfMemoryError | Loading too much data | Add pagination |
141
- | StackOverflowError | Infinite recursion | Find recursive call with no base case |
142
- | Connection refused | Dependency not running | Check config URLs / start service |
143
- | 401 Unauthorized | Token expired, wrong config | Verify token, check auth config |
144
- | 403 Forbidden | Wrong role | Check auth annotations |
145
- | DB constraint violation | Duplicate key, null in NOT NULL | Check data and constraints |
146
- | Serialization error | Circular reference | Check DTO/mapper config |
147
- | Test assertion mismatch | Wrong mock or wrong expected | Re-read mock setup |
138
+ | NullPointerException | Truy cập object null; Optional chưa xử | Kiểm tra Optional.orElseThrow, null guard |
139
+ | ClassCastException | Giả định sai kiểu | Kiểm tra type assignment/return |
140
+ | OutOfMemoryError | Load quá nhiều data | Thêm pagination |
141
+ | StackOverflowError | Đệ quy vô hạn | Tìm recursive call không base case |
142
+ | Connection refused | Dependency chưa chạy | Kiểm tra config URL / khởi động service |
143
+ | 401 Unauthorized | Token hết hạn, sai config | Verify token, kiểm tra auth config |
144
+ | 403 Forbidden | Sai role | Kiểm tra auth annotation |
145
+ | DB constraint violation | Trùng key, null trong NOT NULL | Kiểm tra data constraint |
146
+ | Serialization error | Circular reference | Kiểm tra config DTO/mapper |
147
+ | Test assertion mismatch | Sai mock hoặc sai expected | Đọc lại setup mock |
148
148
 
149
149
  #### context-engineering (AI/LLM pipelines)
150
150
 
151
- | Error | Likely Cause | Fix Direction |
151
+ | Error | Nguyên nhân khả nghi | Hướng fix |
152
152
  |-------|-------------|---------------|
153
- | `APIError` / `RateLimitError` | LLM quota exceeded or service down | Check API key, rate limits; add exponential backoff |
154
- | `TokenLimitError` / `context_length_exceeded` | Input prompt too long | Truncate/chunk input; review prompt template size |
155
- | `AuthenticationError` | API key invalid or expired | Check env var; rotate key |
156
- | Response validation / schema mismatch | LLM output doesn't match expected format | Add output parser; retry with stricter prompt |
157
- | `JSONDecodeError` on LLM output | Model returned non-JSON text | Add JSON extraction post-processing or stricter system prompt |
158
- | Hanging / slow test | Real LLM called in test instead of mock | Verify `patch('...')` applied; add timeout guard |
159
- | Flaky results across runs | Non-deterministic LLM response | Use fixed mock in tests; check temperature = 0 for determinism |
153
+ | `APIError` / `RateLimitError` | Vượt quota LLM hoặc service down | Kiểm tra API key, rate limit; thêm exponential backoff |
154
+ | `TokenLimitError` / `context_length_exceeded` | Prompt input quá dài | Truncate/chunk input; review kích thước prompt template |
155
+ | `AuthenticationError` | API key không hợp lệ hoặc hết hạn | Kiểm tra env var; rotate key |
156
+ | Response validation / schema mismatch | Output LLM không khớp format kỳ vọng | Thêm output parser; retry với prompt chặt hơn |
157
+ | `JSONDecodeError` trên output LLM | Model trả về text non-JSON | Thêm post-processing trích JSON hoặc system prompt chặt hơn |
158
+ | Test treo / chậm | LLM thật bị gọi trong test thay mock | Verify `patch('...')` được áp; thêm timeout guard |
159
+ | Kết quả flaky giữa các lần chạy | Response LLM non-deterministic | Dùng mock cố định trong test; check temperature = 0 cho determinism |
160
160
 
161
- ### If `platform_type = web-frontend`
161
+ ### Nếu `platform_type = web-frontend`
162
162
 
163
- | Error | Likely Cause | Fix Direction |
163
+ | Error | Nguyên nhân khả nghi | Hướng fix |
164
164
  |-------|-------------|---------------|
165
- | `Cannot read properties of undefined` | Data not loaded yet | Add loading guard / optional chaining `?.` |
166
- | `useEffect` infinite loop | Dependency array wrong | Review deps, use stable refs / `useCallback` |
167
- | `Cannot update state on unmounted component` | Async resolves after unmount | Cancel in cleanup / use AbortController |
168
- | CORS error | API not configured | Check backend CORS config or dev proxy setup |
169
- | 401 Unauthorized | Token expired or missing | Refresh token / check Authorization header |
170
- | White screen / no output | Unhandled render error | Check browser console, add ErrorBoundary |
171
- | Type error (Zod / TypeScript) | API response shape mismatch | Compare actual response vs type definition |
172
- | `act(...)` warning in test | Async state update | Wrap in `act(async () => {...})` |
173
- | Module not found | Import path wrong | Check relative path / tsconfig alias |
174
-
175
- ### If `platform_type = mobile`
165
+ | `Cannot read properties of undefined` | Data chưa load | Thêm loading guard / optional chaining `?.` |
166
+ | `useEffect` infinite loop | Dependency array sai | Review deps, dùng stable ref / `useCallback` |
167
+ | `Cannot update state on unmounted component` | Async resolve sau unmount | Cancel trong cleanup / dùng AbortController |
168
+ | CORS error | API chưa cấu hình | Kiểm tra CORS config backend hoặc dev proxy |
169
+ | 401 Unauthorized | Token hết hạn hoặc thiếu | Refresh token / kiểm tra header Authorization |
170
+ | White screen / no output | Render error chưa xử lý | Kiểm tra console browser, thêm ErrorBoundary |
171
+ | Type error (Zod / TypeScript) | Shape response API mismatch | So response thực tế vs type definition |
172
+ | `act(...)` warning trong test | Async state update | Bọc trong `act(async () => {...})` |
173
+ | Module not found | Sai import path | Kiểm tra relative path / tsconfig alias |
174
+
175
+ ### Nếu `platform_type = mobile`
176
176
 
177
177
  #### Flutter
178
- | Error | Likely Cause | Fix Direction |
178
+ | Error | Nguyên nhân khả nghi | Hướng fix |
179
179
  |-------|-------------|---------------|
180
- | `Null check operator on null value` | Nullable not guarded | Add `?` or null check before `!` |
181
- | `pumpAndSettle timed out` | Async not completing in test | Use `pump(Duration(...))` |
182
- | `setState called after dispose` | Async continues after widget removed | Cancel in `dispose()` |
183
- | `RenderFlex overflow` | Widget too wide for screen | Wrap with `Flexible`, `Expanded`, or `SingleChildScrollView` |
184
- | BLoC state not updating | Event not dispatched | Verify `bloc.add(Event())` is called |
185
- | `MissingPluginException` | Native plugin not linked | Run `flutter clean && flutter pub get` |
180
+ | `Null check operator on null value` | Nullable chưa guard | Thêm `?` hoặc null check trước `!` |
181
+ | `pumpAndSettle timed out` | Async chưa hoàn thành trong test | Dùng `pump(Duration(...))` |
182
+ | `setState called after dispose` | Async tiếp tục sau khi widget bị bỏ | Cancel trong `dispose()` |
183
+ | `RenderFlex overflow` | Widget quá rộng so với màn | Bọc `Flexible`, `Expanded`, hoặc `SingleChildScrollView` |
184
+ | BLoC state không update | Event chưa dispatch | Verify `bloc.add(Event())` được gọi |
185
+ | `MissingPluginException` | Native plugin chưa link | Chạy `flutter clean && flutter pub get` |
186
186
 
187
187
  #### React Native
188
- | Error | Likely Cause | Fix Direction |
188
+ | Error | Nguyên nhân khả nghi | Hướng fix |
189
189
  |-------|-------------|---------------|
190
- | `undefined is not an object` | Null prop access | Add null check / optional chaining |
190
+ | `undefined is not an object` | Truy cập prop null | Thêm null check / optional chaining |
191
191
  | Metro bundler error | Cache stale | `npx react-native start --reset-cache` |
192
- | `VirtualizedLists nested` | FlatList inside ScrollView | Use `nestedScrollEnabled` or restructure |
193
- | Navigation `undefined` | `useNavigation` outside navigator | Wrap component inside correct navigator |
194
- | `act(...)` warning | Async state update in test | Wrap in `act(async () => {...})` |
192
+ | `VirtualizedLists nested` | FlatList trong ScrollView | Dùng `nestedScrollEnabled` hoặc tái cấu trúc |
193
+ | Navigation `undefined` | `useNavigation` ngoài navigator | Bọc component trong đúng navigator |
194
+ | `act(...)` warning | Async state update trong test | Bọc trong `act(async () => {...})` |
195
195
 
196
196
  #### iOS / Android
197
- | Error | Likely Cause | Fix Direction |
197
+ | Error | Nguyên nhân khả nghi | Hướng fix |
198
198
  |-------|-------------|---------------|
199
- | `SIGABRT` / `EXC_BAD_ACCESS` (iOS) | Nil dereference | Add optional binding `if let` / `guard let` |
200
- | `IllegalStateException` (Android) | Lifecycle violation | Check if fragment/activity still attached |
201
- | `NetworkOnMainThreadException` | Network call on UI thread | Move to coroutine / background thread |
202
- | Build fails after pod install | Pod cache stale | `pod deintegrate && pod install` |
203
- | `Hilt injection failed` | Missing `@AndroidEntryPoint` | Add annotation to Activity/Fragment |
199
+ | `SIGABRT` / `EXC_BAD_ACCESS` (iOS) | Nil dereference | Thêm optional binding `if let` / `guard let` |
200
+ | `IllegalStateException` (Android) | Vi phạm lifecycle | Kiểm tra fragment/activity còn attached không |
201
+ | `NetworkOnMainThreadException` | Network call trên UI thread | Chuyển sang coroutine / background thread |
202
+ | Build fail sau pod install | Pod cache stale | `pod deintegrate && pod install` |
203
+ | `Hilt injection failed` | Thiếu `@AndroidEntryPoint` | Thêm annotation vào Activity/Fragment |
204
204
 
205
205
  ## Test Failure Analysis
206
206
 
@@ -209,7 +209,7 @@ Expected: {value}
209
209
  Actual : {value}
210
210
  at {test}.{method}(line {N})
211
211
  ```
212
- 1. What is the gap? 2. Is mock setup correct? 3. Is assertion logically correct?
212
+ 1. Gap gì? 2. Mock setup đúng chưa? 3. Assertion đúng logic không?
213
213
 
214
214
  ---
215
215
 
@@ -224,34 +224,34 @@ Actual : {value}
224
224
  {description}
225
225
 
226
226
  ## Root Cause
227
- {technical explanation}
227
+ {giải thích kỹ thuật}
228
228
 
229
229
  ## Location
230
230
  File: {path} | Line: {N} | Layer: {Controller/Service/Repository/Test}
231
231
 
232
232
  ## Suggested Fix
233
- {specific code change}
233
+ {thay đổi code cụ thể}
234
234
 
235
235
  ## Related Rule
236
- See CLAUDE.md §{section}
236
+ Xem CLAUDE.md §{section}
237
237
 
238
238
  ## Next Step
239
- - To fully fix → /fix-bug {TICKET_ID}
240
- - Just needed analysisdone
239
+ - Để fix hoàn toàn → /fix-bug {TICKET_ID}
240
+ - Chỉ cần phân tích xong
241
241
  ```
242
242
 
243
243
  ---
244
244
 
245
- ## Offer to Record a Lesson (optional)
245
+ ## Đề xuất ghi Lesson (tuỳ chọn)
246
246
 
247
- If the root cause is a **mistake the AI made when generating code and could repeat**
248
- (not an environment/config issue or external cause), ask:
247
+ Nếu root cause một **lỗi AI gây ra khi sinh code thể lặp lại**
248
+ (không phải vấn đề env/config hay nguyên nhân bên ngoài), hỏi:
249
249
 
250
250
  ```
251
- This looks like a repeatable AI mistake. Record it as a project lesson? (Y/N)
251
+ Cái này trông như một lỗi AI lặp lại. Ghi thành project lesson? (Y/N)
252
252
  ```
253
253
 
254
- If `Y` → run the capture procedure below with `source=/debug`, an appropriate `category`
255
- (usually `code-gen`), and `scope` = the affected domain or file glob.
254
+ Nếu `Y` → chạy quy trình capture bên dưới với `source=/debug`, một `category` phù hợp
255
+ (thường `code-gen`), `scope` = domain hoặc file glob bị ảnh hưởng.
256
256
 
257
257
  {{include:steps/capture-lesson.md}}