@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/skills/prd/SKILL.tmpl
CHANGED
|
@@ -1,79 +1,63 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Sinh PRD từ một product definition, hoặc phân tích một PRD có sẵn qua 4 lăng kính review (QA, DEV, SA, PO) để tìm gap và rủi ro. Trigger when: "/generate-prd", "/refine-prd", "tạo PRD", "generate PRD", "phân tích PRD", "review PRD", "refine PRD", "PRD có vấn đề gì không", "check PRD quality".
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# PRD Skills — Generate & Refine
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Skill này xử lý hai lệnh: `/generate-prd` để tạo PRD, và `/refine-prd` để phân tích PRD tìm gap.
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
## /generate-prd —
|
|
11
|
+
## /generate-prd — Sinh Product Requirements Document
|
|
12
12
|
|
|
13
13
|
### Gate
|
|
14
14
|
|
|
15
|
-
<!-- Directory:
|
|
15
|
+
<!-- Directory: {paths.product_definitions_dir}/**/*.md -->
|
|
16
16
|
{{include:steps/gate.md}}
|
|
17
17
|
|
|
18
|
-
###
|
|
19
|
-
|
|
20
|
-
Write `specs/{domain}/{prd-slug}/prd.md`:
|
|
21
|
-
|
|
22
|
-
```markdown
|
|
23
|
-
# PRD — {Feature Name}
|
|
24
|
-
|
|
25
|
-
**Version**: 1.0
|
|
26
|
-
**Status**: draft
|
|
27
|
-
**Domain**: {domain}
|
|
28
|
-
**Ticket**: {TICKET_PREFIX}-{N} (if available)
|
|
29
|
-
**Date**: {date}
|
|
30
|
-
|
|
31
|
-
## 1. Problem Statement
|
|
32
|
-
{from product-definition}
|
|
33
|
-
|
|
34
|
-
## 2. Goals & Non-Goals
|
|
18
|
+
### Quy tắc nội dung — chống jargon kỹ thuật *(áp dụng cho mọi PRD sinh ra)*
|
|
35
19
|
|
|
36
|
-
|
|
37
|
-
|
|
20
|
+
**1. PRD platform-agnostic — chỉ mô tả WHAT (nghiệp vụ), KHÔNG mô tả HOW (kỹ thuật).**
|
|
21
|
+
Viết AC / Business Rule / Business Logic theo *kết quả nghiệp vụ*, KHÔNG nhét chi tiết triển khai (API, JWT/token, endpoint, HTTP status, tên class/bảng/cột DB, query, spinner, animation…). Những thứ đó thuộc **Tech Docs** (kỹ thuật) hoặc **Design Spec** (giao diện).
|
|
38
22
|
|
|
39
|
-
|
|
40
|
-
|
|
23
|
+
| ✅ Viết trong PRD (nghiệp vụ) | ❌ KHÔNG viết trong PRD |
|
|
24
|
+
|---|---|
|
|
25
|
+
| "Đăng nhập thành công → truy cập được tính năng" | "API trả về JWT token" ← Tech Docs |
|
|
26
|
+
| "Sai mật khẩu 5 lần → khoá tài khoản 30 phút" | "Click button → hiện toast" ← Design Spec |
|
|
27
|
+
| "Phiên hết hạn → yêu cầu xác thực lại" | "Hiển thị spinner khi loading" ← Design Spec |
|
|
41
28
|
|
|
42
|
-
|
|
29
|
+
- Nếu PO đưa chi tiết UI (màu, layout, animation) → **nhắc**: *"Chi tiết UI này thuộc Design Spec, không thuộc PRD. Ghi nhận để tạo Design Spec sau."*
|
|
30
|
+
- Enum/thuật ngữ kỹ thuật ĐÃ chuẩn hoá trong domain-knowledge (vd `userType`, `TYPE_1`) thì giữ nguyên gốc — đây là từ vựng nghiệp vụ, KHÔNG phải jargon triển khai.
|
|
43
31
|
|
|
44
|
-
|
|
32
|
+
**2. Terminology — bám từ điển dự án.**
|
|
33
|
+
- Thay mọi **banned term** bằng canonical term (xem `business-dictionary.md` § Banned Terms); ghi chú việc thay ở mục **Giả định AI**.
|
|
34
|
+
- Status/Enum → lấy đúng giá trị trong `core-entities.md` (Enum Registry).
|
|
35
|
+
- **Thuật ngữ MỚI**: nếu input PO có từ chưa có trong `business-dictionary.md` và lặp ≥2 lần → **DỪNG, hỏi PO** (nghĩa là gì / canonical term / có thêm vào từ điển không) trước khi tiếp tục.
|
|
45
36
|
|
|
46
|
-
|
|
37
|
+
**3. Cross-reference bắt buộc.** Mọi chỗ nhắc TICKET-ID khác → inline link `[TICKET-ID](./file.md)` nếu file PRD tồn tại; không để plain text.
|
|
47
38
|
|
|
48
|
-
|
|
49
|
-
|-------|------|----------|-------------|
|
|
50
|
-
| {DOMAIN}-UC1 | {name} | High | {description} |
|
|
51
|
-
|
|
52
|
-
## 5. Business Rules
|
|
53
|
-
|
|
54
|
-
| BR-ID | Rule | UC |
|
|
55
|
-
|-------|------|----|
|
|
56
|
-
| BR-1 | {rule} | UC1 |
|
|
57
|
-
|
|
58
|
-
## 6. Acceptance Criteria
|
|
39
|
+
### Generate
|
|
59
40
|
|
|
60
|
-
|
|
61
|
-
- AC1: Given {context}, when {action}, then {result}
|
|
41
|
+
Sinh PRD theo đúng cấu trúc chuẩn dưới đây (template canonical: `templates/prd.template.md`). Quy ước bắt buộc:
|
|
62
42
|
|
|
63
|
-
|
|
64
|
-
{
|
|
43
|
+
- **Ngôn ngữ:** heading + nội dung viết tiếng Việt (giữ thuật ngữ kỹ thuật/Enum nguyên gốc).
|
|
44
|
+
- **Tiêu đề file:** `# {TICKET}-{N} {Feature Name}` — KHÔNG thêm tiền tố "PRD —".
|
|
45
|
+
- **Tên file ghi ra:** `specs/{domain}/{prd-slug}/prd.md` (bố cục feature-package — mọi artifact của feature nằm chung folder này).
|
|
46
|
+
- **Business Rule:** đặt BÊN TRONG từng Use Case (không gom thành mục phẳng), bảng 3 cột `ID | Business Rule | Business Logic`; ID theo dạng `{TICKET}-{N}-UC{n}-BR{m}` (đánh số BR liên tục xuyên suốt các UC, không reset mỗi UC).
|
|
47
|
+
- **Acceptance Criteria:** danh sách phẳng `**AC{n}:**`, văn xuôi — KHÔNG ép Given/When/Then.
|
|
48
|
+
- **Liên kết:** trỏ tới PRD/tài liệu liên quan bằng link tương đối; trỏ `core-entities` / `business-dictionary` ở mục Tài liệu tham khảo.
|
|
49
|
+
- **Giả định AI:** nếu phát hiện độ vênh/giả định chưa được PO chốt → liệt kê thành `Q1…Qn` để PO xác nhận; nếu mọi thứ đã rõ từ product-definition → ghi "Không có — toàn bộ nội dung đã được PO xác nhận".
|
|
65
50
|
|
|
66
|
-
|
|
67
|
-
{from product-definition}
|
|
51
|
+
Template (cấu trúc đầu ra — single-source từ `templates/prd.template.md`):
|
|
68
52
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
53
|
+
````markdown
|
|
54
|
+
{{include:templates/prd.template.md}}
|
|
55
|
+
````
|
|
72
56
|
|
|
73
57
|
### Output
|
|
74
58
|
|
|
75
59
|
```
|
|
76
|
-
✅ PRD
|
|
60
|
+
✅ Đã tạo PRD: specs/{domain}/{prd-slug}/prd.md
|
|
77
61
|
Status: draft
|
|
78
62
|
```
|
|
79
63
|
|
|
@@ -81,108 +65,13 @@ Status: draft
|
|
|
81
65
|
|
|
82
66
|
---
|
|
83
67
|
|
|
84
|
-
## /refine-prd —
|
|
85
|
-
|
|
86
|
-
Performs a structured multi-perspective analysis of a PRD and writes findings to a YAML file for human review.
|
|
68
|
+
## /refine-prd — Phân tích PRD qua 4 lăng kính review
|
|
87
69
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
<!-- Directory: specs/*/*/prd.md -->
|
|
91
|
-
{{include:steps/gate.md}}
|
|
92
|
-
|
|
93
|
-
### Analyze — 4 Lenses (run all four perspectives)
|
|
94
|
-
|
|
95
|
-
#### QA Lens — Test Coverage & Edge Cases
|
|
96
|
-
Evaluate:
|
|
97
|
-
- Are all acceptance criteria testable and measurable?
|
|
98
|
-
- Are edge cases and error scenarios specified?
|
|
99
|
-
- Are boundary conditions defined?
|
|
100
|
-
- Is there ambiguity in expected behavior?
|
|
101
|
-
|
|
102
|
-
#### DEV Lens — Technical Clarity & Feasibility
|
|
103
|
-
Evaluate:
|
|
104
|
-
- Are API inputs/outputs clearly defined?
|
|
105
|
-
- Are business rules unambiguous enough to implement?
|
|
106
|
-
- Are there performance or scalability concerns?
|
|
107
|
-
- Are cross-service dependencies fully described?
|
|
108
|
-
- Is there anything technically infeasible or risky?
|
|
109
|
-
|
|
110
|
-
#### SA Lens — Architecture & Design
|
|
111
|
-
Evaluate:
|
|
112
|
-
- Does this fit the existing architecture?
|
|
113
|
-
- Are there design patterns or constraints to apply?
|
|
114
|
-
- Is data modeling clear (entities, relationships)?
|
|
115
|
-
- Are there security or auth implications?
|
|
116
|
-
|
|
117
|
-
#### PO Lens — Business Value & Scope
|
|
118
|
-
Evaluate:
|
|
119
|
-
- Is scope clearly bounded?
|
|
120
|
-
- Are priorities clear?
|
|
121
|
-
- Are success metrics defined?
|
|
122
|
-
- Are stakeholder needs fully captured?
|
|
123
|
-
- Any scope creep risk?
|
|
124
|
-
|
|
125
|
-
### Write Output
|
|
126
|
-
|
|
127
|
-
Derive the output filename from the PRD slug:
|
|
128
|
-
- PRD file: `specs/payment/create-invoice/prd.md` → output: `.agent/review/create-invoice-findings.yaml`
|
|
129
|
-
- Rule: take the PRD's parent folder name (the `prd-slug`), append `-findings.yaml`
|
|
130
|
-
|
|
131
|
-
Write findings to `.agent/review/{prd-slug}-findings.yaml`:
|
|
132
|
-
|
|
133
|
-
```yaml
|
|
134
|
-
# Generated by /refine-prd
|
|
135
|
-
# Review each finding and mark: accepted / rejected / needs_discussion
|
|
136
|
-
prd_source: "specs/{domain}/{prd-slug}/prd.md"
|
|
137
|
-
generated_at: "{ISO datetime}"
|
|
138
|
-
status: "pending_review"
|
|
139
|
-
|
|
140
|
-
findings:
|
|
141
|
-
- id: "F001"
|
|
142
|
-
lens: "QA" # QA | DEV | SA | PO
|
|
143
|
-
severity: "major" # critical | major | minor
|
|
144
|
-
section: "§6. Acceptance Criteria"
|
|
145
|
-
finding: "{Clear description of the gap or issue}"
|
|
146
|
-
suggestion: "{Specific actionable improvement}"
|
|
147
|
-
status: "pending" # pending | accepted | rejected | needs_discussion
|
|
148
|
-
|
|
149
|
-
- id: "F002"
|
|
150
|
-
lens: "DEV"
|
|
151
|
-
severity: "minor"
|
|
152
|
-
section: "§8. Cross-Service Dependencies"
|
|
153
|
-
finding: "{finding}"
|
|
154
|
-
suggestion: "{suggestion}"
|
|
155
|
-
status: "pending"
|
|
156
|
-
|
|
157
|
-
summary:
|
|
158
|
-
total_findings: {N}
|
|
159
|
-
by_severity:
|
|
160
|
-
critical: {N}
|
|
161
|
-
major: {N}
|
|
162
|
-
minor: {N}
|
|
163
|
-
by_lens:
|
|
164
|
-
QA: {N}
|
|
165
|
-
DEV: {N}
|
|
166
|
-
SA: {N}
|
|
167
|
-
PO: {N}
|
|
168
|
-
recommendation: "APPROVED_WITH_MINOR_CHANGES | NEEDS_REVISION | BLOCKED"
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
### Report to User
|
|
70
|
+
Lệnh này thực thi **y hệt** `commands/refine-prd.md` — không nhân bản logic ở đây để tránh lệch schema findings.
|
|
172
71
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
🔴 Critical: {N} 🟡 Major: {N} 🟢 Minor: {N}
|
|
178
|
-
|
|
179
|
-
Top issues:
|
|
180
|
-
[F001] QA/major — {brief description}
|
|
181
|
-
[F002] DEV/minor — {brief description}
|
|
72
|
+
`commands/refine-prd.md` bao gồm:
|
|
73
|
+
- Phân tích PRD bằng 4 lăng kính **fan-out đa sub-agent** (QA / DEV / SA / PO) + vòng completeness-critic (1 lần chạy ra đủ finding).
|
|
74
|
+
- Ghi findings YAML với **schema đầy đủ** (`uc_id`, `quote`, `auto_fixable`) — bắt buộc cho source-jump và nút "Apply to PRD" của Review Board.
|
|
75
|
+
- **Resume Mode** (`--resume`): áp dụng findings đã accept → bump version → ghi changelog → reset `draft`.
|
|
182
76
|
|
|
183
|
-
|
|
184
|
-
→ Open with Review Board extension (right-click file) to accept/reject each finding
|
|
185
|
-
→ After review: update PRD and run /generate-bdd
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
{{include:steps/report-footer.md}}
|
|
77
|
+
→ **Đọc và tuân theo `commands/refine-prd.md`** với cùng `$ARGUMENTS`.
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Cài đặt framework Spec-Driven Development trong bất kỳ backend project nào từ đầu. Trigger when: "/setup-ai-first", "setup spec-driven workflow", "initialize ai-first framework", "cài đặt framework", "khởi tạo spec-driven", "set up this workflow", "how do I start using this framework".
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# /setup-ai-first — Initialize Spec-Driven Docs in a Project
|
|
6
6
|
|
|
7
|
-
|
|
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, và verify môi trường.
|
|
8
8
|
|
|
9
9
|
## Precondition Check
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Trước tiên, hỏi: "Bạn đang ở project nào? Cho tôi đường dẫn root của project."
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
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
16
|
|
|
17
|
-
## Step 1 —
|
|
17
|
+
## Step 1 — Tạo cấu trúc thư mục
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Tạo các thư mục sau (skip nếu đã tồn tại):
|
|
20
20
|
|
|
21
21
|
```
|
|
22
22
|
{project-root}/
|
|
@@ -28,22 +28,22 @@ Create the following directories (skip if already exist):
|
|
|
28
28
|
└── review/ # Output of /refine-prd ({prd-slug}-findings.yaml)
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
**
|
|
32
|
-
|
|
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
33
|
|
|
34
34
|
```
|
|
35
35
|
specs/{domain}/{prd-slug}/
|
|
36
36
|
├── prd.md # /generate-prd
|
|
37
|
-
├── bdd/ # /generate-bdd (.feature
|
|
37
|
+
├── bdd/ # /generate-bdd (file .feature)
|
|
38
38
|
├── tech-docs/ # /generate-tech-docs
|
|
39
|
-
└── design-spec/ # /generate-design-spec (FE/App
|
|
39
|
+
└── design-spec/ # /generate-design-spec (chỉ FE/App)
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
Report
|
|
42
|
+
Report mỗi thư mục được tạo hoặc đã tồn tại.
|
|
43
43
|
|
|
44
44
|
## Step 2 — Copy Slash Commands
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
Nói với người dùng:
|
|
47
47
|
|
|
48
48
|
> "Framework này đã cài slash commands vào Claude tự động qua skill system.
|
|
49
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:"
|
|
@@ -54,21 +54,21 @@ mkdir -p {project-root}/.claude/commands
|
|
|
54
54
|
cp {plugin-dir}/commands/*.md {project-root}/.claude/commands/
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
|
|
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
58
|
|
|
59
|
-
## Step 3 —
|
|
59
|
+
## Step 3 — Tạo CLAUDE.md
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
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
64
|
|
|
65
|
-
|
|
65
|
+
Sau khi tạo, hướng dẫn:
|
|
66
66
|
> "Mở CLAUDE.md và điền vào các placeholder `{{...}}` với thông tin dự án của bạn.
|
|
67
67
|
> Đặc biệt quan trọng: §1 (project overview) và §3 (coding standards)."
|
|
68
68
|
|
|
69
|
-
## Step 4 —
|
|
69
|
+
## Step 4 — Tạo project-context.yaml
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
Tạo `{project-root}/.agent/project-context.yaml`:
|
|
72
72
|
|
|
73
73
|
```yaml
|
|
74
74
|
# Project context for AI-First workflow
|
|
@@ -97,11 +97,11 @@ domains: [] # List your business domains, e.g. [rental, payment, user]
|
|
|
97
97
|
|
|
98
98
|
## Step 5 — Verify Setup
|
|
99
99
|
|
|
100
|
-
|
|
101
|
-
- [ ] `specs/`
|
|
102
|
-
- [ ] `.trace/`
|
|
103
|
-
- [ ] `.agent/project-context.yaml`
|
|
104
|
-
- [ ] `CLAUDE.md`
|
|
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
105
|
|
|
106
106
|
Report:
|
|
107
107
|
```
|
|
@@ -113,38 +113,38 @@ Files created:
|
|
|
113
113
|
✅ .agent/project-context.yaml (needs customization)
|
|
114
114
|
```
|
|
115
115
|
|
|
116
|
-
# Report Footer —
|
|
116
|
+
# Report Footer — Định dạng output chuẩn cho mọi lệnh
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
Mọi report của lệnh phải kết thúc bằng section footer chuẩn này.
|
|
119
119
|
|
|
120
120
|
## Status Badge
|
|
121
121
|
|
|
122
|
-
|
|
123
|
-
- `✅ Complete` —
|
|
124
|
-
- `❌ Failed` —
|
|
125
|
-
- `⚠️ Warnings` —
|
|
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
126
|
|
|
127
127
|
## Output Artifacts
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
Liệt kê mọi file được tạo hoặc sửa bởi lệnh này:
|
|
130
130
|
```
|
|
131
131
|
Output Artifacts:
|
|
132
|
-
{created|updated} {file-path} ({
|
|
133
|
-
{created|updated} {file-path} ({
|
|
132
|
+
{created|updated} {file-path} ({mô tả ngắn})
|
|
133
|
+
{created|updated} {file-path} ({mô tả ngắn})
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
-
|
|
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
137
|
|
|
138
138
|
## Pipeline Position
|
|
139
139
|
|
|
140
|
-
|
|
141
|
-
|
|
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
142
|
|
|
143
143
|
```
|
|
144
144
|
Discovery → PRD → [Design Spec] → BDD → Tech Design → Code → Dev Self-Check → QC → Trace Audit
|
|
145
145
|
```
|
|
146
146
|
|
|
147
|
-
|
|
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
148
|
|
|
149
149
|
| Phase | Commands |
|
|
150
150
|
|-------|----------|
|
|
@@ -158,59 +158,59 @@ Find the current command in this phase legend and mark **its** phase in the map
|
|
|
158
158
|
| QC | `/qc-analyze` · `/qc-plan` · `/qc-design-test` · `/qc-review` · `/qc-run-test` · `/qc-report` |
|
|
159
159
|
| Trace Audit | `/validate-traces` |
|
|
160
160
|
|
|
161
|
-
|
|
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
162
|
`Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume`.
|
|
163
163
|
|
|
164
|
-
**
|
|
165
|
-
`/report-bug`, `/propose-scenario`, `/generate-spec-manifest`)
|
|
166
|
-
**
|
|
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
167
|
|
|
168
|
-
##
|
|
168
|
+
## Gợi ý lệnh tiếp theo
|
|
169
169
|
|
|
170
|
-
|
|
170
|
+
Gợi ý lệnh kế tiếp hợp lý theo phase của workflow:
|
|
171
171
|
|
|
172
|
-
|
|
|
172
|
+
| Lệnh hiện tại | Gợi ý lệnh tiếp theo |
|
|
173
173
|
|-------------------------|-----------------------------------------------|
|
|
174
|
-
| /setup-ai-first | `/define-product`
|
|
174
|
+
| /setup-ai-first | `/define-product` để bắt đầu feature đầu tiên |
|
|
175
175
|
| /define-product | `/generate-prd {product-definition-file}` |
|
|
176
|
-
| /generate-prd | `/refine-prd {prd-file}`
|
|
177
|
-
| /refine-prd |
|
|
178
|
-
| /review-context (PRD) | FE/App: `/generate-design-spec {prd-file}` (
|
|
179
|
-
| /generate-design-spec | Designer review →
|
|
180
|
-
| /generate-bdd | `/review-context {feature-file}`
|
|
181
|
-
| /review-context (BDD) | `/generate-tech-docs {UC-ID}`
|
|
182
|
-
| /qc-analyze | `/qc-plan {UC-ID}` (
|
|
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
183
|
| /qc-plan | `/qc-design-test {UC-ID}` |
|
|
184
|
-
| /qc-design-test | `/qc-review {UC-ID}` (test-case
|
|
185
|
-
| /qc-review (test-case) | `/qc-run-test {UC-ID}`
|
|
186
|
-
| /qc-run-test | `/qc-report {UC-ID}`
|
|
187
|
-
| /qc-review (script) | `/qc-report {UC-ID}`
|
|
188
|
-
| /qc-report | `/validate-traces {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
189
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
190
|
-
| /review-tech-docs | `/generate-code {feature-file}`
|
|
191
|
-
| /generate-code |
|
|
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
192
|
| /dev-gen-test | `/dev-run-test {UC-ID}` |
|
|
193
193
|
| /dev-run-test (passing) | `/review-code {UC-ID}` |
|
|
194
|
-
| /dev-run-test (failing) | `/fix-bug {ticket-id}`
|
|
195
|
-
| /review-code | `/dev-smoke-test {UC-ID}`
|
|
196
|
-
| /dev-smoke-test |
|
|
197
|
-
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`;
|
|
198
|
-
| /fix-bug |
|
|
199
|
-
| /debug | `/fix-bug {ticket-id}`
|
|
200
|
-
| /report-bug |
|
|
201
|
-
| /propose-scenario |
|
|
202
|
-
| /learn |
|
|
203
|
-
| /sync | `/validate-traces`
|
|
204
|
-
| /update-framework | Review `git diff .agent/`, commit; `/sync`
|
|
205
|
-
|
|
206
|
-
|
|
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
207
|
```
|
|
208
208
|
---
|
|
209
209
|
Status : {badge}
|
|
210
|
-
{Output Artifacts
|
|
210
|
+
{khối Output Artifacts}
|
|
211
211
|
Pipeline : Discovery → PRD → [BDD ◀ bạn ở đây] → Tech Design → Code → Dev Self-Check → QC → Trace Audit
|
|
212
|
-
(review
|
|
213
|
-
Next : {
|
|
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
214
|
```
|
|
215
|
-
*(
|
|
215
|
+
*(Bỏ dòng `Pipeline` cho các lệnh xuyên suốt liệt kê ở trên.)*
|
|
216
216
|
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Cài đặt framework Spec-Driven Development trong bất kỳ backend project nào từ đầu. Trigger when: "/setup-ai-first", "setup spec-driven workflow", "initialize ai-first framework", "cài đặt framework", "khởi tạo spec-driven", "set up this workflow", "how do I start using this framework".
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# /setup-ai-first — Initialize Spec-Driven Docs in a Project
|
|
6
6
|
|
|
7
|
-
|
|
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, và verify môi trường.
|
|
8
8
|
|
|
9
9
|
## Precondition Check
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Trước tiên, hỏi: "Bạn đang ở project nào? Cho tôi đường dẫn root của project."
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
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
16
|
|
|
17
|
-
## Step 1 —
|
|
17
|
+
## Step 1 — Tạo cấu trúc thư mục
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Tạo các thư mục sau (skip nếu đã tồn tại):
|
|
20
20
|
|
|
21
21
|
```
|
|
22
22
|
{project-root}/
|
|
@@ -28,22 +28,22 @@ Create the following directories (skip if already exist):
|
|
|
28
28
|
└── review/ # Output of /refine-prd ({prd-slug}-findings.yaml)
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
**
|
|
32
|
-
|
|
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
33
|
|
|
34
34
|
```
|
|
35
35
|
specs/{domain}/{prd-slug}/
|
|
36
36
|
├── prd.md # /generate-prd
|
|
37
|
-
├── bdd/ # /generate-bdd (.feature
|
|
37
|
+
├── bdd/ # /generate-bdd (file .feature)
|
|
38
38
|
├── tech-docs/ # /generate-tech-docs
|
|
39
|
-
└── design-spec/ # /generate-design-spec (FE/App
|
|
39
|
+
└── design-spec/ # /generate-design-spec (chỉ FE/App)
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
Report
|
|
42
|
+
Report mỗi thư mục được tạo hoặc đã tồn tại.
|
|
43
43
|
|
|
44
44
|
## Step 2 — Copy Slash Commands
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
Nói với người dùng:
|
|
47
47
|
|
|
48
48
|
> "Framework này đã cài slash commands vào Claude tự động qua skill system.
|
|
49
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:"
|
|
@@ -54,21 +54,21 @@ mkdir -p {project-root}/.claude/commands
|
|
|
54
54
|
cp {plugin-dir}/commands/*.md {project-root}/.claude/commands/
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
|
|
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
58
|
|
|
59
|
-
## Step 3 —
|
|
59
|
+
## Step 3 — Tạo CLAUDE.md
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
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
64
|
|
|
65
|
-
|
|
65
|
+
Sau khi tạo, hướng dẫn:
|
|
66
66
|
> "Mở CLAUDE.md và điền vào các placeholder `{{...}}` với thông tin dự án của bạn.
|
|
67
67
|
> Đặc biệt quan trọng: §1 (project overview) và §3 (coding standards)."
|
|
68
68
|
|
|
69
|
-
## Step 4 —
|
|
69
|
+
## Step 4 — Tạo project-context.yaml
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
Tạo `{project-root}/.agent/project-context.yaml`:
|
|
72
72
|
|
|
73
73
|
```yaml
|
|
74
74
|
# Project context for AI-First workflow
|
|
@@ -97,11 +97,11 @@ domains: [] # List your business domains, e.g. [rental, payment, user]
|
|
|
97
97
|
|
|
98
98
|
## Step 5 — Verify Setup
|
|
99
99
|
|
|
100
|
-
|
|
101
|
-
- [ ] `specs/`
|
|
102
|
-
- [ ] `.trace/`
|
|
103
|
-
- [ ] `.agent/project-context.yaml`
|
|
104
|
-
- [ ] `CLAUDE.md`
|
|
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
105
|
|
|
106
106
|
Report:
|
|
107
107
|
```
|