@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/skills/debug/SKILL.tmpl
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Fix bug với full workflow (branch, test, commit), phân tích debug nhanh các lỗi hoặc hành vi bất ngờ, hoặc kiểm chứng độ phủ traceability giữa spec và code. Trigger when: "/fix-bug", "/debug", "/validate-traces", "fix bug", "sửa bug", "debug lỗi", "phân tích lỗi", "tại sao lỗi này", "validate traces", "kiểm tra traceability", "coverage matrix", "trace drift".
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# Debug & Quality Skills — Fix Bug, Debug, Validate Traces
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Skill này xử lý: `/fix-bug` (full bug fix workflow), `/debug` (phân tích nhanh), và `/validate-traces` (check độ phủ traceability).
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -12,42 +12,42 @@ This skill handles: `/fix-bug` (full bug fix workflow), `/debug` (quick analysis
|
|
|
12
12
|
|
|
13
13
|
### Input
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Nhận: ticket ID (vd `PROJ-123`) hoặc một mô tả bug trực tiếp.
|
|
16
16
|
|
|
17
17
|
### Phase 1 — Gather Information
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
- Fetch ticket
|
|
21
|
-
-
|
|
19
|
+
Nếu cho ticket ID:
|
|
20
|
+
- Fetch chi tiết ticket nếu Jira/issue tracker được kết nối
|
|
21
|
+
- Ngược lại nhờ user dán: title, các bước tái hiện, expected vs actual
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
**CHECKPOINT** —
|
|
25
|
-
1.
|
|
26
|
-
2.
|
|
23
|
+
Nếu không có ticket:
|
|
24
|
+
**CHECKPOINT** — Hỏi:
|
|
25
|
+
1. Bug xảy ra ở đâu? (service, endpoint, flow)
|
|
26
|
+
2. Các bước tái hiện?
|
|
27
27
|
3. Expected vs Actual behavior?
|
|
28
|
-
4. Error log / stack trace (
|
|
28
|
+
4. Error log / stack trace (nếu có)?
|
|
29
29
|
|
|
30
30
|
### Phase 2 — Root Cause Analysis
|
|
31
31
|
|
|
32
32
|
{{include:steps/context-loader.md}}
|
|
33
33
|
|
|
34
|
-
Trace
|
|
35
|
-
1.
|
|
36
|
-
2.
|
|
37
|
-
3.
|
|
34
|
+
Trace qua các layer (từ kiến trúc CLAUDE.md):
|
|
35
|
+
1. Xác định service/module từ endpoint/feature đang lỗi
|
|
36
|
+
2. Đọc các file code liên quan, từng layer
|
|
37
|
+
3. Đối chiếu với các bug pattern thường gặp:
|
|
38
38
|
|
|
39
|
-
| Bug Type |
|
|
39
|
+
| Bug Type | Vị trí thường gặp | Cách kiểm tra |
|
|
40
40
|
|----------|----------------|--------------|
|
|
41
|
-
| Wrong response data | Data mapping layer |
|
|
42
|
-
| 400 Bad Request | Input validation |
|
|
43
|
-
| 403 Forbidden | Auth configuration |
|
|
44
|
-
| 404 Not Found | Repository query |
|
|
45
|
-
| Slow query / N+1 | Data access layer |
|
|
46
|
-
| Null Pointer |
|
|
47
|
-
| Transaction rollback |
|
|
48
|
-
| Stale cache |
|
|
49
|
-
| Type mismatch in query |
|
|
50
|
-
| Cross-service timeout |
|
|
41
|
+
| Wrong response data | Data mapping layer | Kiểm tra field mapping, DTO conversion |
|
|
42
|
+
| 400 Bad Request | Input validation | Kiểm tra DTO constraint, field bắt buộc |
|
|
43
|
+
| 403 Forbidden | Auth configuration | Kiểm tra rule role-based access |
|
|
44
|
+
| 404 Not Found | Repository query | Kiểm tra find method, kiểu ID |
|
|
45
|
+
| Slow query / N+1 | Data access layer | Kiểm tra thiếu JOIN FETCH hoặc batch loading |
|
|
46
|
+
| Null Pointer | Thiếu null check, Optional chưa xử lý | Kiểm tra dùng Optional.orElseThrow |
|
|
47
|
+
| Transaction rollback | Thiếu/sai transaction scope | Kiểm tra @Transactional trên service method |
|
|
48
|
+
| Stale cache | Thiếu cache eviction sau write | Kiểm tra cache invalidation khi write |
|
|
49
|
+
| Type mismatch in query | Code filter/specification | Kiểm tra kiểu field trong query predicate |
|
|
50
|
+
| Cross-service timeout | Lời gọi external service | Kiểm tra URL config, hành vi fallback |
|
|
51
51
|
|
|
52
52
|
**CHECKPOINT — Root Cause Report:**
|
|
53
53
|
|
|
@@ -69,7 +69,7 @@ Regression risk: Low / Medium / High
|
|
|
69
69
|
Proceed with fix? (Y/N)
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
Chờ user xác nhận.
|
|
73
73
|
|
|
74
74
|
### Phase 3 — Implement Fix
|
|
75
75
|
|
|
@@ -77,9 +77,9 @@ Wait for user confirmation.
|
|
|
77
77
|
git checkout -b fix/{TICKET_ID}-{short-description}
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
Áp dụng fix đúng như đã phân tích. Theo coding standards CLAUDE.md — đừng đưa thêm vi phạm mới.
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
Thêm annotation traceability nếu file có `@trace.implements`:
|
|
83
83
|
```
|
|
84
84
|
// @trace.implements={UC-ID}-SC{N}
|
|
85
85
|
// @trace.fixes={TICKET_ID}
|
|
@@ -88,7 +88,7 @@ Add traceability annotation if the file has `@trace.implements`:
|
|
|
88
88
|
|
|
89
89
|
### Phase 4 — Regression Test
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
Sinh một regression test nếu chưa có:
|
|
92
92
|
```
|
|
93
93
|
// @trace.verifies={UC-ID}
|
|
94
94
|
// @trace.regression={TICKET_ID}
|
|
@@ -97,9 +97,9 @@ Test: "Regression {TICKET_ID}: {bug description}"
|
|
|
97
97
|
→ Assert the fix works correctly
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
Chạy test: `{TEST_COMMAND_FOR_CLASS}`
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
Nếu test fail → debug và fix (tối đa 3 vòng).
|
|
103
103
|
|
|
104
104
|
### Phase 5 — Build Verify
|
|
105
105
|
|
|
@@ -140,21 +140,21 @@ fix/{TICKET_ID}-{slug}
|
|
|
140
140
|
|
|
141
141
|
## /debug — Quick Debug Analysis
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
Dùng khi: IDE hiện lỗi, test fail bất ngờ, hành vi lạ, hoặc bạn cần hiểu vì sao code làm gì đó.
|
|
144
144
|
|
|
145
|
-
**
|
|
145
|
+
**Khác `/fix-bug`**: Đây chỉ là phân tích, không full workflow, không cần ticket.
|
|
146
146
|
|
|
147
147
|
### Input
|
|
148
148
|
|
|
149
|
-
|
|
149
|
+
Dán một trong:
|
|
150
150
|
1. Stack trace / error log
|
|
151
|
-
2.
|
|
152
|
-
3. File path +
|
|
153
|
-
4.
|
|
151
|
+
2. Output test fail
|
|
152
|
+
3. File path + mô tả hành vi bất ngờ
|
|
153
|
+
4. Một câu hỏi cụ thể về code snippet
|
|
154
154
|
|
|
155
155
|
### Stack Trace Analysis
|
|
156
156
|
|
|
157
|
-
|
|
157
|
+
Đọc stack trace từ **dưới lên** — dòng `Caused by:` là root cause thật.
|
|
158
158
|
|
|
159
159
|
```
|
|
160
160
|
Caused by: {RealException} ← start here
|
|
@@ -165,18 +165,18 @@ Caused by: {RealException} ← start here
|
|
|
165
165
|
|
|
166
166
|
### Common Error Patterns
|
|
167
167
|
|
|
168
|
-
| Error |
|
|
168
|
+
| Error | Nguyên nhân khả nghi | Hướng fix |
|
|
169
169
|
|-------|-------------|---------------|
|
|
170
|
-
| NullPointerException |
|
|
171
|
-
| ClassCastException |
|
|
172
|
-
| OutOfMemoryError |
|
|
173
|
-
| StackOverflowError |
|
|
174
|
-
| Connection refused | Dependency service
|
|
175
|
-
| Authentication/401 | Token
|
|
176
|
-
| Permission denied/403 |
|
|
177
|
-
| Database constraint violation |
|
|
178
|
-
| Serialization error | Circular reference,
|
|
179
|
-
| Test assertion mismatch |
|
|
170
|
+
| NullPointerException | Truy cập field trên object null; Optional chưa xử lý | Kiểm tra Optional.orElseThrow, null guard |
|
|
171
|
+
| ClassCastException | Giả định sai kiểu; dùng generic không đúng | Kiểm tra type ở điểm assignment/return |
|
|
172
|
+
| OutOfMemoryError | Load quá nhiều data; memory leak | Thêm pagination, kiểm tra kích thước collection |
|
|
173
|
+
| StackOverflowError | Đệ quy vô hạn | Tìm recursive call không có base case |
|
|
174
|
+
| Connection refused | Dependency service chưa chạy | Kiểm tra config URL, khởi động service phụ thuộc |
|
|
175
|
+
| Authentication/401 | Token hết hạn, sai config, thiếu header | Verify token, kiểm tra auth config |
|
|
176
|
+
| Permission denied/403 | Sai role trong request hoặc access rule cấu hình sai | Kiểm tra auth annotation và role config |
|
|
177
|
+
| Database constraint violation | Trùng key, thiếu FK, null trong cột NOT NULL | Kiểm tra data và định nghĩa constraint |
|
|
178
|
+
| Serialization error | Circular reference, field chưa map | Kiểm tra config DTO/mapper |
|
|
179
|
+
| Test assertion mismatch | Sai mock setup hoặc sai giá trị expected | Đọc lại mock setup và logic assertion |
|
|
180
180
|
|
|
181
181
|
### Test Failure Analysis
|
|
182
182
|
|
|
@@ -186,10 +186,10 @@ Actual : {actual value}
|
|
|
186
186
|
at {test class}.{method}(line {N})
|
|
187
187
|
```
|
|
188
188
|
|
|
189
|
-
1.
|
|
190
|
-
2. Trace
|
|
191
|
-
3.
|
|
192
|
-
4.
|
|
189
|
+
1. Gap giữa Expected và Actual là gì?
|
|
190
|
+
2. Trace tới đúng dòng test
|
|
191
|
+
3. Mock setup đúng chưa? (`given(...).willReturn(...)`)
|
|
192
|
+
4. Assertion có đúng logic không?
|
|
193
193
|
|
|
194
194
|
### Output
|
|
195
195
|
|
|
@@ -224,18 +224,18 @@ See CLAUDE.md §{section} — {section name}
|
|
|
224
224
|
|
|
225
225
|
## /validate-traces — Traceability Coverage Matrix
|
|
226
226
|
|
|
227
|
-
|
|
227
|
+
Check read-only độ phủ giữa spec, code, và test.
|
|
228
228
|
|
|
229
229
|
### Input
|
|
230
230
|
|
|
231
|
-
|
|
231
|
+
Nhận: tên domain hoặc UC-ID cụ thể.
|
|
232
232
|
|
|
233
233
|
### Process
|
|
234
234
|
|
|
235
|
-
1.
|
|
236
|
-
2. **
|
|
237
|
-
3. **
|
|
238
|
-
4.
|
|
235
|
+
1. **Đọc file .feature** → gom tất cả SC-ID cho domain/UC
|
|
236
|
+
2. **Quét file controller** → tìm tag `@trace.implements`
|
|
237
|
+
3. **Quét file test** → tìm tag `@trace.verifies`
|
|
238
|
+
4. **Đọc `.trace/{domain}/{prd-slug}/{UC-ID}.tsv`** → check drift (text scenario đổi từ lần gen code trước)
|
|
239
239
|
|
|
240
240
|
### Output
|
|
241
241
|
|