@edupia-tutor/spec-driven-docs 0.14.6 → 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 (130) hide show
  1. package/bin/index.js +1 -1
  2. package/commands/debug.md +1 -1
  3. package/commands/define-product.md +1 -1
  4. package/commands/dev-gen-test.md +1 -1
  5. package/commands/dev-run-test.md +1 -1
  6. package/commands/dev-smoke-test.md +1 -1
  7. package/commands/fix-bug.md +1 -1
  8. package/commands/generate-bdd.md +74 -5
  9. package/commands/generate-bdd.tmpl +73 -4
  10. package/commands/generate-code.md +19 -2
  11. package/commands/generate-code.tmpl +18 -1
  12. package/commands/generate-design-spec.md +50 -6
  13. package/commands/generate-design-spec.tmpl +49 -5
  14. package/commands/generate-prd.md +9 -5
  15. package/commands/generate-prd.tmpl +1 -0
  16. package/commands/generate-spec-manifest.md +1 -1
  17. package/commands/generate-tech-docs.md +2 -1
  18. package/commands/generate-tech-docs.tmpl +1 -0
  19. package/commands/learn.md +1 -1
  20. package/commands/map-testids.md +1 -1
  21. package/commands/propose-scenario.md +7 -3
  22. package/commands/propose-scenario.tmpl +6 -2
  23. package/commands/qc-analyze.md +15 -1
  24. package/commands/qc-analyze.tmpl +14 -0
  25. package/commands/qc-design-test.md +1 -1
  26. package/commands/qc-plan.md +1 -1
  27. package/commands/qc-report.md +1 -1
  28. package/commands/qc-review.md +1 -1
  29. package/commands/qc-run-test.md +1 -1
  30. package/commands/refine-prd.md +33 -13
  31. package/commands/refine-prd.tmpl +32 -12
  32. package/commands/report-bug.md +1 -1
  33. package/commands/review-code.md +1 -1
  34. package/commands/review-context.md +49 -27
  35. package/commands/review-context.tmpl +48 -26
  36. package/commands/review-tech-docs.md +1 -1
  37. package/commands/setup-ai-first.md +10 -10
  38. package/commands/setup-ai-first.tmpl +9 -9
  39. package/commands/sync.md +1 -1
  40. package/commands/update-framework.md +1 -1
  41. package/commands/validate-traces.md +2 -1
  42. package/commands/validate-traces.tmpl +1 -0
  43. package/core/FRAMEWORK_VERSION +1 -1
  44. package/core/commands/debug.md +1 -1
  45. package/core/commands/define-product.md +1 -1
  46. package/core/commands/dev-gen-test.md +1 -1
  47. package/core/commands/dev-run-test.md +1 -1
  48. package/core/commands/dev-smoke-test.md +1 -1
  49. package/core/commands/fix-bug.md +1 -1
  50. package/core/commands/generate-bdd.md +74 -5
  51. package/core/commands/generate-code.md +19 -2
  52. package/core/commands/generate-design-spec.md +50 -6
  53. package/core/commands/generate-prd.md +9 -5
  54. package/core/commands/generate-spec-manifest.md +1 -1
  55. package/core/commands/generate-tech-docs.md +2 -1
  56. package/core/commands/learn.md +1 -1
  57. package/core/commands/map-testids.md +1 -1
  58. package/core/commands/propose-scenario.md +7 -3
  59. package/core/commands/qc-analyze.md +15 -1
  60. package/core/commands/qc-design-test.md +1 -1
  61. package/core/commands/qc-plan.md +1 -1
  62. package/core/commands/qc-report.md +1 -1
  63. package/core/commands/qc-review.md +1 -1
  64. package/core/commands/qc-run-test.md +1 -1
  65. package/core/commands/refine-prd.md +33 -13
  66. package/core/commands/report-bug.md +1 -1
  67. package/core/commands/review-code.md +1 -1
  68. package/core/commands/review-context.md +49 -27
  69. package/core/commands/review-tech-docs.md +1 -1
  70. package/core/commands/setup-ai-first.md +10 -10
  71. package/core/commands/sync.md +1 -1
  72. package/core/commands/update-framework.md +1 -1
  73. package/core/commands/validate-traces.md +2 -1
  74. package/core/skills/code/SKILL.md +7 -759
  75. package/core/skills/debug/SKILL.md +9 -859
  76. package/core/skills/design-spec/SKILL.md +3 -582
  77. package/core/skills/prd/SKILL.md +5 -464
  78. package/core/skills/setup-ai-first/SKILL.md +3 -208
  79. package/core/skills/spec/SKILL.md +7 -450
  80. package/core/skills/test/SKILL.md +10 -1290
  81. package/core/steps/report-footer.md +1 -1
  82. package/core/steps/spawn-agent.md +12 -7
  83. package/core/templates/prd.template.md +7 -4
  84. package/core/templates/project-context.yaml +2 -2
  85. package/docs/01-getting-started/core-concepts.md +3 -3
  86. package/docs/01-getting-started/quickstart.md +4 -3
  87. package/docs/02-guides/bdd-input-checklist.md +68 -0
  88. package/docs/02-guides/developer/README.md +3 -0
  89. package/docs/02-guides/developer/bdd-and-trace.md +4 -3
  90. package/docs/02-guides/developer/commands.md +3 -3
  91. package/docs/02-guides/developer/pr-checklist.md +1 -0
  92. package/docs/02-guides/developer/scenarios.md +2 -2
  93. package/docs/02-guides/developer/workflow.md +3 -3
  94. package/docs/02-guides/prd-input-checklist.md +94 -0
  95. package/docs/02-guides/product-owner/README.md +5 -3
  96. package/docs/02-guides/product-owner/commands.md +1 -1
  97. package/docs/02-guides/product-owner/handoff-checklist.md +5 -5
  98. package/docs/02-guides/product-owner/scenarios.md +19 -17
  99. package/docs/02-guides/tech-docs-input-checklist.md +82 -0
  100. package/docs/02-guides/tester/README.md +1 -1
  101. package/docs/02-guides/tester/bug-reporting.md +1 -1
  102. package/docs/02-guides/tester/qc-automation.md +1 -1
  103. package/docs/03-concepts/README.md +1 -0
  104. package/docs/03-concepts/mechanisms-explained.md +34 -0
  105. package/docs/03-concepts/pipeline.md +12 -9
  106. package/docs/03-concepts/traceability.md +7 -4
  107. package/docs/04-operations/bug-flow.md +2 -0
  108. package/docs/04-operations/sync-and-update.md +3 -3
  109. package/docs/05-reference/command-cheatsheet.md +9 -9
  110. package/docs/05-reference/commands.md +12 -10
  111. package/docs/05-reference/trace-schema.md +2 -1
  112. package/package.json +1 -1
  113. package/skills/code/SKILL.md +7 -759
  114. package/skills/code/SKILL.tmpl +7 -164
  115. package/skills/debug/SKILL.md +9 -859
  116. package/skills/debug/SKILL.tmpl +9 -252
  117. package/skills/design-spec/SKILL.md +3 -582
  118. package/skills/design-spec/SKILL.tmpl +3 -87
  119. package/skills/prd/SKILL.md +5 -464
  120. package/skills/prd/SKILL.tmpl +5 -63
  121. package/skills/setup-ai-first/SKILL.md +3 -208
  122. package/skills/setup-ai-first/SKILL.tmpl +3 -108
  123. package/skills/spec/SKILL.md +7 -450
  124. package/skills/spec/SKILL.tmpl +7 -162
  125. package/skills/test/SKILL.md +10 -1290
  126. package/skills/test/SKILL.tmpl +10 -288
  127. package/steps/report-footer.md +1 -1
  128. package/steps/spawn-agent.md +12 -7
  129. package/templates/prd.template.md +7 -4
  130. package/templates/project-context.yaml +2 -2
@@ -4,213 +4,8 @@ description: Cài đặt framework Spec-Driven Development trong bất kỳ back
4
4
 
5
5
  # /setup-ai-first — Initialize Spec-Driven Docs in a Project
6
6
 
7
- Dẫn người dùng qua một setup một-lần tạo mọi thư mục cần thiết, cài CLAUDE.md, verify môi trường.
7
+ Skill này xử `/setup-ai-first`. Để **không lệch** (umbrella/services routing, cấu trúc), skill KHÔNG nhân bản — thực thi **y hệt** command.
8
8
 
9
- ## Precondition Check
10
-
11
- Trước tiên, hỏi: "Bạn đang ở project nào? Cho tôi đường dẫn root của project."
12
-
13
- Kiểm tra đã setup chưa:
14
- - Nếu `.claude/commands/` tồn tại với file `.md` → báo "Đã setup. Chạy `/validate-traces` để kiểm tra trạng thái."
15
- - Nếu `specs/` tồn tại → đề nghị re-initialize hoặc skip
16
-
17
- ## Step 1 — Tạo cấu trúc thư mục
18
-
19
- Tạo các thư mục sau (skip nếu đã tồn tại):
20
-
21
- ```
22
- {project-root}/
23
- ├── specs/
24
- │ ├── product-definition/ # Output of /define-product
25
- │ └── domain-knowledge/ # Business dictionary + core entities
26
- ├── .trace/ # Traceability state (.trace/{domain}/{prd-slug}/{UC-ID}.tsv)
27
- └── .agent/
28
- └── review/ # Output of /refine-prd ({prd-slug}-findings.yaml)
29
- ```
30
-
31
- **Bố cục feature-package** — artifact theo từng feature KHÔNG được tạo trước ở đây; mỗi lệnh
32
- tự tạo folder của nó on demand dưới `specs/{domain}/{prd-slug}/`:
33
-
34
- ```
35
- specs/{domain}/{prd-slug}/
36
- ├── {TICKET-ID}-{prd-slug}.md # /generate-prd (vd SEG01-segment-scoring-service.md)
37
- ├── bdd/ # /generate-bdd (file .feature)
38
- ├── tech-docs/ # /generate-tech-docs
39
- └── design-spec/ # /generate-design-spec (chỉ FE/App)
40
- ```
41
-
42
- Report mỗi thư mục được tạo hoặc đã tồn tại.
43
-
44
- ## Step 2 — Copy Slash Commands
45
-
46
- Nói với người dùng:
47
-
48
- > "Framework này đã cài slash commands vào Claude tự động qua skill system.
49
- > Nếu bạn muốn dùng commands trực tiếp trong Claude Code project (`.claude/commands/`), chạy lệnh sau:"
50
-
51
- ```bash
52
- # Copy all commands from plugin to project
53
- mkdir -p {project-root}/.claude/commands
54
- cp {plugin-dir}/commands/*.md {project-root}/.claude/commands/
55
- ```
56
-
57
- Lưu ý: Bản copy `.claude/commands/` là tuỳ chọn. Skill trong framework này hoạt động không cần chúng.
58
-
59
- ## Step 3 — Tạo CLAUDE.md
60
-
61
- Kiểm tra `{project-root}/CLAUDE.md` tồn tại chưa:
62
- - Nếu có: hỏi "CLAUDE.md đã tồn tại. Merge template vào hay bỏ qua?"
63
- - Nếu không: tạo từ template trong `templates/architecture.template.md`
64
-
65
- Sau khi tạo, hướng dẫn:
66
- > "Mở CLAUDE.md và điền vào các placeholder `{{...}}` với thông tin dự án của bạn.
67
- > Đặc biệt quan trọng: §1 (project overview) và §3 (coding standards)."
68
-
69
- ## Step 4 — Tạo project-context.yaml
70
-
71
- Tạo `{project-root}/.agent/project-context.yaml`:
72
-
73
- ```yaml
74
- # Project context for AI-First workflow
75
- # Fill in all fields before starting
76
-
77
- project:
78
- name: "{{PROJECT_NAME}}"
79
- description: "{{ONE_LINE_DESCRIPTION}}"
80
-
81
- tech_stack:
82
- language: "{{LANGUAGE}}" # e.g. Java 21, Python 3.12, Node.js 20
83
- framework: "{{FRAMEWORK}}" # e.g. Spring Boot 3.x, FastAPI, NestJS
84
- build_tool: "{{BUILD_TOOL}}" # e.g. Gradle, Maven, npm
85
- test_framework: "{{TEST_FW}}" # e.g. JUnit 5, pytest, Jest
86
- orm: "{{ORM}}" # e.g. Hibernate/JPA, SQLAlchemy, Prisma
87
- database: "{{DATABASE}}" # e.g. PostgreSQL, MySQL, MongoDB
88
-
89
- conventions:
90
- build_command: "{{BUILD_COMMAND}}" # e.g. ./gradlew build -x test
91
- test_command: "{{TEST_COMMAND}}" # e.g. ./gradlew test
92
- service_run: "{{RUN_COMMAND}}" # e.g. ./gradlew bootRun
93
- ticket_prefix: "{{TICKET_PREFIX}}" # e.g. PROJ, FEAT, PD
94
-
95
- domains: [] # List your business domains, e.g. [rental, payment, user]
96
- ```
97
-
98
- ## Step 5 — Verify Setup
99
-
100
- Chạy check nhanh:
101
- - [ ] Thư mục `specs/` tồn tại
102
- - [ ] Thư mục `.trace/` tồn tại
103
- - [ ] `.agent/project-context.yaml` tồn tại
104
- - [ ] `CLAUDE.md` tồn tại
105
-
106
- Report:
107
- ```
108
- /setup-ai-first Complete ✅
109
-
110
- Directories created: {N}
111
- Files created:
112
- ✅ CLAUDE.md (needs customization)
113
- ✅ .agent/project-context.yaml (needs customization)
114
- ```
115
-
116
- # Report Footer — Định dạng output chuẩn cho mọi lệnh
117
-
118
- Mọi report của lệnh phải kết thúc bằng section footer chuẩn này.
119
-
120
- ## Status Badge
121
-
122
- Chọn một theo kết quả:
123
- - `✅ Complete` — mọi bước thành công, không có vấn đề
124
- - `❌ Failed` — lệnh không hoàn thành được do lỗi chặn
125
- - `⚠️ Warnings` — hoàn thành nhưng có vấn đề không chặn, nên review lại
126
-
127
- ## Output Artifacts
128
-
129
- Liệt kê mọi file được tạo hoặc sửa bởi lệnh này:
130
- ```
131
- Output Artifacts:
132
- {created|updated} {file-path} ({mô tả ngắn})
133
- {created|updated} {file-path} ({mô tả ngắn})
134
- ```
135
-
136
- Nếu không ghi file nào (vd: lệnh review hoặc phân tích) → ghi `Output Artifacts: none (read-only)`.
137
-
138
- ## Pipeline Position
139
-
140
- In một sơ đồ pipeline một dòng, đánh dấu phase của lệnh HIỆN TẠI bằng `◀ bạn ở đây`,
141
- để người dùng luôn thấy lệnh này nằm ở đâu trong luồng end-to-end:
142
-
143
- ```
144
- Discovery → PRD → [Design Spec] → BDD → Tech Design → Code → Dev Self-Check → QC → Trace Audit
145
- ```
146
-
147
- Tìm lệnh hiện tại trong bảng phase dưới đây và đánh dấu **phase của nó** trong sơ đồ trên:
148
-
149
- | Phase | Commands |
150
- |-------|----------|
151
- | Discovery | `/define-product` |
152
- | PRD | `/generate-prd` · `/refine-prd` · `/review-context` (PRD) |
153
- | Design Spec | `/generate-design-spec` |
154
- | BDD | `/generate-bdd` · `/review-context` (BDD) |
155
- | Tech Design | `/generate-tech-docs` · `/map-testids` · `/review-tech-docs` |
156
- | Code | `/generate-code` · `/review-code` |
157
- | Dev Self-Check | `/dev-gen-test` · `/dev-run-test` · `/dev-smoke-test` |
158
- | QC | `/qc-analyze` · `/qc-plan` · `/qc-design-test` · `/qc-review` · `/qc-run-test` · `/qc-report` |
159
- | Trace Audit | `/validate-traces` |
160
-
161
- Với **lệnh review**, thêm vòng review 3 bước và đánh dấu bước hiện tại, vd:
162
- `Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume`.
163
-
164
- **Lệnh xuyên suốt** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
165
- `/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) nằm ngoài pipeline tuyến tính —
166
- **bỏ hẳn dòng Pipeline** cho các lệnh này (đừng cố nhét chúng vào sơ đồ).
167
-
168
- ## Gợi ý lệnh tiếp theo
169
-
170
- Gợi ý lệnh kế tiếp hợp lý theo phase của workflow:
171
-
172
- | Lệnh hiện tại | Gợi ý lệnh tiếp theo |
173
- |-------------------------|-----------------------------------------------|
174
- | /setup-ai-first | `/define-product` để bắt đầu feature đầu tiên |
175
- | /define-product | `/generate-prd {product-definition-file}` |
176
- | /generate-prd | `/refine-prd {prd-file}` rồi `/review-context {prd-file}` |
177
- | /refine-prd | Mở Review Board → cập nhật PRD → `/review-context {prd-file}` |
178
- | /review-context (PRD) | FE/App: `/generate-design-spec {prd-file}` (rồi BDD sau khi sign-off); BE: `/generate-bdd {prd-file}` trực tiếp; sửa PRD nếu NEEDS_FIX |
179
- | /generate-design-spec | Designer review → xác nhận link Figma → PO + Designer sign-off → `/generate-bdd {prd-file}` |
180
- | /generate-bdd | `/review-context {feature-file}` để kiểm tra độ phủ |
181
- | /review-context (BDD) | `/generate-tech-docs {UC-ID}` nếu APPROVED; sinh lại nếu NEEDS_FIX |
182
- | /qc-analyze | `/qc-plan {UC-ID}` (xử lý các gap blocker 🔴 trước) |
183
- | /qc-plan | `/qc-design-test {UC-ID}` |
184
- | /qc-design-test | `/qc-review {UC-ID}` (review test-case) |
185
- | /qc-review (test-case) | `/qc-run-test {UC-ID}` nếu APPROVED; sửa TC nếu NEEDS_FIX |
186
- | /qc-run-test | `/qc-report {UC-ID}` rồi `/qc-review {UC-ID}` (review script) |
187
- | /qc-review (script) | `/qc-report {UC-ID}` rồi tạo PR nếu APPROVED |
188
- | /qc-report | `/validate-traces {UC-ID}` để làm mới Living Docs (qc_status) |
189
- | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
190
- | /review-tech-docs | `/generate-code {feature-file}` nếu APPROVED; sửa doc nếu NEEDS_FIX |
191
- | /generate-code | Lần gen đầu → `/review-code {UC-ID}`; gen lại → `/dev-gen-test {UC-ID}` |
192
- | /dev-gen-test | `/dev-run-test {UC-ID}` |
193
- | /dev-run-test (passing) | `/review-code {UC-ID}` |
194
- | /dev-run-test (failing) | `/fix-bug {ticket-id}` hoặc `/debug {error}` |
195
- | /review-code | `/dev-smoke-test {UC-ID}` hoặc tạo PR |
196
- | /dev-smoke-test | Tạo PR và link tới ticket |
197
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; tất cả OK → tạo PR |
198
- | /fix-bug | Tạo PR và link tới ticket |
199
- | /debug | `/fix-bug {ticket-id}` nếu cần sửa |
200
- | /report-bug | Gửi cho dev (`/fix-bug {BUG-ID}`); nếu thiếu coverage → `/propose-scenario {UC-ID}` |
201
- | /propose-scenario | Báo PO/Dev review proposal trong `feedback/bdd-proposals/` |
202
- | /learn | Tiếp tục làm việc — lesson áp dụng ở lệnh kế tiếp |
203
- | /sync | `/validate-traces` để xem độ phủ đầy đủ; xử lý mọi `📥 tester feedback` được nêu |
204
- | /update-framework | Review `git diff .agent/`, commit; `/sync` để đồng bộ nội dung dự án |
205
-
206
- Định dạng footer như sau:
207
- ```
208
- ---
209
- Status : {badge}
210
- {khối Output Artifacts}
211
- Pipeline : Discovery → PRD → [BDD ◀ bạn ở đây] → Tech Design → Code → Dev Self-Check → QC → Trace Audit
212
- (lệnh review) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
213
- Next : {lệnh gợi ý kèm ví dụ tham số}
214
- ```
215
- *(Bỏ dòng `Pipeline` cho các lệnh xuyên suốt liệt kê ở trên.)*
9
+ **Đọc và tuân theo `commands/setup-ai-first.md`** với cùng `$ARGUMENTS`.
216
10
 
11
+ Command lo: tạo cấu trúc thư mục + feature-package on demand · CLAUDE.md + `.agent/project-context.yaml` (gồm umbrella `services` routing) · nhắc PO đặt row `Domain` (bảng Metadata) khớp services config · verify môi trường.