@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.
Files changed (162) hide show
  1. package/bin/index.js +12 -1
  2. package/commands/debug.md +436 -436
  3. package/commands/debug.tmpl +111 -111
  4. package/commands/define-product.md +350 -345
  5. package/commands/define-product.tmpl +69 -64
  6. package/commands/dev-gen-test.md +365 -365
  7. package/commands/dev-gen-test.tmpl +63 -63
  8. package/commands/dev-run-test.md +376 -376
  9. package/commands/dev-run-test.tmpl +74 -74
  10. package/commands/dev-smoke-test.md +341 -341
  11. package/commands/dev-smoke-test.tmpl +60 -60
  12. package/commands/fix-bug.md +403 -403
  13. package/commands/fix-bug.tmpl +78 -78
  14. package/commands/generate-bdd.md +513 -513
  15. package/commands/generate-bdd.tmpl +211 -211
  16. package/commands/generate-code.md +481 -483
  17. package/commands/generate-code.tmpl +179 -181
  18. package/commands/generate-design-spec.md +497 -497
  19. package/commands/generate-design-spec.tmpl +220 -220
  20. package/commands/generate-prd.md +452 -400
  21. package/commands/generate-prd.tmpl +50 -200
  22. package/commands/generate-spec-manifest.md +340 -340
  23. package/commands/generate-spec-manifest.tmpl +59 -59
  24. package/commands/generate-tech-docs.md +365 -365
  25. package/commands/generate-tech-docs.tmpl +84 -84
  26. package/commands/learn.md +347 -347
  27. package/commands/learn.tmpl +22 -22
  28. package/commands/map-testids.md +322 -322
  29. package/commands/map-testids.tmpl +41 -41
  30. package/commands/propose-scenario.md +335 -335
  31. package/commands/propose-scenario.tmpl +54 -54
  32. package/commands/qc-analyze.md +323 -324
  33. package/commands/qc-analyze.tmpl +42 -43
  34. package/commands/qc-design-test.md +304 -304
  35. package/commands/qc-design-test.tmpl +23 -23
  36. package/commands/qc-plan.md +297 -297
  37. package/commands/qc-plan.tmpl +16 -16
  38. package/commands/qc-report.md +302 -302
  39. package/commands/qc-report.tmpl +21 -21
  40. package/commands/qc-review.md +298 -298
  41. package/commands/qc-review.tmpl +17 -17
  42. package/commands/qc-run-test.md +337 -337
  43. package/commands/qc-run-test.tmpl +35 -35
  44. package/commands/refine-prd.md +428 -430
  45. package/commands/refine-prd.tmpl +62 -62
  46. package/commands/report-bug.md +351 -351
  47. package/commands/report-bug.tmpl +70 -70
  48. package/commands/review-code.md +364 -364
  49. package/commands/review-code.tmpl +39 -39
  50. package/commands/review-context.md +578 -580
  51. package/commands/review-context.tmpl +212 -212
  52. package/commands/review-tech-docs.md +427 -427
  53. package/commands/review-tech-docs.tmpl +146 -146
  54. package/commands/setup-ai-first.md +239 -239
  55. package/commands/setup-ai-first.tmpl +133 -133
  56. package/commands/sync.md +145 -145
  57. package/commands/sync.tmpl +93 -93
  58. package/commands/update-framework.md +88 -88
  59. package/commands/update-framework.tmpl +36 -36
  60. package/commands/validate-traces.md +381 -381
  61. package/commands/validate-traces.tmpl +100 -100
  62. package/core/FRAMEWORK_VERSION +1 -1
  63. package/core/commands/debug.md +436 -436
  64. package/core/commands/define-product.md +350 -345
  65. package/core/commands/dev-gen-test.md +365 -365
  66. package/core/commands/dev-run-test.md +376 -376
  67. package/core/commands/dev-smoke-test.md +341 -341
  68. package/core/commands/fix-bug.md +403 -403
  69. package/core/commands/generate-bdd.md +513 -513
  70. package/core/commands/generate-code.md +481 -483
  71. package/core/commands/generate-design-spec.md +497 -497
  72. package/core/commands/generate-prd.md +452 -400
  73. package/core/commands/generate-spec-manifest.md +340 -340
  74. package/core/commands/generate-tech-docs.md +365 -365
  75. package/core/commands/learn.md +347 -347
  76. package/core/commands/map-testids.md +322 -322
  77. package/core/commands/propose-scenario.md +335 -335
  78. package/core/commands/qc-analyze.md +323 -324
  79. package/core/commands/qc-design-test.md +304 -304
  80. package/core/commands/qc-plan.md +297 -297
  81. package/core/commands/qc-report.md +302 -302
  82. package/core/commands/qc-review.md +298 -298
  83. package/core/commands/qc-run-test.md +337 -337
  84. package/core/commands/refine-prd.md +428 -430
  85. package/core/commands/report-bug.md +351 -351
  86. package/core/commands/review-code.md +364 -364
  87. package/core/commands/review-context.md +578 -580
  88. package/core/commands/review-tech-docs.md +427 -427
  89. package/core/commands/setup-ai-first.md +239 -239
  90. package/core/commands/sync.md +145 -145
  91. package/core/commands/update-framework.md +88 -88
  92. package/core/commands/validate-traces.md +381 -381
  93. package/core/skills/code/SKILL.md +389 -389
  94. package/core/skills/debug/SKILL.md +391 -391
  95. package/core/skills/design-spec/SKILL.md +318 -318
  96. package/core/skills/discovery/SKILL.md +7 -547
  97. package/core/skills/prd/SKILL.md +298 -394
  98. package/core/skills/setup-ai-first/SKILL.md +80 -80
  99. package/core/skills/spec/SKILL.md +178 -178
  100. package/core/skills/test/SKILL.md +604 -604
  101. package/core/steps/capture-lesson.md +44 -44
  102. package/core/steps/context-loader.md +175 -175
  103. package/core/steps/gate.md +54 -54
  104. package/core/steps/report-footer.md +52 -52
  105. package/core/steps/review-fanout.md +85 -87
  106. package/core/steps/spawn-agent.md +45 -45
  107. package/core/steps/trace-mirror.md +21 -21
  108. package/core/templates/architecture.template.md +37 -37
  109. package/core/templates/design-spec.template.md +77 -77
  110. package/core/templates/platform-guide.template.md +47 -47
  111. package/core/templates/prd.template.md +107 -232
  112. package/core/templates/product-definition.template.md +101 -88
  113. package/core/templates/project-context.yaml +2 -2
  114. package/docs/01-getting-started/core-concepts.md +1 -1
  115. package/docs/01-getting-started/quickstart.md +7 -7
  116. package/docs/02-guides/developer/bdd-and-trace.md +1 -1
  117. package/docs/02-guides/developer/scenarios.md +5 -5
  118. package/docs/02-guides/product-owner/handoff-checklist.md +1 -1
  119. package/docs/02-guides/product-owner/scenarios.md +23 -23
  120. package/docs/02-guides/tester/bug-reporting.md +2 -2
  121. package/docs/02-guides/tester/reading-specs.md +2 -2
  122. package/docs/02-guides/tester/scenarios.md +1 -1
  123. package/docs/02-guides/tester/spec-manifest.md +3 -3
  124. package/docs/02-guides/tester/workflow.md +1 -1
  125. package/docs/03-concepts/architecture.md +3 -3
  126. package/docs/03-concepts/pipeline.md +3 -3
  127. package/docs/04-operations/publishing.md +20 -3
  128. package/docs/04-operations/sync-and-update.md +5 -5
  129. package/docs/05-reference/command-cheatsheet.md +2 -2
  130. package/docs/05-reference/commands.md +8 -8
  131. package/package.json +1 -1
  132. package/scripts/migrate-specs.js +5 -3
  133. package/scripts/rename-prd-files.js +174 -0
  134. package/skills/code/SKILL.md +389 -389
  135. package/skills/code/SKILL.tmpl +56 -56
  136. package/skills/debug/SKILL.md +391 -391
  137. package/skills/debug/SKILL.tmpl +60 -60
  138. package/skills/design-spec/SKILL.md +318 -318
  139. package/skills/design-spec/SKILL.tmpl +37 -37
  140. package/skills/discovery/SKILL.md +7 -547
  141. package/skills/discovery/SKILL.tmpl +7 -140
  142. package/skills/prd/SKILL.md +298 -394
  143. package/skills/prd/SKILL.tmpl +40 -151
  144. package/skills/setup-ai-first/SKILL.md +80 -80
  145. package/skills/setup-ai-first/SKILL.tmpl +28 -28
  146. package/skills/spec/SKILL.md +178 -178
  147. package/skills/spec/SKILL.tmpl +20 -20
  148. package/skills/test/SKILL.md +604 -604
  149. package/skills/test/SKILL.tmpl +44 -44
  150. package/steps/capture-lesson.md +44 -44
  151. package/steps/context-loader.md +175 -175
  152. package/steps/gate.md +54 -54
  153. package/steps/report-footer.md +52 -52
  154. package/steps/review-fanout.md +85 -87
  155. package/steps/spawn-agent.md +45 -45
  156. package/steps/trace-mirror.md +21 -21
  157. package/templates/architecture.template.md +37 -37
  158. package/templates/design-spec.template.md +77 -77
  159. package/templates/platform-guide.template.md +47 -47
  160. package/templates/prd.template.md +107 -232
  161. package/templates/product-definition.template.md +101 -88
  162. package/templates/project-context.yaml +2 -2
@@ -1,10 +1,10 @@
1
1
  ---
2
- description: Fixes bugs with full workflow (branch, test, commit), performs quick debug analysis of errors or unexpected behavior, or validates traceability coverage between specs and 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".
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 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
- This skill handles: `/fix-bug` (full bug fix workflow), `/debug` (quick analysis), and `/validate-traces` (traceability coverage check).
7
+ Skill này xử lý: `/fix-bug` (full bug fix workflow), `/debug` (phân tích nhanh), `/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
- Accept: ticket ID (e.g. `PROJ-123`) or a direct bug description.
15
+ Nhận: ticket ID (vd `PROJ-123`) hoặc một tả bug trực tiếp.
16
16
 
17
17
  ### Phase 1 — Gather Information
18
18
 
19
- If ticket ID provided:
20
- - Fetch ticket details if Jira/issue tracker is connected
21
- - Otherwise ask user to paste: title, steps to reproduce, expected vs actual
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
- If no ticket:
24
- **CHECKPOINT** — Ask:
25
- 1. Where does the bug occur? (service, endpoint, flow)
26
- 2. Steps to reproduce?
23
+ Nếu không 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 (if any)?
28
+ 4. Error log / stack trace (nếu )?
29
29
 
30
30
  ### Phase 2 — Root Cause Analysis
31
31
 
32
32
  {{include:steps/context-loader.md}}
33
33
 
34
- Trace through layers (from CLAUDE.md architecture):
35
- 1. Identify the service/module from the failing endpoint/feature
36
- 2. Read relevant code files, layer by layer
37
- 3. Match against common bug patterns:
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 | Common Location | How to Check |
39
+ | Bug Type | Vị trí thường gặp | Cách kiểm tra |
40
40
  |----------|----------------|--------------|
41
- | Wrong response data | Data mapping layer | Check field mapping, DTO conversions |
42
- | 400 Bad Request | Input validation | Check DTO constraints, required fields |
43
- | 403 Forbidden | Auth configuration | Check role-based access rules |
44
- | 404 Not Found | Repository query | Check find method, ID types |
45
- | Slow query / N+1 | Data access layer | Check for missing JOIN FETCH or batch loading |
46
- | Null Pointer | Missing null checks, optional not handled | Check Optional.orElseThrow usage |
47
- | Transaction rollback | Missing/wrong transaction scope | Check @Transactional on service methods |
48
- | Stale cache | Missing cache eviction after write | Check cache invalidation on write operations |
49
- | Type mismatch in query | Filter/specification code | Check field types in query predicates |
50
- | Cross-service timeout | External service call | Check URL config, fallback behavior |
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ử | 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
- Wait for user confirmation.
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
- Apply the fix exactly as analyzed. Follow CLAUDE.md coding standards — do not introduce new violations.
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
- Add traceability annotation if the file has `@trace.implements`:
82
+ Thêm annotation traceability nếu file `@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
- Generate a regression test if one doesn't exist:
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
- Run the test: `{TEST_COMMAND_FOR_CLASS}`
100
+ Chạy test: `{TEST_COMMAND_FOR_CLASS}`
101
101
 
102
- If test fails → debug and fix (max 3 iterations).
102
+ Nếu test fail → debug 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
- Use when: IDE shows an error, test fails unexpectedly, behavior is strange, or you need to understand why code does something.
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 sao code làm gì đó.
144
144
 
145
- **Different from `/fix-bug`**: This is analysis only, no full workflow, no ticket required.
145
+ **Khác `/fix-bug`**: Đây chỉ phân tích, không full workflow, không cần ticket.
146
146
 
147
147
  ### Input
148
148
 
149
- Paste one of:
149
+ Dán một trong:
150
150
  1. Stack trace / error log
151
- 2. Test failure output
152
- 3. File path + description of unexpected behavior
153
- 4. A specific question about a code snippet
151
+ 2. Output test fail
152
+ 3. File path + 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
- Read stack trace from **bottom up** — the `Caused by:` line is the real root cause.
157
+ Đọc stack trace từ **dưới lên** — dòng `Caused by:` 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 | Likely Cause | Fix Direction |
168
+ | Error | Nguyên nhân khả nghi | Hướng fix |
169
169
  |-------|-------------|---------------|
170
- | NullPointerException | Accessing field on null object; Optional not handled | Check Optional.orElseThrow, null guards |
171
- | ClassCastException | Wrong type assumption; incorrect generic usage | Check type at assignment/return point |
172
- | OutOfMemoryError | Loading too much data; memory leak | Add pagination, check collection sizes |
173
- | StackOverflowError | Infinite recursion | Find recursive call with no base case |
174
- | Connection refused | Dependency service not running | Check config URLs, start dependent service |
175
- | Authentication/401 | Token expired, wrong config, missing header | Verify token, check auth config |
176
- | Permission denied/403 | Wrong role in request or misconfigured access rules | Check auth annotations and role config |
177
- | Database constraint violation | Duplicate key, missing FK, null in NOT NULL column | Check data and constraint definitions |
178
- | Serialization error | Circular reference, unmapped field | Check DTO/mapper configuration |
179
- | Test assertion mismatch | Wrong mock setup or wrong expected value | Re-read mock setup and assertion logic |
170
+ | NullPointerException | Truy cập field trên object null; Optional chưa xử | 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 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 role config |
177
+ | Database constraint violation | Trùng key, thiếu FK, null trong cột NOT NULL | Kiểm tra data đị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 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. What is the gap between Expected and Actual?
190
- 2. Trace to the exact test line
191
- 3. Is the mock setup correct? (`given(...).willReturn(...)`)
192
- 4. Is the assertion logically correct?
189
+ 1. Gap giữa Expected Actual gì?
190
+ 2. Trace tới đúng dòng test
191
+ 3. Mock setup đúng chưa? (`given(...).willReturn(...)`)
192
+ 4. Assertion đú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
- Read-only check of coverage between specs, code, and tests.
227
+ Check read-only độ phủ giữa spec, code, test.
228
228
 
229
229
  ### Input
230
230
 
231
- Accept: domain name or specific UC-ID.
231
+ Nhận: tên domain hoặc UC-ID cụ thể.
232
232
 
233
233
  ### Process
234
234
 
235
- 1. **Read .feature files** → collect all SC-IDs for the domain/UC
236
- 2. **Scan controller files** → find `@trace.implements` tags
237
- 3. **Scan test files** → find `@trace.verifies` tags
238
- 4. **Read `.trace/{domain}/{prd-slug}/{UC-ID}.tsv`** → check for drift (scenario text changed since last code gen)
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