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,98 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dw-research
|
|
3
|
+
description: "Khảo sát và phân tích codebase trước khi lập kế hoạch. Tìm patterns, dependencies, và ảnh hưởng của thay đổi. Dùng khi cần hiểu code trước khi implement."
|
|
4
|
+
argument-hint: "[task-name]"
|
|
5
|
+
context: fork
|
|
6
|
+
agent: researcher
|
|
7
|
+
allowed-tools:
|
|
8
|
+
- Read
|
|
9
|
+
- Grep
|
|
10
|
+
- Glob
|
|
11
|
+
- "Bash(git log *)"
|
|
12
|
+
- "Bash(git diff *)"
|
|
13
|
+
- "Bash(git show *)"
|
|
14
|
+
- "Bash(git blame *)"
|
|
15
|
+
- "Bash(ls *)"
|
|
16
|
+
- "Bash(wc *)"
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
# Khảo Sát Codebase
|
|
20
|
+
|
|
21
|
+
Task: **$ARGUMENTS**
|
|
22
|
+
|
|
23
|
+
## Đọc Config
|
|
24
|
+
|
|
25
|
+
Đọc `.dw/config/dw.config.yml` → lấy `paths.tasks` để biết output location.
|
|
26
|
+
|
|
27
|
+
## Bước 1: Đọc yêu cầu
|
|
28
|
+
|
|
29
|
+
- Đọc file `{paths.tasks}/$ARGUMENTS/$ARGUMENTS-plan.md` nếu đã có mô tả yêu cầu
|
|
30
|
+
- Hoặc lấy yêu cầu từ conversation context
|
|
31
|
+
|
|
32
|
+
## Bước 2: Khảo sát
|
|
33
|
+
|
|
34
|
+
Thực hiện các bước sau (không cần theo thứ tự cứng):
|
|
35
|
+
|
|
36
|
+
1. **Tìm files liên quan**: Dùng Glob + Grep để tìm files theo keywords từ yêu cầu
|
|
37
|
+
2. **Đọc code**: Đọc các files tìm được, hiểu logic hiện tại
|
|
38
|
+
3. **Trace data flow**: Theo dõi luồng dữ liệu từ input → processing → output
|
|
39
|
+
4. **Xác định dependencies**:
|
|
40
|
+
- Upstream: modules/APIs mà code hiện tại gọi đến
|
|
41
|
+
- Downstream: modules/APIs gọi đến code hiện tại
|
|
42
|
+
5. **Tìm patterns**: Conventions, design patterns đang dùng trong project
|
|
43
|
+
6. **Kiểm tra tests**: Đã có test coverage cho khu vực liên quan?
|
|
44
|
+
7. **Git history**: Xem lịch sử thay đổi gần đây của files liên quan
|
|
45
|
+
|
|
46
|
+
## Bước 3: Áp dụng tư duy phản biện
|
|
47
|
+
|
|
48
|
+
Từ framework `.claude/skills/dw-thinking/THINKING.md`:
|
|
49
|
+
- **Giả định**: Những gì đang giả định là đúng? Cần kiểm chứng?
|
|
50
|
+
- **Dependencies**: Module nào bị ảnh hưởng nếu thay đổi?
|
|
51
|
+
- **Edge cases**: Trường hợp biên nào cần xem xét?
|
|
52
|
+
- **Rủi ro**: Rủi ro kỹ thuật, bảo mật, performance?
|
|
53
|
+
|
|
54
|
+
## Bước 4: Ghi kết quả
|
|
55
|
+
|
|
56
|
+
Ghi vào `{paths.tasks}/$ARGUMENTS/$ARGUMENTS-context.md` theo cấu trúc:
|
|
57
|
+
|
|
58
|
+
```markdown
|
|
59
|
+
# Context: [Task Name]
|
|
60
|
+
|
|
61
|
+
## Ngày khảo sát: [date]
|
|
62
|
+
|
|
63
|
+
## Yêu Cầu Gốc
|
|
64
|
+
[Copy yêu cầu]
|
|
65
|
+
|
|
66
|
+
## Files Liên Quan
|
|
67
|
+
| File | Vai trò | Cần thay đổi? | Ghi chú |
|
|
68
|
+
|------|---------|----------------|---------|
|
|
69
|
+
|
|
70
|
+
## Kiến Trúc Hiện Tại
|
|
71
|
+
[Mô tả luồng, diagram nếu cần]
|
|
72
|
+
|
|
73
|
+
## Dependencies
|
|
74
|
+
**Upstream**: ...
|
|
75
|
+
**Downstream**: ...
|
|
76
|
+
|
|
77
|
+
## Patterns & Conventions
|
|
78
|
+
- [Pattern]: [mô tả]
|
|
79
|
+
|
|
80
|
+
## Giả Định & Hạn Chế
|
|
81
|
+
- Giả định: ...
|
|
82
|
+
- Hạn chế: ...
|
|
83
|
+
- Chưa rõ: ...
|
|
84
|
+
|
|
85
|
+
## Test Coverage Hiện Tại
|
|
86
|
+
[Có test không? Coverage ở đâu?]
|
|
87
|
+
|
|
88
|
+
## Ghi Chú
|
|
89
|
+
[Bất kỳ thông tin bổ sung]
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Bước 5: Tóm tắt
|
|
93
|
+
|
|
94
|
+
Khi hoàn thành, trả về tóm tắt:
|
|
95
|
+
- Số files khảo sát
|
|
96
|
+
- Key findings (3-5 bullets)
|
|
97
|
+
- Risks & unknowns
|
|
98
|
+
- Gợi ý: "Tiếp theo chạy `/dw-plan $ARGUMENTS`"
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Research: [Task Name]
|
|
2
|
+
|
|
3
|
+
## Ngày: [date] | Agent: researcher
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Yêu Cầu
|
|
8
|
+
|
|
9
|
+
[Mô tả ngắn gọn task / yêu cầu cần khảo sát]
|
|
10
|
+
|
|
11
|
+
## Files Liên Quan
|
|
12
|
+
|
|
13
|
+
| # | File | Vai trò | Cần thay đổi? |
|
|
14
|
+
|---|------|---------|----------------|
|
|
15
|
+
| 1 | | | Có / Không |
|
|
16
|
+
|
|
17
|
+
## Kiến Trúc Hiện Tại
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
[Sơ đồ ASCII đơn giản hoặc mô tả luồng hiện tại]
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Dependencies
|
|
24
|
+
|
|
25
|
+
**Upstream** (phụ thuộc vào):
|
|
26
|
+
- [Module/API]
|
|
27
|
+
|
|
28
|
+
**Downstream** (bị ảnh hưởng):
|
|
29
|
+
- [Module/API]
|
|
30
|
+
|
|
31
|
+
## Patterns Phát Hiện
|
|
32
|
+
|
|
33
|
+
| Pattern | Mô tả | Ví dụ (file) |
|
|
34
|
+
|---------|--------|--------------|
|
|
35
|
+
| | | |
|
|
36
|
+
|
|
37
|
+
## Test Coverage
|
|
38
|
+
|
|
39
|
+
- Tests hiện có: [Có / Không / Partial]
|
|
40
|
+
- Files test: [danh sách nếu có]
|
|
41
|
+
- Gaps: [thiếu test ở đâu]
|
|
42
|
+
|
|
43
|
+
## Giả Định & Hạn Chế
|
|
44
|
+
|
|
45
|
+
- **Giả định**: [điều đang coi là đúng]
|
|
46
|
+
- **Hạn chế**: [giới hạn đã biết]
|
|
47
|
+
- **Chưa rõ**: [cần làm rõ thêm]
|
|
48
|
+
|
|
49
|
+
## Ghi Chú
|
|
50
|
+
|
|
51
|
+
[Bất kỳ context quan trọng: gotchas, tech debt, lịch sử thay đổi gần đây]
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dw-review
|
|
3
|
+
description: "Review code thay đổi gần đây hoặc cả task. Kiểm tra correctness, security, conventions, test coverage. Tạo báo cáo phân loại Critical/Warning/Suggestion."
|
|
4
|
+
argument-hint: "[task-name | branch | file]"
|
|
5
|
+
context: fork
|
|
6
|
+
agent: reviewer
|
|
7
|
+
allowed-tools:
|
|
8
|
+
- Read
|
|
9
|
+
- Grep
|
|
10
|
+
- Glob
|
|
11
|
+
- "Bash(git diff *)"
|
|
12
|
+
- "Bash(git log *)"
|
|
13
|
+
- "Bash(git show *)"
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Code Review
|
|
17
|
+
|
|
18
|
+
Target: **$ARGUMENTS**
|
|
19
|
+
|
|
20
|
+
## Đọc Config
|
|
21
|
+
|
|
22
|
+
Đọc `.dw/config/dw.config.yml` → `paths.tasks`, `workflow.default_depth`.
|
|
23
|
+
|
|
24
|
+
## Xác Định Scope
|
|
25
|
+
|
|
26
|
+
- Nếu có argument = task-name: review tất cả commits liên quan đến task
|
|
27
|
+
- Nếu có argument = branch: `git diff main...$ARGUMENTS`
|
|
28
|
+
- Nếu không có argument: `git diff HEAD~1` (commit gần nhất)
|
|
29
|
+
|
|
30
|
+
## Quy Trình
|
|
31
|
+
|
|
32
|
+
### 1. Lấy diff
|
|
33
|
+
```bash
|
|
34
|
+
git diff [scope] --name-only # danh sách files changed
|
|
35
|
+
git diff [scope] # nội dung thay đổi
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 2. Đọc files liên quan
|
|
39
|
+
Đọc toàn bộ files đã changed để hiểu full context (không chỉ diff).
|
|
40
|
+
|
|
41
|
+
### 3. Review theo reviewer agent
|
|
42
|
+
|
|
43
|
+
Agent `reviewer` sẽ kiểm tra:
|
|
44
|
+
- **Correctness**: Logic, edge cases, error handling
|
|
45
|
+
- **Security**: Input validation, auth, data exposure
|
|
46
|
+
- **Performance**: N+1, unnecessary calls, complexity
|
|
47
|
+
- **Tests**: Coverage, test quality
|
|
48
|
+
- **Conventions**: Naming, structure, code style (`.claude/rules/code-style.md`)
|
|
49
|
+
|
|
50
|
+
### 4. Kiểm tra checklist cụ thể
|
|
51
|
+
|
|
52
|
+
Nếu có plan file (`{paths.tasks}/$ARGUMENTS/$ARGUMENTS-plan.md`):
|
|
53
|
+
- Đối chiếu acceptance criteria từng subtask
|
|
54
|
+
- Kiểm tra scope có vượt plan không
|
|
55
|
+
|
|
56
|
+
### 5. Output
|
|
57
|
+
|
|
58
|
+
Tạo báo cáo đầy đủ theo format của reviewer agent.
|
|
59
|
+
|
|
60
|
+
## Sau Review
|
|
61
|
+
|
|
62
|
+
- Nếu có Critical issues: "Cần fix trước khi merge"
|
|
63
|
+
- Nếu chỉ có Warnings: "Khuyến khích fix, nhưng có thể proceed"
|
|
64
|
+
- Nếu pass: "Approved — có thể chạy `/dw-commit`"
|
|
65
|
+
|
|
66
|
+
Nếu team có TL: "Gợi ý gửi báo cáo này cho TL để final approve."
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Code Review Checklist
|
|
2
|
+
|
|
3
|
+
Dùng checklist này khi review code. Phân loại mỗi issue tìm được.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 🔴 Critical — Phải sửa trước khi merge
|
|
8
|
+
|
|
9
|
+
### Correctness
|
|
10
|
+
- [ ] Logic có đúng với requirements không?
|
|
11
|
+
- [ ] Có lỗi off-by-one, null pointer, type mismatch?
|
|
12
|
+
- [ ] Race conditions hoặc concurrency issues?
|
|
13
|
+
- [ ] Data loss scenarios (delete không có confirm, overwrite không safe)?
|
|
14
|
+
|
|
15
|
+
### Security
|
|
16
|
+
- [ ] Input validation đầy đủ (SQL injection, XSS, path traversal)?
|
|
17
|
+
- [ ] Authentication & authorization đúng ở mọi endpoint?
|
|
18
|
+
- [ ] Sensitive data không bị log, expose qua API, hoặc lưu plain text?
|
|
19
|
+
- [ ] Secrets/credentials không hardcode trong code?
|
|
20
|
+
- [ ] CORS, rate limiting, CSRF được xử lý đúng?
|
|
21
|
+
|
|
22
|
+
### Data Integrity
|
|
23
|
+
- [ ] Database transactions dùng đúng chỗ?
|
|
24
|
+
- [ ] Foreign key constraints được tôn trọng?
|
|
25
|
+
- [ ] Migration có rollback plan?
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 🟡 Warning — Nên sửa
|
|
30
|
+
|
|
31
|
+
### Performance
|
|
32
|
+
- [ ] Có N+1 query problem không? (loop gọi DB từng item)
|
|
33
|
+
- [ ] Index database cho các query thường xuyên?
|
|
34
|
+
- [ ] Tải file/data lớn có streaming/pagination?
|
|
35
|
+
- [ ] Cache được dùng hợp lý (không over-cache, không under-cache)?
|
|
36
|
+
|
|
37
|
+
### Error Handling
|
|
38
|
+
- [ ] Mọi error đều được catch và xử lý?
|
|
39
|
+
- [ ] Error messages có đủ context để debug không?
|
|
40
|
+
- [ ] API trả về đúng HTTP status code?
|
|
41
|
+
- [ ] Không có empty catch blocks?
|
|
42
|
+
|
|
43
|
+
### Code Quality
|
|
44
|
+
- [ ] Functions quá dài (>50 lines) hoặc làm nhiều hơn 1 việc?
|
|
45
|
+
- [ ] Code duplication đáng kể (>3 lần) không có abstraction?
|
|
46
|
+
- [ ] Magic numbers/strings chưa được đặt tên?
|
|
47
|
+
- [ ] Dead code, commented-out code còn sót?
|
|
48
|
+
|
|
49
|
+
### Testing
|
|
50
|
+
- [ ] Happy path được test?
|
|
51
|
+
- [ ] Edge cases được test (empty, null, max value)?
|
|
52
|
+
- [ ] Error paths được test?
|
|
53
|
+
- [ ] Test có mock internal implementation không? (nên tránh)
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 🔵 Suggestion — Cân nhắc
|
|
58
|
+
|
|
59
|
+
### Readability
|
|
60
|
+
- [ ] Naming rõ ràng, tự giải thích?
|
|
61
|
+
- [ ] Complex logic có comment giải thích WHY?
|
|
62
|
+
- [ ] Imports được organize (external → internal → relative)?
|
|
63
|
+
|
|
64
|
+
### Maintainability
|
|
65
|
+
- [ ] Có thể test được (testability)?
|
|
66
|
+
- [ ] Dependencies được inject thay vì hardcode?
|
|
67
|
+
- [ ] Breaking changes được document?
|
|
68
|
+
|
|
69
|
+
### Conventions
|
|
70
|
+
- [ ] Tuân thủ `.claude/rules/code-style.md`?
|
|
71
|
+
- [ ] File structure nhất quán với phần còn lại của project?
|
|
72
|
+
- [ ] Commit message đúng format?
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## ✅ Điểm Tốt Cần Ghi Nhận
|
|
77
|
+
|
|
78
|
+
[Ghi lại những pattern tốt, approaches thông minh, hoặc improvements đáng khen]
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Severity Scale
|
|
83
|
+
|
|
84
|
+
| Level | Mô tả | Action |
|
|
85
|
+
|-------|--------|--------|
|
|
86
|
+
| 🔴 Critical | Security issue, data loss, logic sai | Phải fix trước merge |
|
|
87
|
+
| 🟡 Warning | Performance, maintainability, error handling | Nên fix, có thể negotiate |
|
|
88
|
+
| 🔵 Suggestion | Style, readability, nice-to-have | Cân nhắc, không bắt buộc |
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dw-rollback
|
|
3
|
+
description: "Revert task docs về trạng thái trước. Dùng khi plan sai, execute sai hướng, hoặc cần bắt đầu lại từ sau research."
|
|
4
|
+
argument-hint: "[task-name] [checkpoint: after-research | after-plan | clean]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Rollback Task Docs: $ARGUMENTS
|
|
8
|
+
|
|
9
|
+
## Parse Arguments
|
|
10
|
+
|
|
11
|
+
Từ `$ARGUMENTS`:
|
|
12
|
+
- `task-name`: tên task cần rollback
|
|
13
|
+
- `checkpoint` (optional): điểm muốn revert về
|
|
14
|
+
- `after-research` — giữ context.md, xóa plan.md và reset progress.md
|
|
15
|
+
- `after-plan` — giữ context.md + plan.md, reset progress.md về trạng thái ban đầu
|
|
16
|
+
- `clean` — xóa toàn bộ nội dung, giữ files trống (restart từ đầu)
|
|
17
|
+
- (không có) → hỏi user chọn
|
|
18
|
+
|
|
19
|
+
## Bước 1: Đọc config
|
|
20
|
+
|
|
21
|
+
`paths.tasks` → xác định thư mục task.
|
|
22
|
+
|
|
23
|
+
## Bước 2: Kiểm tra task tồn tại
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
{paths.tasks}/[task-name]/
|
|
27
|
+
├── [task-name]-context.md
|
|
28
|
+
├── [task-name]-plan.md
|
|
29
|
+
└── [task-name]-progress.md
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Nếu không tìm thấy → thông báo và DỪNG.
|
|
33
|
+
|
|
34
|
+
## Bước 3: Git checkpoint (an toàn)
|
|
35
|
+
|
|
36
|
+
Kiểm tra uncommitted changes trong task docs:
|
|
37
|
+
```bash
|
|
38
|
+
git status {paths.tasks}/[task-name]/
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Nếu có uncommitted changes → hỏi: "Có uncommitted changes trong task docs. Commit trước khi rollback? (y/n/skip)"
|
|
42
|
+
|
|
43
|
+
## Bước 4: Hiển thị preview và confirm
|
|
44
|
+
|
|
45
|
+
Hiển thị rõ sẽ làm gì:
|
|
46
|
+
```
|
|
47
|
+
Rollback [task-name] về checkpoint: [checkpoint]
|
|
48
|
+
|
|
49
|
+
Sẽ GIỮ:
|
|
50
|
+
✓ [task-name]-context.md (research findings)
|
|
51
|
+
|
|
52
|
+
Sẽ RESET:
|
|
53
|
+
✗ [task-name]-plan.md → xóa nội dung, giữ file trống
|
|
54
|
+
✗ [task-name]-progress.md → reset về "Not Started"
|
|
55
|
+
|
|
56
|
+
Tiếp tục? (y/n)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Chờ user confirm trước khi thực hiện.
|
|
60
|
+
|
|
61
|
+
## Bước 5: Thực hiện rollback
|
|
62
|
+
|
|
63
|
+
### checkpoint = "after-research"
|
|
64
|
+
- Giữ `context.md` nguyên vẹn
|
|
65
|
+
- Reset `plan.md` → file trống (chỉ giữ header)
|
|
66
|
+
- Reset `progress.md` → status = "Not Started", xóa subtask rows
|
|
67
|
+
|
|
68
|
+
### checkpoint = "after-plan"
|
|
69
|
+
- Giữ `context.md` nguyên vẹn
|
|
70
|
+
- Giữ `plan.md` nguyên vẹn
|
|
71
|
+
- Reset `progress.md` → status = "Not Started", tất cả subtasks = Pending
|
|
72
|
+
|
|
73
|
+
### checkpoint = "clean"
|
|
74
|
+
- Reset tất cả 3 files về template trống
|
|
75
|
+
- Điền lại [Task Name] và [date]
|
|
76
|
+
|
|
77
|
+
## Bước 6: Thông báo
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
Rollback hoàn tất.
|
|
81
|
+
|
|
82
|
+
Task: [task-name]
|
|
83
|
+
Checkpoint: [checkpoint]
|
|
84
|
+
Thời gian: [timestamp]
|
|
85
|
+
|
|
86
|
+
Bước tiếp theo:
|
|
87
|
+
- after-research → Chạy /dw-plan [task-name] để lập kế hoạch lại
|
|
88
|
+
- after-plan → Chạy /dw-execute [task-name] để implement lại
|
|
89
|
+
- clean → Chạy /dw-research [task-name] để bắt đầu từ đầu
|
|
90
|
+
```
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dw-sprint-review
|
|
3
|
+
description: "Tổng kết sprint: tasks hoàn thành, metrics, lessons learned, items cho sprint tiếp theo. Dành cho team retrospective cuối sprint."
|
|
4
|
+
argument-hint: "[sprint-name hoặc period: e.g. sprint-3, 2026-03]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Sprint Review: $ARGUMENTS
|
|
8
|
+
|
|
9
|
+
## Đọc Config
|
|
10
|
+
|
|
11
|
+
Đọc `.dw/config/dw.config.yml`:
|
|
12
|
+
- `paths.tasks` → tìm task docs
|
|
13
|
+
- `.dw/metrics` → tìm effort data
|
|
14
|
+
- `tracking.estimation`, `tracking.log_work` → biết có data nào
|
|
15
|
+
|
|
16
|
+
## Bước 1: Thu thập dữ liệu
|
|
17
|
+
|
|
18
|
+
### Tasks trong sprint
|
|
19
|
+
Scan `{paths.tasks}/` tìm tasks có status Done hoặc In Progress trong kỳ sprint.
|
|
20
|
+
Đọc `*-progress.md` của mỗi task để lấy:
|
|
21
|
+
- Trạng thái cuối
|
|
22
|
+
- Effort estimate vs actual
|
|
23
|
+
- Blockers gặp phải
|
|
24
|
+
- Commits liên quan
|
|
25
|
+
|
|
26
|
+
### Git history
|
|
27
|
+
```bash
|
|
28
|
+
git log --oneline --since="[sprint-start]" --until="[sprint-end]"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Bước 2: Tạo báo cáo sprint
|
|
32
|
+
|
|
33
|
+
Ghi vào `{paths.reports}/sprint-review-$ARGUMENTS.md`:
|
|
34
|
+
|
|
35
|
+
```markdown
|
|
36
|
+
# Sprint Review: [Sprint Name]
|
|
37
|
+
|
|
38
|
+
**Kỳ**: [start] → [end]
|
|
39
|
+
**Team**: [roles từ config]
|
|
40
|
+
**Ngày tạo**: [date]
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Tóm Tắt
|
|
45
|
+
|
|
46
|
+
| Metric | Giá trị |
|
|
47
|
+
|--------|---------|
|
|
48
|
+
| Tasks hoàn thành | X/Y |
|
|
49
|
+
| Estimate tổng | Xh |
|
|
50
|
+
| Actual tổng | Xh |
|
|
51
|
+
| Accuracy | X% |
|
|
52
|
+
| Commits | X |
|
|
53
|
+
|
|
54
|
+
## Tasks Hoàn Thành
|
|
55
|
+
|
|
56
|
+
| Task | Estimate | Actual | Variance | Ghi chú |
|
|
57
|
+
|------|----------|--------|----------|---------|
|
|
58
|
+
| [task-name] | | | | |
|
|
59
|
+
|
|
60
|
+
## Tasks Chưa Hoàn Thành / Carry-over
|
|
61
|
+
|
|
62
|
+
| Task | Lý do | Hành động |
|
|
63
|
+
|------|-------|-----------|
|
|
64
|
+
| | | |
|
|
65
|
+
|
|
66
|
+
## Blockers Gặp Phải
|
|
67
|
+
|
|
68
|
+
[Danh sách blockers, đã giải quyết hay chưa]
|
|
69
|
+
|
|
70
|
+
## Lessons Learned
|
|
71
|
+
|
|
72
|
+
### Làm tốt (Keep)
|
|
73
|
+
- [Điều gì hiệu quả trong sprint này]
|
|
74
|
+
|
|
75
|
+
### Cần cải thiện (Improve)
|
|
76
|
+
- [Điều gì cần làm khác đi]
|
|
77
|
+
|
|
78
|
+
### Thử nghiệm (Try)
|
|
79
|
+
- [Điều gì muốn thử trong sprint sau]
|
|
80
|
+
|
|
81
|
+
## Items Cho Sprint Tiếp Theo
|
|
82
|
+
|
|
83
|
+
- [ ] [Action item 1] — owner: [role]
|
|
84
|
+
- [ ] [Action item 2]
|
|
85
|
+
|
|
86
|
+
## DORA Metrics (nếu có data)
|
|
87
|
+
|
|
88
|
+
| Metric | Giá trị | Target |
|
|
89
|
+
|--------|---------|--------|
|
|
90
|
+
| Deployment frequency | | |
|
|
91
|
+
| Lead time for changes | | |
|
|
92
|
+
| Change failure rate | | |
|
|
93
|
+
| MTTR | | |
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Bước 3: Thông báo
|
|
97
|
+
|
|
98
|
+
Hiển thị summary và path đến file báo cáo.
|
|
99
|
+
Gợi ý: "PM có thể chạy `/dw-dashboard` để xem báo cáo đầy đủ hơn."
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dw-task-init
|
|
3
|
+
description: "Khởi tạo bộ documentation cho task mới. Tạo thư mục và 3 template files (context, plan, progress)."
|
|
4
|
+
argument-hint: "[task-name]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Khởi Tạo Task: $ARGUMENTS
|
|
8
|
+
|
|
9
|
+
## Đọc Config
|
|
10
|
+
|
|
11
|
+
Đọc `.dw/config/dw.config.yml` để lấy:
|
|
12
|
+
- `paths.tasks` → thư mục chứa task docs (mặc định: `.dw/tasks`)
|
|
13
|
+
- `workflow.default_depth` → `quick | standard | thorough`
|
|
14
|
+
- `tracking.estimation` → có tạo section estimation không
|
|
15
|
+
- `tracking.log_work` → có tạo section effort log không
|
|
16
|
+
- `team.roles` → hiển thị workflow phù hợp
|
|
17
|
+
- `project.language` → chọn template ngôn ngữ
|
|
18
|
+
|
|
19
|
+
## Tạo Thư Mục & Files
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
{paths.tasks}/$ARGUMENTS/
|
|
23
|
+
├── $ARGUMENTS-context.md # Research findings & codebase analysis
|
|
24
|
+
├── $ARGUMENTS-plan.md # Implementation plan & design
|
|
25
|
+
└── $ARGUMENTS-progress.md # Progress tracking, effort log, changelog
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### File context.md
|
|
29
|
+
Đọc `project.language` từ config để chọn template:
|
|
30
|
+
- `language: "vi"` → dùng `.claude/templates/task-context.md`
|
|
31
|
+
- `language: "en"` → dùng `.claude/templates/en/task-context.md`
|
|
32
|
+
|
|
33
|
+
Điền vào template:
|
|
34
|
+
- `[Task Name]` = `$ARGUMENTS`
|
|
35
|
+
- `[date]` = ngày hiện tại
|
|
36
|
+
|
|
37
|
+
### File plan.md
|
|
38
|
+
Chọn template theo `project.language` (`.claude/templates/[lang]/task-plan.md`).
|
|
39
|
+
- Nếu `tracking.estimation = true`: giữ nguyên section Estimation
|
|
40
|
+
- Nếu `tracking.estimation = false`: xóa section Estimation
|
|
41
|
+
|
|
42
|
+
### File progress.md
|
|
43
|
+
Chọn template theo `project.language` (`.claude/templates/[lang]/task-progress.md`).
|
|
44
|
+
- Điền `[Task Name]` = `$ARGUMENTS`
|
|
45
|
+
- Điền `[date]` = ngày hiện tại
|
|
46
|
+
- Nếu `tracking.log_work = true`: giữ section Effort Log
|
|
47
|
+
- Nếu `tracking.log_work = false`: xóa section Effort Log
|
|
48
|
+
|
|
49
|
+
## Sau Khi Tạo
|
|
50
|
+
|
|
51
|
+
Hiển thị cho user:
|
|
52
|
+
1. Danh sách files đã tạo
|
|
53
|
+
2. Workflow tiếp theo dựa trên `workflow.default_depth`:
|
|
54
|
+
|
|
55
|
+
**quick**: "Tiếp theo: Code ngay hoặc `/dw-research $ARGUMENTS` nếu cần khảo sát"
|
|
56
|
+
**standard**: "Tiếp theo: `/dw-research $ARGUMENTS` → `/dw-plan $ARGUMENTS` → approve → `/dw-execute $ARGUMENTS`"
|
|
57
|
+
**thorough**: "Tiếp theo: `/dw-requirements $ARGUMENTS` → `/dw-research $ARGUMENTS` → `/dw-estimate $ARGUMENTS` → `/dw-plan $ARGUMENTS`"
|
|
58
|
+
|
|
59
|
+
Nếu team có BA: "Gợi ý: BA có thể chạy `/dw-requirements $ARGUMENTS` trước để chuẩn bị yêu cầu"
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dw-test-plan
|
|
3
|
+
description: "QC skill: Tạo test plan cho feature/task. Bao gồm test cases, edge cases, regression checklist. Dùng sau khi plan được approve."
|
|
4
|
+
argument-hint: "[task-name | feature-name]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Glob
|
|
9
|
+
- Grep
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Tạo Test Plan
|
|
13
|
+
|
|
14
|
+
Feature/Task: **$ARGUMENTS**
|
|
15
|
+
|
|
16
|
+
## Đọc Config
|
|
17
|
+
|
|
18
|
+
Đọc `.dw/config/dw.config.yml` → `paths.tasks`, `workflow.default_depth`.
|
|
19
|
+
Skill này dành cho depth: `standard` hoặc `thorough` (QC role).
|
|
20
|
+
|
|
21
|
+
## Đọc Tài Liệu Liên Quan
|
|
22
|
+
|
|
23
|
+
1. Đọc requirements: `{paths.tasks}/$ARGUMENTS/$ARGUMENTS-requirements.md` (nếu có)
|
|
24
|
+
2. Đọc plan: `{paths.tasks}/$ARGUMENTS/$ARGUMENTS-plan.md`
|
|
25
|
+
3. Đọc context: `{paths.tasks}/$ARGUMENTS/$ARGUMENTS-context.md`
|
|
26
|
+
|
|
27
|
+
## Tạo Test Plan
|
|
28
|
+
|
|
29
|
+
Ghi ra `{paths.tasks}/$ARGUMENTS/$ARGUMENTS-test-plan.md`:
|
|
30
|
+
|
|
31
|
+
```markdown
|
|
32
|
+
# Test Plan: [Feature/Task Name]
|
|
33
|
+
|
|
34
|
+
## Ngày: [date] | QC: [name] | Status: Draft
|
|
35
|
+
|
|
36
|
+
## Scope
|
|
37
|
+
**In scope**: [Những gì sẽ được test]
|
|
38
|
+
**Out of scope**: [Những gì KHÔNG test]
|
|
39
|
+
**Test environment**: [dev / staging]
|
|
40
|
+
|
|
41
|
+
## Test Strategy
|
|
42
|
+
- [ ] Unit testing (dev responsibility)
|
|
43
|
+
- [ ] Integration testing
|
|
44
|
+
- [ ] Manual functional testing (QC)
|
|
45
|
+
- [ ] Regression testing
|
|
46
|
+
- [ ] Performance testing (nếu cần)
|
|
47
|
+
- [ ] Security testing (nếu cần)
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Test Cases
|
|
52
|
+
|
|
53
|
+
### TC-001: [Happy Path - Tên mô tả]
|
|
54
|
+
- **Preconditions**: [Điều kiện trước]
|
|
55
|
+
- **Steps**:
|
|
56
|
+
1. [Bước 1]
|
|
57
|
+
2. [Bước 2]
|
|
58
|
+
- **Expected Result**: [Kết quả mong đợi]
|
|
59
|
+
- **Priority**: P1 Critical / P2 High / P3 Medium / P4 Low
|
|
60
|
+
- **Status**: Not Run / Pass / Fail / Blocked
|
|
61
|
+
|
|
62
|
+
### TC-002: [Edge Case]
|
|
63
|
+
...
|
|
64
|
+
|
|
65
|
+
### TC-00N: [Negative Test]
|
|
66
|
+
...
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Regression Checklist
|
|
71
|
+
|
|
72
|
+
Các tính năng hiện có có thể bị ảnh hưởng bởi thay đổi này:
|
|
73
|
+
- [ ] [Feature A] — Test: [quick test steps]
|
|
74
|
+
- [ ] [Feature B]
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Performance Criteria (nếu applicable)
|
|
79
|
+
| Metric | Target | Actual |
|
|
80
|
+
|--------|--------|--------|
|
|
81
|
+
| Page load | < 2s | |
|
|
82
|
+
| API response | < 500ms | |
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Bug Report Template
|
|
87
|
+
|
|
88
|
+
```markdown
|
|
89
|
+
**Bug**: [Tiêu đề ngắn gọn]
|
|
90
|
+
**Severity**: Critical / High / Medium / Low
|
|
91
|
+
**Steps to Reproduce**:
|
|
92
|
+
1.
|
|
93
|
+
**Expected**:
|
|
94
|
+
**Actual**:
|
|
95
|
+
**Environment**: [OS, Browser, Version]
|
|
96
|
+
**Screenshot**: [đính kèm]
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Sign-off Criteria
|
|
102
|
+
- [ ] Tất cả P1 test cases PASS
|
|
103
|
+
- [ ] Không có open Critical/High bugs
|
|
104
|
+
- [ ] Regression checklist clear
|
|
105
|
+
- [ ] Performance criteria met
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Thông Báo
|
|
109
|
+
|
|
110
|
+
Sau khi tạo:
|
|
111
|
+
- "Test plan sẵn sàng: [path]"
|
|
112
|
+
- Gợi ý cho dev: "Review test cases để đảm bảo unit tests cover các scenarios này"
|
|
113
|
+
- Gợi ý cho TL: "Review có cần thêm test cases nào không"
|