opencode-swarm-plugin 0.23.5 → 0.24.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.
@@ -273,13 +273,11 @@ Only modify these files. Need others? Message the coordinator.
273
273
 
274
274
  {error_context}
275
275
 
276
- ## [MANDATORY: SWARM MAIL INITIALIZATION]
276
+ ## [MANDATORY SURVIVAL CHECKLIST]
277
277
 
278
- **CRITICAL: YOU MUST INITIALIZE SWARM MAIL BEFORE DOING ANY WORK.**
278
+ **CRITICAL: Follow this checklist IN ORDER. Each step builds on the previous.**
279
279
 
280
- This is your FIRST step - before reading files, before planning, before ANY other action.
281
-
282
- ### Step 1: Initialize (REQUIRED - DO THIS FIRST)
280
+ ### Step 1: Initialize Coordination (REQUIRED - DO THIS FIRST)
283
281
  \`\`\`
284
282
  swarmmail_init(project_path="{project_path}", task_description="{bead_id}: {subtask_title}")
285
283
  \`\`\`
@@ -292,26 +290,124 @@ swarmmail_init(project_path="{project_path}", task_description="{bead_id}: {subt
292
290
 
293
291
  **If you skip this step, your work will not be tracked and swarm_complete will fail.**
294
292
 
295
- ## [SWARM MAIL USAGE]
293
+ ### Step 2: Query Past Learnings (BEFORE starting work)
294
+ \`\`\`
295
+ semantic-memory_find(query="<keywords from your task>", limit=5)
296
+ \`\`\`
296
297
 
297
- After initialization, use Swarm Mail for coordination:
298
+ **Check if past agents solved similar problems.** Search for:
299
+ - Error messages if debugging
300
+ - Domain concepts (e.g., "authentication", "caching")
301
+ - Technology stack (e.g., "Next.js", "React")
302
+ - Patterns (e.g., "event sourcing", "validation")
298
303
 
299
- ### Check Inbox Regularly
304
+ **Past learnings save time and prevent repeating mistakes.**
305
+
306
+ ### Step 3: Load Relevant Skills (if available)
300
307
  \`\`\`
301
- swarmmail_inbox() # Check for coordinator messages
302
- swarmmail_read_message(message_id=N) # Read specific message
308
+ skills_list() # See what skills exist
309
+ skills_use(name="<relevant-skill>", context="<your task>") # Load skill
303
310
  \`\`\`
304
311
 
305
- ### Report Progress (REQUIRED - don't work silently)
312
+ **Common skill triggers:**
313
+ - Writing tests? → \`skills_use(name="testing-patterns")\`
314
+ - Breaking dependencies? → \`skills_use(name="testing-patterns")\`
315
+ - Multi-agent coordination? → \`skills_use(name="swarm-coordination")\`
316
+ - Building a CLI? → \`skills_use(name="cli-builder")\`
317
+
318
+ ### Step 4: Reserve Your Files (YOU reserve, not coordinator)
306
319
  \`\`\`
307
- swarmmail_send(
308
- to=["coordinator"],
309
- subject="Progress: {bead_id}",
310
- body="<what you did, blockers, questions>",
311
- thread_id="{epic_id}"
320
+ swarmmail_reserve(
321
+ paths=[{file_list}],
322
+ reason="{bead_id}: {subtask_title}",
323
+ exclusive=true
324
+ )
325
+ \`\`\`
326
+
327
+ **Workers reserve their own files.** This prevents edit conflicts with other agents.
328
+
329
+ ### Step 5: Do the Work
330
+ - Read your assigned files
331
+ - Implement changes
332
+ - Verify (typecheck if applicable)
333
+
334
+ ### Step 6: Report Progress at Milestones
335
+ \`\`\`
336
+ swarm_progress(
337
+ project_key="{project_path}",
338
+ agent_name="<your-agent-name>",
339
+ bead_id="{bead_id}",
340
+ status="in_progress",
341
+ progress_percent=25, # or 50, 75
342
+ message="<what you just completed>"
312
343
  )
313
344
  \`\`\`
314
345
 
346
+ **Report at 25%, 50%, 75% completion.** This:
347
+ - Triggers auto-checkpoint (saves context)
348
+ - Keeps coordinator informed
349
+ - Prevents silent failures
350
+
351
+ ### Step 7: Manual Checkpoint BEFORE Risky Operations
352
+ \`\`\`
353
+ swarm_checkpoint(
354
+ project_key="{project_path}",
355
+ agent_name="<your-agent-name>",
356
+ bead_id="{bead_id}"
357
+ )
358
+ \`\`\`
359
+
360
+ **Call BEFORE:**
361
+ - Large refactors
362
+ - File deletions
363
+ - Breaking API changes
364
+ - Anything that might fail catastrophically
365
+
366
+ **Checkpoints preserve context so you can recover if things go wrong.**
367
+
368
+ ### Step 8: Store Learnings (if you discovered something)
369
+ \`\`\`
370
+ semantic-memory_store(
371
+ information="<what you learned, WHY it matters, how to apply it>",
372
+ metadata="<tags: domain, tech-stack, pattern-type>"
373
+ )
374
+ \`\`\`
375
+
376
+ **Store:**
377
+ - Tricky bugs you solved (root cause + solution)
378
+ - Project-specific patterns or domain rules
379
+ - Tool/library gotchas and workarounds
380
+ - Failed approaches (anti-patterns to avoid)
381
+
382
+ **Don't store generic knowledge.** Store the WHY, not just the WHAT.
383
+
384
+ ### Step 9: Complete (REQUIRED - releases reservations)
385
+ \`\`\`
386
+ swarm_complete(
387
+ project_key="{project_path}",
388
+ agent_name="<your-agent-name>",
389
+ bead_id="{bead_id}",
390
+ summary="<what you accomplished>",
391
+ files_touched=["list", "of", "files"]
392
+ )
393
+ \`\`\`
394
+
395
+ **This automatically:**
396
+ - Runs UBS bug scan
397
+ - Releases file reservations
398
+ - Records learning signals
399
+ - Notifies coordinator
400
+
401
+ **DO NOT manually close the bead with beads_close.** Use swarm_complete.
402
+
403
+ ## [SWARM MAIL COMMUNICATION]
404
+
405
+ ### Check Inbox Regularly
406
+ \`\`\`
407
+ swarmmail_inbox() # Check for coordinator messages
408
+ swarmmail_read_message(message_id=N) # Read specific message
409
+ \`\`\`
410
+
315
411
  ### When Blocked
316
412
  \`\`\`
317
413
  swarmmail_send(
@@ -324,42 +420,48 @@ swarmmail_send(
324
420
  beads_update(id="{bead_id}", status="blocked")
325
421
  \`\`\`
326
422
 
327
- ### Release Files When Done
423
+ ### Report Issues to Other Agents
424
+ \`\`\`
425
+ swarmmail_send(
426
+ to=["OtherAgent", "coordinator"],
427
+ subject="Issue in {bead_id}",
428
+ body="<describe problem, don't fix their code>",
429
+ thread_id="{epic_id}"
430
+ )
431
+ \`\`\`
432
+
433
+ ### Manual Release (if needed)
328
434
  \`\`\`
329
- swarmmail_release() # Or let swarm_complete handle it
435
+ swarmmail_release() # Manually release reservations
330
436
  \`\`\`
331
437
 
438
+ **Note:** \`swarm_complete\` automatically releases reservations. Only use manual release if aborting work.
439
+
332
440
  ## [OTHER TOOLS]
333
441
  ### Beads
334
442
  - beads_update(id, status) - Mark blocked if stuck
335
443
  - beads_create(title, type) - Log new bugs found
336
444
 
337
- ### Skills (if available)
445
+ ### Skills
338
446
  - skills_list() - Discover available skills
339
447
  - skills_use(name) - Activate skill for specialized guidance
340
-
341
- ### Completion (REQUIRED)
342
- - swarm_complete(project_key, agent_name, bead_id, summary, files_touched)
343
-
344
- ## [LEARNING]
345
- As you work, note reusable patterns, best practices, or domain insights:
346
- - If you discover something that would help future agents, consider creating a skill
347
- - Use skills_create to codify patterns for the project
348
- - Good skills have clear "when to use" descriptions with actionable instructions
349
- - Skills make swarms smarter over time
350
-
351
- ## [WORKFLOW]
352
- 1. **swarmmail_init** - Initialize session (MANDATORY FIRST STEP)
353
- 2. Read assigned files
354
- 3. Implement changes
355
- 4. **swarmmail_send** - Report progress to coordinator
356
- 5. Verify (typecheck)
357
- 6. **swarm_complete** - Mark done, release reservations
358
-
359
- **CRITICAL REQUIREMENTS:**
360
- - Step 1 (swarmmail_init) is NON-NEGOTIABLE - do it before anything else
361
- - Never work silently - send progress updates via swarmmail_send every significant milestone
362
- - If you complete without initializing, swarm_complete will detect this and warn/fail
448
+ - skills_create(name) - Create new skill (if you found a reusable pattern)
449
+
450
+ ## [CRITICAL REQUIREMENTS]
451
+
452
+ **NON-NEGOTIABLE:**
453
+ 1. Step 1 (swarmmail_init) MUST be first - do it before anything else
454
+ 2. Step 2 (semantic-memory_find) MUST happen before starting work
455
+ 3. Step 4 (swarmmail_reserve) - YOU reserve files, not coordinator
456
+ 4. Step 6 (swarm_progress) - Report at milestones, don't work silently
457
+ 5. Step 9 (swarm_complete) - Use this to close, NOT beads_close
458
+
459
+ **If you skip these steps:**
460
+ - Your work won't be tracked (swarm_complete will fail)
461
+ - You'll waste time repeating solved problems (no semantic memory query)
462
+ - Edit conflicts with other agents (no file reservation)
463
+ - Lost work if you crash (no checkpoints)
464
+ - Future agents repeat your mistakes (no learnings stored)
363
465
 
364
466
  Begin now.`;
365
467