opencode-swarm-plugin 0.59.1 → 0.59.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-plugin/.claude-plugin/plugin.json +1 -1
- package/claude-plugin/commands/swarm.md +125 -2
- package/claude-plugin/dist/index.js +380 -262
- package/claude-plugin/dist/utils/adapter-cache.d.ts +36 -0
- package/claude-plugin/dist/utils/adapter-cache.d.ts.map +1 -0
- package/claude-plugin/dist/utils/event-utils.d.ts +31 -0
- package/claude-plugin/dist/utils/event-utils.d.ts.map +1 -0
- package/dist/bin/swarm.js +783 -596
- package/dist/cass-tools.d.ts.map +1 -1
- package/dist/hive.d.ts.map +1 -1
- package/dist/hive.js +75 -97
- package/dist/hivemind-tools.d.ts.map +1 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +396 -295
- package/dist/marketplace/index.js +380 -262
- package/dist/memory-tools.d.ts.map +1 -1
- package/dist/memory.d.ts.map +1 -1
- package/dist/plugin.js +395 -293
- package/dist/swarm-mail.d.ts +2 -2
- package/dist/swarm-mail.d.ts.map +1 -1
- package/dist/swarm-orchestrate.d.ts.map +1 -1
- package/dist/swarm-prompts.d.ts +1 -1
- package/dist/swarm-prompts.d.ts.map +1 -1
- package/dist/swarm-prompts.js +347 -259
- package/dist/swarm-verify.d.ts +100 -0
- package/dist/swarm-verify.d.ts.map +1 -0
- package/dist/swarm.d.ts +13 -1
- package/dist/swarm.d.ts.map +1 -1
- package/dist/utils/adapter-cache.d.ts +36 -0
- package/dist/utils/adapter-cache.d.ts.map +1 -0
- package/dist/utils/event-utils.d.ts +31 -0
- package/dist/utils/event-utils.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -260,13 +260,27 @@ Return a 3-5 bullet summary for shared_context."
|
|
|
260
260
|
)
|
|
261
261
|
```
|
|
262
262
|
|
|
263
|
-
### 3.
|
|
263
|
+
### 3. Confirm Git Strategy with User
|
|
264
264
|
|
|
265
|
+
**ALWAYS ask the user before creating branches or PRs.**
|
|
266
|
+
|
|
267
|
+
Use AskUserQuestion:
|
|
268
|
+
```
|
|
269
|
+
"Should I create a feature branch for this swarm?"
|
|
270
|
+
Options:
|
|
271
|
+
- "Yes, create swarm/<task-name> branch" (Recommended)
|
|
272
|
+
- "No, work on current branch"
|
|
273
|
+
- "I'll handle branching myself"
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
If user approves branch:
|
|
265
277
|
```bash
|
|
266
278
|
git checkout -b swarm/<short-task-name>
|
|
267
279
|
git push -u origin HEAD
|
|
268
280
|
```
|
|
269
281
|
|
|
282
|
+
**Never assume - always confirm git operations with the user.**
|
|
283
|
+
|
|
270
284
|
### 4. Decomposition (Delegate to Subagent)
|
|
271
285
|
|
|
272
286
|
> **⚠️ CRITICAL: Context Preservation**
|
|
@@ -359,6 +373,100 @@ Task(
|
|
|
359
373
|
**✅ GOOD:** Spawned all 5 workers in single message → parallel execution
|
|
360
374
|
**❌ BAD:** Spawned workers one-by-one → sequential, slow
|
|
361
375
|
|
|
376
|
+
### 6.5. Custom Prompts: MANDATORY Sections
|
|
377
|
+
|
|
378
|
+
> **⚠️ If you write custom prompts instead of using `swarm_spawn_subtask`, they MUST include hivemind steps.**
|
|
379
|
+
|
|
380
|
+
**Why?** Workers that skip hivemind waste time rediscovering solved problems and lose learnings for future agents.
|
|
381
|
+
|
|
382
|
+
```
|
|
383
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
384
|
+
│ CUSTOM PROMPT CHECKLIST (NON-NEGOTIABLE) │
|
|
385
|
+
├─────────────────────────────────────────────────────────────┤
|
|
386
|
+
│ │
|
|
387
|
+
│ ✅ [PRIOR LEARNINGS] section with hivemind_find queries │
|
|
388
|
+
│ ✅ hivemind_find as step 1-2 in MANDATORY STEPS │
|
|
389
|
+
│ ✅ hivemind_store before completion │
|
|
390
|
+
│ ✅ swarmmail_init as first action │
|
|
391
|
+
│ ✅ swarm_complete (not hive_close) to finish │
|
|
392
|
+
│ │
|
|
393
|
+
│ Missing any of these? Your workers will: │
|
|
394
|
+
│ - Repeat mistakes from last week │
|
|
395
|
+
│ - Lose discoveries that took 30+ min to find │
|
|
396
|
+
│ - Start from zero every time │
|
|
397
|
+
│ │
|
|
398
|
+
└─────────────────────────────────────────────────────────────┘
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
**Minimal Custom Prompt Template:**
|
|
402
|
+
|
|
403
|
+
```markdown
|
|
404
|
+
You are a swarm agent working on: **{task_title}**
|
|
405
|
+
|
|
406
|
+
[IDENTITY]
|
|
407
|
+
Agent: {agent_name}
|
|
408
|
+
Cell: {bead_id}
|
|
409
|
+
Epic: {epic_id}
|
|
410
|
+
|
|
411
|
+
[TASK]
|
|
412
|
+
{task_description}
|
|
413
|
+
|
|
414
|
+
[CONTEXT]
|
|
415
|
+
{shared_context_from_coordinator}
|
|
416
|
+
|
|
417
|
+
[PRIOR LEARNINGS - QUERY THESE FIRST]
|
|
418
|
+
Before starting work, check what past agents learned:
|
|
419
|
+
- hivemind_find(query="{task keywords}", limit=5)
|
|
420
|
+
- hivemind_find(query="{technology/domain} gotchas", limit=3)
|
|
421
|
+
|
|
422
|
+
Use findings to avoid known pitfalls and apply proven patterns.
|
|
423
|
+
|
|
424
|
+
[MANDATORY STEPS]
|
|
425
|
+
1. swarmmail_init(project_path="{project_path}", agent_name="{agent_name}", task_description="{bead_id}: {task_title}")
|
|
426
|
+
2. hivemind_find - query for relevant prior learnings (see above)
|
|
427
|
+
3. {your actual task steps here}
|
|
428
|
+
4. hivemind_store - if you discovered something valuable, STORE IT:
|
|
429
|
+
hivemind_store(information="<what you learned>", tags="{domain},{tech}")
|
|
430
|
+
5. swarmmail_send(to=["coordinator"], subject="{completion subject}", body="{findings}")
|
|
431
|
+
6. swarm_complete(project_key="{project_path}", agent_name="{agent_name}", bead_id="{bead_id}", summary="...", files_touched=[])
|
|
432
|
+
|
|
433
|
+
[STORE YOUR LEARNINGS]
|
|
434
|
+
If you discovered any of these, STORE them before completing:
|
|
435
|
+
- 🐛 Tricky bugs (>15min to solve)
|
|
436
|
+
- 💡 Project-specific patterns
|
|
437
|
+
- ⚠️ Tool/library gotchas
|
|
438
|
+
- 🚫 Approaches that failed
|
|
439
|
+
- 🏗️ Architectural decisions
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
**Example: Research Task (Fixed)**
|
|
443
|
+
|
|
444
|
+
Before (missing hivemind):
|
|
445
|
+
```
|
|
446
|
+
[MANDATORY STEPS]
|
|
447
|
+
1. swarmmail_init(...)
|
|
448
|
+
2. Search for patterns...
|
|
449
|
+
3. Document findings...
|
|
450
|
+
4. swarmmail_send(...)
|
|
451
|
+
5. swarm_complete(...)
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
After (with hivemind):
|
|
455
|
+
```
|
|
456
|
+
[PRIOR LEARNINGS]
|
|
457
|
+
- hivemind_find(query="client bundle hydration RSC", limit=5)
|
|
458
|
+
- hivemind_find(query="course-builder performance patterns", limit=3)
|
|
459
|
+
|
|
460
|
+
[MANDATORY STEPS]
|
|
461
|
+
1. swarmmail_init(...)
|
|
462
|
+
2. hivemind_find - check for prior learnings about this task
|
|
463
|
+
3. Search for patterns...
|
|
464
|
+
4. Document findings...
|
|
465
|
+
5. hivemind_store - store discoveries for future agents
|
|
466
|
+
6. swarmmail_send(...)
|
|
467
|
+
7. swarm_complete(...)
|
|
468
|
+
```
|
|
469
|
+
|
|
362
470
|
### 7. Monitor Inbox (MANDATORY - unless --no-sync)
|
|
363
471
|
|
|
364
472
|
> **⚠️ CRITICAL: Active monitoring is NOT optional.**
|
|
@@ -461,12 +569,26 @@ swarm_complete({
|
|
|
461
569
|
})
|
|
462
570
|
```
|
|
463
571
|
|
|
464
|
-
### 11.
|
|
572
|
+
### 11. Confirm PR Creation with User
|
|
573
|
+
|
|
574
|
+
**ALWAYS ask before creating a PR.**
|
|
465
575
|
|
|
576
|
+
Use AskUserQuestion:
|
|
577
|
+
```
|
|
578
|
+
"Swarm complete. Should I create a PR?"
|
|
579
|
+
Options:
|
|
580
|
+
- "Yes, create PR" (Recommended)
|
|
581
|
+
- "No, I'll create it manually"
|
|
582
|
+
- "No, commit to main directly"
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
If user approves PR:
|
|
466
586
|
```bash
|
|
467
587
|
gh pr create --title "feat: <epic title>" --body "## Summary\n<bullets>\n\n## Subtasks\n<list>"
|
|
468
588
|
```
|
|
469
589
|
|
|
590
|
+
**Return the PR URL when done.**
|
|
591
|
+
|
|
470
592
|
## Swarm Mail Quick Reference
|
|
471
593
|
|
|
472
594
|
| Tool | Purpose |
|
|
@@ -531,6 +653,7 @@ Not: Do Everything Inline → Run Out of Context → Fail
|
|
|
531
653
|
- [ ] CellTree validated (no file conflicts)
|
|
532
654
|
- [ ] Epic + subtasks created
|
|
533
655
|
- [ ] **Coordinator did NOT reserve files** (workers do this)
|
|
656
|
+
- [ ] **Custom prompts include hivemind steps** (see 6.5)
|
|
534
657
|
- [ ] **Workers spawned in parallel** (single message, multiple Task calls)
|
|
535
658
|
- [ ] **Inbox monitored every 5-10 min**
|
|
536
659
|
- [ ] **All workers reviewed** with swarm_review
|