@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.
- package/commands/debug.md +435 -435
- package/commands/debug.tmpl +111 -111
- package/commands/define-product.md +330 -327
- package/commands/define-product.tmpl +50 -47
- package/commands/dev-gen-test.md +364 -364
- package/commands/dev-gen-test.tmpl +63 -63
- package/commands/dev-run-test.md +375 -375
- package/commands/dev-run-test.tmpl +74 -74
- package/commands/dev-smoke-test.md +340 -340
- package/commands/dev-smoke-test.tmpl +60 -60
- package/commands/fix-bug.md +402 -402
- package/commands/fix-bug.tmpl +78 -78
- package/commands/generate-bdd.md +512 -512
- package/commands/generate-bdd.tmpl +211 -211
- package/commands/generate-code.md +480 -482
- package/commands/generate-code.tmpl +179 -181
- package/commands/generate-design-spec.md +495 -495
- package/commands/generate-design-spec.tmpl +219 -219
- package/commands/generate-prd.md +445 -396
- package/commands/generate-prd.tmpl +45 -198
- package/commands/generate-spec-manifest.md +337 -337
- package/commands/generate-spec-manifest.tmpl +57 -57
- package/commands/generate-tech-docs.md +364 -364
- package/commands/generate-tech-docs.tmpl +84 -84
- package/commands/learn.md +346 -346
- package/commands/learn.tmpl +22 -22
- package/commands/map-testids.md +321 -321
- package/commands/map-testids.tmpl +41 -41
- package/commands/propose-scenario.md +334 -334
- package/commands/propose-scenario.tmpl +54 -54
- package/commands/qc-analyze.md +322 -323
- package/commands/qc-analyze.tmpl +42 -43
- package/commands/qc-design-test.md +303 -303
- package/commands/qc-design-test.tmpl +23 -23
- package/commands/qc-plan.md +296 -296
- package/commands/qc-plan.tmpl +16 -16
- package/commands/qc-report.md +301 -301
- package/commands/qc-report.tmpl +21 -21
- package/commands/qc-review.md +297 -297
- package/commands/qc-review.tmpl +17 -17
- package/commands/qc-run-test.md +336 -336
- package/commands/qc-run-test.tmpl +35 -35
- package/commands/refine-prd.md +426 -428
- package/commands/refine-prd.tmpl +61 -61
- package/commands/report-bug.md +350 -350
- package/commands/report-bug.tmpl +70 -70
- package/commands/review-code.md +363 -363
- package/commands/review-code.tmpl +39 -39
- package/commands/review-context.md +577 -579
- package/commands/review-context.tmpl +212 -212
- package/commands/review-tech-docs.md +426 -426
- package/commands/review-tech-docs.tmpl +146 -146
- package/commands/setup-ai-first.md +237 -237
- package/commands/setup-ai-first.tmpl +131 -131
- 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 +379 -379
- package/commands/validate-traces.tmpl +99 -99
- package/core/FRAMEWORK_VERSION +1 -1
- package/core/commands/debug.md +435 -435
- package/core/commands/define-product.md +330 -327
- package/core/commands/dev-gen-test.md +364 -364
- package/core/commands/dev-run-test.md +375 -375
- package/core/commands/dev-smoke-test.md +340 -340
- package/core/commands/fix-bug.md +402 -402
- package/core/commands/generate-bdd.md +512 -512
- package/core/commands/generate-code.md +480 -482
- package/core/commands/generate-design-spec.md +495 -495
- package/core/commands/generate-prd.md +445 -396
- package/core/commands/generate-spec-manifest.md +337 -337
- package/core/commands/generate-tech-docs.md +364 -364
- package/core/commands/learn.md +346 -346
- package/core/commands/map-testids.md +321 -321
- package/core/commands/propose-scenario.md +334 -334
- package/core/commands/qc-analyze.md +322 -323
- package/core/commands/qc-design-test.md +303 -303
- package/core/commands/qc-plan.md +296 -296
- package/core/commands/qc-report.md +301 -301
- package/core/commands/qc-review.md +297 -297
- package/core/commands/qc-run-test.md +336 -336
- package/core/commands/refine-prd.md +426 -428
- package/core/commands/report-bug.md +350 -350
- package/core/commands/review-code.md +363 -363
- package/core/commands/review-context.md +577 -579
- package/core/commands/review-tech-docs.md +426 -426
- package/core/commands/setup-ai-first.md +237 -237
- package/core/commands/sync.md +145 -145
- package/core/commands/update-framework.md +88 -88
- package/core/commands/validate-traces.md +379 -379
- package/core/skills/code/SKILL.md +388 -388
- package/core/skills/debug/SKILL.md +390 -390
- package/core/skills/design-spec/SKILL.md +316 -316
- package/core/skills/discovery/SKILL.md +7 -547
- package/core/skills/prd/SKILL.md +298 -394
- package/core/skills/setup-ai-first/SKILL.md +79 -79
- package/core/skills/spec/SKILL.md +176 -176
- package/core/skills/test/SKILL.md +602 -602
- package/core/steps/capture-lesson.md +44 -44
- package/core/steps/context-loader.md +174 -174
- 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 +106 -231
- package/core/templates/product-definition.template.md +101 -88
- package/docs/04-operations/publishing.md +20 -3
- package/package.json +1 -1
- package/skills/code/SKILL.md +388 -388
- package/skills/code/SKILL.tmpl +56 -56
- package/skills/debug/SKILL.md +390 -390
- package/skills/debug/SKILL.tmpl +60 -60
- package/skills/design-spec/SKILL.md +316 -316
- package/skills/design-spec/SKILL.tmpl +36 -36
- 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 +79 -79
- package/skills/setup-ai-first/SKILL.tmpl +27 -27
- package/skills/spec/SKILL.md +176 -176
- package/skills/spec/SKILL.tmpl +18 -18
- package/skills/test/SKILL.md +602 -602
- package/skills/test/SKILL.tmpl +44 -44
- package/steps/capture-lesson.md +44 -44
- package/steps/context-loader.md +174 -174
- 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 +106 -231
- package/templates/product-definition.template.md +101 -88
package/commands/fix-bug.tmpl
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
# /fix-bug —
|
|
1
|
+
# /fix-bug — Workflow Fix Bug đầy đủ
|
|
2
2
|
|
|
3
3
|
## Gate
|
|
4
4
|
{{include:steps/gate.md}}
|
|
5
5
|
|
|
6
|
-
*
|
|
6
|
+
*Lưu ý: Với lệnh này, target ở Bước 1 là một ticket ID (vd `PROJ-123`), một **bug đã file `{BUG-ID}`** (một `{paths.bug_reports_dir}/{BUG-ID}.md` từ `/report-bug` — vd một QC product-gap), hoặc một mô tả bug từ `$ARGUMENTS`. Nếu cho `{BUG-ID}`, phân giải & đọc report đó để lấy spec context; ngược lại tiếp tục sang context loading.*
|
|
7
7
|
|
|
8
8
|
## Context
|
|
9
9
|
{{include:steps/context-loader.md}}
|
|
@@ -11,69 +11,69 @@
|
|
|
11
11
|
---
|
|
12
12
|
|
|
13
13
|
## Phase 1 — Gather Info
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
1.
|
|
18
|
-
2.
|
|
14
|
+
Nếu cho `{BUG-ID}`: đọc `{paths.bug_reports_dir}/{BUG-ID}.md` để lấy spec context, AC bị vi phạm, expected-vs-actual, và layer gợi ý — dùng làm chi tiết bug (không cần hỏi lại).
|
|
15
|
+
Nếu ticket: fetch chi tiết (hoặc nhờ user dán).
|
|
16
|
+
Nếu không có ticket / BUG-ID — CHECKPOINT:
|
|
17
|
+
1. Bug xảy ra ở đâu? (module, endpoint, flow)
|
|
18
|
+
2. Các bước tái hiện?
|
|
19
19
|
3. Expected vs Actual?
|
|
20
20
|
4. Error log / stack trace?
|
|
21
21
|
|
|
22
22
|
## Phase 2 — Root Cause Analysis
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
Dùng `active_module` từ context để chọn bảng liên quan.
|
|
25
25
|
|
|
26
|
-
###
|
|
26
|
+
### Nếu `platform_type = backend`
|
|
27
27
|
|
|
28
28
|
#### java-spring / golang / dotnet / php-laravel
|
|
29
29
|
|
|
30
|
-
| Bug Type |
|
|
30
|
+
| Bug Type | Vị trí thường gặp | Cách kiểm tra |
|
|
31
31
|
|----------|----------------|--------------|
|
|
32
|
-
| Wrong response data | Mapping layer |
|
|
33
|
-
| 400 Bad Request | Input validation |
|
|
34
|
-
| 401 Unauthorized | Auth filter |
|
|
35
|
-
| 403 Forbidden | Auth config |
|
|
36
|
-
| 404 Not Found | Repository query |
|
|
37
|
-
| N+1 Query | Data access |
|
|
38
|
-
| Null Pointer | Optional
|
|
39
|
-
| Transaction rollback |
|
|
40
|
-
| Stale cache |
|
|
41
|
-
| Type mismatch | Filter / specification |
|
|
32
|
+
| Wrong response data | Mapping layer | Kiểm tra field mapping, DTO conversion |
|
|
33
|
+
| 400 Bad Request | Input validation | Kiểm tra DTO constraint / validator |
|
|
34
|
+
| 401 Unauthorized | Auth filter | Kiểm tra token config, thứ tự filter |
|
|
35
|
+
| 403 Forbidden | Auth config | Kiểm tra rule role-based access |
|
|
36
|
+
| 404 Not Found | Repository query | Kiểm tra find method, kiểu ID |
|
|
37
|
+
| N+1 Query | Data access | Kiểm tra thiếu JOIN FETCH / eager load |
|
|
38
|
+
| Null Pointer | Optional chưa xử lý | Kiểm tra Optional.orElseThrow, null guard |
|
|
39
|
+
| Transaction rollback | Thiếu @Transactional | Kiểm tra transaction scope, propagation |
|
|
40
|
+
| Stale cache | Thiếu eviction | Kiểm tra trigger cache invalidation |
|
|
41
|
+
| Type mismatch | Filter / specification | Kiểm tra kiểu field trong predicate |
|
|
42
42
|
|
|
43
43
|
#### context-engineering (AI/LLM pipelines)
|
|
44
44
|
|
|
45
|
-
| Bug Type |
|
|
45
|
+
| Bug Type | Vị trí thường gặp | Cách kiểm tra |
|
|
46
46
|
|----------|----------------|--------------|
|
|
47
|
-
| Wrong pipeline output | Prompt template |
|
|
48
|
-
| Missing context in output | Context assembly | Verify
|
|
49
|
-
| Schema validation failure | Output parser |
|
|
50
|
-
| Flaky / non-deterministic results | LLM temperature |
|
|
51
|
-
| API rate limit errors | LLM client | Implement backoff;
|
|
52
|
-
| Token limit exceeded | Prompt assembly |
|
|
47
|
+
| Wrong pipeline output | Prompt template | Kiểm tra nội dung prompt; verify biến được substitute đúng |
|
|
48
|
+
| Missing context in output | Context assembly | Verify mọi context block bắt buộc có mặt và không rỗng |
|
|
49
|
+
| Schema validation failure | Output parser | So raw LLM output vs schema kỳ vọng; thêm output instruction chặt hơn |
|
|
50
|
+
| Flaky / non-deterministic results | LLM temperature | Kiểm tra temperature; dùng fixed seed/mock trong test |
|
|
51
|
+
| API rate limit errors | LLM client | Implement backoff; kiểm tra quota trên dashboard provider |
|
|
52
|
+
| Token limit exceeded | Prompt assembly | Giảm kích thước context; thêm chiến lược chunking |
|
|
53
53
|
|
|
54
|
-
###
|
|
54
|
+
### Nếu `platform_type = web-frontend`
|
|
55
55
|
|
|
56
|
-
| Bug Type |
|
|
56
|
+
| Bug Type | Vị trí thường gặp | Cách kiểm tra |
|
|
57
57
|
|----------|----------------|--------------|
|
|
58
|
-
| Wrong data displayed | State / store |
|
|
59
|
-
| UI not re-rendering |
|
|
60
|
-
| API data not loading | HTTP client / hook |
|
|
61
|
-
| 401 on API call | Auth token |
|
|
62
|
-
| Form not submitting | Validation / handler |
|
|
63
|
-
| Route not found | Router config |
|
|
64
|
-
| Build / type error | TypeScript types |
|
|
58
|
+
| Wrong data displayed | State / store | Kiểm tra logic update state, selector |
|
|
59
|
+
| UI not re-rendering | Thiếu reactive dep | Kiểm tra deps array, state immutability |
|
|
60
|
+
| API data not loading | HTTP client / hook | Kiểm tra network tab, error handler |
|
|
61
|
+
| 401 on API call | Auth token | Kiểm tra token refresh, header injection |
|
|
62
|
+
| Form not submitting | Validation / handler | Kiểm tra form state, field bắt buộc, error |
|
|
63
|
+
| Route not found | Router config | Kiểm tra route definition, lazy import |
|
|
64
|
+
| Build / type error | TypeScript types | So type definition vs shape API thực tế |
|
|
65
65
|
|
|
66
|
-
###
|
|
66
|
+
### Nếu `platform_type = mobile`
|
|
67
67
|
|
|
68
|
-
| Bug Type |
|
|
68
|
+
| Bug Type | Vị trí thường gặp | Cách kiểm tra |
|
|
69
69
|
|----------|----------------|--------------|
|
|
70
|
-
| Screen shows stale data | State / BLoC / ViewModel |
|
|
71
|
-
| Crash on navigation |
|
|
72
|
-
| API call not firing | Repository / service layer |
|
|
73
|
-
| UI not reflecting state | Widget
|
|
74
|
-
| Crash on app resume | Lifecycle handler |
|
|
75
|
-
| Auth token expired | Token refresh logic |
|
|
76
|
-
| Permission denied | OS permission |
|
|
70
|
+
| Screen shows stale data | State / BLoC / ViewModel | Kiểm tra event dispatch, state emit đúng |
|
|
71
|
+
| Crash on navigation | Thiếu route param | Kiểm tra param truyền, null safety |
|
|
72
|
+
| API call not firing | Repository / service layer | Thêm log trong repo method, kiểm tra network |
|
|
73
|
+
| UI not reflecting state | Widget không observe stream | Kiểm tra setup `BlocBuilder` / `StateObserver` |
|
|
74
|
+
| Crash on app resume | Lifecycle handler | Kiểm tra logic `onResume` / `viewDidAppear` |
|
|
75
|
+
| Auth token expired | Token refresh logic | Kiểm tra refresh flow, token storage |
|
|
76
|
+
| Permission denied | OS permission | Kiểm tra code request runtime permission |
|
|
77
77
|
|
|
78
78
|
CHECKPOINT — Root Cause Report:
|
|
79
79
|
```
|
|
@@ -87,13 +87,13 @@ Proceed? (Y/N)
|
|
|
87
87
|
|
|
88
88
|
## Phase 3 — Fix
|
|
89
89
|
|
|
90
|
-
*Umbrella mode:
|
|
90
|
+
*Umbrella mode: code lỗi sống trong **service submodule** phân giải ở context-loader Bước 1.6 — tạo branch và chạy mọi bước git/build từ **trong** `{service_root}`. Single-service: bỏ `cd`.*
|
|
91
91
|
|
|
92
92
|
```bash
|
|
93
93
|
cd {service_root} # umbrella: the service submodule; single-service: omit
|
|
94
94
|
git checkout -b fix/{TICKET_ID}-{description}
|
|
95
95
|
```
|
|
96
|
-
|
|
96
|
+
Áp dụng fix. Thêm trace annotation nếu file có `@trace.implements`:
|
|
97
97
|
```
|
|
98
98
|
@trace.fixes={TICKET_ID}
|
|
99
99
|
@trace.root_cause={brief description}
|
|
@@ -105,53 +105,53 @@ Apply fix. Add trace annotation if file has `@trace.implements`:
|
|
|
105
105
|
// @trace.regression={TICKET_ID}
|
|
106
106
|
Test: "Regression {TICKET_ID}: {bug description}"
|
|
107
107
|
```
|
|
108
|
-
|
|
108
|
+
Chạy test. Nếu fail → debug và fix (tối đa 3 vòng).
|
|
109
109
|
|
|
110
|
-
## Phase 5 — Build & Commit (2
|
|
110
|
+
## Phase 5 — Build & Commit (push 2 tầng ở umbrella mode)
|
|
111
111
|
```bash
|
|
112
|
-
{conventions.build_command} #
|
|
113
|
-
# Tầng 1 — push
|
|
112
|
+
{conventions.build_command} # tối đa 3 retry — chạy trong {service_root} ở umbrella mode
|
|
113
|
+
# Tầng 1 — push fix branch trong service submodule (nơi code sống):
|
|
114
114
|
git add {files}
|
|
115
115
|
git commit -m "fix({TICKET_ID}): {description}"
|
|
116
|
-
git push -u origin fix/{TICKET_ID}-{slug} #
|
|
116
|
+
git push -u origin fix/{TICKET_ID}-{slug} # rồi mở PR vào branch được track của service
|
|
117
117
|
```
|
|
118
|
-
> **Umbrella mode — Tầng 2 (bump umbrella pointer):**
|
|
119
|
-
> submodule,
|
|
120
|
-
>
|
|
118
|
+
> **Umbrella mode — Tầng 2 (bump umbrella pointer):** umbrella ghi một *commit* của service
|
|
119
|
+
> submodule, không phải branch. Sau khi PR fix-branch **merge** vào branch được track của service, bump
|
|
120
|
+
> pointer để đồng đội pull umbrella không gặp "commit not found":
|
|
121
121
|
> ```bash
|
|
122
122
|
> cd - # back to umbrella root
|
|
123
123
|
> git add {service_root} && git commit -m "chore: bump {service_root} pointer (fix {TICKET_ID})"
|
|
124
124
|
> git push
|
|
125
125
|
> ```
|
|
126
|
-
> Single-service mode:
|
|
126
|
+
> Single-service mode: không có umbrella pointer — Tầng 1 là toàn bộ push. Quy tắc đầy đủ: Sync & Update §4.4 (commit 2 tầng).
|
|
127
127
|
|
|
128
|
-
## Phase 5.5 —
|
|
128
|
+
## Phase 5.5 — Đóng bug report (nếu fix một `{BUG-ID}` đã file)
|
|
129
129
|
|
|
130
|
-
*
|
|
130
|
+
*Bỏ qua nếu target là ticket/mô tả thường (không có file `{BUG-ID}`).*
|
|
131
131
|
|
|
132
|
-
|
|
133
|
-
- Set `State` → `🟡 Fixed`
|
|
134
|
-
-
|
|
135
|
-
|
|
136
|
-
- Commit
|
|
137
|
-
"waiting-on"
|
|
132
|
+
Sau khi fix được commit, cập nhật `{paths.bug_reports_dir}/{BUG-ID}.md`:
|
|
133
|
+
- Set `State` → `🟡 Fixed` và thêm một **Resolution** ngắn (root cause + link commit/PR).
|
|
134
|
+
- Nó **chưa** `Closed` — QC sở hữu verification: khi `/qc-run-test` chạy lại và `qc_status`
|
|
135
|
+
của SC liên kết flip thành `pass`, nó thành `🟢 Closed` (và `qc_owner`/`qc_blocked_by` clear).
|
|
136
|
+
- Commit report đã cập nhật vào spec repo (cùng push 2 tầng như `/report-bug`) để view
|
|
137
|
+
"waiting-on" của PO/PM phản ánh nó trên `/sync`.
|
|
138
138
|
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
Đây là lần ghi duy nhất `/fix-bug` làm tới khu feedback — nó vẫn chỉ fix **code**,
|
|
140
|
+
không bao giờ sửa PRD/BDD (thay đổi spec là việc PO/Dev theo BUG_FLOW Case 2–4).
|
|
141
141
|
|
|
142
|
-
## Phase 6 —
|
|
142
|
+
## Phase 6 — Đề xuất ghi Lesson (tuỳ chọn)
|
|
143
143
|
|
|
144
|
-
|
|
145
|
-
(
|
|
146
|
-
|
|
144
|
+
Nếu root cause là một **lỗi AI gây ra khi sinh và có thể lặp lại**
|
|
145
|
+
(vd nó sinh code skip layer, thiếu null guard, dùng sai pattern —
|
|
146
|
+
KHÔNG phải nguyên nhân bên ngoài như outage third-party hay input data sai), hỏi:
|
|
147
147
|
|
|
148
148
|
```
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
Root cause này trông như một lỗi AI lặp lại.
|
|
150
|
+
Ghi nó thành project lesson để không bị sinh lại? (Y/N)
|
|
151
151
|
```
|
|
152
152
|
|
|
153
|
-
|
|
154
|
-
`category` (
|
|
153
|
+
Nếu `Y` → chạy quy trình capture bên dưới với `source=/fix-bug {TICKET_ID}`, một
|
|
154
|
+
`category` phù hợp (thường `code-gen`), và `scope` = domain hoặc file glob bị ảnh hưởng.
|
|
155
155
|
|
|
156
156
|
{{include:steps/capture-lesson.md}}
|
|
157
157
|
|
|
@@ -160,12 +160,12 @@ If `Y` → run the capture procedure below with `source=/fix-bug {TICKET_ID}`, a
|
|
|
160
160
|
{{include:steps/report-footer.md}}
|
|
161
161
|
|
|
162
162
|
```
|
|
163
|
-
/fix-bug
|
|
163
|
+
/fix-bug Hoàn tất — {TICKET_ID}
|
|
164
164
|
Root Cause: {analysis}
|
|
165
165
|
Changes: {list}
|
|
166
166
|
✅ Regression test added | ✅ Build: SUCCESS
|
|
167
|
-
{🐞 BUG-{id} → State: Fixed (pushed) — Closed
|
|
168
|
-
{📝 Lesson L-NNN recorded (
|
|
167
|
+
{🐞 BUG-{id} → State: Fixed (pushed) — Closed sau khi /qc-run-test re-verify pass | nếu fix một bug đã file}
|
|
168
|
+
{📝 Lesson L-NNN recorded (nếu đã capture)}
|
|
169
169
|
Branch: fix/{TICKET_ID}-{slug}
|
|
170
|
-
Next:
|
|
170
|
+
Next: Tạo PR và link tới ticket. {QC: chạy lại /qc-run-test {UC-ID} để verify + đóng bug | nếu áp dụng}
|
|
171
171
|
```
|