@educa-corp/sdd-framework 0.5.0 → 0.7.0
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/build.js +113 -19
- package/bin/gate-trace.js +487 -0
- package/bin/index.js +445 -146
- package/bin/lint-trace.js +643 -0
- package/bin/self-check.js +804 -2
- package/bin/trace-schema.json +621 -10
- package/core/FRAMEWORK_VERSION +1 -1
- package/core/README.md +20 -0
- package/core/commands/amend-prd.md +518 -0
- package/core/commands/debug.md +123 -511
- package/core/commands/define-product.md +86 -510
- package/core/commands/dev-gen-test.md +86 -510
- package/core/commands/dev-run-test.md +133 -519
- package/core/commands/dev-smoke-test.md +86 -510
- package/core/commands/extend-prd.md +128 -522
- package/core/commands/fix-bug.md +118 -509
- package/core/commands/generate-architecture.md +94 -515
- package/core/commands/generate-bdd.md +128 -513
- package/core/commands/generate-code.md +119 -510
- package/core/commands/generate-design-spec.md +86 -510
- package/core/commands/generate-prd.md +89 -510
- package/core/commands/generate-spec-manifest.md +86 -510
- package/core/commands/generate-tech-docs.md +120 -512
- package/core/commands/learn.md +172 -496
- package/core/commands/map-testids.md +86 -510
- package/core/commands/propose-scenario.md +86 -510
- package/core/commands/qc-analyze.md +86 -510
- package/core/commands/qc-design-test.md +86 -510
- package/core/commands/qc-plan.md +86 -510
- package/core/commands/qc-report.md +86 -510
- package/core/commands/qc-review.md +86 -510
- package/core/commands/qc-run-test.md +115 -513
- package/core/commands/refine-prd.md +112 -522
- package/core/commands/report-bug.md +86 -510
- package/core/commands/review-code.md +123 -511
- package/core/commands/review-context.md +136 -522
- package/core/commands/review-tech-docs.md +90 -511
- package/core/commands/setup-ai-first.md +166 -138
- package/core/commands/sync.md +155 -107
- package/core/commands/update-framework.md +16 -103
- package/core/commands/validate-traces.md +426 -511
- package/core/hooks/data-guard.js +174 -83
- package/core/hooks/settings.json +2 -1
- package/core/rules/workflow.md +64 -4
- package/core/steps/capture-lesson.md +34 -1
- package/core/steps/context-loader.md +50 -8
- package/core/steps/gate.md +92 -35
- package/core/steps/report-footer.md +23 -0
- package/core/templates/README.md +24 -1
- package/core/templates/ci/trace-gate.yml +146 -0
- package/core/templates/feature.template +1 -1
- package/core/templates/hooks/pre-push +61 -0
- package/docs/02-concepts/architecture.md +61 -6
- package/docs/02-concepts/traceability.md +57 -0
- package/docs/03-guides/architect.md +63 -0
- package/docs/04-reference/commands.md +148 -134
- package/docs/04-reference/model-selection.md +32 -19
- package/docs/04-reference/trace-schema.md +39 -0
- package/docs/explain/02b-extend-prd.md +1 -1
- package/docs/explain/02c-amend-prd.md +152 -0
- package/docs/explain/21-validate-traces.md +2 -1
- package/docs/explain/27-learn.md +5 -3
- package/docs/explain/28-sync.md +25 -0
- package/docs/explain/README.md +136 -135
- package/package.json +5 -9
- package/commands/debug.md +0 -917
- package/commands/debug.tmpl +0 -257
- package/commands/define-product.md +0 -862
- package/commands/define-product.tmpl +0 -225
- package/commands/dev-gen-test.md +0 -1124
- package/commands/dev-gen-test.tmpl +0 -490
- package/commands/dev-run-test.md +0 -859
- package/commands/dev-run-test.tmpl +0 -225
- package/commands/dev-smoke-test.md +0 -798
- package/commands/dev-smoke-test.tmpl +0 -217
- package/commands/extend-prd.md +0 -907
- package/commands/extend-prd.tmpl +0 -270
- package/commands/fix-bug.md +0 -910
- package/commands/fix-bug.tmpl +0 -197
- package/commands/generate-architecture.md +0 -775
- package/commands/generate-architecture.tmpl +0 -194
- package/commands/generate-bdd.md +0 -1347
- package/commands/generate-bdd.tmpl +0 -590
- package/commands/generate-code.md +0 -1283
- package/commands/generate-code.tmpl +0 -649
- package/commands/generate-design-spec.md +0 -1161
- package/commands/generate-design-spec.tmpl +0 -524
- package/commands/generate-prd.md +0 -1143
- package/commands/generate-prd.tmpl +0 -223
- package/commands/generate-spec-manifest.md +0 -745
- package/commands/generate-spec-manifest.tmpl +0 -164
- package/commands/generate-tech-docs.md +0 -1344
- package/commands/generate-tech-docs.tmpl +0 -273
- package/commands/learn.md +0 -723
- package/commands/learn.tmpl +0 -63
- package/commands/map-testids.md +0 -662
- package/commands/map-testids.tmpl +0 -81
- package/commands/propose-scenario.md +0 -783
- package/commands/propose-scenario.tmpl +0 -202
- package/commands/qc-analyze.md +0 -693
- package/commands/qc-analyze.tmpl +0 -112
- package/commands/qc-design-test.md +0 -650
- package/commands/qc-design-test.tmpl +0 -69
- package/commands/qc-plan.md +0 -630
- package/commands/qc-plan.tmpl +0 -49
- package/commands/qc-report.md +0 -641
- package/commands/qc-report.tmpl +0 -60
- package/commands/qc-review.md +0 -634
- package/commands/qc-review.tmpl +0 -53
- package/commands/qc-run-test.md +0 -750
- package/commands/qc-run-test.tmpl +0 -116
- package/commands/refine-prd.md +0 -1074
- package/commands/refine-prd.tmpl +0 -278
- package/commands/report-bug.md +0 -729
- package/commands/report-bug.tmpl +0 -148
- package/commands/review-code.md +0 -803
- package/commands/review-code.tmpl +0 -143
- package/commands/review-context.md +0 -1323
- package/commands/review-context.tmpl +0 -527
- package/commands/review-tech-docs.md +0 -982
- package/commands/review-tech-docs.tmpl +0 -401
- package/commands/setup-ai-first.md +0 -574
- package/commands/setup-ai-first.tmpl +0 -378
- package/commands/sync.md +0 -486
- package/commands/sync.tmpl +0 -384
- package/commands/update-framework.md +0 -290
- package/commands/update-framework.tmpl +0 -188
- package/commands/validate-traces.md +0 -1435
- package/commands/validate-traces.tmpl +0 -854
- package/hooks/data-guard.js +0 -141
- package/hooks/settings.json +0 -18
- package/modules/android-compose/module.yaml +0 -13
- package/modules/android-compose/stack-profile.yaml +0 -57
- package/modules/angular/architecture-snippets/component-patterns.md +0 -187
- package/modules/angular/module.yaml +0 -6
- package/modules/angular/stack-profile.yaml +0 -38
- package/modules/context-engineering/architecture-snippets/context-design.md +0 -119
- package/modules/context-engineering/module.yaml +0 -9
- package/modules/context-engineering/stack-profile.yaml +0 -61
- package/modules/dotnet/architecture-snippets/clean-arch.md +0 -160
- package/modules/dotnet/module.yaml +0 -6
- package/modules/dotnet/stack-profile.yaml +0 -50
- package/modules/flutter/module.yaml +0 -14
- package/modules/flutter/stack-profile.yaml +0 -59
- package/modules/golang/architecture-snippets/domain-layout.md +0 -283
- package/modules/golang/module.yaml +0 -6
- package/modules/golang/stack-profile.yaml +0 -40
- package/modules/ios-swiftui/module.yaml +0 -13
- package/modules/ios-swiftui/stack-profile.yaml +0 -55
- package/modules/java-spring/architecture-snippets/layered-arch.md +0 -201
- package/modules/java-spring/module.yaml +0 -15
- package/modules/java-spring/stack-profile.yaml +0 -28
- package/modules/nextjs/architecture-snippets/app-router-patterns.md +0 -269
- package/modules/nextjs/module.yaml +0 -14
- package/modules/nextjs/stack-profile.yaml +0 -74
- package/modules/nuxt/module.yaml +0 -14
- package/modules/nuxt/stack-profile.yaml +0 -58
- package/modules/phaser-game/architecture-snippets/phaser-scene-patterns.md +0 -646
- package/modules/phaser-game/module.yaml +0 -15
- package/modules/phaser-game/stack-profile.yaml +0 -90
- package/modules/php-laravel/architecture-snippets/service-repository.md +0 -302
- package/modules/php-laravel/module.yaml +0 -15
- package/modules/php-laravel/stack-profile.yaml +0 -56
- package/modules/qc-playwright/stack-profile.yaml +0 -66
- package/modules/react/architecture-snippets/hooks-query-patterns.md +0 -254
- package/modules/react/module.yaml +0 -14
- package/modules/react/stack-profile.yaml +0 -63
- package/modules/react-native/module.yaml +0 -14
- package/modules/react-native/stack-profile.yaml +0 -56
- package/modules/vue/module.yaml +0 -14
- package/modules/vue/stack-profile.yaml +0 -65
- package/rules/data-protection.md +0 -80
- package/rules/workflow.md +0 -73
- package/scripts/init.sh +0 -49
- package/scripts/upgrade.sh +0 -94
- package/skills/code/SKILL.md +0 -19
- package/skills/code/SKILL.tmpl +0 -19
- package/skills/debug/SKILL.md +0 -19
- package/skills/debug/SKILL.tmpl +0 -19
- package/skills/design-spec/SKILL.md +0 -11
- package/skills/design-spec/SKILL.tmpl +0 -11
- package/skills/discovery/SKILL.md +0 -14
- package/skills/discovery/SKILL.tmpl +0 -14
- package/skills/prd/SKILL.md +0 -19
- package/skills/prd/SKILL.tmpl +0 -19
- package/skills/qc/qa-analyst/DOC_GAPS.template.md +0 -63
- package/skills/qc/qa-analyst/acceptance-criteria.md +0 -60
- package/skills/qc/qa-analyst/business-rules.md +0 -59
- package/skills/qc/qa-analyst/data-flow.md +0 -64
- package/skills/qc/qa-analyst/spec-breakdown.md +0 -61
- package/skills/qc/qa-designer/e2e/journey.md +0 -41
- package/skills/qc/qa-designer/exploratory/charter.md +0 -68
- package/skills/qc/qa-designer/exploratory/explore-to-functional.md +0 -43
- package/skills/qc/qa-designer/functional/api.md +0 -45
- package/skills/qc/qa-designer/functional/gui-feature.md +0 -46
- package/skills/qc/qa-designer/functional/gui-screen.md +0 -52
- package/skills/qc/qa-designer/integration/api.md +0 -42
- package/skills/qc/qa-designer/integration/db.md +0 -39
- package/skills/qc/qa-designer/integration/gui.md +0 -40
- package/skills/qc/qa-designer/integration/kafka.md +0 -40
- package/skills/qc/qa-designer/non-functional.md +0 -40
- package/skills/qc/qa-planner/test-plan.md +0 -120
- package/skills/qc/qa-reviewer/script/e2e.md +0 -87
- package/skills/qc/qa-reviewer/script/exploratory.md +0 -45
- package/skills/qc/qa-reviewer/script/functional.md +0 -101
- package/skills/qc/qa-reviewer/script/integration.md +0 -91
- package/skills/qc/qa-reviewer/script/non-functional.md +0 -126
- package/skills/qc/qa-reviewer/test-case/e2e.md +0 -73
- package/skills/qc/qa-reviewer/test-case/exploratory.md +0 -43
- package/skills/qc/qa-reviewer/test-case/functional.md +0 -76
- package/skills/qc/qa-reviewer/test-case/integration.md +0 -69
- package/skills/qc/qa-reviewer/test-case/non-functional.md +0 -73
- package/skills/qc/qa-runner/e2e.md +0 -49
- package/skills/qc/qa-runner/exploratory/session.md +0 -36
- package/skills/qc/qa-runner/functional/api.md +0 -35
- package/skills/qc/qa-runner/functional/gui-feature.md +0 -51
- package/skills/qc/qa-runner/functional/gui-screen.md +0 -55
- package/skills/qc/qa-runner/integration.md +0 -47
- package/skills/qc/qa-runner/non-functional.md +0 -49
- package/skills/qc/qa-runner/report/report.md +0 -37
- package/skills/setup-ai-first/SKILL.md +0 -19
- package/skills/setup-ai-first/SKILL.tmpl +0 -19
- package/skills/spec/SKILL.md +0 -19
- package/skills/spec/SKILL.tmpl +0 -19
- package/skills/test/SKILL.md +0 -18
- package/skills/test/SKILL.tmpl +0 -18
- package/steps/business-language.md +0 -56
- package/steps/capture-lesson.md +0 -79
- package/steps/context-loader.md +0 -385
- package/steps/gate.md +0 -94
- package/steps/report-footer.md +0 -102
- package/steps/review-fanout.md +0 -159
- package/steps/spawn-agent.md +0 -129
- package/steps/trace-mirror.md +0 -53
- package/templates/README.md +0 -47
- package/templates/architecture.template.md +0 -394
- package/templates/design-spec.template.md +0 -217
- package/templates/feature.template +0 -123
- package/templates/platform-guide.template.md +0 -145
- package/templates/prd.template.md +0 -283
- package/templates/product-definition.template.md +0 -188
- package/templates/project-context.yaml +0 -212
- package/templates/tech-design.template.md +0 -490
package/commands/debug.tmpl
DELETED
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
# /debug — Phân tích Debug nhanh
|
|
2
|
-
|
|
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
|
-
|
|
6
|
-
## Gate
|
|
7
|
-
{{include:steps/gate.md}}
|
|
8
|
-
|
|
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
|
-
|
|
11
|
-
## Context
|
|
12
|
-
{{include:steps/context-loader.md}}
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
## Step 1 — Phân loại loại debug
|
|
17
|
-
|
|
18
|
-
Sau khi nạp context, hiện prompt này và chờ user chọn:
|
|
19
|
-
|
|
20
|
-
```
|
|
21
|
-
DEBUG SESSION
|
|
22
|
-
──────────────────────────────────────────────────────────────
|
|
23
|
-
Tình huống của bạn?
|
|
24
|
-
|
|
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
|
-
──────────────────────────────────────────────────────────────
|
|
30
|
-
Nhập 1 / 2 / 3 / 4:
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
Chờ user chọn, rồi theo path tương ứng bên dưới.
|
|
34
|
-
|
|
35
|
-
---
|
|
36
|
-
|
|
37
|
-
### Path 1 — Đã có error output
|
|
38
|
-
|
|
39
|
-
Hỏi:
|
|
40
|
-
```
|
|
41
|
-
Dán stack trace / error log của bạn bên dưới:
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Chờ input, rồi sang [Stack Trace Analysis](#stack-trace-analysis).
|
|
45
|
-
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
### Path 2 — Cần reproduce trước
|
|
49
|
-
|
|
50
|
-
Hiện lệnh run từ `conventions.service_run` trong `project-context.yaml`:
|
|
51
|
-
|
|
52
|
-
```
|
|
53
|
-
Khởi động service trước:
|
|
54
|
-
|
|
55
|
-
{conventions.service_run}
|
|
56
|
-
|
|
57
|
-
(Nếu dùng Docker: `docker compose up -d`, rồi verify với `docker compose ps`)
|
|
58
|
-
|
|
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
|
-
|
|
64
|
-
Đang chờ error output của bạn...
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
Chờ user dán lỗi, rồi sang [Stack Trace Analysis](#stack-trace-analysis).
|
|
68
|
-
|
|
69
|
-
Nếu `conventions.service_run` chưa set → hiện:
|
|
70
|
-
```
|
|
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
|
-
|
|
74
|
-
conventions:
|
|
75
|
-
service_run: "mvn spring-boot:run" # or: npm run dev / go run . / etc.
|
|
76
|
-
```
|
|
77
|
-
Rồi nhờ user khởi động service thủ công và dán lỗi khi sẵn sàng.
|
|
78
|
-
|
|
79
|
-
---
|
|
80
|
-
|
|
81
|
-
### Path 3 — Test đang fail
|
|
82
|
-
|
|
83
|
-
Hiện lệnh test từ `conventions.test_command` trong `project-context.yaml`:
|
|
84
|
-
|
|
85
|
-
```
|
|
86
|
-
Chạy test của bạn trước:
|
|
87
|
-
|
|
88
|
-
{conventions.test_command}
|
|
89
|
-
|
|
90
|
-
Khi chạy xong, dán full output test fail vào đây.
|
|
91
|
-
|
|
92
|
-
Đang chờ...
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
Chờ user dán output fail, rồi sang [Test Failure Analysis](#test-failure-analysis).
|
|
96
|
-
|
|
97
|
-
Nếu `conventions.test_command` chưa set → hiện:
|
|
98
|
-
```
|
|
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
|
-
|
|
102
|
-
conventions:
|
|
103
|
-
test_command: "mvn test" # or: npm test / go test ./... / etc.
|
|
104
|
-
```
|
|
105
|
-
Rồi nhờ user chạy test thủ công và dán output khi sẵn sàng.
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
### Path 4 — Câu hỏi code
|
|
110
|
-
|
|
111
|
-
Hỏi:
|
|
112
|
-
```
|
|
113
|
-
Mô tả câu hỏi của bạn hoặc dán code snippet bạn đang hỏi:
|
|
114
|
-
```
|
|
115
|
-
|
|
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
|
-
|
|
118
|
-
---
|
|
119
|
-
|
|
120
|
-
## Stack Trace Analysis
|
|
121
|
-
|
|
122
|
-
Đọc từ **dưới lên** — `Caused by:` là root cause thật:
|
|
123
|
-
```
|
|
124
|
-
Caused by: {RealException} ← bắt đầu ở đây
|
|
125
|
-
at {class}.{method}({file}:{line})
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
## Common Error Patterns
|
|
129
|
-
|
|
130
|
-
Dùng `active_module` từ context để chọn bảng liên quan.
|
|
131
|
-
|
|
132
|
-
### Nếu `platform_type = backend`
|
|
133
|
-
|
|
134
|
-
#### java-spring / golang / dotnet / php-laravel
|
|
135
|
-
|
|
136
|
-
| Error | Nguyên nhân khả nghi | Hướng fix |
|
|
137
|
-
|-------|-------------|---------------|
|
|
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
|
-
|
|
149
|
-
#### context-engineering (AI/LLM pipelines)
|
|
150
|
-
|
|
151
|
-
| Error | Nguyên nhân khả nghi | Hướng fix |
|
|
152
|
-
|-------|-------------|---------------|
|
|
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
|
-
|
|
161
|
-
### Nếu `platform_type = web-frontend`
|
|
162
|
-
|
|
163
|
-
| Error | Nguyên nhân khả nghi | Hướng fix |
|
|
164
|
-
|-------|-------------|---------------|
|
|
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
|
-
|
|
177
|
-
#### Flutter
|
|
178
|
-
| Error | Nguyên nhân khả nghi | Hướng fix |
|
|
179
|
-
|-------|-------------|---------------|
|
|
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
|
-
|
|
187
|
-
#### React Native
|
|
188
|
-
| Error | Nguyên nhân khả nghi | Hướng fix |
|
|
189
|
-
|-------|-------------|---------------|
|
|
190
|
-
| `undefined is not an object` | Truy cập prop null | Thêm null check / optional chaining |
|
|
191
|
-
| Metro bundler error | Cache stale | `npx react-native start --reset-cache` |
|
|
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
|
-
|
|
196
|
-
#### iOS / Android
|
|
197
|
-
| Error | Nguyên nhân khả nghi | Hướng fix |
|
|
198
|
-
|-------|-------------|---------------|
|
|
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
|
-
|
|
205
|
-
## Test Failure Analysis
|
|
206
|
-
|
|
207
|
-
```
|
|
208
|
-
Expected: {value}
|
|
209
|
-
Actual : {value}
|
|
210
|
-
at {test}.{method}(line {N})
|
|
211
|
-
```
|
|
212
|
-
1. Gap là gì? 2. Mock setup đúng chưa? 3. Assertion có đúng logic không?
|
|
213
|
-
|
|
214
|
-
---
|
|
215
|
-
|
|
216
|
-
## Output
|
|
217
|
-
|
|
218
|
-
{{include:steps/report-footer.md}}
|
|
219
|
-
|
|
220
|
-
```
|
|
221
|
-
/debug Analysis
|
|
222
|
-
|
|
223
|
-
## Error
|
|
224
|
-
{description}
|
|
225
|
-
|
|
226
|
-
## Root Cause
|
|
227
|
-
{giải thích kỹ thuật}
|
|
228
|
-
|
|
229
|
-
## Location
|
|
230
|
-
File: {path} | Line: {N} | Layer: {Controller/Service/Repository/Test}
|
|
231
|
-
|
|
232
|
-
## Suggested Fix
|
|
233
|
-
{thay đổi code cụ thể}
|
|
234
|
-
|
|
235
|
-
## Related Rule
|
|
236
|
-
Xem CLAUDE.md §{section}
|
|
237
|
-
|
|
238
|
-
## Next Step
|
|
239
|
-
- Để fix hoàn toàn → /fix-bug {TICKET_ID}
|
|
240
|
-
- Chỉ cần phân tích → xong
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
---
|
|
244
|
-
|
|
245
|
-
## Đề xuất ghi Lesson (tuỳ chọn)
|
|
246
|
-
|
|
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
|
-
|
|
250
|
-
```
|
|
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
|
-
```
|
|
253
|
-
|
|
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
|
-
|
|
257
|
-
{{include:steps/capture-lesson.md}}
|