opencode-swarm-plugin 0.13.2 → 0.15.0

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.
@@ -0,0 +1,504 @@
1
+ # Socratic Planner Pattern Analysis
2
+
3
+ **Analysis Date:** 2025-12-13
4
+ **Source:** obra/superpowers repo
5
+ **Bead:** opencode-swarm-plugin-v737h.1
6
+
7
+ ## Executive Summary
8
+
9
+ The Socratic Planner is a two-phase workflow that transforms rough ideas into executable implementation plans through:
10
+
11
+ 1. **Brainstorming** - Collaborative refinement using Socratic questioning
12
+ 2. **Writing Plans** - Detailed task breakdown for engineers with zero context
13
+
14
+ The pattern emphasizes **incremental validation**, **extreme granularity**, and **context-free execution**. It's designed to prevent premature commitment while ensuring execution clarity.
15
+
16
+ ---
17
+
18
+ ## Core Principles
19
+
20
+ ### Brainstorming Phase
21
+
22
+ 1. **One Question at a Time** - Never overwhelm with multiple questions in a single message. If a topic needs exploration, break it into sequential questions.
23
+
24
+ 2. **Multiple Choice Preferred** - Easier for users to answer than open-ended when possible, but open-ended is fine when necessary.
25
+
26
+ 3. **Project Context First** - Always check current state (files, docs, recent commits) before asking questions.
27
+
28
+ 4. **Focus on Understanding** - Extract purpose, constraints, and success criteria before proposing solutions.
29
+
30
+ 5. **Explore 2-3 Alternatives** - Always propose multiple approaches with trade-offs. Lead with your recommendation and explain why.
31
+
32
+ 6. **Incremental Validation (200-300 Words)** - Present design in digestible sections, validate each section before continuing. Cover: architecture, components, data flow, error handling, testing.
33
+
34
+ 7. **YAGNI Ruthlessly** - Remove unnecessary features from all designs. Don't build what you don't need.
35
+
36
+ 8. **Be Flexible** - Go back and clarify when something doesn't make sense. The process is iterative.
37
+
38
+ ### Writing Plans Phase
39
+
40
+ 9. **Bite-Sized Tasks (2-5 Minutes Each)** - Each step is ONE action:
41
+ - "Write the failing test" (step)
42
+ - "Run it to make sure it fails" (step)
43
+ - "Implement minimal code to pass" (step)
44
+ - "Run tests to verify" (step)
45
+ - "Commit" (step)
46
+
47
+ 10. **Zero Context Assumption** - Write for a "junior engineer with poor taste, no judgment, no project context." Assume they're skilled but know nothing about your toolset or problem domain.
48
+
49
+ 11. **Exact File Paths Always** - Never say "create a file" - say `exact/path/to/file.py`. Include line numbers for modifications: `existing.py:123-145`.
50
+
51
+ 12. **Complete Code in Plans** - Don't say "add validation" - show the exact code to write.
52
+
53
+ 13. **DRY, YAGNI, TDD** - Enforce these principles in every task. Test-first, minimal implementation, no duplication.
54
+
55
+ 14. **Exact Commands with Expected Output** - Don't say "run tests" - say `pytest tests/path/test.py::test_name -v` and specify what "PASS" looks like.
56
+
57
+ 15. **Frequent Commits** - Every task ends with a commit. Small, atomic changes.
58
+
59
+ ---
60
+
61
+ ## Anti-Patterns to Avoid
62
+
63
+ ### Brainstorming Anti-Patterns
64
+
65
+ ❌ **Multiple Questions per Message** - Overwhelms user, creates decision paralysis
66
+ ✅ **One question, wait for answer, next question**
67
+
68
+ ❌ **Proposing One Solution** - Forces user down a single path
69
+ ✅ **2-3 alternatives with trade-offs, recommend one with reasoning**
70
+
71
+ ❌ **Presenting Entire Design at Once** - User can't validate incrementally
72
+ ✅ **200-300 word sections, check after each**
73
+
74
+ ❌ **Building for Future Needs** - YAGNI violation
75
+ ✅ **Ruthlessly strip unnecessary features**
76
+
77
+ ❌ **Starting Questions Before Context** - Asking blind questions
78
+ ✅ **Check files/docs/commits first, then ask informed questions**
79
+
80
+ ### Writing Plans Anti-Patterns
81
+
82
+ ❌ **Large Tasks** - "Build the auth system" (30+ minutes)
83
+ ✅ **Bite-sized steps: "Write failing test for login" (2-5 min)**
84
+
85
+ ❌ **Assuming Context** - "Update the auth flow" (which file?)
86
+ ✅ **`src/auth/login.py:45-67` - exact path and lines**
87
+
88
+ ❌ **Vague Instructions** - "Add error handling"
89
+ ✅ **Complete try-catch block with specific exceptions**
90
+
91
+ ❌ **Skipping Test Failures** - "Write test and implementation"
92
+ ✅ **Step 1: Write test. Step 2: Run to verify FAIL. Step 3: Implement.**
93
+
94
+ ❌ **Batch Commits** - "Commit all the auth changes"
95
+ ✅ **Commit after each passing test**
96
+
97
+ ❌ **Trusting Engineer's Taste** - "Style as appropriate"
98
+ ✅ **Exact code, exact format, zero judgment calls**
99
+
100
+ ---
101
+
102
+ ## Implementation Details
103
+
104
+ ### Brainstorming Workflow
105
+
106
+ ```markdown
107
+ Phase 1: Understanding the Idea
108
+ ├─ Check project state (files, docs, commits)
109
+ ├─ Ask questions one at a time
110
+ ├─ Prefer multiple choice when possible
111
+ └─ Focus: purpose, constraints, success criteria
112
+
113
+ Phase 2: Exploring Approaches
114
+ ├─ Propose 2-3 different approaches
115
+ ├─ Present trade-offs for each
116
+ ├─ Lead with recommendation + reasoning
117
+ └─ Wait for user decision
118
+
119
+ Phase 3: Presenting the Design
120
+ ├─ Break into 200-300 word sections
121
+ ├─ Ask "Does this look right so far?" after each
122
+ ├─ Cover: architecture, components, data flow, errors, testing
123
+ └─ Be ready to backtrack and clarify
124
+
125
+ Phase 4: Documentation
126
+ ├─ Save to: docs/plans/YYYY-MM-DD-<topic>-design.md
127
+ ├─ Use elements-of-style:writing-clearly-and-concisely (if available)
128
+ └─ Commit the design document
129
+
130
+ Phase 5: Implementation Setup (if continuing)
131
+ ├─ Ask: "Ready to set up for implementation?"
132
+ ├─ Use superpowers:using-git-worktrees (create isolated workspace)
133
+ └─ Use superpowers:writing-plans (create detailed plan)
134
+ ```
135
+
136
+ ### Writing Plans Workflow
137
+
138
+ ```markdown
139
+ Setup
140
+ ├─ Run in dedicated worktree (created by brainstorming)
141
+ └─ Announce: "I'm using the writing-plans skill..."
142
+
143
+ Plan Structure
144
+ ├─ Header (REQUIRED format - see below)
145
+ ├─ Task 1: [Component Name]
146
+ │ ├─ Files: (Create/Modify/Test with exact paths)
147
+ │ ├─ Step 1: Write failing test (with code)
148
+ │ ├─ Step 2: Run test, verify FAIL (exact command + expected output)
149
+ │ ├─ Step 3: Write minimal implementation (with code)
150
+ │ ├─ Step 4: Run test, verify PASS (exact command)
151
+ │ └─ Step 5: Commit (exact git commands)
152
+ ├─ Task 2: [Component Name]
153
+ │ └─ (same structure)
154
+ └─ ...
155
+
156
+ Save
157
+ └─ docs/plans/YYYY-MM-DD-<feature-name>.md
158
+
159
+ Handoff
160
+ ├─ Offer execution choice:
161
+ │ ├─ Option 1: Subagent-Driven (this session)
162
+ │ │ └─ Use superpowers:subagent-driven-development
163
+ │ └─ Option 2: Parallel Session (separate)
164
+ │ └─ Use superpowers:executing-plans
165
+ ```
166
+
167
+ ### Required Plan Header Format
168
+
169
+ Every plan MUST start with this exact header:
170
+
171
+ ```markdown
172
+ # [Feature Name] Implementation Plan
173
+
174
+ > **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
175
+
176
+ **Goal:** [One sentence describing what this builds]
177
+
178
+ **Architecture:** [2-3 sentences about approach]
179
+
180
+ **Tech Stack:** [Key technologies/libraries]
181
+
182
+ ---
183
+ ```
184
+
185
+ ### Task Structure Template
186
+
187
+ ````markdown
188
+ ### Task N: [Component Name]
189
+
190
+ **Files:**
191
+
192
+ - Create: `exact/path/to/file.py`
193
+ - Modify: `exact/path/to/existing.py:123-145`
194
+ - Test: `tests/exact/path/to/test.py`
195
+
196
+ **Step 1: Write the failing test**
197
+
198
+ ```python
199
+ def test_specific_behavior():
200
+ result = function(input)
201
+ assert result == expected
202
+ ```
203
+ ````
204
+
205
+ **Step 2: Run test to verify it fails**
206
+
207
+ Run: `pytest tests/path/test.py::test_name -v`
208
+ Expected: FAIL with "function not defined"
209
+
210
+ **Step 3: Write minimal implementation**
211
+
212
+ ```python
213
+ def function(input):
214
+ return expected
215
+ ```
216
+
217
+ **Step 4: Run test to verify it passes**
218
+
219
+ Run: `pytest tests/path/test.py::test_name -v`
220
+ Expected: PASS
221
+
222
+ **Step 5: Commit**
223
+
224
+ ```bash
225
+ git add tests/path/test.py src/path/file.py
226
+ git commit -m "feat: add specific feature"
227
+ ```
228
+
229
+ ```
230
+
231
+ ---
232
+
233
+ ## How the Two Skills Integrate
234
+
235
+ ### Skill Handoff Flow
236
+
237
+ ```
238
+
239
+ User: "I want to build X"
240
+
241
+ [Brainstorming Skill]
242
+ ├─ Understand idea (Socratic questions)
243
+ ├─ Explore approaches (2-3 alternatives)
244
+ ├─ Present design (200-300 word sections)
245
+ └─ Save design doc (docs/plans/YYYY-MM-DD-X-design.md)
246
+
247
+ "Ready to set up for implementation?"
248
+
249
+ [Using Git Worktrees Skill]
250
+ └─ Create isolated workspace
251
+
252
+ [Writing Plans Skill]
253
+ ├─ Break design into bite-sized tasks
254
+ ├─ Exact paths, complete code, exact commands
255
+ └─ Save plan (docs/plans/YYYY-MM-DD-X.md)
256
+
257
+ "Two execution options: Subagent-Driven or Parallel Session?"
258
+
259
+ ┌─────────────────────┬─────────────────────┐
260
+ │ Subagent-Driven │ Parallel Session │
261
+ │ (same session) │ (separate session) │
262
+ ├─────────────────────┼─────────────────────┤
263
+ │ [Subagent-Driven- │ [Executing-Plans │
264
+ │ Development] │ Skill] │
265
+ │ ├─ Fresh subagent │ ├─ Load plan │
266
+ │ │ per task │ ├─ Review critically│
267
+ │ ├─ Code review │ ├─ Execute in │
268
+ │ │ after each │ │ batches (3 tasks)│
269
+ │ └─ Fast iteration │ ├─ Report for review│
270
+ │ │ └─ Continue batches │
271
+ └─────────────────────┴─────────────────────┘
272
+
273
+ [Finishing-a-Development-Branch Skill]
274
+ └─ Verify tests, present merge options
275
+
276
+ ```
277
+
278
+ ### Context Preservation Strategy
279
+
280
+ The two-phase split serves a critical purpose:
281
+
282
+ 1. **Brainstorming keeps context lean** - 200-300 word validation checkpoints prevent bloat
283
+ 2. **Plans are context-free** - Engineer doesn't need the brainstorming conversation
284
+ 3. **Plans are reusable** - Can be executed by different agents in different sessions
285
+ 4. **Incremental validation prevents rework** - Catch design issues before implementation
286
+
287
+ ### When NOT to Use This Pattern
288
+
289
+ From the brainstorming skill description:
290
+
291
+ > "Don't use during clear 'mechanical' processes"
292
+
293
+ Skip brainstorming when:
294
+ - Task is purely mechanical (updating dependencies, formatting code)
295
+ - Requirements are completely clear and unambiguous
296
+ - No design decisions needed (just execution)
297
+
298
+ ---
299
+
300
+ ## Key Quotes Worth Preserving
301
+
302
+ ### On Task Granularity
303
+
304
+ > "Assume they are a skilled developer, but know almost nothing about our toolset or problem domain. Assume they don't know good test design very well."
305
+
306
+ > "Each step is one action (2-5 minutes): 'Write the failing test' - step. 'Run it to make sure it fails' - step."
307
+
308
+ ### On Context Assumptions
309
+
310
+ > "Write comprehensive implementation plans assuming the engineer has zero context for our codebase and questionable taste."
311
+
312
+ > "Document everything they need to know: which files to touch for each task, code, testing, docs they might need to check, how to test it."
313
+
314
+ ### On Incremental Validation
315
+
316
+ > "Break it into sections of 200-300 words. Ask after each section whether it looks right so far."
317
+
318
+ > "Be ready to go back and clarify if something doesn't make sense."
319
+
320
+ ### On Question Design
321
+
322
+ > "Ask questions one at a time to refine the idea. Prefer multiple choice questions when possible, but open-ended is fine too."
323
+
324
+ > "Only one question per message - if a topic needs more exploration, break it into multiple questions."
325
+
326
+ ### On Alternative Exploration
327
+
328
+ > "Propose 2-3 different approaches with trade-offs. Present options conversationally with your recommendation and reasoning. Lead with your recommended option and explain why."
329
+
330
+ ### On Specificity in Plans
331
+
332
+ > "Exact file paths always. Complete code in plan (not 'add validation'). Exact commands with expected output."
333
+
334
+ ---
335
+
336
+ ## Execution Handoff Options
337
+
338
+ After plan creation, the pattern offers two execution modes:
339
+
340
+ ### Option 1: Subagent-Driven Development (Same Session)
341
+
342
+ **Characteristics:**
343
+ - Stay in current session
344
+ - Fresh subagent per task (no context pollution)
345
+ - Code review after each task (catch issues early)
346
+ - Faster iteration (no human-in-loop between tasks)
347
+
348
+ **When to use:**
349
+ - Tasks are mostly independent
350
+ - Want continuous progress with quality gates
351
+ - Need fast iteration
352
+
353
+ **Process:**
354
+ 1. Load plan, create TodoWrite
355
+ 2. For each task:
356
+ - Dispatch implementation subagent
357
+ - Dispatch code-reviewer subagent
358
+ - Fix issues from review
359
+ - Mark complete
360
+ 3. Final review of entire implementation
361
+ 4. Use finishing-a-development-branch skill
362
+
363
+ ### Option 2: Executing Plans (Parallel Session)
364
+
365
+ **Characteristics:**
366
+ - Open new session in worktree
367
+ - Batch execution (default: 3 tasks per batch)
368
+ - Human review between batches
369
+ - Architect oversight at checkpoints
370
+
371
+ **When to use:**
372
+ - Need to review plan first
373
+ - Tasks are tightly coupled
374
+ - Want explicit approval between batches
375
+
376
+ **Process:**
377
+ 1. Load plan, review critically
378
+ 2. Execute batch (3 tasks)
379
+ 3. Report for feedback
380
+ 4. Apply changes if needed
381
+ 5. Continue next batch
382
+ 6. Use finishing-a-development-branch skill
383
+
384
+ ---
385
+
386
+ ## Integration with Other Skills
387
+
388
+ ### Required Skills (Hard Dependencies)
389
+
390
+ **Brainstorming uses:**
391
+ - `elements-of-style:writing-clearly-and-concisely` (if available) - for design docs
392
+ - `superpowers:using-git-worktrees` (REQUIRED) - create isolated workspace
393
+ - `superpowers:writing-plans` (REQUIRED) - create implementation plan
394
+
395
+ **Writing Plans uses:**
396
+ - Referenced skills with `@syntax` - embedded in plan steps
397
+
398
+ **Execution skills use:**
399
+ - `superpowers:finishing-a-development-branch` (REQUIRED) - both execution paths
400
+
401
+ **Subagent-Driven Development uses:**
402
+ - `superpowers:requesting-code-review` (REQUIRED) - review template
403
+ - `superpowers:test-driven-development` - subagents follow TDD
404
+
405
+ ### Optional Skills
406
+
407
+ Plans can reference any skill using `@skill-name` syntax. The engineer executing the plan will load and use those skills as needed.
408
+
409
+ ---
410
+
411
+ ## Pattern Maturity Assessment
412
+
413
+ **Evidence for "Proven" status:**
414
+
415
+ 1. **Clear success criteria** - Bite-sized tasks (2-5 min) are measurable
416
+ 2. **Incremental validation** - 200-300 word sections prevent big-bang failures
417
+ 3. **Context-free execution** - Plans work across agents/sessions
418
+ 4. **Quality gates** - Code review after each task (subagent-driven) or batch (parallel)
419
+ 5. **TDD enforcement** - Every task follows red-green-refactor
420
+
421
+ **Potential weaknesses:**
422
+
423
+ 1. **Context switch cost** - Two-phase approach requires handoff overhead
424
+ 2. **Over-specification** - "Zero context" assumption may create verbose plans
425
+ 3. **Execution rigidity** - 2-5 minute granularity may not fit all domains
426
+
427
+ **Overall:** This is a **proven pattern** for transforming ideas into implementation. The incremental validation and extreme task granularity prevent the most common failure modes (premature commitment, vague requirements, context loss).
428
+
429
+ ---
430
+
431
+ ## Comparison with OpenCode Swarm
432
+
433
+ ### Similarities
434
+
435
+ - Both break work into small, parallelizable tasks
436
+ - Both use file reservations to prevent conflicts
437
+ - Both emphasize quality gates (UBS scan, code review)
438
+ - Both support parallel execution
439
+
440
+ ### Differences
441
+
442
+ | Aspect | Socratic Planner | OpenCode Swarm |
443
+ |--------|------------------|----------------|
444
+ | **Decomposition** | Manual (Socratic questions) | Automated (LLM + CASS) |
445
+ | **Task size** | 2-5 minutes (extreme granularity) | Varies (file/feature/risk-based) |
446
+ | **Context assumption** | Zero context | Shared context via Agent Mail |
447
+ | **Execution** | Sequential with reviews | Parallel with coordination |
448
+ | **Learning** | Implicit (through review) | Explicit (outcome tracking) |
449
+ | **Best for** | Novel features, design-heavy | Known patterns, scale work |
450
+
451
+ ### Integration Opportunities
452
+
453
+ 1. **Use Socratic for decomposition** - Replace swarm_decompose with brainstorming skill for complex features
454
+ 2. **Use swarm for execution** - Execute writing-plans output via swarm workers instead of subagent-driven
455
+ 3. **Hybrid approach** - Brainstorm → writing-plans → swarm_spawn_subtask (combine best of both)
456
+
457
+ ---
458
+
459
+ ## Recommendations
460
+
461
+ ### For OpenCode Swarm Plugin
462
+
463
+ 1. **Add brainstorming mode to swarm_decompose** - Offer interactive Socratic questioning for complex tasks
464
+ 2. **Enforce 2-5 minute task granularity** - Add validation in swarm_validate_decomposition
465
+ 3. **Steal "zero context" principle** - Worker prompts should assume no codebase knowledge
466
+ 4. **Add incremental validation** - Option to validate decomposition in chunks (not all-at-once)
467
+
468
+ ### For Skills Library
469
+
470
+ 1. **Port brainstorming skill** - Generalize for OpenCode (remove superpowers-specific refs)
471
+ 2. **Port writing-plans skill** - Adapt for OpenCode execution model
472
+ 3. **Create hybrid skill** - Combine Socratic decomposition with swarm execution
473
+
474
+ ### For Learning System
475
+
476
+ Track these metrics from Socratic-style decompositions:
477
+ - **Question count to understanding** - How many questions before design phase?
478
+ - **Section validation failures** - Which sections needed rework?
479
+ - **Task size drift** - Are tasks staying in 2-5 min range?
480
+ - **Context assumptions** - Did engineer have to guess? (signals under-specification)
481
+
482
+ ---
483
+
484
+ ## Appendix: File Locations
485
+
486
+ **Analyzed files:**
487
+ - `skills/brainstorming/SKILL.md`
488
+ - `skills/writing-plans/SKILL.md`
489
+ - `skills/executing-plans/SKILL.md`
490
+ - `skills/subagent-driven-development/SKILL.md`
491
+ - `skills/using-git-worktrees/SKILL.md`
492
+ - `commands/brainstorm.md`
493
+ - `commands/write-plan.md`
494
+
495
+ **Related skills not analyzed (referenced but not deep-dived):**
496
+ - `skills/elements-of-style/writing-clearly-and-concisely/SKILL.md`
497
+ - `skills/finishing-a-development-branch/SKILL.md`
498
+ - `skills/requesting-code-review/code-reviewer.md`
499
+ - `skills/test-driven-development/SKILL.md`
500
+
501
+ ---
502
+
503
+ **End of Analysis**
504
+ ```
@@ -83,21 +83,67 @@ git checkout -b swarm/<short-task-name>
83
83
  git push -u origin HEAD
84
84
  ```
85
85
 
86
- ### 4. Decompose Task
86
+ ### 4. Decompose Task (DELEGATE TO SUBAGENT)
87
87
 
88
- Use strategy selection and planning:
88
+ > **⚠️ CRITICAL: Context Preservation**
89
+ >
90
+ > **DO NOT decompose inline in the coordinator thread.** This consumes massive context with file reading, CASS queries, and reasoning. You will hit context limits on long swarms.
91
+ >
92
+ > **ALWAYS delegate to a `swarm/planner` subagent** that returns only the validated BeadTree JSON.
93
+
94
+ **❌ Don't do this (inline planning):**
89
95
 
90
96
  ```bash
97
+ # This pollutes your main thread context
91
98
  swarm_select_strategy(task="<the task>")
92
- swarm_plan_prompt(task="<the task>", strategy="<auto or selected>", context="<synthesized knowledge>")
99
+ swarm_plan_prompt(task="<the task>", ...)
100
+ # ... you reason about decomposition inline ...
101
+ # ... context fills with file contents, analysis ...
102
+ swarm_validate_decomposition(response="...")
93
103
  ```
94
104
 
95
- Follow the prompt to create a BeadTree, then validate:
105
+ **✅ Do this (delegate to subagent):**
96
106
 
97
107
  ```bash
98
- swarm_validate_decomposition(response="<your BeadTree JSON>")
108
+ # 1. Create planning bead
109
+ beads_create(title="Plan: <task>", type="task", description="Decompose into subtasks")
110
+
111
+ # 2. Delegate to swarm/planner subagent
112
+ Task(
113
+ subagent_type="swarm/planner",
114
+ description="Decompose task: <task>",
115
+ prompt="
116
+ You are a swarm planner. Generate a BeadTree for this task.
117
+
118
+ ## Task
119
+ <task description>
120
+
121
+ ## Synthesized Context
122
+ <from knowledge gathering step 2>
123
+
124
+ ## Instructions
125
+ 1. Use swarm_select_strategy(task=\"...\")
126
+ 2. Use swarm_plan_prompt(task=\"...\", max_subtasks=5, query_cass=true)
127
+ 3. Reason about decomposition strategy
128
+ 4. Generate BeadTree JSON
129
+ 5. Validate with swarm_validate_decomposition
130
+ 6. Return ONLY the validated BeadTree JSON (no analysis)
131
+
132
+ Output: Valid BeadTree JSON only.
133
+ "
134
+ )
135
+
136
+ # 3. Subagent returns validated JSON, parse it
137
+ # beadTree = <result from subagent>
99
138
  ```
100
139
 
140
+ **Why?**
141
+
142
+ - Main thread stays clean (only receives final JSON)
143
+ - Subagent context is disposable (garbage collected after planning)
144
+ - Scales to 10+ worker swarms without exhaustion
145
+ - Faster coordination responses
146
+
101
147
  ### 5. Create Beads
102
148
 
103
149
  ```bash
@@ -226,16 +272,32 @@ gh pr create --title "feat: <epic title>" --body "## Summary\n<bullets>\n\n## Be
226
272
  | Architecture decisions | `skills_use(name="system-design")` |
227
273
  | Breaking dependencies | `skills_use(name="testing-patterns")` |
228
274
 
275
+ ## Context Preservation Rules
276
+
277
+ **These are NON-NEGOTIABLE. Violating them burns context and kills long swarms.**
278
+
279
+ | Rule | Why |
280
+ | ---------------------------------- | --------------------------------------------------------- |
281
+ | **Delegate planning to subagent** | Decomposition reasoning + file reads consume huge context |
282
+ | **Never read 10+ files inline** | Use subagent to read + summarize |
283
+ | **Limit CASS queries** | One query per domain, delegate deep searching |
284
+ | **Use swarmmail_inbox carefully** | Max 5 messages, no bodies by default |
285
+ | **Receive JSON only from planner** | No analysis, no file contents, just structure |
286
+
287
+ **Pattern: Delegate → Receive Summary → Act**
288
+
289
+ Not: Do Everything Inline → Run Out of Context → Fail
290
+
229
291
  ## Quick Checklist
230
292
 
231
293
  - [ ] **swarmmail_init** called FIRST
232
294
  - [ ] Knowledge gathered (semantic-memory, CASS, pdf-brain, skills)
233
- - [ ] Strategy selected
295
+ - [ ] **Planning delegated to swarm/planner subagent** (NOT inline)
234
296
  - [ ] BeadTree validated (no file conflicts)
235
297
  - [ ] Epic + subtasks created
236
298
  - [ ] Files reserved via **swarmmail_reserve**
237
299
  - [ ] Workers spawned in parallel
238
- - [ ] Progress monitored via **swarmmail_inbox**
300
+ - [ ] Progress monitored via **swarmmail_inbox** (limit=5, no bodies)
239
301
  - [ ] PR created (or pushed to main)
240
302
 
241
303
  Begin with swarmmail_init and knowledge gathering now.