@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.
- package/bin/index.js +12 -1
- package/commands/debug.md +436 -436
- package/commands/debug.tmpl +111 -111
- package/commands/define-product.md +350 -345
- package/commands/define-product.tmpl +69 -64
- package/commands/dev-gen-test.md +365 -365
- package/commands/dev-gen-test.tmpl +63 -63
- package/commands/dev-run-test.md +376 -376
- package/commands/dev-run-test.tmpl +74 -74
- package/commands/dev-smoke-test.md +341 -341
- package/commands/dev-smoke-test.tmpl +60 -60
- package/commands/fix-bug.md +403 -403
- package/commands/fix-bug.tmpl +78 -78
- package/commands/generate-bdd.md +513 -513
- package/commands/generate-bdd.tmpl +211 -211
- package/commands/generate-code.md +481 -483
- package/commands/generate-code.tmpl +179 -181
- package/commands/generate-design-spec.md +497 -497
- package/commands/generate-design-spec.tmpl +220 -220
- package/commands/generate-prd.md +452 -400
- package/commands/generate-prd.tmpl +50 -200
- package/commands/generate-spec-manifest.md +340 -340
- package/commands/generate-spec-manifest.tmpl +59 -59
- package/commands/generate-tech-docs.md +365 -365
- package/commands/generate-tech-docs.tmpl +84 -84
- package/commands/learn.md +347 -347
- package/commands/learn.tmpl +22 -22
- package/commands/map-testids.md +322 -322
- package/commands/map-testids.tmpl +41 -41
- package/commands/propose-scenario.md +335 -335
- package/commands/propose-scenario.tmpl +54 -54
- package/commands/qc-analyze.md +323 -324
- package/commands/qc-analyze.tmpl +42 -43
- package/commands/qc-design-test.md +304 -304
- package/commands/qc-design-test.tmpl +23 -23
- package/commands/qc-plan.md +297 -297
- package/commands/qc-plan.tmpl +16 -16
- package/commands/qc-report.md +302 -302
- package/commands/qc-report.tmpl +21 -21
- package/commands/qc-review.md +298 -298
- package/commands/qc-review.tmpl +17 -17
- package/commands/qc-run-test.md +337 -337
- package/commands/qc-run-test.tmpl +35 -35
- package/commands/refine-prd.md +428 -430
- package/commands/refine-prd.tmpl +62 -62
- package/commands/report-bug.md +351 -351
- package/commands/report-bug.tmpl +70 -70
- package/commands/review-code.md +364 -364
- package/commands/review-code.tmpl +39 -39
- package/commands/review-context.md +578 -580
- package/commands/review-context.tmpl +212 -212
- package/commands/review-tech-docs.md +427 -427
- package/commands/review-tech-docs.tmpl +146 -146
- package/commands/setup-ai-first.md +239 -239
- package/commands/setup-ai-first.tmpl +133 -133
- package/commands/sync.md +145 -145
- package/commands/sync.tmpl +93 -93
- package/commands/update-framework.md +88 -88
- package/commands/update-framework.tmpl +36 -36
- package/commands/validate-traces.md +381 -381
- package/commands/validate-traces.tmpl +100 -100
- package/core/FRAMEWORK_VERSION +1 -1
- package/core/commands/debug.md +436 -436
- package/core/commands/define-product.md +350 -345
- package/core/commands/dev-gen-test.md +365 -365
- package/core/commands/dev-run-test.md +376 -376
- package/core/commands/dev-smoke-test.md +341 -341
- package/core/commands/fix-bug.md +403 -403
- package/core/commands/generate-bdd.md +513 -513
- package/core/commands/generate-code.md +481 -483
- package/core/commands/generate-design-spec.md +497 -497
- package/core/commands/generate-prd.md +452 -400
- package/core/commands/generate-spec-manifest.md +340 -340
- package/core/commands/generate-tech-docs.md +365 -365
- package/core/commands/learn.md +347 -347
- package/core/commands/map-testids.md +322 -322
- package/core/commands/propose-scenario.md +335 -335
- package/core/commands/qc-analyze.md +323 -324
- package/core/commands/qc-design-test.md +304 -304
- package/core/commands/qc-plan.md +297 -297
- package/core/commands/qc-report.md +302 -302
- package/core/commands/qc-review.md +298 -298
- package/core/commands/qc-run-test.md +337 -337
- package/core/commands/refine-prd.md +428 -430
- package/core/commands/report-bug.md +351 -351
- package/core/commands/review-code.md +364 -364
- package/core/commands/review-context.md +578 -580
- package/core/commands/review-tech-docs.md +427 -427
- package/core/commands/setup-ai-first.md +239 -239
- package/core/commands/sync.md +145 -145
- package/core/commands/update-framework.md +88 -88
- package/core/commands/validate-traces.md +381 -381
- package/core/skills/code/SKILL.md +389 -389
- package/core/skills/debug/SKILL.md +391 -391
- package/core/skills/design-spec/SKILL.md +318 -318
- package/core/skills/discovery/SKILL.md +7 -547
- package/core/skills/prd/SKILL.md +298 -394
- package/core/skills/setup-ai-first/SKILL.md +80 -80
- package/core/skills/spec/SKILL.md +178 -178
- package/core/skills/test/SKILL.md +604 -604
- package/core/steps/capture-lesson.md +44 -44
- package/core/steps/context-loader.md +175 -175
- package/core/steps/gate.md +54 -54
- package/core/steps/report-footer.md +52 -52
- package/core/steps/review-fanout.md +85 -87
- package/core/steps/spawn-agent.md +45 -45
- package/core/steps/trace-mirror.md +21 -21
- package/core/templates/architecture.template.md +37 -37
- package/core/templates/design-spec.template.md +77 -77
- package/core/templates/platform-guide.template.md +47 -47
- package/core/templates/prd.template.md +107 -232
- package/core/templates/product-definition.template.md +101 -88
- package/core/templates/project-context.yaml +2 -2
- package/docs/01-getting-started/core-concepts.md +1 -1
- package/docs/01-getting-started/quickstart.md +7 -7
- package/docs/02-guides/developer/bdd-and-trace.md +1 -1
- package/docs/02-guides/developer/scenarios.md +5 -5
- package/docs/02-guides/product-owner/handoff-checklist.md +1 -1
- package/docs/02-guides/product-owner/scenarios.md +23 -23
- package/docs/02-guides/tester/bug-reporting.md +2 -2
- package/docs/02-guides/tester/reading-specs.md +2 -2
- package/docs/02-guides/tester/scenarios.md +1 -1
- package/docs/02-guides/tester/spec-manifest.md +3 -3
- package/docs/02-guides/tester/workflow.md +1 -1
- package/docs/03-concepts/architecture.md +3 -3
- package/docs/03-concepts/pipeline.md +3 -3
- package/docs/04-operations/publishing.md +20 -3
- package/docs/04-operations/sync-and-update.md +5 -5
- package/docs/05-reference/command-cheatsheet.md +2 -2
- package/docs/05-reference/commands.md +8 -8
- package/package.json +1 -1
- package/scripts/migrate-specs.js +5 -3
- package/scripts/rename-prd-files.js +174 -0
- package/skills/code/SKILL.md +389 -389
- package/skills/code/SKILL.tmpl +56 -56
- package/skills/debug/SKILL.md +391 -391
- package/skills/debug/SKILL.tmpl +60 -60
- package/skills/design-spec/SKILL.md +318 -318
- package/skills/design-spec/SKILL.tmpl +37 -37
- package/skills/discovery/SKILL.md +7 -547
- package/skills/discovery/SKILL.tmpl +7 -140
- package/skills/prd/SKILL.md +298 -394
- package/skills/prd/SKILL.tmpl +40 -151
- package/skills/setup-ai-first/SKILL.md +80 -80
- package/skills/setup-ai-first/SKILL.tmpl +28 -28
- package/skills/spec/SKILL.md +178 -178
- package/skills/spec/SKILL.tmpl +20 -20
- package/skills/test/SKILL.md +604 -604
- package/skills/test/SKILL.tmpl +44 -44
- package/steps/capture-lesson.md +44 -44
- package/steps/context-loader.md +175 -175
- package/steps/gate.md +54 -54
- package/steps/report-footer.md +52 -52
- package/steps/review-fanout.md +85 -87
- package/steps/spawn-agent.md +45 -45
- package/steps/trace-mirror.md +21 -21
- package/templates/architecture.template.md +37 -37
- package/templates/design-spec.template.md +77 -77
- package/templates/platform-guide.template.md +47 -47
- package/templates/prd.template.md +107 -232
- package/templates/product-definition.template.md +101 -88
- package/templates/project-context.yaml +2 -2
package/commands/debug.tmpl
CHANGED
|
@@ -1,206 +1,206 @@
|
|
|
1
|
-
# /debug —
|
|
1
|
+
# /debug — Phân tích Debug nhanh
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
*
|
|
9
|
+
*Lưu ý: Với lệnh này, target ở Bước 1 là input người dùng cung cấp (stack trace, output test fail, file path + mô 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 —
|
|
16
|
+
## Step 1 — Phân loại loại debug
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
Sau khi nạp context, hiện prompt này và chờ user chọn:
|
|
19
19
|
|
|
20
20
|
```
|
|
21
21
|
DEBUG SESSION
|
|
22
22
|
──────────────────────────────────────────────────────────────
|
|
23
|
-
|
|
23
|
+
Tình huống của bạn?
|
|
24
24
|
|
|
25
|
-
1
|
|
26
|
-
2
|
|
27
|
-
3
|
|
28
|
-
4
|
|
25
|
+
1 Tôi đã có stack trace / error log → dán 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
|
-
|
|
30
|
+
Nhập 1 / 2 / 3 / 4:
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
|
|
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 —
|
|
37
|
+
### Path 1 — Đã có error output
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
Hỏi:
|
|
40
40
|
```
|
|
41
|
-
|
|
41
|
+
Dán stack trace / error log của bạn bên dưới:
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
Chờ input, rồi sang [Stack Trace Analysis](#stack-trace-analysis).
|
|
45
45
|
|
|
46
46
|
---
|
|
47
47
|
|
|
48
|
-
### Path 2 —
|
|
48
|
+
### Path 2 — Cần reproduce trước
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
Hiện lệnh run từ `conventions.service_run` trong `project-context.yaml`:
|
|
51
51
|
|
|
52
52
|
```
|
|
53
|
-
|
|
53
|
+
Khởi động service trước:
|
|
54
54
|
|
|
55
55
|
{conventions.service_run}
|
|
56
56
|
|
|
57
|
-
(
|
|
57
|
+
(Nếu dùng Docker: `docker compose up -d`, rồi verify với `docker compose ps`)
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
1. Trigger
|
|
61
|
-
2. Copy
|
|
62
|
-
3.
|
|
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
|
-
|
|
64
|
+
Đang chờ error output của bạn...
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
Chờ user dán lỗi, rồi sang [Stack Trace Analysis](#stack-trace-analysis).
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
Nếu `conventions.service_run` chưa set → hiện:
|
|
70
70
|
```
|
|
71
|
-
⚠️ service_run
|
|
72
|
-
|
|
71
|
+
⚠️ service_run chưa được cấu hình trong .agent/project-context.yaml.
|
|
72
|
+
Thêm nó để 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
|
-
|
|
77
|
+
Rồi nhờ user khởi động service thủ công và dán lỗi khi sẵn sàng.
|
|
78
78
|
|
|
79
79
|
---
|
|
80
80
|
|
|
81
|
-
### Path 3 — Test
|
|
81
|
+
### Path 3 — Test đang fail
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
Hiện lệnh test từ `conventions.test_command` trong `project-context.yaml`:
|
|
84
84
|
|
|
85
85
|
```
|
|
86
|
-
|
|
86
|
+
Chạy test của bạn trước:
|
|
87
87
|
|
|
88
88
|
{conventions.test_command}
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
Khi chạy xong, dán full output test fail vào đây.
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
Đang chờ...
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
Chờ user dán output fail, rồi sang [Test Failure Analysis](#test-failure-analysis).
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
Nếu `conventions.test_command` chưa set → hiện:
|
|
98
98
|
```
|
|
99
|
-
⚠️ test_command
|
|
100
|
-
|
|
99
|
+
⚠️ test_command chưa được cấu hình trong .agent/project-context.yaml.
|
|
100
|
+
Thêm nó để 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
|
-
|
|
105
|
+
Rồi nhờ user chạy test thủ công và dán output khi sẵn sàng.
|
|
106
106
|
|
|
107
107
|
---
|
|
108
108
|
|
|
109
|
-
### Path 4 —
|
|
109
|
+
### Path 4 — Câu hỏi code
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
Hỏi:
|
|
112
112
|
```
|
|
113
|
-
|
|
113
|
+
Mô 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
|
-
|
|
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
|
-
|
|
122
|
+
Đọc từ **dưới lên** — `Caused by:` là root cause thật:
|
|
123
123
|
```
|
|
124
|
-
Caused by: {RealException} ←
|
|
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
|
-
|
|
130
|
+
Dùng `active_module` từ context để chọn bảng liên quan.
|
|
131
131
|
|
|
132
|
-
###
|
|
132
|
+
### Nếu `platform_type = backend`
|
|
133
133
|
|
|
134
134
|
#### java-spring / golang / dotnet / php-laravel
|
|
135
135
|
|
|
136
|
-
| Error |
|
|
136
|
+
| Error | Nguyên nhân khả nghi | Hướng fix |
|
|
137
137
|
|-------|-------------|---------------|
|
|
138
|
-
| NullPointerException |
|
|
139
|
-
| ClassCastException |
|
|
140
|
-
| OutOfMemoryError |
|
|
141
|
-
| StackOverflowError |
|
|
142
|
-
| Connection refused | Dependency
|
|
143
|
-
| 401 Unauthorized | Token
|
|
144
|
-
| 403 Forbidden |
|
|
145
|
-
| DB constraint violation |
|
|
146
|
-
| Serialization error | Circular reference |
|
|
147
|
-
| Test assertion mismatch |
|
|
138
|
+
| NullPointerException | Truy cập object null; Optional chưa xử lý | 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 có 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 và 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 |
|
|
151
|
+
| Error | Nguyên nhân khả nghi | Hướng fix |
|
|
152
152
|
|-------|-------------|---------------|
|
|
153
|
-
| `APIError` / `RateLimitError` |
|
|
154
|
-
| `TokenLimitError` / `context_length_exceeded` |
|
|
155
|
-
| `AuthenticationError` | API key
|
|
156
|
-
| Response validation / schema mismatch | LLM
|
|
157
|
-
| `JSONDecodeError`
|
|
158
|
-
|
|
|
159
|
-
|
|
|
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 vì 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
|
-
###
|
|
161
|
+
### Nếu `platform_type = web-frontend`
|
|
162
162
|
|
|
163
|
-
| Error |
|
|
163
|
+
| Error | Nguyên nhân khả nghi | Hướng fix |
|
|
164
164
|
|-------|-------------|---------------|
|
|
165
|
-
| `Cannot read properties of undefined` | Data
|
|
166
|
-
| `useEffect` infinite loop | Dependency array
|
|
167
|
-
| `Cannot update state on unmounted component` | Async
|
|
168
|
-
| CORS error | API
|
|
169
|
-
| 401 Unauthorized | Token
|
|
170
|
-
| White screen / no output |
|
|
171
|
-
| Type error (Zod / TypeScript) |
|
|
172
|
-
| `act(...)` warning
|
|
173
|
-
| Module not found |
|
|
174
|
-
|
|
175
|
-
###
|
|
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 |
|
|
178
|
+
| Error | Nguyên nhân khả nghi | Hướng fix |
|
|
179
179
|
|-------|-------------|---------------|
|
|
180
|
-
| `Null check operator on null value` | Nullable
|
|
181
|
-
| `pumpAndSettle timed out` | Async
|
|
182
|
-
| `setState called after dispose` | Async
|
|
183
|
-
| `RenderFlex overflow` | Widget
|
|
184
|
-
| BLoC state
|
|
185
|
-
| `MissingPluginException` | Native plugin
|
|
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 |
|
|
188
|
+
| Error | Nguyên nhân khả nghi | Hướng fix |
|
|
189
189
|
|-------|-------------|---------------|
|
|
190
|
-
| `undefined is not an object` |
|
|
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
|
|
193
|
-
| Navigation `undefined` | `useNavigation`
|
|
194
|
-
| `act(...)` warning | Async state update
|
|
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 |
|
|
197
|
+
| Error | Nguyên nhân khả nghi | Hướng fix |
|
|
198
198
|
|-------|-------------|---------------|
|
|
199
|
-
| `SIGABRT` / `EXC_BAD_ACCESS` (iOS) | Nil dereference |
|
|
200
|
-
| `IllegalStateException` (Android) |
|
|
201
|
-
| `NetworkOnMainThreadException` | Network call
|
|
202
|
-
| Build
|
|
203
|
-
| `Hilt injection failed` |
|
|
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.
|
|
212
|
+
1. Gap là gì? 2. Mock setup đúng chưa? 3. Assertion có đú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
|
-
{
|
|
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
|
-
{
|
|
233
|
+
{thay đổi code cụ thể}
|
|
234
234
|
|
|
235
235
|
## Related Rule
|
|
236
|
-
|
|
236
|
+
Xem CLAUDE.md §{section}
|
|
237
237
|
|
|
238
238
|
## Next Step
|
|
239
|
-
-
|
|
240
|
-
-
|
|
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
|
-
##
|
|
245
|
+
## Đề xuất ghi Lesson (tuỳ chọn)
|
|
246
246
|
|
|
247
|
-
|
|
248
|
-
(
|
|
247
|
+
Nếu root cause là một **lỗi AI gây ra khi sinh code và có 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
|
-
|
|
251
|
+
Cái này trông như một lỗi AI lặp lại. Ghi nó thành project lesson? (Y/N)
|
|
252
252
|
```
|
|
253
253
|
|
|
254
|
-
|
|
255
|
-
(
|
|
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`), và `scope` = domain hoặc file glob bị ảnh hưởng.
|
|
256
256
|
|
|
257
257
|
{{include:steps/capture-lesson.md}}
|