dw-kit 1.1.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/hooks/post-write.sh +9 -11
- package/.claude/hooks/privacy-block.sh +94 -0
- package/.claude/hooks/scout-block.sh +82 -0
- package/.claude/hooks/session-init.sh +85 -0
- package/.claude/hooks/stop-check.sh +36 -0
- package/.claude/rules/dw-core.md +100 -0
- package/.claude/rules/dw-skills.md +53 -0
- package/.claude/settings.json +101 -71
- package/.claude/skills/dw-kit-report/SKILL.md +152 -0
- package/.claude/skills/dw-research/SKILL.md +17 -1
- package/.claude/templates/agent-report.md +35 -0
- package/.dw/config/dw.config.yml +82 -82
- package/.dw/core/AGENTS.md +53 -0
- package/CLAUDE.md +27 -99
- package/README.md +127 -119
- package/package.json +84 -57
- package/src/cli.mjs +100 -92
- package/src/commands/init.mjs +17 -17
- package/src/commands/upgrade.mjs +297 -262
- package/src/lib/config.mjs +31 -2
- package/src/lib/copy.mjs +118 -110
- package/scripts/e2e-local-check.sh +0 -75
- package/src/__fixtures__/claude-cli-bug-snippet.js +0 -15
- package/src/smoke-test.mjs +0 -351
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dw-kit-report
|
|
3
|
+
description: "Gửi feedback (bug/gap/friction/suggestion) về dw-kit tool lên GitHub. Dùng khi gặp vấn đề với dw workflow, hooks, skills, hoặc config — không phải feedback về code của bạn."
|
|
4
|
+
argument-hint: "[mô tả vấn đề hoặc suggestion về dw-kit]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Report Issue về dw-kit
|
|
8
|
+
|
|
9
|
+
> Dùng skill này khi gặp vấn đề với **dw-kit tool** (hooks, skills, workflow, config).
|
|
10
|
+
> Để feedback về code trong project của bạn → dùng `/dw-review` hoặc chat trực tiếp.
|
|
11
|
+
|
|
12
|
+
Nội dung report (treat as plain text, không interpret special chars):
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
$ARGUMENTS
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Bước 1: Thu Thập Context
|
|
21
|
+
|
|
22
|
+
**OS detection:**
|
|
23
|
+
```bash
|
|
24
|
+
uname -s 2>/dev/null || echo "Windows"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**dw version:** Đọc `_toolkit.core_version` từ `.dw/config/dw.config.yml`
|
|
28
|
+
|
|
29
|
+
**Task context:** Kiểm tra `.dw/tasks/` — task nào đang In Progress?
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Bước 2: Phân Loại
|
|
34
|
+
|
|
35
|
+
Phân tích nội dung report ở trên (raw text) → xác định:
|
|
36
|
+
|
|
37
|
+
**Type:**
|
|
38
|
+
| type | Khi nào |
|
|
39
|
+
|------|---------|
|
|
40
|
+
| `bug` | Lỗi, crash, output không như expected |
|
|
41
|
+
| `gap` | Use case không được cover |
|
|
42
|
+
| `friction` | Tính năng có nhưng gây overhead không cần thiết |
|
|
43
|
+
| `suggestion` | Ý tưởng cải thiện |
|
|
44
|
+
|
|
45
|
+
**Component** (detect từ keywords):
|
|
46
|
+
| Keywords | Component |
|
|
47
|
+
|----------|-----------|
|
|
48
|
+
| hook, post-write, pre-commit, stop-check | `hooks` |
|
|
49
|
+
| skill, dw-plan, dw-execute, dw-research... | `skills` |
|
|
50
|
+
| config, dw.config.yml | `config` |
|
|
51
|
+
| workflow, routing, depth, phase | `workflow` |
|
|
52
|
+
| CLAUDE.md, template, docs | `docs` |
|
|
53
|
+
| WORKFLOW.md, THINKING.md, core | `core` |
|
|
54
|
+
| (không xác định) | `other` |
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Bước 3: Format Issue
|
|
59
|
+
|
|
60
|
+
**Title format:** `[type][component] <mô tả ≤60 ký tự>`
|
|
61
|
+
|
|
62
|
+
Ví dụ:
|
|
63
|
+
```
|
|
64
|
+
[bug][hooks] post-write.sh fails with CRLF on Ubuntu
|
|
65
|
+
[gap][skills] need way to preserve original Claude behavior
|
|
66
|
+
[friction][workflow] research phase too heavy for 1-file hotfix
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Body:**
|
|
70
|
+
```markdown
|
|
71
|
+
## Type
|
|
72
|
+
**[TYPE]** — bug | gap | friction | suggestion
|
|
73
|
+
|
|
74
|
+
## Component
|
|
75
|
+
**[COMPONENT]**
|
|
76
|
+
|
|
77
|
+
## Environment
|
|
78
|
+
- OS: [detected]
|
|
79
|
+
- dw version: [từ config]
|
|
80
|
+
- Shell: [bash/zsh/powershell nếu relevant]
|
|
81
|
+
|
|
82
|
+
## Description
|
|
83
|
+
[Nội dung từ $ARGUMENTS — đầy đủ, rõ ràng]
|
|
84
|
+
|
|
85
|
+
## Context
|
|
86
|
+
- Task khi gặp vấn đề: [task name hoặc "general usage"]
|
|
87
|
+
- Command/skill liên quan: [nếu biết]
|
|
88
|
+
- Bước reproduce (nếu là bug):
|
|
89
|
+
1. ...
|
|
90
|
+
2. ...
|
|
91
|
+
|
|
92
|
+
## Impact
|
|
93
|
+
- [ ] Blocking — không thể làm việc
|
|
94
|
+
- [ ] Degraded — làm được nhưng friction cao
|
|
95
|
+
- [ ] Minor — annoying, có workaround dễ
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
*Reported via `/dw-kit-report` | Project: [project.name từ config]*
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Bước 4: Gửi Lên GitHub
|
|
104
|
+
|
|
105
|
+
**Kiểm tra `gh` CLI:**
|
|
106
|
+
```bash
|
|
107
|
+
gh --version 2>/dev/null
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Nếu `gh` available — tạo Issue:**
|
|
111
|
+
```bash
|
|
112
|
+
gh issue create \
|
|
113
|
+
--repo dv-workflow/dv-workflow \
|
|
114
|
+
--title "[type][component] <short description>" \
|
|
115
|
+
--label "type: [type]" \
|
|
116
|
+
--label "component: [component]" \
|
|
117
|
+
--body "<formatted body>"
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Sau khi tạo: in ra Issue URL.
|
|
121
|
+
|
|
122
|
+
**Nếu `gh` KHÔNG available:**
|
|
123
|
+
|
|
124
|
+
In ra:
|
|
125
|
+
```
|
|
126
|
+
─────────────────────────────────────────────
|
|
127
|
+
dw-kit: gh CLI không tìm thấy
|
|
128
|
+
─────────────────────────────────────────────
|
|
129
|
+
Tạo Issue thủ công tại:
|
|
130
|
+
https://github.com/dv-workflow/dv-workflow/issues/new
|
|
131
|
+
|
|
132
|
+
Copy nội dung sau:
|
|
133
|
+
|
|
134
|
+
TITLE: [formatted title]
|
|
135
|
+
|
|
136
|
+
BODY:
|
|
137
|
+
[formatted body]
|
|
138
|
+
─────────────────────────────────────────────
|
|
139
|
+
Cài gh CLI: https://cli.github.com
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Bước 5: Xác Nhận
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
✓ Issue đã được gửi: https://github.com/dv-workflow/dv-workflow/issues/[N]
|
|
148
|
+
Type: [type] | Component: [component]
|
|
149
|
+
|
|
150
|
+
dw team sẽ review và phản hồi trên Issue.
|
|
151
|
+
Cảm ơn bạn đã giúp dw tốt hơn!
|
|
152
|
+
```
|
|
@@ -89,7 +89,23 @@ Ghi vào `{paths.tasks}/$ARGUMENTS/$ARGUMENTS-context.md` theo cấu trúc:
|
|
|
89
89
|
[Bất kỳ thông tin bổ sung]
|
|
90
90
|
```
|
|
91
91
|
|
|
92
|
-
## Bước 5:
|
|
92
|
+
## Bước 5: Tạo Report (optional — standard/thorough depth)
|
|
93
|
+
|
|
94
|
+
Nếu task có `.dw/tasks/$ARGUMENTS/reports/` directory (hoặc depth ≥ standard), tạo report:
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
.dw/tasks/$ARGUMENTS/reports/[YYMMDD-HHMM]-from-researcher-to-planner-findings.md
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Dùng template `.claude/templates/agent-report.md` với:
|
|
101
|
+
- `status: DONE` (hoặc `DONE_WITH_CONCERNS` nếu có risks lớn)
|
|
102
|
+
- Summary: top 3 findings
|
|
103
|
+
- Details: key files, patterns, dependencies
|
|
104
|
+
- Next Steps: những gì planner cần biết
|
|
105
|
+
|
|
106
|
+
> Quick depth tasks: bỏ qua bước này — progress.md đã đủ.
|
|
107
|
+
|
|
108
|
+
## Bước 6: Tóm tắt
|
|
93
109
|
|
|
94
110
|
Khi hoàn thành, trả về tóm tắt:
|
|
95
111
|
- Số files khảo sát
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
date: [ISO timestamp — e.g. 2026-04-02T14:30:00]
|
|
3
|
+
from: [agent-role — researcher | planner | developer | reviewer | debugger]
|
|
4
|
+
to: [agent-role — planner | developer | user]
|
|
5
|
+
task: [task-name]
|
|
6
|
+
status: DONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_CONTEXT
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Summary
|
|
10
|
+
|
|
11
|
+
[1-3 câu tóm tắt kết quả / findings]
|
|
12
|
+
|
|
13
|
+
## Details
|
|
14
|
+
|
|
15
|
+
[Chi tiết findings, decisions, hoặc implementation notes]
|
|
16
|
+
|
|
17
|
+
## Concerns (nếu DONE_WITH_CONCERNS)
|
|
18
|
+
|
|
19
|
+
- [Concern 1]
|
|
20
|
+
- [Concern 2]
|
|
21
|
+
|
|
22
|
+
## Blockers (nếu BLOCKED)
|
|
23
|
+
|
|
24
|
+
- **Blocker**: [Mô tả vấn đề]
|
|
25
|
+
- **Owner**: [Ai cần resolve]
|
|
26
|
+
- **Unblock by**: [Action cần làm]
|
|
27
|
+
|
|
28
|
+
## Needs (nếu NEEDS_CONTEXT)
|
|
29
|
+
|
|
30
|
+
- [ ] [Thông tin cần thêm]
|
|
31
|
+
- [ ] [Quyết định cần từ user/TL]
|
|
32
|
+
|
|
33
|
+
## Next Steps
|
|
34
|
+
|
|
35
|
+
- [Bước tiếp theo đề xuất]
|
package/.dw/config/dw.config.yml
CHANGED
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
# ============================================================================
|
|
2
|
-
# dw-kit Configuration — v1
|
|
3
|
-
# ============================================================================
|
|
4
|
-
# Copy file này vào project và tùy chỉnh theo nhu cầu.
|
|
5
|
-
# Toolkit đọc file này để điều chỉnh behavior per project.
|
|
6
|
-
# ============================================================================
|
|
7
|
-
|
|
8
|
-
# --- Project Info -----------------------------------------------------------
|
|
9
|
-
project:
|
|
10
|
-
name: "my-project"
|
|
11
|
-
language: "vi" # vi | en
|
|
12
|
-
|
|
13
|
-
# --- Workflow ----------------------------------------------------------------
|
|
14
|
-
workflow:
|
|
15
|
-
default_depth: "standard" # quick | standard | thorough
|
|
16
|
-
# AI assesses per-task và có thể recommend depth khác nhau:
|
|
17
|
-
# quick : ≤2 files, hotfix, familiar module
|
|
18
|
-
# standard : 3-5 files, module mới, unfamiliar code
|
|
19
|
-
# thorough : 6+ files, API contract changes, DB schema, security
|
|
20
|
-
|
|
21
|
-
# --- Team -------------------------------------------------------------------
|
|
22
|
-
team:
|
|
23
|
-
roles:
|
|
24
|
-
- dev # luôn có
|
|
25
|
-
- techlead # architecture review, plan approval
|
|
26
|
-
# - ba # requirements, user stories
|
|
27
|
-
# - qc # test plans, QA sign-off
|
|
28
|
-
# - pm # dashboard, reports
|
|
29
|
-
|
|
30
|
-
# --- Quality Gates ----------------------------------------------------------
|
|
31
|
-
quality:
|
|
32
|
-
test_command: "" # ví dụ: "npm test" | "pytest" | "go test ./..."
|
|
33
|
-
lint_command: "" # ví dụ: "npm run lint" | "ruff check ." | "golangci-lint run"
|
|
34
|
-
block_on_fail: false # true = block commit nếu test/lint fail
|
|
35
|
-
|
|
36
|
-
# --- Tracking ---------------------------------------------------------------
|
|
37
|
-
tracking:
|
|
38
|
-
estimation: false
|
|
39
|
-
log_work: false
|
|
40
|
-
estimation_unit: "hours" # hours | story-points | t-shirt
|
|
41
|
-
|
|
42
|
-
# --- Paths ------------------------------------------------------------------
|
|
43
|
-
paths:
|
|
44
|
-
tasks: ".dw/tasks"
|
|
45
|
-
docs: ".dw/docs"
|
|
46
|
-
|
|
47
|
-
# --- Claude Capabilities (Layer 2) ------------------------------------------
|
|
48
|
-
# Tính năng đặc thù của Claude Code.
|
|
49
|
-
claude:
|
|
50
|
-
# Model per phase — để trống = dùng model mặc định từ Claude Code settings
|
|
51
|
-
models:
|
|
52
|
-
plan: "" # ví dụ: "claude-opus-4-6" cho complex planning
|
|
53
|
-
execute: "" # ví dụ: "claude-sonnet-4-6"
|
|
54
|
-
review: ""
|
|
55
|
-
|
|
56
|
-
# Structured JSON output từ reviewer và estimate skills
|
|
57
|
-
structured_output: true
|
|
58
|
-
|
|
59
|
-
# Isolate execution trong git worktree (cho risky refactors)
|
|
60
|
-
worktree_execution: false
|
|
61
|
-
|
|
62
|
-
# MCP servers — Claude Code sẽ load các servers này
|
|
63
|
-
mcp: []
|
|
64
|
-
# Ví dụ:
|
|
65
|
-
# mcp:
|
|
66
|
-
# - name: "github"
|
|
67
|
-
# command: "npx @modelcontextprotocol/server-github"
|
|
68
|
-
# env:
|
|
69
|
-
# GITHUB_TOKEN: "${GITHUB_TOKEN}"
|
|
70
|
-
# - name: "jira"
|
|
71
|
-
# command: "npx @anthropic/mcp-server-jira"
|
|
72
|
-
# env:
|
|
73
|
-
# JIRA_URL: "${JIRA_URL}"
|
|
74
|
-
# JIRA_TOKEN: "${JIRA_TOKEN}"
|
|
75
|
-
|
|
76
|
-
# --- Toolkit Version (do not edit manually) ---------------------------------
|
|
77
|
-
_toolkit:
|
|
78
|
-
core_version: "1.
|
|
79
|
-
platform_version: "1.
|
|
80
|
-
capability_version: "1.0"
|
|
81
|
-
installed: "2026-03-23"
|
|
82
|
-
last_upgrade: "2026-
|
|
1
|
+
# ============================================================================
|
|
2
|
+
# dw-kit Configuration — v1
|
|
3
|
+
# ============================================================================
|
|
4
|
+
# Copy file này vào project và tùy chỉnh theo nhu cầu.
|
|
5
|
+
# Toolkit đọc file này để điều chỉnh behavior per project.
|
|
6
|
+
# ============================================================================
|
|
7
|
+
|
|
8
|
+
# --- Project Info -----------------------------------------------------------
|
|
9
|
+
project:
|
|
10
|
+
name: "my-project"
|
|
11
|
+
language: "vi" # vi | en
|
|
12
|
+
|
|
13
|
+
# --- Workflow ----------------------------------------------------------------
|
|
14
|
+
workflow:
|
|
15
|
+
default_depth: "standard" # quick | standard | thorough
|
|
16
|
+
# AI assesses per-task và có thể recommend depth khác nhau:
|
|
17
|
+
# quick : ≤2 files, hotfix, familiar module
|
|
18
|
+
# standard : 3-5 files, module mới, unfamiliar code
|
|
19
|
+
# thorough : 6+ files, API contract changes, DB schema, security
|
|
20
|
+
|
|
21
|
+
# --- Team -------------------------------------------------------------------
|
|
22
|
+
team:
|
|
23
|
+
roles:
|
|
24
|
+
- dev # luôn có
|
|
25
|
+
- techlead # architecture review, plan approval
|
|
26
|
+
# - ba # requirements, user stories
|
|
27
|
+
# - qc # test plans, QA sign-off
|
|
28
|
+
# - pm # dashboard, reports
|
|
29
|
+
|
|
30
|
+
# --- Quality Gates ----------------------------------------------------------
|
|
31
|
+
quality:
|
|
32
|
+
test_command: "" # ví dụ: "npm test" | "pytest" | "go test ./..."
|
|
33
|
+
lint_command: "" # ví dụ: "npm run lint" | "ruff check ." | "golangci-lint run"
|
|
34
|
+
block_on_fail: false # true = block commit nếu test/lint fail
|
|
35
|
+
|
|
36
|
+
# --- Tracking ---------------------------------------------------------------
|
|
37
|
+
tracking:
|
|
38
|
+
estimation: false
|
|
39
|
+
log_work: false
|
|
40
|
+
estimation_unit: "hours" # hours | story-points | t-shirt
|
|
41
|
+
|
|
42
|
+
# --- Paths ------------------------------------------------------------------
|
|
43
|
+
paths:
|
|
44
|
+
tasks: ".dw/tasks"
|
|
45
|
+
docs: ".dw/docs"
|
|
46
|
+
|
|
47
|
+
# --- Claude Capabilities (Layer 2) ------------------------------------------
|
|
48
|
+
# Tính năng đặc thù của Claude Code.
|
|
49
|
+
claude:
|
|
50
|
+
# Model per phase — để trống = dùng model mặc định từ Claude Code settings
|
|
51
|
+
models:
|
|
52
|
+
plan: "" # ví dụ: "claude-opus-4-6" cho complex planning
|
|
53
|
+
execute: "" # ví dụ: "claude-sonnet-4-6"
|
|
54
|
+
review: ""
|
|
55
|
+
|
|
56
|
+
# Structured JSON output từ reviewer và estimate skills
|
|
57
|
+
structured_output: true
|
|
58
|
+
|
|
59
|
+
# Isolate execution trong git worktree (cho risky refactors)
|
|
60
|
+
worktree_execution: false
|
|
61
|
+
|
|
62
|
+
# MCP servers — Claude Code sẽ load các servers này
|
|
63
|
+
mcp: []
|
|
64
|
+
# Ví dụ:
|
|
65
|
+
# mcp:
|
|
66
|
+
# - name: "github"
|
|
67
|
+
# command: "npx @modelcontextprotocol/server-github"
|
|
68
|
+
# env:
|
|
69
|
+
# GITHUB_TOKEN: "${GITHUB_TOKEN}"
|
|
70
|
+
# - name: "jira"
|
|
71
|
+
# command: "npx @anthropic/mcp-server-jira"
|
|
72
|
+
# env:
|
|
73
|
+
# JIRA_URL: "${JIRA_URL}"
|
|
74
|
+
# JIRA_TOKEN: "${JIRA_TOKEN}"
|
|
75
|
+
|
|
76
|
+
# --- Toolkit Version (do not edit manually) ---------------------------------
|
|
77
|
+
_toolkit:
|
|
78
|
+
core_version: "1.2"
|
|
79
|
+
platform_version: "1.2"
|
|
80
|
+
capability_version: "1.0"
|
|
81
|
+
installed: "2026-03-23"
|
|
82
|
+
last_upgrade: "2026-04-15"
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Agent Communication Protocol — dw-kit v1.2
|
|
2
|
+
|
|
3
|
+
## Mục Đích
|
|
4
|
+
|
|
5
|
+
Khi một task lớn cần nhiều "vai" khác nhau (researcher → planner → developer), việc ghi lại kết quả từng bước giúp:
|
|
6
|
+
- Team members (người hoặc agent) biết chính xác task đang ở đâu
|
|
7
|
+
- Audit trail rõ ràng: ai quyết định gì, lúc nào
|
|
8
|
+
- Session tiếp theo có thể tiếp tục mà không cần hỏi lại
|
|
9
|
+
|
|
10
|
+
## Convention: Reports Directory
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
.dw/tasks/[task-name]/
|
|
14
|
+
├── [name]-context.md # Research findings
|
|
15
|
+
├── [name]-plan.md # Implementation plan
|
|
16
|
+
├── [name]-progress.md # Progress tracking
|
|
17
|
+
└── reports/ # Agent communication (v1.2+)
|
|
18
|
+
├── 260402-1430-from-researcher-to-planner-analysis.md
|
|
19
|
+
├── 260402-1500-from-planner-to-developer-subtask-1.md
|
|
20
|
+
└── 260402-1600-from-developer-to-reviewer-pr-ready.md
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Filename format**: `[YYMMDD-HHMM]-from-[role]-to-[role]-[description].md`
|
|
24
|
+
|
|
25
|
+
## Status Codes
|
|
26
|
+
|
|
27
|
+
| Status | Nghĩa |
|
|
28
|
+
|--------|-------|
|
|
29
|
+
| `DONE` | Hoàn thành, output sẵn sàng để dùng |
|
|
30
|
+
| `DONE_WITH_CONCERNS` | Xong nhưng có điểm đáng chú ý / cần review |
|
|
31
|
+
| `BLOCKED` | Bị chặn, cần action từ bên ngoài để tiếp tục |
|
|
32
|
+
| `NEEDS_CONTEXT` | Thiếu thông tin, cần human confirm |
|
|
33
|
+
|
|
34
|
+
## Khi Nào Tạo Report
|
|
35
|
+
|
|
36
|
+
- Sau khi `dw-research` hoàn thành → report `from-researcher-to-planner`
|
|
37
|
+
- Sau khi `dw-plan` approved → report `from-planner-to-developer`
|
|
38
|
+
- Khi phát hiện blocker trong execute → report `from-developer-to-user` với `BLOCKED`
|
|
39
|
+
- Sau khi review xong → report `from-reviewer-to-developer`
|
|
40
|
+
|
|
41
|
+
## Khi Nào KHÔNG Cần Report
|
|
42
|
+
|
|
43
|
+
- Tasks `quick` depth (≤2 files, hotfix) → không cần overhead này
|
|
44
|
+
- Solo dev, single session → progress.md đã đủ
|
|
45
|
+
- Thông tin đã có trong context.md / plan.md → không duplicate
|
|
46
|
+
|
|
47
|
+
## Template
|
|
48
|
+
|
|
49
|
+
Dùng `.claude/templates/agent-report.md`
|
|
50
|
+
|
|
51
|
+
## Lưu Ý Quan Trọng
|
|
52
|
+
|
|
53
|
+
Reports là **cho con người đọc**, không phải protocol cho AI. Claude Code đã communicate qua conversation context. Reports giúp team members theo dõi task cross-session, không phải AI-to-AI messaging.
|
package/CLAUDE.md
CHANGED
|
@@ -1,111 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
# dw-kit
|
|
1
|
+
# dw-kit (repo)
|
|
3
2
|
|
|
4
|
-
Workflow toolkit
|
|
5
|
-
Methodology: `core/WORKFLOW.md` (load on demand — không phải always-loaded)
|
|
3
|
+
Workflow toolkit codebase. dw rules live in `.claude/rules/` — auto-loaded by Claude Code.
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## Override
|
|
10
|
-
|
|
11
|
-
Nếu prompt của user chứa `--no-dw`:
|
|
12
|
-
- Bỏ qua **toàn bộ** dw workflow instructions (Quy Tắc Vàng, Routing, Session Start)
|
|
13
|
-
- KHÔNG đọc config, KHÔNG check tasks, KHÔNG apply thinking framework
|
|
14
|
-
- Làm việc như Claude thông thường — trả lời trực tiếp, không theo process nào
|
|
15
|
-
- Áp dụng cho request đó; request tiếp theo vẫn dùng dw bình thường
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## Quy Tắc Vàng
|
|
20
|
-
|
|
21
|
-
1. **Config-driven**: Đọc `.dw/config/dw.config.yml` trước mọi action
|
|
22
|
-
2. **Research trước, code sau**: Task ≥3 files BẮT BUỘC qua research → plan → execute
|
|
23
|
-
3. **Thinking framework**: Áp dụng `core/THINKING.md` khi planning
|
|
24
|
-
4. **TDD**: Viết test trước khi code
|
|
25
|
-
5. **Commit nhỏ**: Mỗi subtask = 1 commit
|
|
5
|
+
Config: `.dw/config/dw.config.yml`
|
|
26
6
|
|
|
27
7
|
---
|
|
28
8
|
|
|
29
|
-
##
|
|
30
|
-
|
|
31
|
-
Đọc `workflow.default_depth` từ config. AI assess per-task:
|
|
9
|
+
## Tech Stack
|
|
32
10
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
| 3-5 files, module mới | standard | Tất cả 6 phases |
|
|
37
|
-
| 6+ files, API/DB/security changes | thorough | Full + arch-review + test-plan |
|
|
38
|
-
|
|
39
|
-
Không chắc scope → dùng `standard`. Assess dựa trên facts (file count, API changes, git blame).
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
## Session Start
|
|
44
|
-
|
|
45
|
-
1. Đọc `.dw/config/dw.config.yml` → depth, roles, quality commands
|
|
46
|
-
2. Kiểm tra `.dw/tasks/` → active tasks
|
|
47
|
-
3. Đọc `[task]-progress.md` của task đang dở → tiếp tục từ subtask cuối
|
|
48
|
-
|
|
49
|
-
---
|
|
11
|
+
- Runtime: Node.js ≥18, ESM (`.mjs`)
|
|
12
|
+
- CLI: `commander` · UI: `enquirer`, `chalk` · Config: `js-yaml`, `ajv`
|
|
13
|
+
- Tests: `node src/smoke-test.mjs`
|
|
50
14
|
|
|
51
|
-
##
|
|
52
|
-
|
|
53
|
-
| Skill | Mô tả | Depth |
|
|
54
|
-
|-------|--------|-------|
|
|
55
|
-
| `/dw-prompt [desc]` | Build structured prompt (autocomplete + wizard) | all |
|
|
56
|
-
| `/dw-task-init [name]` | Khởi tạo task docs | all |
|
|
57
|
-
| `/dw-research [name]` | Khảo sát codebase | all |
|
|
58
|
-
| `/dw-plan [name]` | Lập kế hoạch (DỪNG chờ approve) | standard+ |
|
|
59
|
-
| `/dw-execute [name]` | Implement theo plan (TDD) | all |
|
|
60
|
-
| `/dw-commit [msg]` | Smart commit + quality gates | all |
|
|
61
|
-
| `/dw-review` | Code review với checklist | standard+ |
|
|
62
|
-
| `/dw-debug [issue]` | Debug: investigate → diagnose → fix | all |
|
|
63
|
-
| `/dw-thinking [question]` | Apply thinking framework | all |
|
|
64
|
-
| `/dw-estimate [name]` | Ước lượng effort | if enabled |
|
|
65
|
-
| `/dw-log-work [name]` | Ghi effort thực tế | if enabled |
|
|
66
|
-
| `/dw-handoff` | Bàn giao session | all |
|
|
67
|
-
| `/dw-requirements` | BA: requirements + user stories | if ba role |
|
|
68
|
-
| `/dw-test-plan` | QC: test plan + regression | if qc role |
|
|
69
|
-
| `/dw-arch-review` | TL: architecture review | if techlead |
|
|
70
|
-
| `/dw-dashboard` | PM: metrics report | if pm role |
|
|
71
|
-
| `/dw-sprint-review` | Team retrospective | all |
|
|
72
|
-
| `/dw-docs-update` | Cập nhật living docs | thorough |
|
|
73
|
-
| `/dw-onboard` | Onboard dw vào existing project (breadth-first scan) | always |
|
|
74
|
-
| `/dw-retroactive [name]` | Retroactive doc 1 feature đã có (depth-first) | always |
|
|
75
|
-
| `/dw-config-init` | Khởi tạo config mới | always |
|
|
76
|
-
| `/dw-config-validate` | Validate config file | always |
|
|
77
|
-
| `/dw-upgrade` | Upgrade toolkit | always |
|
|
78
|
-
| `/dw-rollback [name]` | Rollback task docs | always |
|
|
79
|
-
| `/dw-archive [name]` | Archive completed task | always |
|
|
80
|
-
|
|
81
|
-
---
|
|
82
|
-
|
|
83
|
-
## Task Documentation
|
|
84
|
-
|
|
85
|
-
```
|
|
86
|
-
.dw/tasks/[task-name]/
|
|
87
|
-
├── [name]-context.md # Research findings
|
|
88
|
-
├── [name]-plan.md # Implementation plan
|
|
89
|
-
└── [name]-progress.md # Progress + handoff notes
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
|
|
94
|
-
## Commit Format
|
|
15
|
+
## Repo Structure
|
|
95
16
|
|
|
96
17
|
```
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
18
|
+
bin/ CLI entrypoint
|
|
19
|
+
src/
|
|
20
|
+
commands/ CLI subcommands (init, upgrade, validate, ...)
|
|
21
|
+
lib/ Shared utilities (config, copy, ui, ...)
|
|
22
|
+
.claude/
|
|
23
|
+
hooks/ Bash hooks — python3-free, node only (Windows compat)
|
|
24
|
+
rules/ dw-core.md + dw-skills.md (auto-loaded by Claude Code)
|
|
25
|
+
skills/ Slash command definitions
|
|
26
|
+
templates/ Agent report template
|
|
27
|
+
.dw/
|
|
28
|
+
core/ WORKFLOW.md, THINKING.md, QUALITY.md, ROLES.md
|
|
29
|
+
config/ dw.config.yml for this repo
|
|
30
|
+
tasks/ Active task docs
|
|
100
31
|
```
|
|
101
32
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
---
|
|
105
|
-
|
|
106
|
-
## Methodology Reference
|
|
33
|
+
## Dev Notes
|
|
107
34
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
35
|
+
- All source ESM (`import`/`export`) — no CommonJS
|
|
36
|
+
- `TOOLKIT_ROOT` resolved from `import.meta.url` in each command
|
|
37
|
+
- Hooks use `node` for JSON parsing (not python3 — Windows compat)
|
|
38
|
+
- Skills `dw-kit-evolve` and `dw-kit-audit` are maintainer-only — excluded from npm package
|
|
39
|
+
- Published package files declared explicitly in `package.json#files`
|