deepflow 0.1.22 → 0.1.24

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepflow",
3
- "version": "0.1.22",
3
+ "version": "0.1.24",
4
4
  "description": "Stay in flow state - lightweight spec-driven task orchestration for Claude Code",
5
5
  "keywords": [
6
6
  "claude",
@@ -1,5 +1,15 @@
1
1
  # /df:execute — Execute Tasks from Plan
2
2
 
3
+ ## Orchestrator Role
4
+
5
+ You spawn agents and poll results. You never implement.
6
+
7
+ **NEVER:** Read source files, edit code, run tests, run git (except status), use `TaskOutput`
8
+
9
+ **ONLY:** Read `PLAN.md` + `specs/doing-*.md`, spawn background agents, poll `.deepflow/results/`, update PLAN.md
10
+
11
+ ---
12
+
3
13
  ## Purpose
4
14
  Implement tasks from PLAN.md with parallel agents, atomic commits, and context-efficient execution.
5
15
 
@@ -28,17 +38,21 @@ Statusline writes to `.deepflow/context.json`: `{"percentage": 45}`
28
38
 
29
39
  ## Agent Protocol
30
40
 
31
- Agents write results to `.deepflow/results/{task_id}.yaml`:
41
+ Every task = one background agent. Poll result files, never `TaskOutput`.
42
+
43
+ ```python
44
+ Task(subagent_type="general-purpose", run_in_background=True, prompt="T1: ...")
45
+ # Poll: Glob(".deepflow/results/T*.yaml")
46
+ ```
47
+
48
+ Result file `.deepflow/results/{task_id}.yaml`:
32
49
  ```yaml
33
50
  task: T3
34
- status: success
51
+ status: success|failed
35
52
  commit: abc1234
53
+ summary: "one line"
36
54
  ```
37
55
 
38
- **Spawn with:** `run_in_background: true`
39
- **Poll:** `Glob(".deepflow/results/T*.yaml")`
40
- **NEVER use TaskOutput** — returns full trace, wastes context.
41
-
42
56
  ## Checkpoint & Resume
43
57
 
44
58
  **File:** `.deepflow/checkpoint.json` — stores completed tasks, current wave.
@@ -72,19 +86,24 @@ Warn if `specs/*.md` (excluding doing-/done-) exist. Non-blocking.
72
86
 
73
87
  Ready = `[ ]` + all `blocked_by` complete + not in checkpoint.
74
88
 
75
- ### 5. CHECK CONTEXT & EXECUTE
89
+ ### 5. SPAWN AGENTS
76
90
 
77
- If context ≥50%: wait for agents, checkpoint, exit.
91
+ Context ≥50%: checkpoint and exit.
78
92
 
79
- All ready tasks run in parallel. File conflicts execute sequentially.
93
+ Spawn all ready tasks in ONE message (parallel). Same-file conflicts: sequential.
80
94
 
81
95
  On failure: spawn `reasoner`.
82
96
 
83
- ### 6. PER-TASK (agent)
97
+ ### 6. PER-TASK (agent prompt)
84
98
 
85
- 1. Read existing code patterns (if any)
86
- 2. Implement following existing style
87
- 3. Verify → commit → write result file
99
+ ```
100
+ {task_id}: {description from PLAN.md}
101
+ Files: {target files}
102
+ Spec: {spec_name}
103
+
104
+ Implement, test, commit as feat({spec}): {description}.
105
+ Write result to .deepflow/results/{task_id}.yaml
106
+ ```
88
107
 
89
108
  ### 7. COMPLETE SPECS
90
109
 
@@ -99,13 +118,11 @@ Repeat until: all done, all blocked, or checkpoint.
99
118
 
100
119
  ## Rules
101
120
 
102
- | Rule | Enforcement |
103
- |------|-------------|
104
- | 1 task = 1 commit | `atomic-commits` skill |
105
- | No broken commits | Verify before commit |
106
- | 1 writer per file | Sequential if conflict |
107
- | Minimal returns | 5 lines max from agents |
108
- | Internal verification | Agents fix issues, don't report |
121
+ | Rule | Detail |
122
+ |------|--------|
123
+ | 1 task = 1 agent = 1 commit | `atomic-commits` skill |
124
+ | 1 file = 1 writer | Sequential if conflict |
125
+ | Agents verify internally | Fix issues, don't report |
109
126
 
110
127
  ## Example
111
128
 
@@ -1,5 +1,15 @@
1
1
  # /df:spec — Generate Spec from Conversation
2
2
 
3
+ ## Orchestrator Role
4
+
5
+ You coordinate agents and ask questions. You never search code directly.
6
+
7
+ **NEVER:** Read source files, use Glob/Grep directly, run git
8
+
9
+ **ONLY:** Spawn agents, poll results, ask user questions, write spec file
10
+
11
+ ---
12
+
3
13
  ## Purpose
4
14
  Transform conversation context into a structured specification file.
5
15
 
@@ -8,13 +18,29 @@ Transform conversation context into a structured specification file.
8
18
  /df:spec <name>
9
19
  ```
10
20
 
11
- ## Skills
12
- Uses: `gap-discovery` — Proactive requirement gap identification
21
+ ## Skills & Agents
22
+ - Skill: `gap-discovery` — Proactive requirement gap identification
23
+ - Agent: `Explore` (haiku) — Codebase context gathering
24
+ - Agent: `reasoner` (Opus) — Synthesize findings into requirements
13
25
 
14
26
  ## Behavior
15
27
 
16
- ### 1. GAP CHECK
17
- Before generating, use the `gap-discovery` skill to analyze conversation.
28
+ ### 1. GATHER CODEBASE CONTEXT
29
+
30
+ **Spawn Explore agents** (haiku, read-only, parallel) to find:
31
+ - Related existing implementations
32
+ - Code patterns and conventions
33
+ - Integration points relevant to the feature
34
+ - Existing TODOs or placeholders in related areas
35
+
36
+ | Codebase Size | Agents |
37
+ |---------------|--------|
38
+ | <20 files | 2-3 |
39
+ | 20-100 | 5-8 |
40
+ | 100+ | 10-15 |
41
+
42
+ ### 2. GAP CHECK
43
+ Use the `gap-discovery` skill to analyze conversation + agent findings.
18
44
 
19
45
  **Required clarity:**
20
46
  - [ ] Core objective clear
@@ -42,9 +68,17 @@ Before generating, use the `gap-discovery` skill to analyze conversation.
42
68
 
43
69
  Max 4 questions per tool call. Wait for answers before proceeding.
44
70
 
45
- ### 2. GENERATE SPEC
71
+ ### 3. SYNTHESIZE FINDINGS
72
+
73
+ **Spawn `reasoner` agent** (Opus) to:
74
+ - Analyze codebase context from Explore agents
75
+ - Identify constraints from existing architecture
76
+ - Suggest requirements based on patterns found
77
+ - Flag potential conflicts with existing code
78
+
79
+ ### 4. GENERATE SPEC
46
80
 
47
- Once gaps covered, create `specs/{name}.md`:
81
+ Once gaps covered and context gathered, create `specs/{name}.md`:
48
82
 
49
83
  ```markdown
50
84
  # {Name}
@@ -70,10 +104,10 @@ Once gaps covered, create `specs/{name}.md`:
70
104
  - [ ] [Testable criterion 3]
71
105
 
72
106
  ## Technical Notes
73
- [Any implementation hints, preferred approaches, or context]
107
+ [Implementation hints from codebase analysis — patterns, integration points, constraints discovered by agents]
74
108
  ```
75
109
 
76
- ### 3. CONFIRM
110
+ ### 5. CONFIRM
77
111
 
78
112
  After writing:
79
113
  ```
@@ -86,17 +120,33 @@ Next: Run /df:plan to generate tasks
86
120
  ```
87
121
 
88
122
  ## Rules
123
+ - **Orchestrator never searches** — Spawn agents for all codebase exploration
89
124
  - Do NOT generate spec if critical gaps remain
90
- - Ask maximum 5 questions per round (not overwhelming)
125
+ - Ask maximum 4 questions per tool call (not overwhelming)
91
126
  - Requirements must be testable
92
127
  - Acceptance criteria must be verifiable
128
+ - Include agent-discovered context in Technical Notes
93
129
  - Keep specs concise (<100 lines)
94
130
 
131
+ ## Agent Scaling
132
+
133
+ | Agent | Base | Purpose |
134
+ |-------|------|---------|
135
+ | Explore (haiku) | 3-5 | Find related code, patterns |
136
+ | Reasoner (Opus) | 1 | Synthesize into requirements |
137
+
95
138
  ## Example
96
139
 
97
140
  ```
98
141
  USER: I want to add image upload
99
142
 
143
+ CLAUDE: [Spawns 3 Explore agents in parallel]
144
+ - "Find existing file handling patterns"
145
+ - "Find API endpoint conventions"
146
+ - "Find storage service implementations"
147
+
148
+ [Agents return: Express multer middleware, REST conventions, no cloud storage yet]
149
+
100
150
  CLAUDE: [Uses AskUserQuestion tool]
101
151
  {
102
152
  "questions": [
@@ -106,18 +156,7 @@ CLAUDE: [Uses AskUserQuestion tool]
106
156
  "multiSelect": true,
107
157
  "options": [
108
158
  {"label": "JPG/PNG only", "description": "Standard formats"},
109
- {"label": "Include WebP", "description": "Modern compression"},
110
- {"label": "Include GIF", "description": "Animated images"}
111
- ]
112
- },
113
- {
114
- "question": "What's the maximum upload size?",
115
- "header": "Size limit",
116
- "multiSelect": false,
117
- "options": [
118
- {"label": "5 MB", "description": "Fast uploads"},
119
- {"label": "10 MB (Recommended)", "description": "Balanced"},
120
- {"label": "25 MB", "description": "High-res photos"}
159
+ {"label": "Include WebP", "description": "Modern compression"}
121
160
  ]
122
161
  },
123
162
  {
@@ -126,29 +165,22 @@ CLAUDE: [Uses AskUserQuestion tool]
126
165
  "multiSelect": false,
127
166
  "options": [
128
167
  {"label": "S3 (Recommended)", "description": "Scalable cloud storage"},
129
- {"label": "Local filesystem", "description": "Simple, single server"},
130
- {"label": "Cloudflare R2", "description": "S3-compatible, no egress fees"}
131
- ]
132
- },
133
- {
134
- "question": "Who can upload files?",
135
- "header": "Auth",
136
- "multiSelect": false,
137
- "options": [
138
- {"label": "Logged-in users", "description": "Require authentication"},
139
- {"label": "Public", "description": "Anyone can upload"},
140
- {"label": "Role-based", "description": "Specific roles only"}
168
+ {"label": "Local filesystem", "description": "Simple, matches current setup"}
141
169
  ]
142
170
  }
143
171
  ]
144
172
  }
145
173
 
146
- USER: [Selects: JPG/PNG + WebP, 10MB, S3, Logged-in users]
174
+ USER: [Selects: JPG/PNG + WebP, S3]
175
+
176
+ CLAUDE: [Spawns reasoner agent]
177
+ - Synthesize: multer + S3 + existing API patterns
147
178
 
148
179
  CLAUDE: ✓ Created specs/image-upload.md
149
180
 
150
181
  Requirements: 4
151
182
  Acceptance criteria: 5
183
+ Technical notes: Express/multer pattern, REST conventions from existing API
152
184
 
153
185
  Next: Run /df:plan to generate tasks
154
186
  ```