@edupia-tutor/spec-driven-docs 0.14.7 → 0.14.8

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 (79) hide show
  1. package/commands/generate-bdd.md +59 -4
  2. package/commands/generate-bdd.tmpl +59 -4
  3. package/commands/generate-code.md +18 -1
  4. package/commands/generate-code.tmpl +18 -1
  5. package/commands/generate-design-spec.md +35 -5
  6. package/commands/generate-design-spec.tmpl +35 -5
  7. package/commands/generate-prd.md +7 -4
  8. package/commands/generate-tech-docs.md +1 -0
  9. package/commands/generate-tech-docs.tmpl +1 -0
  10. package/commands/propose-scenario.md +6 -2
  11. package/commands/propose-scenario.tmpl +6 -2
  12. package/commands/qc-analyze.md +14 -0
  13. package/commands/qc-analyze.tmpl +14 -0
  14. package/commands/refine-prd.md +15 -4
  15. package/commands/refine-prd.tmpl +15 -4
  16. package/commands/review-context.md +15 -11
  17. package/commands/review-context.tmpl +15 -11
  18. package/commands/validate-traces.md +1 -0
  19. package/commands/validate-traces.tmpl +1 -0
  20. package/core/FRAMEWORK_VERSION +1 -1
  21. package/core/commands/generate-bdd.md +59 -4
  22. package/core/commands/generate-code.md +18 -1
  23. package/core/commands/generate-design-spec.md +35 -5
  24. package/core/commands/generate-prd.md +7 -4
  25. package/core/commands/generate-tech-docs.md +1 -0
  26. package/core/commands/propose-scenario.md +6 -2
  27. package/core/commands/qc-analyze.md +14 -0
  28. package/core/commands/refine-prd.md +15 -4
  29. package/core/commands/review-context.md +15 -11
  30. package/core/commands/validate-traces.md +1 -0
  31. package/core/skills/code/SKILL.md +7 -759
  32. package/core/skills/debug/SKILL.md +9 -859
  33. package/core/skills/design-spec/SKILL.md +3 -582
  34. package/core/skills/prd/SKILL.md +5 -464
  35. package/core/skills/setup-ai-first/SKILL.md +3 -208
  36. package/core/skills/spec/SKILL.md +7 -450
  37. package/core/skills/test/SKILL.md +10 -1290
  38. package/core/steps/spawn-agent.md +12 -7
  39. package/core/templates/prd.template.md +7 -4
  40. package/docs/01-getting-started/core-concepts.md +2 -2
  41. package/docs/01-getting-started/quickstart.md +4 -3
  42. package/docs/02-guides/bdd-input-checklist.md +68 -0
  43. package/docs/02-guides/developer/README.md +3 -0
  44. package/docs/02-guides/developer/bdd-and-trace.md +1 -0
  45. package/docs/02-guides/developer/commands.md +3 -3
  46. package/docs/02-guides/developer/pr-checklist.md +1 -0
  47. package/docs/02-guides/developer/workflow.md +2 -2
  48. package/docs/02-guides/prd-input-checklist.md +94 -0
  49. package/docs/02-guides/product-owner/README.md +3 -1
  50. package/docs/02-guides/product-owner/commands.md +1 -1
  51. package/docs/02-guides/tech-docs-input-checklist.md +82 -0
  52. package/docs/02-guides/tester/README.md +1 -1
  53. package/docs/02-guides/tester/bug-reporting.md +1 -1
  54. package/docs/02-guides/tester/qc-automation.md +1 -1
  55. package/docs/03-concepts/README.md +1 -0
  56. package/docs/03-concepts/mechanisms-explained.md +34 -0
  57. package/docs/03-concepts/pipeline.md +12 -9
  58. package/docs/03-concepts/traceability.md +4 -1
  59. package/docs/04-operations/bug-flow.md +2 -0
  60. package/docs/05-reference/command-cheatsheet.md +8 -8
  61. package/docs/05-reference/commands.md +12 -10
  62. package/docs/05-reference/trace-schema.md +2 -1
  63. package/package.json +1 -1
  64. package/skills/code/SKILL.md +7 -759
  65. package/skills/code/SKILL.tmpl +7 -164
  66. package/skills/debug/SKILL.md +9 -859
  67. package/skills/debug/SKILL.tmpl +9 -252
  68. package/skills/design-spec/SKILL.md +3 -582
  69. package/skills/design-spec/SKILL.tmpl +3 -87
  70. package/skills/prd/SKILL.md +5 -464
  71. package/skills/prd/SKILL.tmpl +5 -63
  72. package/skills/setup-ai-first/SKILL.md +3 -208
  73. package/skills/setup-ai-first/SKILL.tmpl +3 -108
  74. package/skills/spec/SKILL.md +7 -450
  75. package/skills/spec/SKILL.tmpl +7 -162
  76. package/skills/test/SKILL.md +10 -1290
  77. package/skills/test/SKILL.tmpl +10 -288
  78. package/steps/spawn-agent.md +12 -7
  79. package/templates/prd.template.md +7 -4
@@ -4,173 +4,16 @@ description: Sinh implementation code từ BDD spec đã duyệt kèm tag tracea
4
4
 
5
5
  # Code Skills — Generate & Review
6
6
 
7
- Skill này xử lý `/generate-code` (implementation) và `/review-code` (review read-only).
7
+ Skill này xử lý `/generate-code` và `/review-code`. Để **không lệch schema/gate**, skill KHÔNG nhân bản — mỗi lệnh thực thi **y hệt** command tương ứng.
8
8
 
9
- ---
10
-
11
- ## /generate-code — Generate Implementation Code
12
-
13
- ### Gate
14
-
15
- <!-- Directory: specs/*/*/bdd/*.feature -->
16
- {{include:steps/gate.md}}
17
-
18
- 4. Kiểm tra trace state có sẵn: đọc `.trace/{domain}/{prd-slug}/{UC-ID}.tsv` nếu tồn tại.
19
- - Xác định: scenario mới vs. drifted (đã đổi) vs. synced (skip)
20
-
21
- 5. Hiện **CHECKPOINT — Comprehension**:
22
- ```
23
- I understand:
24
- - Feature: {name} | Ticket: {TICKET_ID if known}
25
- - UC: {UC-ID} in domain: {domain}
26
- - Scenarios: {N} total ({X} new, {Y} drifted, {Z} synced-skip)
27
- - Layer order: {from CLAUDE.md architecture}
28
- - Files to create/update: [list in generation order]
29
-
30
- Proceed? (Y/N)
31
- ```
32
- Chờ xác nhận.
33
-
34
- ### Context Load
35
-
36
- {{include:steps/context-loader.md}}
37
-
38
- Cũng đọc:
39
- - File `.feature` (cần implement gì)
40
- - Tech doc `specs/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design.md` (nếu tồn tại)
41
- - File entity/model có sẵn trong domain này (để theo pattern)
42
-
43
- ### Branch
44
-
45
- Tạo feature branch:
46
- ```bash
47
- git checkout -b feature/{TICKET_ID}-{slug}
48
- # If no ticket ID: feature/{UC-ID}-{slug}
49
- ```
50
-
51
- ### Generate
52
-
53
- Sinh code theo thứ tự layer (thích ứng theo stack của bạn):
54
-
55
- **Cho một backend phân lớp điển hình (vd Controller → Service → Repository):**
56
-
57
- 1. **DTOs / Request-Response models** — validate input, shape output
58
- 2. **Domain entity / model** — biểu diễn dữ liệu
59
- 3. **Repository / Data Access** — query, filter
60
- 4. **Service interface** — contract
61
- 5. **Service implementation** — business logic, `@Transactional` khi cần
62
- 6. **Facade interface** (nếu kiến trúc dùng facade layer) — contract orchestration
63
- 7. **Facade implementation** — orchestration liên-service
64
- 8. **Controller / Handler** — HTTP mapping, auth, tag `@trace`
65
-
66
- **Quan trọng: Tag traceability trên mỗi controller method:**
67
- ```
68
- # @trace.implements={UC-ID}-SC{N}
69
- # @trace.source=specs/{domain}/{prd-slug}/bdd/{UC-ID}.feature
70
- ```
71
- (Dùng cú pháp comment của ngôn ngữ bạn)
72
-
73
- ### Self-Review (3 vòng)
74
-
75
- Sau khi sinh, verify:
76
- - [ ] Mỗi scenario trong .feature có controller endpoint tương ứng
77
- - [ ] Tag `@trace.implements` trên mỗi endpoint
78
- - [ ] Tôn trọng quy tắc layer kiến trúc (từ CLAUDE.md)
79
- - [ ] Error handling khớp CLAUDE.md §error_handling
80
- - [ ] Không magic number, không debug logging
81
- - [ ] Theo coding standards từ CLAUDE.md
82
-
83
- Nếu phát hiện issue → fix inline trước khi tiếp tục.
84
-
85
- ### Build Verify
86
-
87
- ```bash
88
- {BUILD_COMMAND} # from project-context.yaml, max 3 retries
89
- ```
90
-
91
- Nếu build fail: đọc lỗi, fix, retry. Sau 3 lần fail, report cho user kèm diagnosis.
92
-
93
- ### Write Trace State
94
-
95
- Cập nhật `.trace/{domain}/{prd-slug}/{UC-ID}.tsv`:
96
- ```
97
- UC-ID\tSC-ID\tsc_version\timplemented_by\tlast_updated
98
- {UC-ID}\tSC1\t{hash of scenario text}\t{ControllerClass}.{method}\t{date}
99
- ```
100
-
101
- ### Commit
102
-
103
- ```bash
104
- git add {changed files}
105
- git commit -m "{commit_format from CLAUDE.md}: {description}"
106
- ```
107
-
108
- ### Report
109
-
110
- ```
111
- /generate-code Complete — {UC-ID}
112
- - Files created: {N} | Updated: {M}
113
- - Build: SUCCESS (attempt {K}/3)
114
- - Branch: feature/{TICKET_ID}-{slug}
115
- - Trace: .trace/{domain}/{prd-slug}/{UC-ID}.tsv updated
116
- ```
117
-
118
- {{include:steps/report-footer.md}}
119
-
120
- ---
121
-
122
- ## /review-code — Code Review chỉ-đọc
123
-
124
- **QUAN TRỌNG**: Đây là READ-ONLY. Report issue nhưng KHÔNG sửa.
125
-
126
- ### Input
127
-
128
- Nhận: UC-ID, file path, hoặc tên branch hiện tại.
129
-
130
- ### Review Dimensions
131
-
132
- #### 1. Traceability
133
- - [ ] Mỗi controller endpoint có tag `@trace.implements`?
134
- - [ ] Mỗi test file có tag `@trace.verifies`?
135
- - [ ] Không có tag `@trace` ở layer không phải controller (Service, Repository, v.v.)?
136
- - [ ] `.trace/{domain}/{prd-slug}/{UC-ID}.tsv` cập nhật chưa?
137
-
138
- #### 2. Layer Architecture (từ CLAUDE.md)
139
- - [ ] Mỗi class ở đúng layer?
140
- - [ ] Phụ thuộc giữa layer đi đúng chiều?
141
- - [ ] Không layer nào bị bypass (vd Controller gọi Repository trực tiếp)?
142
-
143
- #### 3. Coding Standards (từ CLAUDE.md)
144
- - [ ] Tuân theo naming convention?
145
- - [ ] Response wrapper dùng nhất quán?
146
- - [ ] Exception được throw (không bị nuốt hoặc tự build vào response)?
147
- - [ ] Không magic number?
148
- - [ ] Không dữ liệu nhạy cảm trong log?
149
- - [ ] Annotation transaction đúng?
150
-
151
- #### 4. Spec Compliance
152
- - [ ] Mỗi scenario trong .feature có implementation?
153
- - [ ] Không có endpoint không tài liệu (code không có spec backing)?
154
-
155
- ### Output
156
-
157
- ```
158
- /review-code Report — {UC-ID}
159
- Critical: {X} | Major: {Y} | Minor: {Z}
160
-
161
- ### Critical
162
- | # | File | Line | Issue | Suggested Fix |
163
- |---|------|------|-------|---------------|
9
+ ## /generate-code — Sinh Implementation Code
164
10
 
165
- ### Major
166
- | # | File | Line | Issue | Suggested Fix |
11
+ **Đọc và tuân theo `commands/generate-code.md`** với cùng `$ARGUMENTS`.
167
12
 
168
- ### Minor
169
- | # | File | Line | Issue | Suggested Fix |
13
+ Command lo: guard mềm BDD `@trace.status` approved + Design Spec (approved/độ-tươi/sanity) cho FE/App · `--phase=ui`/`--phase=integration` · branch + build verify · trace TSV (22 cột) `@trace.implements`.
170
14
 
171
- Verdict: APPROVED | NEEDS_FIX
172
- ```
15
+ ## /review-code Code Review chỉ-đọc (READ-ONLY)
173
16
 
174
- Nếu `NEEDS_FIX`: liệt file cụ thể cần đổi và chạy `/fix-bug` hoặc sửa inline.
17
+ **Đọc tuân theo `commands/review-code.md`** với cùng `$ARGUMENTS`.
175
18
 
176
- {{include:steps/report-footer.md}}
19
+ Command lo: Pre-Review Scan · 4 lăng kính (Traceability · Layer Architecture · Coding Standards · Spec Compliance) · đề xuất ghi Lesson cho lỗi AI lặp.