@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,79 +1,63 @@
1
1
  ---
2
- description: Generates a PRD from a product definition, or analyzes an existing PRD through 4 review lenses (QA, DEV, SA, PO) to find gaps and risks. 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".
2
+ description: Sinh PRD từ một product definition, hoặc phân tích một PRD sẵn qua 4 lăng kính review (QA, DEV, SA, PO) để tìm gap 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
- This skill handles two commands: `/generate-prd` to create a PRD, and `/refine-prd` to analyze it for gaps.
7
+ Skill này xử hai lệnh: `/generate-prd` để tạo PRD, `/refine-prd` để phân tích PRD tìm gap.
8
8
 
9
9
  ---
10
10
 
11
- ## /generate-prd — Generate Product Requirements Document
11
+ ## /generate-prd — Sinh Product Requirements Document
12
12
 
13
13
  ### Gate
14
14
 
15
- <!-- Directory: specs/product-definition/**/*.md -->
15
+ <!-- Directory: {paths.product_definitions_dir}/**/*.md -->
16
16
  {{include:steps/gate.md}}
17
17
 
18
- ### Generate
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
- ### Goals
37
- - {goal 1}
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
- ### Non-Goals
40
- - {non-goal 1}
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
- ## 3. User Stories
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
- As a {persona}, I want to {action} so that {benefit}.
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
- ## 4. Use Cases
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
- | UC-ID | Name | Priority | Description |
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
- ### {DOMAIN}-UC1: {Name}
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
- ## 7. Out of Scope
64
- {from product-definition}
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
- ## 8. Cross-Service Dependencies
67
- {from product-definition}
51
+ Template (cấu trúc đầu ra — single-source từ `templates/prd.template.md`):
68
52
 
69
- ## 9. Open Questions
70
- - [ ] {question requiring clarification}
71
- ```
53
+ ````markdown
54
+ {{include:templates/prd.template.md}}
55
+ ````
72
56
 
73
57
  ### Output
74
58
 
75
59
  ```
76
- ✅ PRD created: specs/{domain}/{prd-slug}/prd.md
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 — Analyze PRD Through 4 Review Lenses
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
- ### Gate
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
- /refine-prd Complete {PRD name}
175
-
176
- Findings: {total} total
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
- Review file: .agent/review/{prd-slug}-findings.yaml
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: Sets up the Spec-Driven Development framework in any backend project from scratch. 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".
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
- Walk the user through a one-time setup that creates all required directories, installs CLAUDE.md, and verifies the environment.
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.
8
8
 
9
9
  ## Precondition Check
10
10
 
11
- First, ask: "Bạn đang ở project nào? Cho tôi đường dẫn root của project."
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
- Check if already set up:
14
- - If `.claude/commands/` exists with `.md` files report "Already set up. Run `/validate-traces` to check status."
15
- - If `specs/` existsoffer to re-initialize or skip
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 — Create Directory Structure
17
+ ## Step 1 — Tạo cấu trúc thư mục
18
18
 
19
- Create the following directories (skip if already exist):
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
- **Feature-package layout** — per-feature artifacts are NOT pre-created here; each command
32
- creates its own folder on demand under `specs/{domain}/{prd-slug}/`:
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 files)
37
+ ├── bdd/ # /generate-bdd (file .feature)
38
38
  ├── tech-docs/ # /generate-tech-docs
39
- └── design-spec/ # /generate-design-spec (FE/App only)
39
+ └── design-spec/ # /generate-design-spec (chỉ FE/App)
40
40
  ```
41
41
 
42
- Report each directory created or already existing.
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
- Tell the user:
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
- Note: The `.claude/commands/` copies are optional. Skills in this framework work without them.
57
+ Lưu ý: Bản copy `.claude/commands/` tuỳ chọn. Skill trong framework này hoạt động không cần chúng.
58
58
 
59
- ## Step 3 — Create CLAUDE.md
59
+ ## Step 3 — Tạo CLAUDE.md
60
60
 
61
- Check if `{project-root}/CLAUDE.md` exists:
62
- - If yes: ask "CLAUDE.md đã tồn tại. Merge template vào hay bỏ qua?"
63
- - If no: create from template in `templates/architecture.template.md`
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
- After creating, instruct:
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 — Create project-context.yaml
69
+ ## Step 4 — Tạo project-context.yaml
70
70
 
71
- Create `{project-root}/.agent/project-context.yaml`:
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
- Run a quick check:
101
- - [ ] `specs/` directory exists
102
- - [ ] `.trace/` directory exists
103
- - [ ] `.agent/project-context.yaml` exists
104
- - [ ] `CLAUDE.md` exists
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 — Standard Command Output Format
116
+ # Report Footer — Định dạng output chuẩn cho mọi lệnh
117
117
 
118
- Every command report must end with this standard footer section.
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
- Choose one based on outcome:
123
- - `✅ Complete` — all steps succeeded, no issues found
124
- - `❌ Failed` — command could not complete due to a blocking error
125
- - `⚠️ Warnings` — completed with non-blocking issues that should be reviewed
122
+ Chọn một theo kết quả:
123
+ - `✅ Complete` — mọi bước thành công, không 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 vấn đề không chặn, nên review lại
126
126
 
127
127
  ## Output Artifacts
128
128
 
129
- List every file created or modified by this command:
129
+ Liệt 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} ({brief description})
133
- {created|updated} {file-path} ({brief description})
132
+ {created|updated} {file-path} ({ tả ngắn})
133
+ {created|updated} {file-path} ({ tả ngắn})
134
134
  ```
135
135
 
136
- If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
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
- Print a one-line map of the pipeline with the CURRENT command's phase marked `◀ bạn ở đây`,
141
- so the user always sees where this command sits in the end-to-end flow:
140
+ In một đồ 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
- Find the current command in this phase legend and mark **its** phase in the map above:
147
+ Tìm lệnh hiện tại trong bảng phase dưới đây đá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
- For a **review command**, also append the 3-step review loop with the current step marked, e.g.:
161
+ Với **lệnh review**, thêm vòng review 3 bước đá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
- **Cross-cutting commands** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
165
- `/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) sit outside the linear pipeline
166
- **omit the Pipeline line entirely** for these (do not force-fit them onto the map).
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 đồ).
167
167
 
168
- ## Next Command Suggestion
168
+ ## Gợi ý lệnh tiếp theo
169
169
 
170
- Suggest the logical next command based on workflow phase:
170
+ Gợi ý lệnh kế tiếp hợp theo phase của workflow:
171
171
 
172
- | Current command | Suggest next |
172
+ | Lệnh hiện tại | Gợi ý lệnh tiếp theo |
173
173
  |-------------------------|-----------------------------------------------|
174
- | /setup-ai-first | `/define-product` to start your first feature |
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}` then `/review-context {prd-file}` |
177
- | /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
178
- | /review-context (PRD) | FE/App: `/generate-design-spec {prd-file}` (then BDD after sign-off); BE: `/generate-bdd {prd-file}` directly; fix PRD if NEEDS_FIX |
179
- | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
180
- | /generate-bdd | `/review-context {feature-file}` to verify coverage |
181
- | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
182
- | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
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ử 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 review) |
185
- | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
186
- | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
187
- | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
188
- | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
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}` if APPROVED; fix doc if NEEDS_FIX |
191
- | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
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}` or `/debug {error}` |
195
- | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
196
- | /dev-smoke-test | Create PR and link to ticket |
197
- | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
198
- | /fix-bug | Create PR and link to ticket |
199
- | /debug | `/fix-bug {ticket-id}` if fix needed |
200
- | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
201
- | /propose-scenario | Notify PO/Dev to review the proposal in `feedback/bdd-proposals/` |
202
- | /learn | Continue working — lesson applies on next command |
203
- | /sync | `/validate-traces` for full coverage; act on any `📥 tester feedback` surfaced |
204
- | /update-framework | Review `git diff .agent/`, commit; `/sync` for project content |
205
-
206
- Format the footer as:
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 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 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 block}
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 cmd) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
213
- Next : {suggested command with example arguments}
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
- *(Omit the `Pipeline` line for cross-cutting commands listed above.)*
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: Sets up the Spec-Driven Development framework in any backend project from scratch. 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".
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
- Walk the user through a one-time setup that creates all required directories, installs CLAUDE.md, and verifies the environment.
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.
8
8
 
9
9
  ## Precondition Check
10
10
 
11
- First, ask: "Bạn đang ở project nào? Cho tôi đường dẫn root của project."
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
- Check if already set up:
14
- - If `.claude/commands/` exists with `.md` files report "Already set up. Run `/validate-traces` to check status."
15
- - If `specs/` existsoffer to re-initialize or skip
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 — Create Directory Structure
17
+ ## Step 1 — Tạo cấu trúc thư mục
18
18
 
19
- Create the following directories (skip if already exist):
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
- **Feature-package layout** — per-feature artifacts are NOT pre-created here; each command
32
- creates its own folder on demand under `specs/{domain}/{prd-slug}/`:
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 files)
37
+ ├── bdd/ # /generate-bdd (file .feature)
38
38
  ├── tech-docs/ # /generate-tech-docs
39
- └── design-spec/ # /generate-design-spec (FE/App only)
39
+ └── design-spec/ # /generate-design-spec (chỉ FE/App)
40
40
  ```
41
41
 
42
- Report each directory created or already existing.
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
- Tell the user:
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
- Note: The `.claude/commands/` copies are optional. Skills in this framework work without them.
57
+ Lưu ý: Bản copy `.claude/commands/` tuỳ chọn. Skill trong framework này hoạt động không cần chúng.
58
58
 
59
- ## Step 3 — Create CLAUDE.md
59
+ ## Step 3 — Tạo CLAUDE.md
60
60
 
61
- Check if `{project-root}/CLAUDE.md` exists:
62
- - If yes: ask "CLAUDE.md đã tồn tại. Merge template vào hay bỏ qua?"
63
- - If no: create from template in `templates/architecture.template.md`
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
- After creating, instruct:
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 — Create project-context.yaml
69
+ ## Step 4 — Tạo project-context.yaml
70
70
 
71
- Create `{project-root}/.agent/project-context.yaml`:
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
- Run a quick check:
101
- - [ ] `specs/` directory exists
102
- - [ ] `.trace/` directory exists
103
- - [ ] `.agent/project-context.yaml` exists
104
- - [ ] `CLAUDE.md` exists
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
  ```