deepflow 0.1.3 → 0.1.5
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/commands/df/execute.md +101 -127
- package/.claude/commands/df/update.md +33 -0
- package/.claude/skills/atomic-commits/SKILL.md +14 -0
- package/VERSION +1 -1
- package/bin/install.js +14 -7
- package/package.json +1 -1
- package/templates/state-template.md +9 -0
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
# /df:execute — Execute Tasks from Plan
|
|
2
2
|
|
|
3
3
|
## Purpose
|
|
4
|
-
Implement tasks from PLAN.md with parallel agents and
|
|
4
|
+
Implement tasks from PLAN.md with parallel agents, atomic commits, and context-efficient execution.
|
|
5
5
|
|
|
6
6
|
## Usage
|
|
7
7
|
```
|
|
8
|
-
/df:execute
|
|
9
|
-
/df:execute T1 T2
|
|
8
|
+
/df:execute # Execute all ready tasks
|
|
9
|
+
/df:execute T1 T2 # Specific tasks only
|
|
10
|
+
/df:execute --continue # Resume from checkpoint
|
|
11
|
+
/df:execute --fresh # Ignore checkpoint
|
|
12
|
+
/df:execute --dry-run # Show plan only
|
|
10
13
|
```
|
|
11
14
|
|
|
12
15
|
## Skills & Agents
|
|
@@ -14,177 +17,148 @@ Implement tasks from PLAN.md with parallel agents and atomic commits.
|
|
|
14
17
|
- Agent: `general-purpose` (Sonnet) — Task implementation
|
|
15
18
|
- Agent: `reasoner` (Opus) — Debugging failures
|
|
16
19
|
|
|
17
|
-
##
|
|
20
|
+
## Context Budget
|
|
18
21
|
|
|
19
|
-
|
|
22
|
+
| Threshold | Tokens | Action |
|
|
23
|
+
|-----------|--------|--------|
|
|
24
|
+
| Normal | <60k | Continue execution |
|
|
25
|
+
| Warning | 60k | Display budget status |
|
|
26
|
+
| Checkpoint | 80k | Save state, prompt resume |
|
|
27
|
+
| Limit | 100k | Hard stop |
|
|
20
28
|
|
|
21
|
-
|
|
22
|
-
Load:
|
|
23
|
-
- PLAN.md (required)
|
|
24
|
-
- specs/*.md (for context)
|
|
25
|
-
- .specflow/config.yaml (if exists)
|
|
26
|
-
```
|
|
29
|
+
Display after each wave: `Budget: ~45k/100k tokens`
|
|
27
30
|
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
No PLAN.md found. Run /df:plan first.
|
|
31
|
-
```
|
|
31
|
+
Token estimates: ~650/task, ~200/wave overhead.
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
## Agent Output Protocol
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
Agents MUST return exactly 5 lines:
|
|
36
|
+
|
|
37
|
+
```yaml
|
|
38
|
+
task: T3
|
|
39
|
+
status: success|failed
|
|
40
|
+
commit: abc1234
|
|
41
|
+
duration: 45s
|
|
42
|
+
error: "single line if failed"
|
|
43
|
+
```
|
|
38
44
|
|
|
45
|
+
**Agent instructions (include in spawn):**
|
|
39
46
|
```
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
Done: []
|
|
47
|
+
Return ONLY 5-line YAML. No test output, git logs, or stack traces.
|
|
48
|
+
Handle all verification internally. Fix issues before returning.
|
|
43
49
|
```
|
|
44
50
|
|
|
45
|
-
|
|
51
|
+
If verbose output received: extract minimal data, discard rest.
|
|
46
52
|
|
|
47
|
-
|
|
53
|
+
## Checkpoint & Resume
|
|
48
54
|
|
|
49
|
-
|
|
50
|
-
|-------------|--------|
|
|
51
|
-
| 1-3 | All parallel |
|
|
52
|
-
| 4-10 | 5 parallel, queue rest |
|
|
53
|
-
| 10+ | 5 parallel, queue rest |
|
|
55
|
+
**File:** `.deepflow/checkpoint.json`
|
|
54
56
|
|
|
55
|
-
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"session_id": "exec_abc123",
|
|
60
|
+
"completed_tasks": ["T1", "T2"],
|
|
61
|
+
"current_wave": 2,
|
|
62
|
+
"last_commit": "def5678",
|
|
63
|
+
"estimated_tokens_used": 82000,
|
|
64
|
+
"decisions_made": ["Used multer for uploads"],
|
|
65
|
+
"resume_instructions": "Continue with Wave 3"
|
|
66
|
+
}
|
|
67
|
+
```
|
|
56
68
|
|
|
57
|
-
**
|
|
58
|
-
|
|
69
|
+
**Checkpoint protocol** (at 80k tokens):
|
|
70
|
+
1. Complete current task
|
|
71
|
+
2. Wait for parallel agents
|
|
72
|
+
3. Update PLAN.md
|
|
73
|
+
4. Write checkpoint atomically (.tmp → rename)
|
|
74
|
+
5. Print: `Context limit reached. Run /df:execute --continue`
|
|
59
75
|
|
|
60
|
-
**
|
|
76
|
+
**Resume** (`--continue`): Load checkpoint, skip completed tasks, reset token counter.
|
|
61
77
|
|
|
62
|
-
|
|
78
|
+
## Behavior
|
|
63
79
|
|
|
64
|
-
|
|
80
|
+
### 1. CHECK CHECKPOINT
|
|
65
81
|
|
|
66
82
|
```
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
- No placeholders
|
|
72
|
-
- No TODO comments
|
|
73
|
-
4. VERIFY implementation works
|
|
74
|
-
- Run related tests if they exist
|
|
75
|
-
- Check TypeScript/lint if applicable
|
|
76
|
-
5. COMMIT atomically
|
|
77
|
-
- Format: feat({spec}): {task description}
|
|
78
|
-
- One task = one commit
|
|
83
|
+
--continue → Load and resume
|
|
84
|
+
--fresh → Delete checkpoint, start fresh
|
|
85
|
+
checkpoint exists → Prompt: "Resume? (y/n)"
|
|
86
|
+
else → Start fresh
|
|
79
87
|
```
|
|
80
88
|
|
|
81
|
-
###
|
|
82
|
-
|
|
83
|
-
After each task completes:
|
|
84
|
-
```markdown
|
|
85
|
-
- [x] **T1**: Create upload API endpoint ✓ (abc1234)
|
|
86
|
-
- Files: src/api/upload.ts
|
|
87
|
-
- Blocked by: none
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
### 6. ITERATE
|
|
91
|
-
|
|
92
|
-
After wave completes:
|
|
93
|
-
```
|
|
94
|
-
Wave 1 complete: T1 ✓, T2 ✓
|
|
89
|
+
### 2. LOAD PLAN
|
|
95
90
|
|
|
96
|
-
Unblocked: T3, T4 now ready
|
|
97
|
-
Executing wave 2...
|
|
98
91
|
```
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
### 7. REPORT
|
|
103
|
-
|
|
92
|
+
Load: PLAN.md (required), specs/*.md, .deepflow/config.yaml
|
|
93
|
+
If missing: "No PLAN.md found. Run /df:plan first."
|
|
104
94
|
```
|
|
105
|
-
✓ Execution complete
|
|
106
|
-
|
|
107
|
-
Tasks completed: 5/5
|
|
108
|
-
Commits: 5
|
|
109
|
-
Failed: 0
|
|
110
95
|
|
|
111
|
-
|
|
112
|
-
```
|
|
96
|
+
### 3. IDENTIFY READY TASKS
|
|
113
97
|
|
|
114
|
-
|
|
115
|
-
```
|
|
116
|
-
⚠ Execution paused
|
|
98
|
+
Ready = `[ ]` status + all `blocked_by` complete + not in checkpoint.
|
|
117
99
|
|
|
118
|
-
|
|
119
|
-
Blocked: T4 (waiting on T3)
|
|
120
|
-
Failed: T3 (see error below)
|
|
100
|
+
### 4. EXECUTE IN PARALLEL
|
|
121
101
|
|
|
122
|
-
|
|
123
|
-
|
|
102
|
+
| Ready | Strategy |
|
|
103
|
+
|-------|----------|
|
|
104
|
+
| 1-3 | All parallel |
|
|
105
|
+
| 4+ | 5 parallel, queue rest |
|
|
124
106
|
|
|
125
|
-
|
|
126
|
-
```
|
|
107
|
+
**Critical:** 1 writer per file. If T1 and T2 both modify `src/api.ts`, execute sequentially.
|
|
127
108
|
|
|
128
|
-
|
|
109
|
+
**On failure:** Spawn `reasoner` (Opus) for debugging.
|
|
129
110
|
|
|
130
|
-
###
|
|
131
|
-
- **Read operations**: Unlimited parallel
|
|
132
|
-
- **Write operations**: Max 5 parallel, 1 per file
|
|
133
|
-
- **Build/test**: Always sequential
|
|
111
|
+
### 5. PER-TASK EXECUTION
|
|
134
112
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
113
|
+
Each agent internally:
|
|
114
|
+
1. Read spec requirements
|
|
115
|
+
2. Implement completely (no stubs/TODOs)
|
|
116
|
+
3. Verify (tests, types, lint) — fix issues
|
|
117
|
+
4. Commit atomically: `feat({spec}): {description}`
|
|
118
|
+
5. Return 5-line YAML only
|
|
140
119
|
|
|
141
|
-
###
|
|
142
|
-
- No stubs or placeholders
|
|
143
|
-
- No `// TODO` comments
|
|
144
|
-
- Implement fully or don't commit
|
|
120
|
+
### 6. UPDATE & CHECK BUDGET
|
|
145
121
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
If
|
|
149
|
-
|
|
150
|
-
Then execute T1, wait, then T2
|
|
151
|
-
```
|
|
122
|
+
- Mark task complete in PLAN.md with commit hash
|
|
123
|
+
- Update token estimate
|
|
124
|
+
- If >80k: checkpoint and exit
|
|
125
|
+
- If >60k: show warning
|
|
152
126
|
|
|
153
|
-
|
|
127
|
+
### 7. ITERATE
|
|
154
128
|
|
|
155
|
-
|
|
156
|
-
executor_agents:
|
|
157
|
-
max_parallel: 5
|
|
158
|
-
per_file_limit: 1
|
|
129
|
+
Repeat until: all done, all blocked, or budget reached.
|
|
159
130
|
|
|
160
|
-
|
|
161
|
-
implement: sonnet
|
|
162
|
-
debug: opus
|
|
131
|
+
## Rules
|
|
163
132
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
133
|
+
| Rule | Enforcement |
|
|
134
|
+
|------|-------------|
|
|
135
|
+
| 1 task = 1 commit | `atomic-commits` skill |
|
|
136
|
+
| No broken commits | Verify before commit |
|
|
137
|
+
| 1 writer per file | Sequential if conflict |
|
|
138
|
+
| Minimal returns | 5 lines max from agents |
|
|
139
|
+
| Internal verification | Agents fix issues, don't report |
|
|
167
140
|
|
|
168
|
-
## Example
|
|
141
|
+
## Example
|
|
169
142
|
|
|
170
143
|
```
|
|
171
144
|
/df:execute
|
|
172
145
|
|
|
173
146
|
Loading PLAN.md...
|
|
174
|
-
Found 5 tasks, 3 ready
|
|
147
|
+
Found 5 tasks, 3 ready
|
|
175
148
|
|
|
176
|
-
Wave 1:
|
|
177
|
-
T1:
|
|
178
|
-
T2:
|
|
179
|
-
T5:
|
|
149
|
+
Wave 1: T1, T2, T5 in parallel...
|
|
150
|
+
T1: success (abc1234) 45s
|
|
151
|
+
T2: success (def5678) 32s
|
|
152
|
+
T5: success (ghi9012) 28s
|
|
153
|
+
Budget: ~32k/100k tokens
|
|
180
154
|
|
|
181
|
-
Wave 2: T3, T4
|
|
182
|
-
T3:
|
|
183
|
-
T4:
|
|
155
|
+
Wave 2: T3, T4 unblocked
|
|
156
|
+
T3: success (jkl3456) 67s
|
|
157
|
+
T4: success (mno7890) 41s
|
|
158
|
+
Budget: ~52k/100k tokens
|
|
184
159
|
|
|
185
160
|
✓ Execution complete
|
|
186
|
-
Tasks: 5/5
|
|
187
|
-
Commits: 5
|
|
161
|
+
Tasks: 5/5 | Commits: 5
|
|
188
162
|
|
|
189
163
|
Run /df:verify to confirm specs satisfied.
|
|
190
164
|
```
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# /df:update — Update deepflow
|
|
2
|
+
|
|
3
|
+
Update deepflow to the latest version from npm.
|
|
4
|
+
|
|
5
|
+
## Instructions
|
|
6
|
+
|
|
7
|
+
1. Run the update command:
|
|
8
|
+
```bash
|
|
9
|
+
npx deepflow@latest
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
2. When prompted, choose the same installation level you used before (Global or Project).
|
|
13
|
+
|
|
14
|
+
3. The installer will update all commands, skills, agents, and hooks.
|
|
15
|
+
|
|
16
|
+
4. Restart Claude Code to apply changes.
|
|
17
|
+
|
|
18
|
+
## What Gets Updated
|
|
19
|
+
|
|
20
|
+
- Commands: `/df:spec`, `/df:plan`, `/df:execute`, `/df:verify`
|
|
21
|
+
- Skills: gap-discovery, atomic-commits, code-completeness
|
|
22
|
+
- Agents: reasoner
|
|
23
|
+
- Hooks: statusline, update checker (global only)
|
|
24
|
+
|
|
25
|
+
## Check Current Version
|
|
26
|
+
|
|
27
|
+
Your installed version is stored in `~/.claude/deepflow/VERSION` (global) or `.claude/deepflow/VERSION` (project).
|
|
28
|
+
|
|
29
|
+
Run this to see versions:
|
|
30
|
+
```bash
|
|
31
|
+
cat ~/.claude/deepflow/VERSION # installed
|
|
32
|
+
npm view deepflow version # latest on npm
|
|
33
|
+
```
|
|
@@ -62,3 +62,17 @@ Task: T1
|
|
|
62
62
|
- Never commit partial work
|
|
63
63
|
- Never commit unrelated changes
|
|
64
64
|
- One logical change per commit
|
|
65
|
+
|
|
66
|
+
## Tags
|
|
67
|
+
|
|
68
|
+
Format: `v{major}.{minor}.{patch}`
|
|
69
|
+
|
|
70
|
+
| Trigger | Bump | Example |
|
|
71
|
+
|---------|------|---------|
|
|
72
|
+
| Breaking change | major | `v2.0.0` |
|
|
73
|
+
| New feature | minor | `v1.1.0` |
|
|
74
|
+
| Bug fix | patch | `v1.0.1` |
|
|
75
|
+
|
|
76
|
+
Create: `git tag -a v1.0.0 -m "message"` → `git push origin v1.0.0`
|
|
77
|
+
|
|
78
|
+
Tag after milestone complete, not every commit.
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.
|
|
1
|
+
0.1.5
|
package/bin/install.js
CHANGED
|
@@ -46,6 +46,8 @@ async function main() {
|
|
|
46
46
|
|
|
47
47
|
if (level === 'global') {
|
|
48
48
|
dirs.push('hooks', 'deepflow');
|
|
49
|
+
} else {
|
|
50
|
+
dirs.push('deepflow');
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
for (const dir of dirs) {
|
|
@@ -89,13 +91,18 @@ async function main() {
|
|
|
89
91
|
}
|
|
90
92
|
}
|
|
91
93
|
|
|
92
|
-
// Copy VERSION (
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
// Copy VERSION file (for update checking)
|
|
95
|
+
const versionFile = path.join(PACKAGE_DIR, 'VERSION');
|
|
96
|
+
if (fs.existsSync(versionFile)) {
|
|
97
|
+
fs.copyFileSync(versionFile, path.join(CLAUDE_DIR, 'deepflow', 'VERSION'));
|
|
98
|
+
log('Version file installed');
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Clear stale update cache to prevent false warnings
|
|
102
|
+
// Cache is always global, so clear it regardless of install level
|
|
103
|
+
const cacheFile = path.join(GLOBAL_DIR, 'cache', 'df-update-check.json');
|
|
104
|
+
if (fs.existsSync(cacheFile)) {
|
|
105
|
+
fs.unlinkSync(cacheFile);
|
|
99
106
|
}
|
|
100
107
|
|
|
101
108
|
// Configure statusline (global only)
|
package/package.json
CHANGED
|
@@ -29,6 +29,15 @@ Project context and learnings for LLM continuity.
|
|
|
29
29
|
|
|
30
30
|
- [ ] [Blocker]: [Workaround if any]
|
|
31
31
|
|
|
32
|
+
## Checkpoint
|
|
33
|
+
|
|
34
|
+
[Auto-populated when /df:execute creates a checkpoint]
|
|
35
|
+
|
|
36
|
+
- **Session**: [none]
|
|
37
|
+
- **Progress**: [0/0 tasks]
|
|
38
|
+
- **Tokens used**: [~0k/100k]
|
|
39
|
+
- **Resume**: `/df:execute --continue`
|
|
40
|
+
|
|
32
41
|
## Session Log
|
|
33
42
|
|
|
34
43
|
### {Date}
|