dw-kit 1.0.0
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/.claude/agents/executor.md +80 -0
- package/.claude/agents/planner.md +100 -0
- package/.claude/agents/quality-checker.md +86 -0
- package/.claude/agents/researcher.md +93 -0
- package/.claude/agents/reviewer.md +126 -0
- package/.claude/hooks/post-write.sh +62 -0
- package/.claude/hooks/pre-commit-gate.sh +90 -0
- package/.claude/hooks/progress-ping.sh +47 -0
- package/.claude/hooks/safety-guard.sh +54 -0
- package/.claude/rules/code-style.md +37 -0
- package/.claude/rules/commit-standards.md +37 -0
- package/.claude/rules/workflow-rules.md +62 -0
- package/.claude/settings.json +71 -0
- package/.claude/settings.local.json +12 -0
- package/.claude/skills/dw-arch-review/SKILL.md +119 -0
- package/.claude/skills/dw-archive/SKILL.md +81 -0
- package/.claude/skills/dw-commit/SKILL.md +81 -0
- package/.claude/skills/dw-config-init/SKILL.md +91 -0
- package/.claude/skills/dw-config-validate/SKILL.md +75 -0
- package/.claude/skills/dw-dashboard/SKILL.md +209 -0
- package/.claude/skills/dw-debug/SKILL.md +97 -0
- package/.claude/skills/dw-docs-update/SKILL.md +125 -0
- package/.claude/skills/dw-estimate/SKILL.md +90 -0
- package/.claude/skills/dw-execute/SKILL.md +98 -0
- package/.claude/skills/dw-flow/SKILL.md +274 -0
- package/.claude/skills/dw-handoff/SKILL.md +81 -0
- package/.claude/skills/dw-log-work/SKILL.md +69 -0
- package/.claude/skills/dw-plan/SKILL.md +125 -0
- package/.claude/skills/dw-plan/template-plan.md +47 -0
- package/.claude/skills/dw-requirements/SKILL.md +98 -0
- package/.claude/skills/dw-research/SKILL.md +98 -0
- package/.claude/skills/dw-research/template-research.md +51 -0
- package/.claude/skills/dw-review/SKILL.md +66 -0
- package/.claude/skills/dw-review/checklist.md +88 -0
- package/.claude/skills/dw-rollback/SKILL.md +90 -0
- package/.claude/skills/dw-sprint-review/SKILL.md +99 -0
- package/.claude/skills/dw-task-init/SKILL.md +59 -0
- package/.claude/skills/dw-test-plan/SKILL.md +113 -0
- package/.claude/skills/dw-thinking/SKILL.md +70 -0
- package/.claude/skills/dw-thinking/THINKING.md +91 -0
- package/.claude/skills/dw-upgrade/SKILL.md +82 -0
- package/.claude/templates/en/task-context.md +73 -0
- package/.claude/templates/en/task-plan.md +79 -0
- package/.claude/templates/en/task-progress.md +65 -0
- package/.claude/templates/pr-template.md +56 -0
- package/.claude/templates/task-context.md +73 -0
- package/.claude/templates/task-plan.md +79 -0
- package/.claude/templates/task-progress.md +65 -0
- package/.dw/adapters/claude-cli/extensions/.gitkeep +0 -0
- package/.dw/adapters/claude-cli/extensions/README.md +36 -0
- package/.dw/adapters/claude-cli/generated/README.md +23 -0
- package/.dw/adapters/claude-cli/generated/agents/.gitkeep +0 -0
- package/.dw/adapters/claude-cli/generated/skills/.gitkeep +0 -0
- package/.dw/adapters/claude-cli/overrides/README.md +35 -0
- package/.dw/adapters/claude-cli/overrides/agents/.gitkeep +0 -0
- package/.dw/adapters/claude-cli/overrides/skills/.gitkeep +0 -0
- package/.dw/adapters/generic/AGENT.md +169 -0
- package/.dw/adapters/generic/README.md +21 -0
- package/.dw/config/config.schema.json +121 -0
- package/.dw/config/dw.config.yml +82 -0
- package/.dw/config/presets/enterprise.yml +52 -0
- package/.dw/config/presets/small-team.yml +39 -0
- package/.dw/config/presets/solo-quick.yml +37 -0
- package/.dw/core/QUALITY.md +220 -0
- package/.dw/core/ROLES.md +257 -0
- package/.dw/core/THINKING.md +126 -0
- package/.dw/core/WORKFLOW.md +450 -0
- package/.dw/core/templates/vi/task-context.md +92 -0
- package/.dw/core/templates/vi/task-plan.md +93 -0
- package/.dw/core/templates/vi/task-progress.md +56 -0
- package/CLAUDE.md +98 -0
- package/LICENSE +21 -0
- package/README.md +183 -0
- package/bin/dw.mjs +28 -0
- package/package.json +52 -0
- package/scripts/e2e-local-check.sh +76 -0
- package/scripts/migrate-v03-to-v1.sh +243 -0
- package/scripts/upgrade.sh +246 -0
- package/setup.sh +382 -0
- package/src/cli.mjs +68 -0
- package/src/commands/doctor.mjs +149 -0
- package/src/commands/init.mjs +332 -0
- package/src/commands/migrate.mjs +215 -0
- package/src/commands/upgrade.mjs +262 -0
- package/src/commands/validate.mjs +102 -0
- package/src/lib/config.mjs +75 -0
- package/src/lib/copy.mjs +110 -0
- package/src/lib/platform.mjs +39 -0
- package/src/lib/ui.mjs +66 -0
- package/src/smoke-test.mjs +315 -0
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dw-flow
|
|
3
|
+
description: "Orchestrator: chạy toàn bộ workflow từ đầu đến cuối cho một task, tự động kết nối các phases, dừng tại các human checkpoints để confirm/feedback. Mạnh nhất khi bạn muốn AI tự drive cả task."
|
|
4
|
+
argument-hint: "[task-name] hoặc DW_DEPTH=[depth] [task-name]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# dw-flow — Full Task Workflow Orchestrator
|
|
8
|
+
|
|
9
|
+
Task: **$ARGUMENTS**
|
|
10
|
+
|
|
11
|
+
> AI sẽ tự động chạy qua tất cả phases phù hợp với depth của project.
|
|
12
|
+
> Bạn chỉ cần xem kết quả và phản hồi tại các **[CHECKPOINT]**.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Bước 0: Khởi động
|
|
17
|
+
|
|
18
|
+
### Parse arguments
|
|
19
|
+
|
|
20
|
+
Kiểm tra `$ARGUMENTS` có dạng `DW_DEPTH=[depth] [task-name]` không:
|
|
21
|
+
- Nếu có (ví dụ: `DW_DEPTH=quick fix-bug-123`) → dùng `quick` làm depth, `fix-bug-123` làm task-name
|
|
22
|
+
- Nếu không → task-name = `$ARGUMENTS` toàn bộ
|
|
23
|
+
|
|
24
|
+
### Đọc config
|
|
25
|
+
|
|
26
|
+
Đọc `.dw/config/dw.config.yml`:
|
|
27
|
+
- `workflow.default_depth` → depth mặc định (dùng nếu không có DW_DEPTH override)
|
|
28
|
+
- `paths.tasks` → location task docs (dùng làm base path — thay thế `{paths.tasks}` trong toàn bộ file này)
|
|
29
|
+
- `tracking.estimation`, `tracking.log_work`
|
|
30
|
+
- `team.roles` → ai cần approve gì
|
|
31
|
+
|
|
32
|
+
**Depth cuối cùng** = DW_DEPTH override (nếu có) → `workflow.default_depth` từ config.
|
|
33
|
+
|
|
34
|
+
### Kiểm tra task docs
|
|
35
|
+
|
|
36
|
+
Kiểm tra task đã có docs chưa (`{paths.tasks}/[task-name]/`):
|
|
37
|
+
- Nếu chưa → tạo mới (follow instructions trong `.claude/skills/dw-task-init/SKILL.md`)
|
|
38
|
+
- Nếu rồi → đọc progress, hỏi: "Task đã có docs. Tiếp tục từ phase nào?"
|
|
39
|
+
- Options: `research | plan | gate-c | execute | review | fresh-start`
|
|
40
|
+
- Nếu chọn `execute` → kiểm tra plan status trước (xem mục "Resume Handling")
|
|
41
|
+
- Nếu chọn `gate-c` → đọc plan và hiển thị GATE C như thể vừa xong phase Plan
|
|
42
|
+
|
|
43
|
+
Hiển thị kế hoạch trước khi bắt đầu:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
╔══════════════════════════════════════════════════════╗
|
|
47
|
+
║ dw-flow: [task-name]
|
|
48
|
+
║ Depth: [quick|standard|thorough]
|
|
49
|
+
║ Pipeline:
|
|
50
|
+
║ [danh sách phases sẽ chạy dựa trên depth]
|
|
51
|
+
╚══════════════════════════════════════════════════════╝
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Pipeline theo Depth
|
|
57
|
+
|
|
58
|
+
### quick
|
|
59
|
+
```
|
|
60
|
+
[1] Task Init → [2] Research (optional) → [GATE Q1: Confirm Scope]
|
|
61
|
+
→ [3] Execute → [GATE Q2: Approve Changes] → [4] Commit
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### standard *(mặc định)*
|
|
65
|
+
```
|
|
66
|
+
[1] Task Init → [2] Research → [GATE A: Confirm Scope]
|
|
67
|
+
→ [3] Plan → [GATE C: Approve Plan ← HARD GATE]
|
|
68
|
+
→ [4] Execute → [5] Review → [GATE D: Approve Changes] → [6] Commit
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### thorough
|
|
72
|
+
```
|
|
73
|
+
[1] Task Init → [2] Requirements → [GATE A: Confirm Scope]
|
|
74
|
+
→ [3] Estimate → [4] Research → [5] Arch Review → [GATE B: TL Approve Architecture]
|
|
75
|
+
→ [6] Plan → [GATE C: Approve Plan ← HARD GATE] → [7] Test Plan
|
|
76
|
+
→ [8] Execute → [9] Review → [GATE D: Approve Changes]
|
|
77
|
+
→ [10] Docs Update → [11] Log Work → [12] Commit
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
> ⚠ **Thorough depth** chạy 12 phases — chỉ dùng cho critical tasks. Nếu bị gián đoạn giữa chừng, dùng `stop` + resume thay vì restart.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Thực Hiện Từng Phase
|
|
85
|
+
|
|
86
|
+
Với **mỗi phase**, làm như sau:
|
|
87
|
+
1. Thông báo bắt đầu phase: `▶ Phase N: [tên phase]`
|
|
88
|
+
2. Follow **toàn bộ instructions** trong SKILL.md tương ứng (đường dẫn bên dưới)
|
|
89
|
+
3. Hiển thị output đầy đủ
|
|
90
|
+
4. Sau phase, nếu có GATE → hiển thị checkpoint (xem mục CHECKPOINTS)
|
|
91
|
+
5. Nếu không có GATE → thông báo "✓ Phase N complete" và chuyển ngay phase tiếp theo
|
|
92
|
+
|
|
93
|
+
### Quy tắc khi follow sub-skill trong flow context
|
|
94
|
+
|
|
95
|
+
Khi đọc và follow bất kỳ SKILL.md nào bên dưới, áp dụng các quy tắc sau:
|
|
96
|
+
- **BỎ QUA** phần "Tiếp theo: /dw-xxx" ở cuối mỗi skill — dw-flow tự handle next step
|
|
97
|
+
- **BỎ QUA** lệnh "DỪNG chờ approve" trong dw-plan và các skills tương tự — dw-flow sẽ hiển thị GATE thay thế
|
|
98
|
+
- **CHỈ** lấy output, ghi files, hiển thị kết quả — không tự dừng workflow
|
|
99
|
+
|
|
100
|
+
### SKILL.md references (đọc và follow từng file này):
|
|
101
|
+
- Task Init → `.claude/skills/dw-task-init/SKILL.md`
|
|
102
|
+
- Requirements → `.claude/skills/dw-requirements/SKILL.md`
|
|
103
|
+
- Estimate → `.claude/skills/dw-estimate/SKILL.md`
|
|
104
|
+
- Research → `.claude/skills/dw-research/SKILL.md`
|
|
105
|
+
- Arch Review → `.claude/skills/dw-arch-review/SKILL.md`
|
|
106
|
+
- Plan → `.claude/skills/dw-plan/SKILL.md`
|
|
107
|
+
- Test Plan → `.claude/skills/dw-test-plan/SKILL.md`
|
|
108
|
+
- Execute → `.claude/skills/dw-execute/SKILL.md`
|
|
109
|
+
- Review → `.claude/skills/dw-review/SKILL.md`
|
|
110
|
+
- Docs Update → `.claude/skills/dw-docs-update/SKILL.md`
|
|
111
|
+
- Log Work → `.claude/skills/dw-log-work/SKILL.md`
|
|
112
|
+
- Commit → `.claude/skills/dw-commit/SKILL.md`
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## CHECKPOINTS (Human Gates)
|
|
117
|
+
|
|
118
|
+
Tại mỗi GATE, **dừng lại** và hiển thị:
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
122
|
+
[GATE X] — [Tên gate]
|
|
123
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
124
|
+
[Tóm tắt output phase vừa xong — 3-5 bullets]
|
|
125
|
+
|
|
126
|
+
Options:
|
|
127
|
+
→ ok / continue Tiếp tục phase tiếp theo
|
|
128
|
+
→ revise: [feedback] AI chỉnh sửa phase này rồi hỏi lại
|
|
129
|
+
→ skip [phase-name] Bỏ qua phase tiếp theo
|
|
130
|
+
→ stop Dừng workflow tại đây
|
|
131
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Xử lý response:
|
|
135
|
+
|
|
136
|
+
**`ok` / `continue` / `approved` / _(bất kỳ affirmative)_**
|
|
137
|
+
→ Chuyển ngay phase tiếp theo, không hỏi thêm.
|
|
138
|
+
|
|
139
|
+
**`revise: [nội dung]`**
|
|
140
|
+
→ Đọc feedback, chỉnh sửa output của phase vừa xong.
|
|
141
|
+
→ Hiển thị lại output đã chỉnh.
|
|
142
|
+
→ Hỏi lại checkpoint (cùng options).
|
|
143
|
+
→ Có thể revise nhiều lần.
|
|
144
|
+
|
|
145
|
+
**`skip [phase-name]`**
|
|
146
|
+
→ Bỏ qua phase được chỉ định.
|
|
147
|
+
→ Thông báo: "Skipped [phase-name]. Continuing with [next-phase]..."
|
|
148
|
+
|
|
149
|
+
**`stop`**
|
|
150
|
+
→ Dừng workflow.
|
|
151
|
+
→ Tóm tắt những gì đã hoàn thành.
|
|
152
|
+
→ Hướng dẫn resume: "Để tiếp tục: `/dw-flow [task-name]` → chọn phase"
|
|
153
|
+
|
|
154
|
+
**Feedback tự do** (không dùng keyword trên)
|
|
155
|
+
→ Interpret là `revise: [feedback]`
|
|
156
|
+
→ AI tự hiểu và điều chỉnh.
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## GATE Descriptions
|
|
161
|
+
|
|
162
|
+
### GATE Q1 — Confirm Scope (quick only)
|
|
163
|
+
Sau Research (nếu có) hoặc Task Init.
|
|
164
|
+
Tóm tắt: phạm vi task, approach dự kiến, files sẽ thay đổi.
|
|
165
|
+
→ User confirm để tiếp tục Execute trực tiếp.
|
|
166
|
+
|
|
167
|
+
### GATE Q2 — Approve Changes (quick only)
|
|
168
|
+
Sau Review (nếu có) hoặc Execute.
|
|
169
|
+
Tóm tắt: thay đổi đã thực hiện, issues phát hiện (nếu review được chạy).
|
|
170
|
+
→ User confirm để commit.
|
|
171
|
+
|
|
172
|
+
### GATE A — Confirm Scope / Approve Research (standard + thorough)
|
|
173
|
+
Sau Research (hoặc Requirements với thorough).
|
|
174
|
+
Tóm tắt: phạm vi task, risks chính, approach gợi ý.
|
|
175
|
+
→ User confirm để tiếp tục Plan.
|
|
176
|
+
|
|
177
|
+
### GATE B — Approve Architecture (thorough only)
|
|
178
|
+
Sau Arch Review.
|
|
179
|
+
Tóm tắt: TL decisions, must-fix concerns.
|
|
180
|
+
→ Cần TL approve rõ ràng trước khi plan.
|
|
181
|
+
|
|
182
|
+
### GATE C — Approve Plan (standard + thorough) ← HARD GATE
|
|
183
|
+
Sau Plan. **Bắt buộc approve** — không tự ý skip.
|
|
184
|
+
Hiển thị:
|
|
185
|
+
- Số subtasks
|
|
186
|
+
- Estimated effort (nếu có)
|
|
187
|
+
- Top risks
|
|
188
|
+
- Files sẽ thay đổi
|
|
189
|
+
|
|
190
|
+
**Sau khi user approve GATE C:**
|
|
191
|
+
→ Cập nhật `{paths.tasks}/[task-name]/[task-name]-plan.md`: đổi `Trạng thái: Draft → cần approve` thành `Trạng thái: Approved`
|
|
192
|
+
→ Sau đó mới proceed sang Execute
|
|
193
|
+
|
|
194
|
+
→ Chỉ execute khi có explicit "approved" / "ok"
|
|
195
|
+
|
|
196
|
+
### GATE D — Approve Changes (standard + thorough)
|
|
197
|
+
Sau Review.
|
|
198
|
+
Tóm tắt: issues tìm được (Critical/Warning/Suggestion).
|
|
199
|
+
→ Nếu có Critical → **phải fix trước** khi commit.
|
|
200
|
+
→ Nếu chỉ Warning → user chọn.
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## Resume Handling
|
|
205
|
+
|
|
206
|
+
Khi user chọn resume từ `execute` mà plan chưa có `Trạng thái: Approved`:
|
|
207
|
+
1. Đọc plan file
|
|
208
|
+
2. Nếu status là `Draft` hoặc `cần approve` → **hiển thị GATE C** với nội dung plan hiện tại
|
|
209
|
+
3. Chỉ tiến vào Execute sau khi user approve GATE C và plan status đã được cập nhật
|
|
210
|
+
|
|
211
|
+
Khi user chọn `gate-c` trực tiếp:
|
|
212
|
+
→ Đọc plan file, hiển thị GATE C, xử lý như bình thường.
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Progress Tracking
|
|
217
|
+
|
|
218
|
+
Cập nhật `{paths.tasks}/[task-name]/[task-name]-progress.md` sau **mỗi phase** hoàn thành.
|
|
219
|
+
*(Lưu ý: `{paths.tasks}` là template — thay bằng giá trị `paths.tasks` đã đọc từ config)*
|
|
220
|
+
|
|
221
|
+
```markdown
|
|
222
|
+
## Flow Progress
|
|
223
|
+
| Phase | Status | Timestamp | Notes |
|
|
224
|
+
|-------|--------|-----------|-------|
|
|
225
|
+
| task-init | ✓ Done | [time] | |
|
|
226
|
+
| research | ✓ Done | [time] | [key finding] |
|
|
227
|
+
| plan | ✓ Done | [time] | [N subtasks] |
|
|
228
|
+
| execute | 🔄 In Progress | [time] | ST-2/4 done |
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## Khi Gặp Vấn Đề Trong Execute
|
|
234
|
+
|
|
235
|
+
Nếu trong phase Execute, phát hiện:
|
|
236
|
+
- **Scope vượt plan** → DỪNG, hiển thị mini-GATE:
|
|
237
|
+
```
|
|
238
|
+
⚠ Scope Issue Detected
|
|
239
|
+
→ extend-plan: [mô tả] Cập nhật plan rồi tiếp tục
|
|
240
|
+
→ skip-subtask Bỏ qua subtask này
|
|
241
|
+
→ stop Dừng để review lại
|
|
242
|
+
```
|
|
243
|
+
- **Test fail không rõ** → Tự động chạy debug routine (`.claude/skills/dw-debug/SKILL.md`), báo kết quả
|
|
244
|
+
- **Blocker** → Dừng, mô tả blocker rõ ràng, đề xuất options
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## Summary khi Hoàn Thành
|
|
249
|
+
|
|
250
|
+
```
|
|
251
|
+
╔══════════════════════════════════════════════════════╗
|
|
252
|
+
║ ✅ dw-flow complete: [task-name]
|
|
253
|
+
╠══════════════════════════════════════════════════════╣
|
|
254
|
+
║ Phases completed : [list]
|
|
255
|
+
║ Subtasks done : N/N
|
|
256
|
+
║ Commits : [N commits, hashes]
|
|
257
|
+
║ Effort : [Xh actual vs Yh estimated] (nếu tracking)
|
|
258
|
+
║ Issues found : [N Critical fixed, N Warnings]
|
|
259
|
+
╠══════════════════════════════════════════════════════╣
|
|
260
|
+
║ Còn lại (nếu có) :
|
|
261
|
+
║ - [ ] Chờ TL review PR
|
|
262
|
+
║ - [ ] Update DECISIONS.md (nếu có arch decision)
|
|
263
|
+
╚══════════════════════════════════════════════════════╝
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## Tips
|
|
269
|
+
|
|
270
|
+
- Muốn chạy nhanh nhất? Override depth: `/dw-flow DW_DEPTH=quick fix-bug-123`
|
|
271
|
+
- Muốn dừng và tiếp tục sau? Gõ `stop` tại bất kỳ GATE nào
|
|
272
|
+
- Muốn bỏ một phase? `skip docs-update` hoặc `skip log-work`
|
|
273
|
+
- Muốn xem lại plan trước khi approve? File ở `.dw/tasks/[task-name]/[task-name]-plan.md`
|
|
274
|
+
- Dừng giữa plan và execute? Resume bằng `gate-c` để re-confirm plan trước khi execute
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dw-handoff
|
|
3
|
+
description: "Tạo tài liệu bàn giao session để người hoặc agent tiếp theo có thể tiếp tục không cần hỏi lại. Dùng cuối session hoặc khi chuyển task."
|
|
4
|
+
argument-hint: "[task-name]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Bàn Giao Session
|
|
8
|
+
|
|
9
|
+
Task: **$ARGUMENTS**
|
|
10
|
+
|
|
11
|
+
## Đọc Config
|
|
12
|
+
|
|
13
|
+
Đọc `.dw/config/dw.config.yml` → `paths.tasks`, `workflow.default_depth`.
|
|
14
|
+
|
|
15
|
+
## Thu Thập Thông Tin
|
|
16
|
+
|
|
17
|
+
### 1. Git state
|
|
18
|
+
```bash
|
|
19
|
+
git log --oneline -5 # commits gần nhất
|
|
20
|
+
git status # unstaged/staged changes
|
|
21
|
+
git stash list # stashed work
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### 2. Task progress
|
|
25
|
+
Đọc `{paths.tasks}/$ARGUMENTS/$ARGUMENTS-progress.md`:
|
|
26
|
+
- Subtask nào đã done?
|
|
27
|
+
- Subtask nào đang làm dở?
|
|
28
|
+
- Blockers nào đang tồn tại?
|
|
29
|
+
|
|
30
|
+
### 3. Code state
|
|
31
|
+
- Có code uncommitted không?
|
|
32
|
+
- Tests đang ở trạng thái pass/fail?
|
|
33
|
+
- Có TODO/FIXME nào mới thêm vào?
|
|
34
|
+
|
|
35
|
+
## Viết Handoff Notes
|
|
36
|
+
|
|
37
|
+
Ghi vào mục "Handoff Notes" trong `{paths.tasks}/$ARGUMENTS/$ARGUMENTS-progress.md`:
|
|
38
|
+
|
|
39
|
+
```markdown
|
|
40
|
+
## Handoff Notes
|
|
41
|
+
|
|
42
|
+
### Session [ngày giờ] → [người/agent tiếp theo]
|
|
43
|
+
|
|
44
|
+
**Trạng thái nhanh**: [1 câu mô tả]
|
|
45
|
+
|
|
46
|
+
**Đang ở**: ST-[N] — [tên subtask] — [% hoặc mô tả tiến độ]
|
|
47
|
+
|
|
48
|
+
**Đã hoàn thành**:
|
|
49
|
+
- ✅ ST-1: [tên] (commit: abc1234)
|
|
50
|
+
- ✅ ST-2: [tên] (commit: def5678)
|
|
51
|
+
|
|
52
|
+
**Đang làm dở**:
|
|
53
|
+
- 🔄 ST-3: [tên]
|
|
54
|
+
- Done: [phần đã làm]
|
|
55
|
+
- Còn lại: [phần chưa làm]
|
|
56
|
+
- Files đang edit: [danh sách]
|
|
57
|
+
|
|
58
|
+
**Blockers**:
|
|
59
|
+
- ❌ [Blocker nếu có]
|
|
60
|
+
|
|
61
|
+
**Bước tiếp theo** (theo thứ tự):
|
|
62
|
+
1. [Việc cần làm đầu tiên]
|
|
63
|
+
2. [Tiếp theo]
|
|
64
|
+
|
|
65
|
+
**Context quan trọng**:
|
|
66
|
+
- [Quyết định A đã được đưa ra vì lý do X]
|
|
67
|
+
- [Cẩn thận: file Y có logic đặc biệt ở line Z]
|
|
68
|
+
- [Assumption: Z đang được coi là đúng]
|
|
69
|
+
|
|
70
|
+
**Uncommitted changes**: [Có / Không — nếu có, mô tả]
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Thông Báo
|
|
74
|
+
|
|
75
|
+
Sau khi ghi xong, hiển thị:
|
|
76
|
+
- Tóm tắt handoff notes
|
|
77
|
+
- Lệnh để người/agent tiếp theo bắt đầu:
|
|
78
|
+
```
|
|
79
|
+
Đọc: {paths.tasks}/$ARGUMENTS/$ARGUMENTS-progress.md
|
|
80
|
+
Tiếp tục: /dw-execute $ARGUMENTS
|
|
81
|
+
```
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dw-log-work
|
|
3
|
+
description: "Ghi nhận effort thực tế cho task hoặc subtask. So sánh với estimate. Cập nhật metrics tracking. Dùng sau khi hoàn thành subtask/task."
|
|
4
|
+
argument-hint: "[task-name]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Ghi Nhận Effort
|
|
8
|
+
|
|
9
|
+
Task: **$ARGUMENTS**
|
|
10
|
+
|
|
11
|
+
## Đọc Config
|
|
12
|
+
|
|
13
|
+
Đọc `.dw/config/dw.config.yml`:
|
|
14
|
+
- `tracking.log_work` — nếu `false` → thông báo "Log work chưa bật cho project này" và DỪNG
|
|
15
|
+
- `tracking.estimation_unit` → đơn vị (hours / story-points / t-shirt)
|
|
16
|
+
- `paths.tasks` → location task docs
|
|
17
|
+
|
|
18
|
+
## Hỏi User (Interactive)
|
|
19
|
+
|
|
20
|
+
Hỏi thông tin cần ghi:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
1. Subtask nào? (ST-1 / ST-2 / all)
|
|
24
|
+
2. Thời gian thực tế: [X hours/points]
|
|
25
|
+
3. Loại công việc: coding / testing / review / research / documentation
|
|
26
|
+
4. Ghi chú (optional): [lý do lệch estimate, blockers gặp, etc.]
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Ghi Vào Progress File
|
|
30
|
+
|
|
31
|
+
Cập nhật `{paths.tasks}/$ARGUMENTS/$ARGUMENTS-progress.md` → mục "Effort Log":
|
|
32
|
+
|
|
33
|
+
```markdown
|
|
34
|
+
| [date] | ST-N | [loại] | [estimate] | [actual] | [ghi chú] |
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Cập Nhật Metrics File
|
|
38
|
+
|
|
39
|
+
Ghi vào `.dw/metrics/effort-log.json`:
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"date": "YYYY-MM-DD",
|
|
44
|
+
"task": "task-name",
|
|
45
|
+
"subtask": "ST-N",
|
|
46
|
+
"type": "coding",
|
|
47
|
+
"estimate": X,
|
|
48
|
+
"actual": Y,
|
|
49
|
+
"variance": Y-X,
|
|
50
|
+
"accuracy_pct": (X/Y)*100,
|
|
51
|
+
"notes": "..."
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Tóm Tắt
|
|
56
|
+
|
|
57
|
+
Sau khi log, hiển thị:
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
✅ Đã ghi: ST-N — Actual: Xh (Estimate: Yh)
|
|
61
|
+
Variance: +Zh (over) / -Zh (under)
|
|
62
|
+
|
|
63
|
+
Task tổng (đến hiện tại):
|
|
64
|
+
Total estimated: Xh
|
|
65
|
+
Total actual: Yh
|
|
66
|
+
Accuracy: Z%
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Nếu variance > 50%: "⚠️ Lệch estimate đáng kể. Cân nhắc cập nhật estimate cho subtasks còn lại."
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dw-plan
|
|
3
|
+
description: "Lập kế hoạch implementation chi tiết sau khi đã research. Thiết kế giải pháp, phân chia subtasks, xác định rủi ro. DỪNG để chờ approval trước khi execute."
|
|
4
|
+
argument-hint: "[task-name]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Grep
|
|
8
|
+
- Glob
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Lập Kế Hoạch Implementation
|
|
12
|
+
|
|
13
|
+
Task: **$ARGUMENTS**
|
|
14
|
+
|
|
15
|
+
## Đọc Config
|
|
16
|
+
|
|
17
|
+
Đọc `.dw/config/dw.config.yml` → lấy:
|
|
18
|
+
- `paths.tasks` → location task docs
|
|
19
|
+
- `tracking.estimation` → có include estimation trong plan không
|
|
20
|
+
- `tracking.estimation_unit` → đơn vị (hours / story-points / t-shirt)
|
|
21
|
+
- `team.roles` → ai cần approve (có `techlead` → plan cần TL review)
|
|
22
|
+
- `workflow.default_depth` → `thorough` = cần arch-review trước execute
|
|
23
|
+
|
|
24
|
+
## QUAN TRỌNG
|
|
25
|
+
- KHÔNG implement bất cứ gì
|
|
26
|
+
- KHÔNG sửa code
|
|
27
|
+
- CHỈ đọc, phân tích, và viết plan
|
|
28
|
+
- DỪNG LẠI cuối cùng để chờ user/TL approve
|
|
29
|
+
|
|
30
|
+
## Bước 1: Đọc Context
|
|
31
|
+
|
|
32
|
+
Đọc `{paths.tasks}/$ARGUMENTS/$ARGUMENTS-context.md` — file research đã tạo.
|
|
33
|
+
Nếu chưa có → thông báo: "Cần chạy `/dw-research $ARGUMENTS` trước."
|
|
34
|
+
|
|
35
|
+
## Bước 2: Thiết kế giải pháp
|
|
36
|
+
|
|
37
|
+
### Xem xét phương án
|
|
38
|
+
- Liệt kê ÍT NHẤT 2 phương án khả thi
|
|
39
|
+
- So sánh trade-offs: complexity, performance, maintainability, timeline
|
|
40
|
+
- Chọn phương án tối ưu và giải thích lý do
|
|
41
|
+
|
|
42
|
+
### Áp dụng THINKING.md
|
|
43
|
+
1. **Critical Thinking**: Giả định nào? Rủi ro gì? Edge cases?
|
|
44
|
+
2. **Systems Thinking**: Tác động lên modules khác? Data flow thay đổi?
|
|
45
|
+
3. **Multiple Perspectives**: User? Developer? Security? Ops?
|
|
46
|
+
|
|
47
|
+
## Bước 3: Phân chia subtasks
|
|
48
|
+
|
|
49
|
+
Mỗi subtask PHẢI có:
|
|
50
|
+
- **Mô tả**: Cụ thể, actionable
|
|
51
|
+
- **Files**: Danh sách files cần thay đổi
|
|
52
|
+
- **Acceptance criteria**: Điều kiện hoàn thành rõ ràng
|
|
53
|
+
- **Dependencies**: Subtask nào phải xong trước
|
|
54
|
+
- **Estimate** (nếu `tracking.estimation = true`): Effort dự kiến theo `tracking.estimation_unit`
|
|
55
|
+
|
|
56
|
+
Thứ tự subtasks theo dependency graph:
|
|
57
|
+
1. Schema/data changes trước
|
|
58
|
+
2. Service/business logic tiếp
|
|
59
|
+
3. API/routes sau
|
|
60
|
+
4. Tests song song hoặc trước (TDD)
|
|
61
|
+
5. Docs cuối
|
|
62
|
+
|
|
63
|
+
## Bước 4: Viết plan
|
|
64
|
+
|
|
65
|
+
Ghi vào `{paths.tasks}/$ARGUMENTS/$ARGUMENTS-plan.md`:
|
|
66
|
+
|
|
67
|
+
```markdown
|
|
68
|
+
# Plan: [Task Name]
|
|
69
|
+
|
|
70
|
+
## Ngày tạo: [date]
|
|
71
|
+
## Trạng thái: Draft → cần approve
|
|
72
|
+
|
|
73
|
+
## Tóm Tắt Giải Pháp
|
|
74
|
+
[1-2 đoạn mô tả approach đã chọn]
|
|
75
|
+
|
|
76
|
+
## Phương Án Đã Xem Xét
|
|
77
|
+
| # | Phương án | Ưu điểm | Nhược điểm | Chọn? |
|
|
78
|
+
|---|-----------|---------|------------|-------|
|
|
79
|
+
|
|
80
|
+
## Subtasks
|
|
81
|
+
### ST-1: [Tên subtask]
|
|
82
|
+
- **Mô tả**: ...
|
|
83
|
+
- **Files**: ...
|
|
84
|
+
- **Criteria**: ...
|
|
85
|
+
- **Dependencies**: none
|
|
86
|
+
- **Estimate**: [nếu có]
|
|
87
|
+
|
|
88
|
+
### ST-2: [Tên subtask]
|
|
89
|
+
...
|
|
90
|
+
|
|
91
|
+
## Rủi Ro & Giả Định
|
|
92
|
+
| # | Loại | Mô tả | Xác suất | Tác động | Giảm thiểu |
|
|
93
|
+
|---|------|--------|----------|----------|------------|
|
|
94
|
+
|
|
95
|
+
## Edge Cases
|
|
96
|
+
- [ ] ...
|
|
97
|
+
|
|
98
|
+
## Tác Động Hệ Thống
|
|
99
|
+
- Modules ảnh hưởng: ...
|
|
100
|
+
- API changes: ...
|
|
101
|
+
- Migration: ...
|
|
102
|
+
- Backward compatibility: ...
|
|
103
|
+
|
|
104
|
+
## Góc Nhìn & Trade-offs
|
|
105
|
+
| Quyết định | User | Dev | Security |
|
|
106
|
+
|-----------|------|-----|----------|
|
|
107
|
+
|
|
108
|
+
## Estimation Tổng (nếu enabled)
|
|
109
|
+
- Research: [done]
|
|
110
|
+
- Planning: [done]
|
|
111
|
+
- Coding: [estimate]
|
|
112
|
+
- Testing: [estimate]
|
|
113
|
+
- Review: [estimate]
|
|
114
|
+
- Total: [sum]
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Bước 5: DỪNG & Trình bày
|
|
118
|
+
|
|
119
|
+
Trình bày plan cho user với:
|
|
120
|
+
1. Tóm tắt approach (3-5 câu)
|
|
121
|
+
2. Số subtasks và estimate tổng (nếu có)
|
|
122
|
+
3. Top 2 risks
|
|
123
|
+
4. Yêu cầu: "Approve plan này để tiếp tục `/dw-execute $ARGUMENTS`"
|
|
124
|
+
|
|
125
|
+
Nếu team có TL: "Plan cần TL review trước khi execute."
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Plan: [Task Name]
|
|
2
|
+
|
|
3
|
+
## Ngày: [date] | Trạng thái: Draft → Approved
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Tóm Tắt
|
|
8
|
+
|
|
9
|
+
[1-2 câu: mục tiêu và approach được chọn]
|
|
10
|
+
|
|
11
|
+
## Phương Án So Sánh
|
|
12
|
+
|
|
13
|
+
| # | Phương án | Ưu điểm | Nhược điểm | Chọn? |
|
|
14
|
+
|---|-----------|---------|------------|-------|
|
|
15
|
+
| 1 | | | | **Chọn** |
|
|
16
|
+
| 2 | | | | Loại — lý do: |
|
|
17
|
+
|
|
18
|
+
## Subtasks
|
|
19
|
+
|
|
20
|
+
### ST-1: [Tên]
|
|
21
|
+
- **Mô tả**: [cụ thể]
|
|
22
|
+
- **Files**: [danh sách]
|
|
23
|
+
- **Criteria**: [ ] [điều kiện pass]
|
|
24
|
+
- **Dependencies**: none
|
|
25
|
+
- **Estimate**: [nếu bật]
|
|
26
|
+
|
|
27
|
+
### ST-2: [Tên]
|
|
28
|
+
- **Mô tả**: ...
|
|
29
|
+
- **Dependencies**: ST-1
|
|
30
|
+
|
|
31
|
+
## Rủi Ro & Giả Định
|
|
32
|
+
|
|
33
|
+
| # | Loại | Mô tả | Xác suất | Tác động | Mitigation |
|
|
34
|
+
|---|------|--------|----------|----------|------------|
|
|
35
|
+
| 1 | Giả định | | | | |
|
|
36
|
+
| 2 | Rủi ro | | Cao/TB/Thấp | | |
|
|
37
|
+
|
|
38
|
+
## Edge Cases
|
|
39
|
+
|
|
40
|
+
- [ ] [Edge case cần xử lý]
|
|
41
|
+
|
|
42
|
+
## Tác Động Hệ Thống
|
|
43
|
+
|
|
44
|
+
- Modules: [danh sách]
|
|
45
|
+
- API changes: [Có / Không]
|
|
46
|
+
- Migration: [Có / Không]
|
|
47
|
+
- Breaking: [Có / Không]
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dw-requirements
|
|
3
|
+
description: "BA skill: Thu thập, phân tích và viết requirements document + user stories. Dùng ở đầu feature trước khi dev bắt đầu."
|
|
4
|
+
argument-hint: "[feature-name]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Glob
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Thu Thập & Viết Requirements
|
|
12
|
+
|
|
13
|
+
Feature: **$ARGUMENTS**
|
|
14
|
+
|
|
15
|
+
## Đọc Config
|
|
16
|
+
|
|
17
|
+
Đọc `.dw/config/dw.config.yml` → `paths.tasks`, `team.roles`, `workflow.default_depth`.
|
|
18
|
+
Skill này dành cho depth: `standard` hoặc `thorough`.
|
|
19
|
+
|
|
20
|
+
## Quy Trình
|
|
21
|
+
|
|
22
|
+
### 1. Thu thập thông tin
|
|
23
|
+
|
|
24
|
+
Hỏi (hoặc đọc từ conversation context):
|
|
25
|
+
- **Business goal**: Mục tiêu kinh doanh là gì?
|
|
26
|
+
- **User problems**: Người dùng đang gặp vấn đề gì?
|
|
27
|
+
- **Stakeholders**: Ai bị ảnh hưởng? (end user, admin, ops)
|
|
28
|
+
- **Scope**: In-scope là gì? Out-of-scope là gì?
|
|
29
|
+
- **Constraints**: Deadline? Tech constraints? Budget?
|
|
30
|
+
- **Success criteria**: Làm sao biết feature thành công?
|
|
31
|
+
|
|
32
|
+
### 2. Phân tích & cấu trúc
|
|
33
|
+
|
|
34
|
+
Tổ chức yêu cầu thành:
|
|
35
|
+
- **Functional requirements**: Hệ thống PHẢI làm gì
|
|
36
|
+
- **Non-functional requirements**: Performance, security, scalability
|
|
37
|
+
- **User stories**: As [who], I want [what], so that [why]
|
|
38
|
+
- **Acceptance criteria**: Điều kiện pass/fail
|
|
39
|
+
|
|
40
|
+
### 3. Tạo Requirements Doc
|
|
41
|
+
|
|
42
|
+
Ghi ra `{paths.tasks}/$ARGUMENTS/$ARGUMENTS-requirements.md`:
|
|
43
|
+
|
|
44
|
+
```markdown
|
|
45
|
+
# Requirements: [Feature Name]
|
|
46
|
+
|
|
47
|
+
## Ngày: [date] | Author: BA | Status: Draft
|
|
48
|
+
|
|
49
|
+
## Business Context
|
|
50
|
+
**Goal**: [Mục tiêu kinh doanh]
|
|
51
|
+
**Problem**: [Vấn đề cần giải quyết]
|
|
52
|
+
**Success Metrics**: [Đo lường thành công bằng gì]
|
|
53
|
+
|
|
54
|
+
## Stakeholders
|
|
55
|
+
| Role | Nhu cầu | Priority |
|
|
56
|
+
|------|---------|---------|
|
|
57
|
+
| End User | | Must-have |
|
|
58
|
+
| Admin | | |
|
|
59
|
+
|
|
60
|
+
## User Stories
|
|
61
|
+
|
|
62
|
+
### Epic: [Tên epic]
|
|
63
|
+
|
|
64
|
+
**US-001**: Tiêu đề ngắn gọn
|
|
65
|
+
- **As**: [role]
|
|
66
|
+
- **I want**: [action/feature]
|
|
67
|
+
- **So that**: [business value]
|
|
68
|
+
- **Acceptance Criteria**:
|
|
69
|
+
- [ ] Given [context], when [action], then [result]
|
|
70
|
+
- [ ] Given [context], when [edge case], then [expected behavior]
|
|
71
|
+
- **Priority**: Must-have / Should-have / Nice-to-have
|
|
72
|
+
- **Estimate**: [rough size]
|
|
73
|
+
|
|
74
|
+
## Functional Requirements
|
|
75
|
+
| # | Requirement | Priority | Notes |
|
|
76
|
+
|---|------------|---------|-------|
|
|
77
|
+
|
|
78
|
+
## Non-Functional Requirements
|
|
79
|
+
| # | Requirement | Metric |
|
|
80
|
+
|---|------------|--------|
|
|
81
|
+
| NFR-1 | Performance: page load < 2s | p95 |
|
|
82
|
+
| NFR-2 | Availability: 99.9% uptime | |
|
|
83
|
+
|
|
84
|
+
## Out of Scope
|
|
85
|
+
- [Điều này KHÔNG bao gồm]
|
|
86
|
+
|
|
87
|
+
## Open Questions
|
|
88
|
+
- [ ] [Câu hỏi cần BA/PM làm rõ]
|
|
89
|
+
|
|
90
|
+
## Dependencies
|
|
91
|
+
- [Feature/system khác cần có trước]
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Sau Khi Tạo
|
|
95
|
+
|
|
96
|
+
- Thông báo dev: "Requirements doc sẵn sàng tại [path]"
|
|
97
|
+
- Gợi ý: "TL có thể chạy `/dw-arch-review $ARGUMENTS` để review technical feasibility"
|
|
98
|
+
- Gợi ý: "Dev có thể chạy `/dw-task-init $ARGUMENTS` để bắt đầu implementation"
|