opencode-swarm-plugin 0.21.0 → 0.23.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.
Files changed (131) hide show
  1. package/.turbo/turbo-build.log +9 -0
  2. package/CHANGELOG.md +12 -0
  3. package/README.md +111 -166
  4. package/dist/agent-mail.d.ts +480 -0
  5. package/dist/agent-mail.d.ts.map +1 -0
  6. package/dist/anti-patterns.d.ts +257 -0
  7. package/dist/anti-patterns.d.ts.map +1 -0
  8. package/dist/beads.d.ts +377 -0
  9. package/dist/beads.d.ts.map +1 -0
  10. package/dist/eval-capture.d.ts +206 -0
  11. package/dist/eval-capture.d.ts.map +1 -0
  12. package/dist/index.d.ts +1299 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +776 -4387
  15. package/dist/learning.d.ts +670 -0
  16. package/dist/learning.d.ts.map +1 -0
  17. package/dist/mandate-promotion.d.ts +93 -0
  18. package/dist/mandate-promotion.d.ts.map +1 -0
  19. package/dist/mandate-storage.d.ts +209 -0
  20. package/dist/mandate-storage.d.ts.map +1 -0
  21. package/dist/mandates.d.ts +230 -0
  22. package/dist/mandates.d.ts.map +1 -0
  23. package/dist/output-guardrails.d.ts +125 -0
  24. package/dist/output-guardrails.d.ts.map +1 -0
  25. package/dist/pattern-maturity.d.ts +246 -0
  26. package/dist/pattern-maturity.d.ts.map +1 -0
  27. package/dist/plugin.d.ts +22 -0
  28. package/dist/plugin.d.ts.map +1 -0
  29. package/dist/plugin.js +755 -4375
  30. package/dist/rate-limiter.d.ts +218 -0
  31. package/dist/rate-limiter.d.ts.map +1 -0
  32. package/dist/repo-crawl.d.ts +146 -0
  33. package/dist/repo-crawl.d.ts.map +1 -0
  34. package/dist/schemas/bead.d.ts +255 -0
  35. package/dist/schemas/bead.d.ts.map +1 -0
  36. package/dist/schemas/evaluation.d.ts +161 -0
  37. package/dist/schemas/evaluation.d.ts.map +1 -0
  38. package/dist/schemas/index.d.ts +34 -0
  39. package/dist/schemas/index.d.ts.map +1 -0
  40. package/dist/schemas/mandate.d.ts +336 -0
  41. package/dist/schemas/mandate.d.ts.map +1 -0
  42. package/dist/schemas/swarm-context.d.ts +131 -0
  43. package/dist/schemas/swarm-context.d.ts.map +1 -0
  44. package/dist/schemas/task.d.ts +188 -0
  45. package/dist/schemas/task.d.ts.map +1 -0
  46. package/dist/skills.d.ts +471 -0
  47. package/dist/skills.d.ts.map +1 -0
  48. package/dist/storage.d.ts +260 -0
  49. package/dist/storage.d.ts.map +1 -0
  50. package/dist/structured.d.ts +196 -0
  51. package/dist/structured.d.ts.map +1 -0
  52. package/dist/swarm-decompose.d.ts +201 -0
  53. package/dist/swarm-decompose.d.ts.map +1 -0
  54. package/dist/swarm-mail.d.ts +240 -0
  55. package/dist/swarm-mail.d.ts.map +1 -0
  56. package/dist/swarm-orchestrate.d.ts +708 -0
  57. package/dist/swarm-orchestrate.d.ts.map +1 -0
  58. package/dist/swarm-prompts.d.ts +292 -0
  59. package/dist/swarm-prompts.d.ts.map +1 -0
  60. package/dist/swarm-strategies.d.ts +100 -0
  61. package/dist/swarm-strategies.d.ts.map +1 -0
  62. package/dist/swarm.d.ts +455 -0
  63. package/dist/swarm.d.ts.map +1 -0
  64. package/dist/tool-availability.d.ts +91 -0
  65. package/dist/tool-availability.d.ts.map +1 -0
  66. package/docs/planning/ADR-001-monorepo-structure.md +171 -0
  67. package/docs/planning/ADR-002-package-extraction.md +393 -0
  68. package/docs/planning/ADR-003-performance-improvements.md +451 -0
  69. package/docs/planning/ADR-004-message-queue-features.md +187 -0
  70. package/docs/planning/ADR-005-devtools-observability.md +202 -0
  71. package/docs/planning/ROADMAP.md +368 -0
  72. package/docs/semantic-memory-cli-syntax.md +123 -0
  73. package/docs/swarm-mail-architecture.md +1147 -0
  74. package/package.json +13 -24
  75. package/scripts/cleanup-test-memories.ts +346 -0
  76. package/src/agent-mail.ts +1 -1
  77. package/src/beads.ts +1 -2
  78. package/src/index.ts +2 -2
  79. package/src/learning.integration.test.ts +80 -10
  80. package/src/mandate-storage.test.ts +3 -3
  81. package/src/storage.ts +189 -9
  82. package/src/swarm-mail.ts +3 -3
  83. package/src/swarm-orchestrate.ts +399 -246
  84. package/src/swarm.integration.test.ts +124 -0
  85. package/src/tool-availability.ts +1 -1
  86. package/tsconfig.json +1 -1
  87. package/.beads/.local_version +0 -1
  88. package/.beads/README.md +0 -81
  89. package/.beads/analysis/skill-architecture-meta-skills.md +0 -1562
  90. package/.beads/config.yaml +0 -62
  91. package/.beads/issues.jsonl +0 -2186
  92. package/.beads/metadata.json +0 -4
  93. package/.gitattributes +0 -3
  94. package/.github/workflows/ci.yml +0 -30
  95. package/.github/workflows/opencode.yml +0 -31
  96. package/.opencode/skills/tdd/SKILL.md +0 -182
  97. package/INTEGRATION_EXAMPLE.md +0 -66
  98. package/VERIFICATION_QUALITY_PATTERNS.md +0 -565
  99. package/bun.lock +0 -286
  100. package/dist/pglite.data +0 -0
  101. package/dist/pglite.wasm +0 -0
  102. package/src/streams/agent-mail.test.ts +0 -777
  103. package/src/streams/agent-mail.ts +0 -535
  104. package/src/streams/debug.test.ts +0 -500
  105. package/src/streams/debug.ts +0 -727
  106. package/src/streams/effect/ask.integration.test.ts +0 -314
  107. package/src/streams/effect/ask.ts +0 -202
  108. package/src/streams/effect/cursor.integration.test.ts +0 -418
  109. package/src/streams/effect/cursor.ts +0 -288
  110. package/src/streams/effect/deferred.test.ts +0 -357
  111. package/src/streams/effect/deferred.ts +0 -445
  112. package/src/streams/effect/index.ts +0 -17
  113. package/src/streams/effect/layers.ts +0 -73
  114. package/src/streams/effect/lock.test.ts +0 -385
  115. package/src/streams/effect/lock.ts +0 -399
  116. package/src/streams/effect/mailbox.test.ts +0 -260
  117. package/src/streams/effect/mailbox.ts +0 -318
  118. package/src/streams/events.test.ts +0 -924
  119. package/src/streams/events.ts +0 -329
  120. package/src/streams/index.test.ts +0 -229
  121. package/src/streams/index.ts +0 -578
  122. package/src/streams/migrations.test.ts +0 -359
  123. package/src/streams/migrations.ts +0 -362
  124. package/src/streams/projections.test.ts +0 -611
  125. package/src/streams/projections.ts +0 -504
  126. package/src/streams/store.integration.test.ts +0 -658
  127. package/src/streams/store.ts +0 -1075
  128. package/src/streams/swarm-mail.ts +0 -552
  129. package/test-bug-fixes.ts +0 -86
  130. package/vitest.integration.config.ts +0 -13
  131. package/workflow-integration-analysis.md +0 -876
@@ -1,876 +0,0 @@
1
- # Workflow Integration & Branch Management Analysis
2
-
3
- **From: obra/superpowers**
4
- **Analyzed: using-git-worktrees, finishing-a-development-branch, executing-plans**
5
- **Date: 2025-12-13**
6
-
7
- ---
8
-
9
- ## Core Principles
10
-
11
- 1. **Systematic directory selection = reliable isolation**
12
- - Priority: existing > CLAUDE.md > ask user
13
- - Never assume, never hardcode
14
-
15
- 2. **Safety verification prevents repository pollution**
16
- - .gitignore check is NON-NEGOTIABLE for project-local worktrees
17
- - "Fix broken things immediately" - add to .gitignore + commit before proceeding
18
-
19
- 3. **Clean baseline establishes known-good state**
20
- - Run tests after worktree creation, before any implementation
21
- - "Can't distinguish new bugs from pre-existing issues" without this
22
-
23
- 4. **Batch execution with checkpoints enables human oversight**
24
- - Default: first 3 tasks, then report
25
- - Architect reviews between batches, not micromanaging individual tasks
26
-
27
- 5. **Structured options eliminate ambiguity**
28
- - Present exactly 4 options (merge/PR/keep/discard)
29
- - No open-ended "what should I do?" questions
30
-
31
- 6. **Typed confirmation for destructive actions**
32
- - Require exact string "discard" to delete work
33
- - Show what will be permanently lost
34
-
35
- 7. **Stop and ask beats guessing**
36
- - Blockers, unclear instructions, repeated failures = STOP
37
- - Clarification > forcing through
38
-
39
- 8. **Worktree lifecycle matches branch lifecycle**
40
- - Create worktree → work → cleanup worktree
41
- - Exception: keep worktree for PR option (may need it)
42
-
43
- ---
44
-
45
- ## Full Workflow Diagram
46
-
47
- ```
48
- ┌─────────────────────────────────────────────────────────────────────┐
49
- │ FULL DEVELOPMENT CYCLE │
50
- └─────────────────────────────────────────────────────────────────────┘
51
-
52
- ┌─────────────────┐
53
- │ BRAINSTORMING │ Socratic refinement → design document
54
- └────────┬────────┘
55
- │ Design approved? ──[NO]──> iterate
56
- │ [YES]
57
-
58
- ┌─────────────────────────────────────┐
59
- │ USING-GIT-WORKTREES │
60
- ├─────────────────────────────────────┤
61
- │ 1. Directory Selection: │
62
- │ ├─ .worktrees/ exists? ──[YES]─> use it
63
- │ ├─ worktrees/ exists? ──[YES]──> use it
64
- │ ├─ CLAUDE.md preference? ──[YES]─> use it
65
- │ └─ [NO to all] ──> ask user │
66
- │ │
67
- │ 2. Safety Verification: │
68
- │ └─ If project-local: │
69
- │ └─ grep .gitignore ──[NOT FOUND]──> add + commit
70
- │ │
71
- │ 3. Create Worktree: │
72
- │ └─ git worktree add <path> -b <branch>
73
- │ │
74
- │ 4. Project Setup: │
75
- │ └─ Auto-detect (npm/cargo/pip/go)│
76
- │ └─ Run install/build │
77
- │ │
78
- │ 5. Verify Clean Baseline: │
79
- │ └─ Run tests ──[FAIL]──> report + ask
80
- │ [PASS]──> proceed │
81
- └────────┬────────────────────────────┘
82
-
83
-
84
- ┌─────────────────┐ ┌──────────────────────┐
85
- │ WRITING-PLANS │ ───> │ Plan Document: │
86
- └────────┬────────┘ │ - Bite-sized tasks │
87
- │ │ - Exact file paths │
88
- │ │ - Complete code │
89
- │ │ - Verification steps │
90
- │ └──────────────────────┘
91
-
92
- ┌─────────────────────┐
93
- │ EXECUTION CHOICE │
94
- └─────────┬───────────┘
95
- ┌────┴────┐
96
- │ │
97
- [BATCH] [CONTINUOUS]
98
- │ │
99
- ▼ ▼
100
- ┌─────────────────┐ ┌────────────────────────┐
101
- │ EXECUTING-PLANS │ │ SUBAGENT-DRIVEN-DEV │
102
- ├─────────────────┤ ├────────────────────────┤
103
- │ Loop: │ │ Loop: │
104
- │ 1. Execute 3 │ │ 1. Dispatch subagent │
105
- │ 2. Report │ │ 2. Review code │
106
- │ 3. Wait feedback│ │ 3. Fix if needed │
107
- │ 4. Next batch │ │ 4. Next task │
108
- │ │ │ │
109
- │ Stop when: │ │ Same session, faster │
110
- │ - Blocker │ │ iteration │
111
- │ - Tests fail │ │ │
112
- │ - Unclear │ └────────┬───────────────┘
113
- └────────┬────────┘ │
114
- │ │
115
- └──────────┬─────────┘
116
- │ All tasks complete
117
-
118
- ┌──────────────────────────────────────────┐
119
- │ FINISHING-A-DEVELOPMENT-BRANCH │
120
- ├──────────────────────────────────────────┤
121
- │ 1. Verify Tests: │
122
- │ └─ Run test suite ──[FAIL]──> STOP │
123
- │ [PASS]──> continue│
124
- │ │
125
- │ 2. Determine Base Branch: │
126
- │ └─ git merge-base HEAD main │
127
- │ │
128
- │ 3. Present Options: │
129
- │ ┌─ 1. Merge back to main locally │
130
- │ ├─ 2. Push and create Pull Request │
131
- │ ├─ 3. Keep the branch as-is │
132
- │ └─ 4. Discard this work │
133
- │ │
134
- │ 4. Execute Choice: │
135
- │ ┌─────┬──────┬────────┬──────────┐ │
136
- │ │ │ │ │ │ │
137
- │ [1] [2] [3] [4] │ │
138
- │ │ │ │ │ │ │
139
- │ ▼ ▼ ▼ ▼ │ │
140
- │ Merge Push Keep Confirm │ │
141
- │ + + worktree ↓ │ │
142
- │ Delete Push │ "discard" │ │
143
- │ branch + │ ↓ │ │
144
- │ + Keep │ Delete │ │
145
- │ Remove worktree │ branch │ │
146
- │ worktree │ │ + │ │
147
- │ │ │ │ Remove │ │
148
- │ │ │ │ worktree │ │
149
- │ └──────┴──────┴───────┘ │ │
150
- │ │ │
151
- │ 5. Report Status │ │
152
- └────────────────────────────────────┘ │
153
- │ │
154
- ▼ │
155
- ┌─────────┐ │
156
- │ DONE │ │
157
- └─────────┘ │
158
- ```
159
-
160
- ---
161
-
162
- ## Git Worktree Best Practices
163
-
164
- ### Directory Selection Priority
165
-
166
- **1. Check existing directories first:**
167
-
168
- ```bash
169
- ls -d .worktrees 2>/dev/null # Preferred (hidden, project-local)
170
- ls -d worktrees 2>/dev/null # Alternative
171
- ```
172
-
173
- **If both exist:** `.worktrees` wins (hidden preference)
174
-
175
- **2. Check CLAUDE.md for preferences:**
176
-
177
- ```bash
178
- grep -i "worktree.*director" CLAUDE.md 2>/dev/null
179
- ```
180
-
181
- **If preference found:** Use it without asking
182
-
183
- **3. Ask user if neither:**
184
-
185
- ```
186
- No worktree directory found. Where should I create worktrees?
187
-
188
- 1. .worktrees/ (project-local, hidden)
189
- 2. ~/.config/superpowers/worktrees/<project-name>/ (global location)
190
-
191
- Which would you prefer?
192
- ```
193
-
194
- ### Safety Verification (MANDATORY for project-local)
195
-
196
- **The .gitignore check is NON-NEGOTIABLE:**
197
-
198
- ```bash
199
- # Check if directory pattern in .gitignore
200
- grep -q "^\.worktrees/$" .gitignore || grep -q "^worktrees/$" .gitignore
201
- ```
202
-
203
- **If NOT in .gitignore:**
204
-
205
- Per Jesse's rule "Fix broken things immediately":
206
-
207
- 1. Add appropriate line to .gitignore
208
- 2. Commit the change
209
- 3. Then proceed with worktree creation
210
-
211
- **Why critical:** Prevents accidentally committing worktree contents to repository.
212
-
213
- **For global directory (~/.config/superpowers/worktrees):**
214
-
215
- - No .gitignore verification needed
216
- - Outside project entirely, can't pollute repo
217
-
218
- ### Project Setup Auto-Detection
219
-
220
- ```bash
221
- # Node.js
222
- if [ -f package.json ]; then npm install; fi
223
-
224
- # Rust
225
- if [ -f Cargo.toml ]; then cargo build; fi
226
-
227
- # Python
228
- if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
229
- if [ -f pyproject.toml ]; then poetry install; fi
230
-
231
- # Go
232
- if [ -f go.mod ]; then go mod download; fi
233
- ```
234
-
235
- **Don't hardcode** - auto-detect from project files
236
-
237
- ### Clean Baseline Verification
238
-
239
- **Run tests after setup, before any implementation:**
240
-
241
- ```bash
242
- npm test / cargo test / pytest / go test ./...
243
- ```
244
-
245
- **If tests fail:**
246
-
247
- - Report failures
248
- - Ask whether to proceed or investigate
249
- - Don't assume broken tests are acceptable
250
-
251
- **If tests pass:**
252
-
253
- - Report ready with count (e.g., "47 tests, 0 failures")
254
- - Proceed with confidence
255
-
256
- **Why:** Can't distinguish new bugs from pre-existing issues without clean baseline
257
-
258
- ---
259
-
260
- ## Branch Completion Options
261
-
262
- ### The 4 Options (Present Exactly)
263
-
264
- ```
265
- Implementation complete. What would you like to do?
266
-
267
- 1. Merge back to <base-branch> locally
268
- 2. Push and create a Pull Request
269
- 3. Keep the branch as-is (I'll handle it later)
270
- 4. Discard this work
271
-
272
- Which option?
273
- ```
274
-
275
- **Don't add explanation** - keep concise, let user choose
276
-
277
- ### Option 1: Merge Locally
278
-
279
- **Workflow:**
280
-
281
- ```bash
282
- # Switch to base branch
283
- git checkout <base-branch>
284
-
285
- # Pull latest
286
- git pull
287
-
288
- # Merge feature branch
289
- git merge <feature-branch>
290
-
291
- # VERIFY TESTS ON MERGED RESULT
292
- <test command>
293
-
294
- # If tests pass
295
- git branch -d <feature-branch>
296
- ```
297
-
298
- **Cleanup:** Remove worktree (Step 5)
299
-
300
- **When to use:**
301
-
302
- - Small changes
303
- - Working alone
304
- - Want immediate integration
305
-
306
- ### Option 2: Push and Create PR
307
-
308
- **Workflow:**
309
-
310
- ```bash
311
- # Push branch
312
- git push -u origin <feature-branch>
313
-
314
- # Create PR
315
- gh pr create --title "<title>" --body "$(cat <<'EOF'
316
- ## Summary
317
- <2-3 bullets of what changed>
318
-
319
- ## Test Plan
320
- - [ ] <verification steps>
321
- EOF
322
- )"
323
- ```
324
-
325
- **Cleanup:** Remove worktree (Step 5)
326
-
327
- **Keep worktree?** Actually YES for this option - might need it for PR feedback
328
-
329
- **When to use:**
330
-
331
- - Team collaboration
332
- - Want code review
333
- - Significant changes
334
-
335
- ### Option 3: Keep As-Is
336
-
337
- **Action:** Report only
338
-
339
- ```
340
- Keeping branch <name>. Worktree preserved at <path>.
341
- ```
342
-
343
- **Don't cleanup worktree** - user will handle later
344
-
345
- **When to use:**
346
-
347
- - Work in progress
348
- - Need to switch contexts
349
- - Experimental branch
350
-
351
- ### Option 4: Discard
352
-
353
- **REQUIRES TYPED CONFIRMATION:**
354
-
355
- ```
356
- This will permanently delete:
357
- - Branch <name>
358
- - All commits: <commit-list>
359
- - Worktree at <path>
360
-
361
- Type 'discard' to confirm.
362
- ```
363
-
364
- **Wait for exact confirmation** - don't accept "yes", "ok", etc.
365
-
366
- **If confirmed:**
367
-
368
- ```bash
369
- git checkout <base-branch>
370
- git branch -D <feature-branch> # Force delete
371
- ```
372
-
373
- **Cleanup:** Remove worktree (Step 5)
374
-
375
- **When to use:**
376
-
377
- - Failed experiment
378
- - Superseded approach
379
- - Accidental branch
380
-
381
- ### Worktree Cleanup (Step 5)
382
-
383
- **For Options 1, 2, 4:**
384
-
385
- ```bash
386
- # Check if in worktree
387
- git worktree list | grep $(git branch --show-current)
388
-
389
- # If yes, remove it
390
- git worktree remove <worktree-path>
391
- ```
392
-
393
- **For Option 3:** Keep worktree intact
394
-
395
- ### Quick Reference Table
396
-
397
- | Option | Merge | Push | Keep Worktree | Cleanup Branch |
398
- | ---------------- | ----- | ---- | ------------- | -------------- |
399
- | 1. Merge locally | ✓ | - | - | ✓ |
400
- | 2. Create PR | - | ✓ | ✓ | - |
401
- | 3. Keep as-is | - | - | ✓ | - |
402
- | 4. Discard | - | - | - | ✓ (force) |
403
-
404
- ---
405
-
406
- ## Batch Execution Patterns
407
-
408
- ### executing-plans Workflow
409
-
410
- **Core principle:** Batch execution with checkpoints for architect review
411
-
412
- **Step 1: Load and Review Plan**
413
-
414
- 1. Read plan file
415
- 2. Review critically - identify questions/concerns
416
- 3. If concerns: raise with human before starting
417
- 4. If no concerns: create TodoWrite and proceed
418
-
419
- **Step 2: Execute Batch**
420
-
421
- **Default: First 3 tasks**
422
-
423
- For each task:
424
-
425
- 1. Mark as in_progress
426
- 2. Follow each step exactly (plan has bite-sized steps)
427
- 3. Run verifications as specified
428
- 4. Mark as completed
429
-
430
- **Step 3: Report**
431
-
432
- When batch complete:
433
-
434
- - Show what was implemented
435
- - Show verification output
436
- - Say: "Ready for feedback."
437
-
438
- **Step 4: Continue**
439
-
440
- Based on feedback:
441
-
442
- - Apply changes if needed
443
- - Execute next batch
444
- - Repeat until complete
445
-
446
- **Step 5: Complete Development**
447
-
448
- After all tasks complete and verified:
449
-
450
- - Announce: "I'm using the finishing-a-development-branch skill to complete this work."
451
- - Use finishing-a-development-branch skill
452
- - Follow that skill to verify tests, present options, execute choice
453
-
454
- ### When to Stop and Ask for Help
455
-
456
- **STOP executing immediately when:**
457
-
458
- - Hit a blocker mid-batch (missing dependency, test fails, instruction unclear)
459
- - Plan has critical gaps preventing starting
460
- - You don't understand an instruction
461
- - Verification fails repeatedly
462
-
463
- **Ask for clarification rather than guessing**
464
-
465
- ### When to Revisit Earlier Steps
466
-
467
- **Return to Review (Step 1) when:**
468
-
469
- - Partner updates the plan based on your feedback
470
- - Fundamental approach needs rethinking
471
-
472
- **Don't force through blockers** - stop and ask
473
-
474
- ### Batch Size Considerations
475
-
476
- **Default 3 tasks chosen because:**
477
-
478
- - Small enough for focused review
479
- - Large enough for meaningful progress
480
- - Matches typical 15-20 minute review cycle
481
-
482
- **Can adjust based on:**
483
-
484
- - Task complexity (1-2 for complex, 5+ for trivial)
485
- - Human availability (larger batches if async)
486
- - Risk level (smaller batches for critical code)
487
-
488
- ---
489
-
490
- ## Anti-Patterns and Red Flags
491
-
492
- ### Git Worktree Anti-Patterns
493
-
494
- **Skipping .gitignore verification**
495
-
496
- - **Problem:** Worktree contents get tracked, pollute git status
497
- - **Fix:** Always grep .gitignore before creating project-local worktree
498
- - **Quote:** "Why critical: Prevents accidentally committing worktree contents to repository"
499
-
500
- **Assuming directory location**
501
-
502
- - **Problem:** Creates inconsistency, violates project conventions
503
- - **Fix:** Follow priority: existing > CLAUDE.md > ask
504
- - **Never:** Create without checking existing first
505
-
506
- **Proceeding with failing tests**
507
-
508
- - **Problem:** Can't distinguish new bugs from pre-existing issues
509
- - **Fix:** Report failures, get explicit permission to proceed
510
- - **Quote:** "If tests fail: Report failures, ask whether to proceed or investigate"
511
-
512
- **Hardcoding setup commands**
513
-
514
- - **Problem:** Breaks on projects using different tools
515
- - **Fix:** Auto-detect from project files (package.json, Cargo.toml, etc.)
516
-
517
- ### Branch Completion Anti-Patterns
518
-
519
- **Skipping test verification**
520
-
521
- - **Problem:** Merge broken code, create failing PR
522
- - **Fix:** Always verify tests before offering options
523
- - **Quote:** "Before presenting options, verify tests pass"
524
-
525
- **Open-ended questions**
526
-
527
- - **Problem:** "What should I do next?" → ambiguous, decision paralysis
528
- - **Fix:** Present exactly 4 structured options
529
- - **Quote:** "Don't add explanation - keep options concise"
530
-
531
- **Automatic worktree cleanup**
532
-
533
- - **Problem:** Remove worktree when might need it (Option 2, 3)
534
- - **Fix:** Only cleanup for Options 1 and 4
535
- - **Note:** Option 2 (PR) might need worktree for feedback iterations
536
-
537
- **No confirmation for discard**
538
-
539
- - **Problem:** Accidentally delete work
540
- - **Fix:** Require typed "discard" confirmation
541
- - **Quote:** "Wait for exact confirmation - don't accept 'yes', 'ok', etc."
542
-
543
- **Merging without verifying tests on result**
544
-
545
- - **Problem:** Merge conflicts can break tests
546
- - **Fix:** Run tests after merge, before deleting branch
547
-
548
- ### Batch Execution Anti-Patterns
549
-
550
- **Forcing through blockers**
551
-
552
- - **Problem:** Waste time on wrong approach, build on broken foundation
553
- - **Fix:** Stop and ask when hit blocker
554
- - **Quote:** "Ask for clarification rather than guessing"
555
-
556
- **Skipping verifications**
557
-
558
- - **Problem:** Don't know if implementation works
559
- - **Fix:** Run every verification step in plan
560
- - **Quote:** "Don't skip verifications"
561
-
562
- **Not reporting between batches**
563
-
564
- - **Problem:** Human can't course-correct, issues compound
565
- - **Fix:** Always report + wait after batch
566
- - **Quote:** "Between batches: just report and wait"
567
-
568
- **Ignoring plan steps**
569
-
570
- - **Problem:** Miss critical setup, tests, edge cases
571
- - **Fix:** Follow plan exactly
572
- - **Quote:** "Follow each step exactly (plan has bite-sized steps)"
573
-
574
- **Guessing when unclear**
575
-
576
- - **Problem:** Implement wrong thing, waste time
577
- - **Fix:** Stop and ask for clarification
578
- - **Quote:** "Stop when blocked, don't guess"
579
-
580
- ### General Red Flags
581
-
582
- **From using-git-worktrees:**
583
-
584
- - Create worktree without .gitignore verification (project-local)
585
- - Skip baseline test verification
586
- - Proceed with failing tests without asking
587
- - Assume directory location when ambiguous
588
- - Skip CLAUDE.md check
589
-
590
- **From finishing-a-development-branch:**
591
-
592
- - Proceed with failing tests
593
- - Merge without verifying tests on result
594
- - Delete work without confirmation
595
- - Force-push without explicit request
596
-
597
- **From executing-plans:**
598
-
599
- - Ignore questions/concerns during review
600
- - Force through blockers
601
- - Skip verifications
602
- - Deviate from plan without discussing
603
- - Continue when fundamentally unclear
604
-
605
- ---
606
-
607
- ## Key Quotes Worth Preserving
608
-
609
- ### On Directory Selection
610
-
611
- > "Follow this priority order: existing > CLAUDE.md > ask"
612
-
613
- > "If both exist, `.worktrees` wins."
614
-
615
- ### On Safety
616
-
617
- > "MUST verify .gitignore before creating worktree"
618
-
619
- > "Why critical: Prevents accidentally committing worktree contents to repository."
620
-
621
- > "Per Jesse's rule 'Fix broken things immediately': 1. Add appropriate line to .gitignore 2. Commit the change 3. Proceed with worktree creation"
622
-
623
- ### On Clean Baseline
624
-
625
- > "Verify clean baseline: Run tests to ensure worktree starts clean"
626
-
627
- > "If tests fail: Report failures, ask whether to proceed or investigate."
628
-
629
- > "Can't distinguish new bugs from pre-existing issues"
630
-
631
- ### On Batch Execution
632
-
633
- > "Batch execution with checkpoints for architect review"
634
-
635
- > "Default: first 3 tasks, then report"
636
-
637
- > "Between batches: just report and wait"
638
-
639
- > "Ask for clarification rather than guessing"
640
-
641
- > "Don't force through blockers - stop and ask"
642
-
643
- ### On Completion Options
644
-
645
- > "Present exactly these 4 options"
646
-
647
- > "Don't add explanation - keep options concise"
648
-
649
- > "Type 'discard' to confirm."
650
-
651
- > "Wait for exact confirmation - don't accept 'yes', 'ok', etc."
652
-
653
- ### On Discipline
654
-
655
- > "Follow plan steps exactly"
656
-
657
- > "Don't skip verifications"
658
-
659
- > "Stop executing immediately when: Hit a blocker mid-batch"
660
-
661
- > "Reference skills when plan says to"
662
-
663
- ### On Integration
664
-
665
- > "REQUIRED SUB-SKILL: Use superpowers:finishing-a-development-branch"
666
-
667
- > "Announces at start: 'I'm using the [skill-name] skill to [action]'"
668
-
669
- ---
670
-
671
- ## Workflow Integration Summary
672
-
673
- ### The Full Loop
674
-
675
- 1. **brainstorming** → design document
676
- 2. **using-git-worktrees** → isolated workspace + clean baseline
677
- 3. **writing-plans** → bite-sized implementation tasks
678
- 4. **executing-plans** OR **subagent-driven-development** → implementation with checkpoints
679
- 5. **finishing-a-development-branch** → structured completion
680
-
681
- ### Key Integration Points
682
-
683
- **brainstorming → using-git-worktrees:**
684
-
685
- - After design approved
686
- - Before implementation starts
687
- - Sets up isolation
688
-
689
- **using-git-worktrees → writing-plans:**
690
-
691
- - Work happens in worktree
692
- - Plan saved to `docs/plans/YYYY-MM-DD-<topic>.md`
693
-
694
- **writing-plans → executing-plans:**
695
-
696
- - Plan header includes: "REQUIRED SUB-SKILL: Use superpowers:executing-plans"
697
- - Executor loads plan, follows tasks
698
-
699
- **executing-plans → finishing-a-development-branch:**
700
-
701
- - After all batches complete
702
- - Step 5 explicitly requires this skill
703
- - Verifies tests, presents options, cleans up
704
-
705
- **finishing-a-development-branch → using-git-worktrees:**
706
-
707
- - Cleanup completes the cycle
708
- - Worktree removed (except Option 3)
709
-
710
- ### Execution Choice: Batch vs Continuous
711
-
712
- **executing-plans (batch, parallel session):**
713
-
714
- - Human reviews between batches
715
- - Default 3 tasks per batch
716
- - Slower but more oversight
717
- - Better when plan needs validation
718
-
719
- **subagent-driven-development (continuous, same session):**
720
-
721
- - Fresh subagent per task
722
- - Code review after each task
723
- - Faster iteration
724
- - Better when tasks independent
725
-
726
- Both end with **finishing-a-development-branch**
727
-
728
- ### Skill Announcement Pattern
729
-
730
- Every skill starts with announcement:
731
-
732
- ```
733
- "I'm using the [skill-name] skill to [action]."
734
- ```
735
-
736
- Examples:
737
-
738
- - "I'm using the using-git-worktrees skill to set up an isolated workspace."
739
- - "I'm using the executing-plans skill to implement this plan."
740
- - "I'm using the finishing-a-development-branch skill to complete this work."
741
-
742
- **Why:** Transparency + confirms skill was read
743
-
744
- ### Mandatory Workflows
745
-
746
- From using-superpowers skill:
747
-
748
- > "If a skill exists for your task, you must use it or you will fail at your task."
749
-
750
- These workflows are MANDATORY, not suggestions:
751
-
752
- - Brainstorming before coding
753
- - Git worktrees for implementation
754
- - Test-driven development during implementation
755
- - Finishing-a-development-branch at completion
756
-
757
- ---
758
-
759
- ## Implementation Notes for opencode-swarm-plugin
760
-
761
- ### Patterns to Adopt
762
-
763
- 1. **Directory selection priority** - systematic approach to finding/creating directories
764
- 2. **Safety verification before mutation** - always check .gitignore before creating project-local directories
765
- 3. **Clean baseline verification** - run tests after setup, before work starts
766
- 4. **Structured option presentation** - 4 exact choices, no open-ended questions
767
- 5. **Typed confirmation for destructive actions** - require exact string match
768
- 6. **Batch execution with reporting** - default 3 tasks, report for review
769
- 7. **Stop-and-ask over guessing** - clarity > forcing through
770
-
771
- ### Skill Integration Pattern
772
-
773
- **Header structure for skills:**
774
-
775
- ```yaml
776
- ---
777
- name: skill-name
778
- description: Use when [trigger] - [one-line summary of workflow]
779
- ---
780
- ```
781
-
782
- **Announcement pattern:**
783
-
784
- ```
785
- "I'm using the [skill-name] skill to [action]."
786
- ```
787
-
788
- **Cross-skill integration:**
789
-
790
- ```markdown
791
- **REQUIRED SUB-SKILL:** Use superpowers:other-skill-name
792
- ```
793
-
794
- **Quick Reference tables** for decision points
795
-
796
- **Red Flags section** with "Never" and "Always" lists
797
-
798
- ### Testing Patterns
799
-
800
- **Clean baseline:**
801
-
802
- - Auto-detect test command from project
803
- - Run before starting work
804
- - Report count + failures
805
- - Ask permission if failures exist
806
-
807
- **Verification steps:**
808
-
809
- - Every task has explicit verification
810
- - Run actual command, show output
811
- - Don't proceed if verification fails
812
-
813
- **Test on merge:**
814
-
815
- - Even after successful feature tests
816
- - Merge conflicts can break things
817
- - Verify before deleting branch
818
-
819
- ### Error Handling
820
-
821
- **Stop conditions:**
822
-
823
- - Blocker mid-batch
824
- - Critical gaps in plan
825
- - Unclear instructions
826
- - Repeated verification failures
827
-
828
- **Recovery paths:**
829
-
830
- - Report issue + wait for guidance
831
- - Don't guess or force through
832
- - Return to earlier step if fundamental rethink needed
833
-
834
- ### Documentation Patterns
835
-
836
- **Plan documents:**
837
-
838
- - Save to `docs/plans/YYYY-MM-DD-<topic>.md`
839
- - Include header with REQUIRED SUB-SKILL directive
840
- - Bite-sized tasks (2-5 minutes each)
841
- - Exact file paths, complete code, verification steps
842
-
843
- **Design documents:**
844
-
845
- - Save to `docs/plans/YYYY-MM-DD-<topic>-design.md`
846
- - Present in sections (200-300 words)
847
- - Validate each section before continuing
848
-
849
- ---
850
-
851
- ## Conclusion
852
-
853
- The Superpowers workflow integration demonstrates:
854
-
855
- 1. **Systematic over ad-hoc** - directory selection, option presentation, batch sizes all follow clear rules
856
- 2. **Safety first** - .gitignore verification, clean baselines, typed confirmations
857
- 3. **Structured checkpoints** - report between batches, present exact options, stop when blocked
858
- 4. **Lifecycle management** - worktree creation tied to branch lifecycle, cleanup when done
859
- 5. **Skill composition** - skills call other skills explicitly, workflows chain cleanly
860
-
861
- The patterns are production-tested (Jesse's "Superpowers" system powers real development) and focused on preventing common failure modes:
862
-
863
- - Repository pollution (worktree .gitignore)
864
- - Broken baselines (test verification)
865
- - Ambiguous decisions (4 exact options)
866
- - Accidental deletion (typed confirmation)
867
- - Context drift (batch execution)
868
- - Forcing through blockers (stop and ask)
869
-
870
- These patterns map directly to opencode-swarm-plugin needs:
871
-
872
- - Swarm decomposition = brainstorming + writing-plans
873
- - Parallel agents = subagent-driven-development
874
- - Cleanup = finishing-a-development-branch
875
- - Safety = .gitignore verification, clean baselines
876
- - Learning = recording outcomes from batch execution