dw-kit 1.4.0 → 1.6.0-rc.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/agents/executor.md +80 -80
- package/.claude/hooks/pre-commit-gate.sh +59 -0
- package/.claude/hooks/stop-check.sh +111 -31
- package/.claude/rules/commit-standards.md +48 -37
- package/.claude/rules/dw.md +47 -11
- package/.claude/skills/dw-commit/SKILL.md +7 -4
- package/.claude/skills/dw-decision/SKILL.md +5 -4
- package/.claude/skills/dw-execute/SKILL.md +18 -5
- package/.claude/skills/dw-handoff/SKILL.md +8 -3
- package/.claude/skills/dw-plan/SKILL.md +15 -2
- package/.claude/skills/dw-research/SKILL.md +7 -5
- package/.claude/skills/dw-retroactive/SKILL.md +75 -63
- package/.claude/skills/dw-task-init/SKILL.md +40 -35
- package/.dw/adapters/generic/AGENT.md +171 -169
- package/.dw/core/WORKFLOW.md +450 -450
- package/.dw/core/schemas/agent-claim.schema.json +127 -0
- package/.dw/core/schemas/agent-report.schema.json +72 -0
- package/.dw/core/schemas/task-frontmatter.schema.json +78 -0
- package/.dw/core/templates/v3/task.md +188 -0
- package/CLAUDE.md +2 -2
- package/MIGRATION-v1.5.md +330 -0
- package/README.md +17 -0
- package/package.json +3 -2
- package/src/cli.mjs +161 -0
- package/src/commands/agent-claim.mjs +235 -0
- package/src/commands/agent-inspect.mjs +123 -0
- package/src/commands/doctor.mjs +64 -0
- package/src/commands/lint-task.mjs +112 -0
- package/src/commands/task-migrate.mjs +366 -0
- package/src/commands/task-new.mjs +90 -0
- package/src/commands/task-render.mjs +235 -0
- package/src/commands/task-rotate.mjs +168 -0
- package/src/commands/task-show.mjs +137 -0
- package/src/commands/task-view.mjs +386 -0
- package/src/commands/task-watch.mjs +223 -0
- package/src/lib/active-index.mjs +19 -1
- package/src/lib/agent-claim.mjs +173 -0
- package/src/lib/agent-conflict.mjs +137 -0
- package/src/lib/agent-events.mjs +43 -0
- package/src/lib/agent-report.mjs +96 -0
- package/src/lib/frontmatter.mjs +72 -0
- package/src/lib/lint-rules.mjs +149 -0
- package/src/lib/timeline-parser.mjs +80 -0
|
@@ -1,169 +1,171 @@
|
|
|
1
|
-
# dw-kit Workflow — Generic Agent Instructions
|
|
2
|
-
|
|
3
|
-
> **For**: Cursor, Windsurf, Copilot Chat, or any AI coding assistant
|
|
4
|
-
> **Note**: This is a methodology reference. It cannot replicate Claude Code-specific features
|
|
5
|
-
> (agent delegation with tool constraints, hooks, MCP integration). For full capabilities, use the Claude CLI adapter.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Setup
|
|
10
|
-
|
|
11
|
-
1. Copy this file to your project root as `AGENT.md` (or paste into your AI assistant's context)
|
|
12
|
-
2. Copy `.dw/config/dw.config.yml` to your project and fill in your settings
|
|
13
|
-
3. Create `.dw/tasks/` directory for task documentation
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
## Configuration
|
|
18
|
-
|
|
19
|
-
Read `.dw/config/dw.config.yml` for:
|
|
20
|
-
- `workflow.default_depth` — quick | standard | thorough
|
|
21
|
-
- `team.roles` — available team roles
|
|
22
|
-
- `quality.test_command`, `quality.lint_command` — quality gates
|
|
23
|
-
- `paths.tasks` — where task docs are stored
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
## Depth Routing
|
|
28
|
-
|
|
29
|
-
| Scope | Depth | Workflow |
|
|
30
|
-
|-------|-------|---------|
|
|
31
|
-
| ≤2 files, hotfix | quick | Understand → Execute → Close |
|
|
32
|
-
| 3-5 files | standard | All 6 phases |
|
|
33
|
-
| 6+ files, API/DB changes | thorough | All phases + arch review |
|
|
34
|
-
|
|
35
|
-
---
|
|
36
|
-
|
|
37
|
-
## Workflow Phases
|
|
38
|
-
|
|
39
|
-
### Phase 1: Initialize
|
|
40
|
-
|
|
41
|
-
Create task documentation at `{paths.tasks}/[task-name]/`:
|
|
42
|
-
```
|
|
43
|
-
[name]-context.md # Research findings
|
|
44
|
-
[name]-plan.md # Implementation plan
|
|
45
|
-
[name]-progress.md # Progress tracking
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
**Before proceeding**: Task name defined, scope assessed, depth chosen.
|
|
49
|
-
|
|
50
|
-
### Phase 2: Understand (Research)
|
|
51
|
-
|
|
52
|
-
Explore the codebase:
|
|
53
|
-
- Find all files related to the task
|
|
54
|
-
- Map dependencies (upstream and downstream)
|
|
55
|
-
- Identify current patterns and conventions
|
|
56
|
-
- Check test coverage
|
|
57
|
-
- Note git history for recent changes in the area
|
|
58
|
-
- Document what is unclear
|
|
59
|
-
|
|
60
|
-
Fill in `[name]-context.md` with findings.
|
|
61
|
-
|
|
62
|
-
**Before proceeding**: All files identified, no critical unknowns.
|
|
63
|
-
|
|
64
|
-
### Phase 3: Plan
|
|
65
|
-
|
|
66
|
-
Design solution before writing any code:
|
|
67
|
-
- Consider ≥2 approaches with trade-offs
|
|
68
|
-
- Apply devil's advocate: strongest reason NOT to choose your preferred approach
|
|
69
|
-
- Break into subtasks (each ≤3 files, ≤4 hours, independent commit)
|
|
70
|
-
- Order: schema → service → API → tests → docs
|
|
71
|
-
|
|
72
|
-
Fill in `[name]-plan.md`.
|
|
73
|
-
|
|
74
|
-
**STOP**: Wait for human approval before executing.
|
|
75
|
-
If team has TL: TL must review architecture decisions.
|
|
76
|
-
|
|
77
|
-
### Phase 4: Execute
|
|
78
|
-
|
|
79
|
-
For each subtask:
|
|
80
|
-
1. Read acceptance criteria
|
|
81
|
-
2. Write tests first (failing) — RED
|
|
82
|
-
3. Implement to make tests pass — GREEN
|
|
83
|
-
4. Refactor if needed — REFACTOR
|
|
84
|
-
5. Update progress file
|
|
85
|
-
6. Commit: `type(scope): description`
|
|
86
|
-
|
|
87
|
-
**Rules**:
|
|
88
|
-
- Only work within subtask scope
|
|
89
|
-
- If ambiguous → stop and ask (don't guess for large changes)
|
|
90
|
-
- If scope changes → update plan, ask human
|
|
91
|
-
|
|
92
|
-
### Phase 5: Verify
|
|
93
|
-
|
|
94
|
-
**Self-review** (always):
|
|
95
|
-
- Logic correct? Edge cases handled?
|
|
96
|
-
- No debug code (console.log, debugger, etc.)
|
|
97
|
-
- No sensitive data (passwords, tokens, keys)
|
|
98
|
-
|
|
99
|
-
**Automated** (if configured):
|
|
100
|
-
```bash
|
|
101
|
-
{quality.test_command}
|
|
102
|
-
{quality.lint_command}
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
**Peer/TL review** (standard+):
|
|
106
|
-
- Architecture decisions reviewed
|
|
107
|
-
- Code review with checklist (see `.dw/core/QUALITY.md`)
|
|
108
|
-
|
|
109
|
-
**QA** (thorough + qc role):
|
|
110
|
-
- QA reviews against test plan
|
|
111
|
-
- Explicit sign-off required
|
|
112
|
-
|
|
113
|
-
### Phase 6: Close
|
|
114
|
-
|
|
115
|
-
Commit format:
|
|
116
|
-
```
|
|
117
|
-
<type>(<scope>): <
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
-
|
|
144
|
-
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
|
155
|
-
|
|
156
|
-
|
|
|
157
|
-
|
|
|
158
|
-
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
-
|
|
169
|
-
-
|
|
1
|
+
# dw-kit Workflow — Generic Agent Instructions
|
|
2
|
+
|
|
3
|
+
> **For**: Cursor, Windsurf, Copilot Chat, or any AI coding assistant
|
|
4
|
+
> **Note**: This is a methodology reference. It cannot replicate Claude Code-specific features
|
|
5
|
+
> (agent delegation with tool constraints, hooks, MCP integration). For full capabilities, use the Claude CLI adapter.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Setup
|
|
10
|
+
|
|
11
|
+
1. Copy this file to your project root as `AGENT.md` (or paste into your AI assistant's context)
|
|
12
|
+
2. Copy `.dw/config/dw.config.yml` to your project and fill in your settings
|
|
13
|
+
3. Create `.dw/tasks/` directory for task documentation
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Configuration
|
|
18
|
+
|
|
19
|
+
Read `.dw/config/dw.config.yml` for:
|
|
20
|
+
- `workflow.default_depth` — quick | standard | thorough
|
|
21
|
+
- `team.roles` — available team roles
|
|
22
|
+
- `quality.test_command`, `quality.lint_command` — quality gates
|
|
23
|
+
- `paths.tasks` — where task docs are stored
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Depth Routing
|
|
28
|
+
|
|
29
|
+
| Scope | Depth | Workflow |
|
|
30
|
+
|-------|-------|---------|
|
|
31
|
+
| ≤2 files, hotfix | quick | Understand → Execute → Close |
|
|
32
|
+
| 3-5 files | standard | All 6 phases |
|
|
33
|
+
| 6+ files, API/DB changes | thorough | All phases + arch review |
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Workflow Phases
|
|
38
|
+
|
|
39
|
+
### Phase 1: Initialize
|
|
40
|
+
|
|
41
|
+
Create task documentation at `{paths.tasks}/[task-name]/`:
|
|
42
|
+
```
|
|
43
|
+
[name]-context.md # Research findings
|
|
44
|
+
[name]-plan.md # Implementation plan
|
|
45
|
+
[name]-progress.md # Progress tracking
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**Before proceeding**: Task name defined, scope assessed, depth chosen.
|
|
49
|
+
|
|
50
|
+
### Phase 2: Understand (Research)
|
|
51
|
+
|
|
52
|
+
Explore the codebase:
|
|
53
|
+
- Find all files related to the task
|
|
54
|
+
- Map dependencies (upstream and downstream)
|
|
55
|
+
- Identify current patterns and conventions
|
|
56
|
+
- Check test coverage
|
|
57
|
+
- Note git history for recent changes in the area
|
|
58
|
+
- Document what is unclear
|
|
59
|
+
|
|
60
|
+
Fill in `[name]-context.md` with findings.
|
|
61
|
+
|
|
62
|
+
**Before proceeding**: All files identified, no critical unknowns.
|
|
63
|
+
|
|
64
|
+
### Phase 3: Plan
|
|
65
|
+
|
|
66
|
+
Design solution before writing any code:
|
|
67
|
+
- Consider ≥2 approaches with trade-offs
|
|
68
|
+
- Apply devil's advocate: strongest reason NOT to choose your preferred approach
|
|
69
|
+
- Break into subtasks (each ≤3 files, ≤4 hours, independent commit)
|
|
70
|
+
- Order: schema → service → API → tests → docs
|
|
71
|
+
|
|
72
|
+
Fill in `[name]-plan.md`.
|
|
73
|
+
|
|
74
|
+
**STOP**: Wait for human approval before executing.
|
|
75
|
+
If team has TL: TL must review architecture decisions.
|
|
76
|
+
|
|
77
|
+
### Phase 4: Execute
|
|
78
|
+
|
|
79
|
+
For each subtask:
|
|
80
|
+
1. Read acceptance criteria
|
|
81
|
+
2. Write tests first (failing) — RED
|
|
82
|
+
3. Implement to make tests pass — GREEN
|
|
83
|
+
4. Refactor if needed — REFACTOR
|
|
84
|
+
5. Update progress file
|
|
85
|
+
6. Commit: `type(scope): description`
|
|
86
|
+
|
|
87
|
+
**Rules**:
|
|
88
|
+
- Only work within subtask scope
|
|
89
|
+
- If ambiguous → stop and ask (don't guess for large changes)
|
|
90
|
+
- If scope changes → update plan, ask human
|
|
91
|
+
|
|
92
|
+
### Phase 5: Verify
|
|
93
|
+
|
|
94
|
+
**Self-review** (always):
|
|
95
|
+
- Logic correct? Edge cases handled?
|
|
96
|
+
- No debug code (console.log, debugger, etc.)
|
|
97
|
+
- No sensitive data (passwords, tokens, keys)
|
|
98
|
+
|
|
99
|
+
**Automated** (if configured):
|
|
100
|
+
```bash
|
|
101
|
+
{quality.test_command}
|
|
102
|
+
{quality.lint_command}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**Peer/TL review** (standard+):
|
|
106
|
+
- Architecture decisions reviewed
|
|
107
|
+
- Code review with checklist (see `.dw/core/QUALITY.md`)
|
|
108
|
+
|
|
109
|
+
**QA** (thorough + qc role):
|
|
110
|
+
- QA reviews against test plan
|
|
111
|
+
- Explicit sign-off required
|
|
112
|
+
|
|
113
|
+
### Phase 6: Close
|
|
114
|
+
|
|
115
|
+
Commit format:
|
|
116
|
+
```
|
|
117
|
+
<type>(<scope>): <imperative English subject ≤72 chars>
|
|
118
|
+
|
|
119
|
+
[Optional body — explain WHY, wrap at 72]
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
English imperative mood. Do not append `Co-Authored-By` AI signatures. Full rules: `.claude/rules/commit-standards.md`.
|
|
123
|
+
|
|
124
|
+
Update progress file: status → Done.
|
|
125
|
+
If handing off: write handoff notes (done/in-progress/blocked, next steps).
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Standalone: Debug
|
|
130
|
+
|
|
131
|
+
When encountering a bug:
|
|
132
|
+
1. **Investigate**: Reproduce exactly. Gather evidence (error, stack trace, file:line).
|
|
133
|
+
2. **Diagnose**: Form hypothesis. Verify. Find root cause (not symptom).
|
|
134
|
+
3. **Fix**: Fix root cause. Test the fix. Check for regressions. Commit.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Quality Principles
|
|
139
|
+
|
|
140
|
+
Full quality strategy: `.dw/core/QUALITY.md`
|
|
141
|
+
|
|
142
|
+
Key principles:
|
|
143
|
+
- Write tests before implementation (TDD)
|
|
144
|
+
- Each subtask = one commit
|
|
145
|
+
- Review checklist: correctness, security, performance, maintainability, tests
|
|
146
|
+
- CRITICAL issues must be fixed before merge
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Limitations of This Adapter
|
|
151
|
+
|
|
152
|
+
This generic adapter provides the **methodology** but cannot provide:
|
|
153
|
+
|
|
154
|
+
| Feature | Claude CLI Adapter | Generic Adapter |
|
|
155
|
+
|---------|-------------------|-----------------|
|
|
156
|
+
| Agent delegation (researcher/planner/reviewer) | ✅ | ❌ |
|
|
157
|
+
| Tool constraints (read-only research agent) | ✅ | ❌ |
|
|
158
|
+
| Pre-commit hooks (safety-guard, quality gates) | ✅ | ❌ |
|
|
159
|
+
| MCP server integration | ✅ | ❌ |
|
|
160
|
+
| Automatic progress tracking | ✅ | Manual |
|
|
161
|
+
|
|
162
|
+
For full capabilities, use Claude Code with the Claude CLI adapter.
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Full Methodology Reference
|
|
167
|
+
|
|
168
|
+
- Workflow phases: `.dw/core/WORKFLOW.md`
|
|
169
|
+
- Thinking framework: `.dw/core/THINKING.md`
|
|
170
|
+
- Quality strategy: `.dw/core/QUALITY.md`
|
|
171
|
+
- Role definitions: `.dw/core/ROLES.md`
|