@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.
Files changed (141) hide show
  1. package/commands/debug.md +435 -435
  2. package/commands/debug.tmpl +111 -111
  3. package/commands/define-product.md +330 -327
  4. package/commands/define-product.tmpl +50 -47
  5. package/commands/dev-gen-test.md +364 -364
  6. package/commands/dev-gen-test.tmpl +63 -63
  7. package/commands/dev-run-test.md +375 -375
  8. package/commands/dev-run-test.tmpl +74 -74
  9. package/commands/dev-smoke-test.md +340 -340
  10. package/commands/dev-smoke-test.tmpl +60 -60
  11. package/commands/fix-bug.md +402 -402
  12. package/commands/fix-bug.tmpl +78 -78
  13. package/commands/generate-bdd.md +512 -512
  14. package/commands/generate-bdd.tmpl +211 -211
  15. package/commands/generate-code.md +480 -482
  16. package/commands/generate-code.tmpl +179 -181
  17. package/commands/generate-design-spec.md +495 -495
  18. package/commands/generate-design-spec.tmpl +219 -219
  19. package/commands/generate-prd.md +445 -396
  20. package/commands/generate-prd.tmpl +45 -198
  21. package/commands/generate-spec-manifest.md +337 -337
  22. package/commands/generate-spec-manifest.tmpl +57 -57
  23. package/commands/generate-tech-docs.md +364 -364
  24. package/commands/generate-tech-docs.tmpl +84 -84
  25. package/commands/learn.md +346 -346
  26. package/commands/learn.tmpl +22 -22
  27. package/commands/map-testids.md +321 -321
  28. package/commands/map-testids.tmpl +41 -41
  29. package/commands/propose-scenario.md +334 -334
  30. package/commands/propose-scenario.tmpl +54 -54
  31. package/commands/qc-analyze.md +322 -323
  32. package/commands/qc-analyze.tmpl +42 -43
  33. package/commands/qc-design-test.md +303 -303
  34. package/commands/qc-design-test.tmpl +23 -23
  35. package/commands/qc-plan.md +296 -296
  36. package/commands/qc-plan.tmpl +16 -16
  37. package/commands/qc-report.md +301 -301
  38. package/commands/qc-report.tmpl +21 -21
  39. package/commands/qc-review.md +297 -297
  40. package/commands/qc-review.tmpl +17 -17
  41. package/commands/qc-run-test.md +336 -336
  42. package/commands/qc-run-test.tmpl +35 -35
  43. package/commands/refine-prd.md +426 -428
  44. package/commands/refine-prd.tmpl +61 -61
  45. package/commands/report-bug.md +350 -350
  46. package/commands/report-bug.tmpl +70 -70
  47. package/commands/review-code.md +363 -363
  48. package/commands/review-code.tmpl +39 -39
  49. package/commands/review-context.md +577 -579
  50. package/commands/review-context.tmpl +212 -212
  51. package/commands/review-tech-docs.md +426 -426
  52. package/commands/review-tech-docs.tmpl +146 -146
  53. package/commands/setup-ai-first.md +237 -237
  54. package/commands/setup-ai-first.tmpl +131 -131
  55. package/commands/sync.md +145 -145
  56. package/commands/sync.tmpl +93 -93
  57. package/commands/update-framework.md +88 -88
  58. package/commands/update-framework.tmpl +36 -36
  59. package/commands/validate-traces.md +379 -379
  60. package/commands/validate-traces.tmpl +99 -99
  61. package/core/FRAMEWORK_VERSION +1 -1
  62. package/core/commands/debug.md +435 -435
  63. package/core/commands/define-product.md +330 -327
  64. package/core/commands/dev-gen-test.md +364 -364
  65. package/core/commands/dev-run-test.md +375 -375
  66. package/core/commands/dev-smoke-test.md +340 -340
  67. package/core/commands/fix-bug.md +402 -402
  68. package/core/commands/generate-bdd.md +512 -512
  69. package/core/commands/generate-code.md +480 -482
  70. package/core/commands/generate-design-spec.md +495 -495
  71. package/core/commands/generate-prd.md +445 -396
  72. package/core/commands/generate-spec-manifest.md +337 -337
  73. package/core/commands/generate-tech-docs.md +364 -364
  74. package/core/commands/learn.md +346 -346
  75. package/core/commands/map-testids.md +321 -321
  76. package/core/commands/propose-scenario.md +334 -334
  77. package/core/commands/qc-analyze.md +322 -323
  78. package/core/commands/qc-design-test.md +303 -303
  79. package/core/commands/qc-plan.md +296 -296
  80. package/core/commands/qc-report.md +301 -301
  81. package/core/commands/qc-review.md +297 -297
  82. package/core/commands/qc-run-test.md +336 -336
  83. package/core/commands/refine-prd.md +426 -428
  84. package/core/commands/report-bug.md +350 -350
  85. package/core/commands/review-code.md +363 -363
  86. package/core/commands/review-context.md +577 -579
  87. package/core/commands/review-tech-docs.md +426 -426
  88. package/core/commands/setup-ai-first.md +237 -237
  89. package/core/commands/sync.md +145 -145
  90. package/core/commands/update-framework.md +88 -88
  91. package/core/commands/validate-traces.md +379 -379
  92. package/core/skills/code/SKILL.md +388 -388
  93. package/core/skills/debug/SKILL.md +390 -390
  94. package/core/skills/design-spec/SKILL.md +316 -316
  95. package/core/skills/discovery/SKILL.md +7 -547
  96. package/core/skills/prd/SKILL.md +298 -394
  97. package/core/skills/setup-ai-first/SKILL.md +79 -79
  98. package/core/skills/spec/SKILL.md +176 -176
  99. package/core/skills/test/SKILL.md +602 -602
  100. package/core/steps/capture-lesson.md +44 -44
  101. package/core/steps/context-loader.md +174 -174
  102. package/core/steps/gate.md +54 -54
  103. package/core/steps/report-footer.md +52 -52
  104. package/core/steps/review-fanout.md +85 -87
  105. package/core/steps/spawn-agent.md +45 -45
  106. package/core/steps/trace-mirror.md +21 -21
  107. package/core/templates/architecture.template.md +37 -37
  108. package/core/templates/design-spec.template.md +77 -77
  109. package/core/templates/platform-guide.template.md +47 -47
  110. package/core/templates/prd.template.md +106 -231
  111. package/core/templates/product-definition.template.md +101 -88
  112. package/docs/04-operations/publishing.md +20 -3
  113. package/package.json +1 -1
  114. package/skills/code/SKILL.md +388 -388
  115. package/skills/code/SKILL.tmpl +56 -56
  116. package/skills/debug/SKILL.md +390 -390
  117. package/skills/debug/SKILL.tmpl +60 -60
  118. package/skills/design-spec/SKILL.md +316 -316
  119. package/skills/design-spec/SKILL.tmpl +36 -36
  120. package/skills/discovery/SKILL.md +7 -547
  121. package/skills/discovery/SKILL.tmpl +7 -140
  122. package/skills/prd/SKILL.md +298 -394
  123. package/skills/prd/SKILL.tmpl +40 -151
  124. package/skills/setup-ai-first/SKILL.md +79 -79
  125. package/skills/setup-ai-first/SKILL.tmpl +27 -27
  126. package/skills/spec/SKILL.md +176 -176
  127. package/skills/spec/SKILL.tmpl +18 -18
  128. package/skills/test/SKILL.md +602 -602
  129. package/skills/test/SKILL.tmpl +44 -44
  130. package/steps/capture-lesson.md +44 -44
  131. package/steps/context-loader.md +174 -174
  132. package/steps/gate.md +54 -54
  133. package/steps/report-footer.md +52 -52
  134. package/steps/review-fanout.md +85 -87
  135. package/steps/spawn-agent.md +45 -45
  136. package/steps/trace-mirror.md +21 -21
  137. package/templates/architecture.template.md +37 -37
  138. package/templates/design-spec.template.md +77 -77
  139. package/templates/platform-guide.template.md +47 -47
  140. package/templates/prd.template.md +106 -231
  141. package/templates/product-definition.template.md +101 -88
@@ -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