deepflow 0.1.4 → 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.
@@ -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 atomic commits.
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 # Execute specific tasks only
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
- ## Behavior
20
+ ## Context Budget
18
21
 
19
- ### 1. LOAD PLAN
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
- If PLAN.md missing:
29
- ```
30
- No PLAN.md found. Run /df:plan first.
31
- ```
31
+ Token estimates: ~650/task, ~200/wave overhead.
32
32
 
33
- ### 2. IDENTIFY READY TASKS
33
+ ## Agent Output Protocol
34
34
 
35
- Find tasks where:
36
- - Status is `[ ]` (not done)
37
- - All `blocked_by` tasks are `[x]` (complete)
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
- Ready: [T1, T2, T5] # No blockers
41
- Blocked: [T3, T4] # Waiting on dependencies
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
- ### 3. EXECUTE IN PARALLEL
51
+ If verbose output received: extract minimal data, discard rest.
46
52
 
47
- **Spawn `general-purpose` agents** (Sonnet) for ready tasks:
53
+ ## Checkpoint & Resume
48
54
 
49
- | Ready Tasks | Agents |
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
- Each agent uses `atomic-commits` skill for commit protocol.
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
- **Critical rule: 1 writer per file**
58
- If T1 and T2 both modify `src/api.ts`, execute sequentially.
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
- **On failure:** Spawn `reasoner` agent (Opus) for debugging.
76
+ **Resume** (`--continue`): Load checkpoint, skip completed tasks, reset token counter.
61
77
 
62
- ### 4. PER-TASK EXECUTION
78
+ ## Behavior
63
79
 
64
- Each executor agent:
80
+ ### 1. CHECK CHECKPOINT
65
81
 
66
82
  ```
67
- 1. READ spec requirements for this task
68
- 2. READ existing code context
69
- 3. IMPLEMENT the task completely
70
- - No stubs
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
- ### 5. UPDATE PLAN
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
- Repeat until all tasks done or blocked.
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
- All specs implemented. Run /df:verify to confirm.
112
- ```
96
+ ### 3. IDENTIFY READY TASKS
113
97
 
114
- Or if partial:
115
- ```
116
- ⚠ Execution paused
98
+ Ready = `[ ]` status + all `blocked_by` complete + not in checkpoint.
117
99
 
118
- Tasks completed: 3/5
119
- Blocked: T4 (waiting on T3)
120
- Failed: T3 (see error below)
100
+ ### 4. EXECUTE IN PARALLEL
121
101
 
122
- Error in T3:
123
- [error details]
102
+ | Ready | Strategy |
103
+ |-------|----------|
104
+ | 1-3 | All parallel |
105
+ | 4+ | 5 parallel, queue rest |
124
106
 
125
- Fix the issue and run /df:execute to continue.
126
- ```
107
+ **Critical:** 1 writer per file. If T1 and T2 both modify `src/api.ts`, execute sequentially.
127
108
 
128
- ## Rules
109
+ **On failure:** Spawn `reasoner` (Opus) for debugging.
129
110
 
130
- ### Parallelism
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
- ### Commits
136
- - One task = one commit
137
- - Format: `feat({spec}): {description}`
138
- - Include task ID in commit body
139
- - Never commit broken code
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
- ### Completeness
142
- - No stubs or placeholders
143
- - No `// TODO` comments
144
- - Implement fully or don't commit
120
+ ### 6. UPDATE & CHECK BUDGET
145
121
 
146
- ### Conflict Avoidance
147
- ```
148
- If T1 writes to src/api.ts
149
- And T2 writes to src/api.ts
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
- ## Agent Spawning
127
+ ### 7. ITERATE
154
128
 
155
- ```yaml
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
- model_selection:
161
- implement: sonnet
162
- debug: opus
131
+ ## Rules
163
132
 
164
- commit_after: each_task
165
- push_after: all_complete # Not every commit
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 Session
141
+ ## Example
169
142
 
170
143
  ```
171
144
  /df:execute
172
145
 
173
146
  Loading PLAN.md...
174
- Found 5 tasks, 3 ready (no blockers)
147
+ Found 5 tasks, 3 ready
175
148
 
176
- Wave 1: Executing T1, T2, T5 in parallel...
177
- T1: Create upload API endpoint... ✓ (abc1234)
178
- T2: Add validation middleware... ✓ (def5678)
179
- T5: Integrate color-thief... ✓ (ghi9012)
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 now unblocked
182
- T3: Implement S3 upload... ✓ (jkl3456)
183
- T4: Complete thumbnails... ✓ (mno7890)
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
  ```
@@ -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.4
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 (global only - for update checking)
93
- if (level === 'global') {
94
- const versionFile = path.join(PACKAGE_DIR, 'VERSION');
95
- if (fs.existsSync(versionFile)) {
96
- fs.copyFileSync(versionFile, path.join(CLAUDE_DIR, 'deepflow', 'VERSION'));
97
- log('Version file installed');
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepflow",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Stay in flow state - lightweight spec-driven task orchestration for Claude Code",
5
5
  "keywords": [
6
6
  "claude",
@@ -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}