opencode-swarm-plugin 0.56.1 → 0.57.1
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/README.md +21 -0
- package/claude-plugin/agents/background-worker.md +1 -0
- package/claude-plugin/agents/coordinator.md +2 -0
- package/claude-plugin/agents/worker.md +1 -0
- package/claude-plugin/bin/swarm-mcp-server.ts +53 -8
- package/claude-plugin/dist/agent-mail.d.ts +480 -0
- package/claude-plugin/dist/agent-mail.d.ts.map +1 -0
- package/claude-plugin/dist/anti-patterns.d.ts +257 -0
- package/claude-plugin/dist/anti-patterns.d.ts.map +1 -0
- package/claude-plugin/dist/bin/swarm.js +373132 -0
- package/claude-plugin/dist/build/mcp-bundle.d.ts +16 -0
- package/claude-plugin/dist/build/mcp-bundle.d.ts.map +1 -0
- package/claude-plugin/dist/cache/claude-plugin-cache.d.ts +41 -0
- package/claude-plugin/dist/cache/claude-plugin-cache.d.ts.map +1 -0
- package/claude-plugin/dist/cass-tools.d.ts +74 -0
- package/claude-plugin/dist/cass-tools.d.ts.map +1 -0
- package/claude-plugin/dist/claude-plugin/claude-plugin-assets.d.ts +10 -0
- package/claude-plugin/dist/claude-plugin/claude-plugin-assets.d.ts.map +1 -0
- package/claude-plugin/dist/compaction-hook.d.ts +178 -0
- package/claude-plugin/dist/compaction-hook.d.ts.map +1 -0
- package/claude-plugin/dist/compaction-observability.d.ts +173 -0
- package/claude-plugin/dist/compaction-observability.d.ts.map +1 -0
- package/claude-plugin/dist/compaction-prompt-scoring.d.ts +125 -0
- package/claude-plugin/dist/compaction-prompt-scoring.d.ts.map +1 -0
- package/claude-plugin/dist/compaction-prompt-scoring.js +139 -0
- package/claude-plugin/dist/contributor-tools.d.ts +42 -0
- package/claude-plugin/dist/contributor-tools.d.ts.map +1 -0
- package/claude-plugin/dist/coordinator-guard.d.ts +79 -0
- package/claude-plugin/dist/coordinator-guard.d.ts.map +1 -0
- package/claude-plugin/dist/dashboard.d.ts +82 -0
- package/claude-plugin/dist/dashboard.d.ts.map +1 -0
- package/claude-plugin/dist/decision-trace-integration.d.ts +204 -0
- package/claude-plugin/dist/decision-trace-integration.d.ts.map +1 -0
- package/claude-plugin/dist/error-enrichment.d.ts +49 -0
- package/claude-plugin/dist/error-enrichment.d.ts.map +1 -0
- package/claude-plugin/dist/eval-capture.d.ts +494 -0
- package/claude-plugin/dist/eval-capture.d.ts.map +1 -0
- package/claude-plugin/dist/eval-capture.js +12844 -0
- package/claude-plugin/dist/eval-gates.d.ts +84 -0
- package/claude-plugin/dist/eval-gates.d.ts.map +1 -0
- package/claude-plugin/dist/eval-history.d.ts +117 -0
- package/claude-plugin/dist/eval-history.d.ts.map +1 -0
- package/claude-plugin/dist/eval-learning.d.ts +216 -0
- package/claude-plugin/dist/eval-learning.d.ts.map +1 -0
- package/claude-plugin/dist/eval-runner.d.ts +134 -0
- package/claude-plugin/dist/eval-runner.d.ts.map +1 -0
- package/claude-plugin/dist/examples/plugin-wrapper-template.ts +3341 -0
- package/claude-plugin/dist/export-tools.d.ts +76 -0
- package/claude-plugin/dist/export-tools.d.ts.map +1 -0
- package/claude-plugin/dist/hive.d.ts +949 -0
- package/claude-plugin/dist/hive.d.ts.map +1 -0
- package/claude-plugin/dist/hive.js +15009 -0
- package/claude-plugin/dist/hivemind-tools.d.ts +479 -0
- package/claude-plugin/dist/hivemind-tools.d.ts.map +1 -0
- package/claude-plugin/dist/hooks/atomic-write.d.ts +21 -0
- package/claude-plugin/dist/hooks/atomic-write.d.ts.map +1 -0
- package/claude-plugin/dist/hooks/constants.d.ts +28 -0
- package/claude-plugin/dist/hooks/constants.d.ts.map +1 -0
- package/claude-plugin/dist/hooks/index.d.ts +16 -0
- package/claude-plugin/dist/hooks/index.d.ts.map +1 -0
- package/claude-plugin/dist/hooks/session-start.d.ts +30 -0
- package/claude-plugin/dist/hooks/session-start.d.ts.map +1 -0
- package/claude-plugin/dist/hooks/tool-complete.d.ts +54 -0
- package/claude-plugin/dist/hooks/tool-complete.d.ts.map +1 -0
- package/claude-plugin/dist/index.d.ts +2017 -0
- package/claude-plugin/dist/index.d.ts.map +1 -0
- package/claude-plugin/dist/index.js +73454 -0
- package/claude-plugin/dist/learning.d.ts +700 -0
- package/claude-plugin/dist/learning.d.ts.map +1 -0
- package/claude-plugin/dist/logger.d.ts +38 -0
- package/claude-plugin/dist/logger.d.ts.map +1 -0
- package/claude-plugin/dist/mandate-promotion.d.ts +93 -0
- package/claude-plugin/dist/mandate-promotion.d.ts.map +1 -0
- package/claude-plugin/dist/mandate-storage.d.ts +209 -0
- package/claude-plugin/dist/mandate-storage.d.ts.map +1 -0
- package/claude-plugin/dist/mandates.d.ts +230 -0
- package/claude-plugin/dist/mandates.d.ts.map +1 -0
- package/claude-plugin/dist/mcp/swarm-mcp-server.js +19675 -0
- package/claude-plugin/dist/memory-tools.d.ts +281 -0
- package/claude-plugin/dist/memory-tools.d.ts.map +1 -0
- package/claude-plugin/dist/memory.d.ts +164 -0
- package/claude-plugin/dist/memory.d.ts.map +1 -0
- package/claude-plugin/dist/model-selection.d.ts +37 -0
- package/claude-plugin/dist/model-selection.d.ts.map +1 -0
- package/claude-plugin/dist/observability-health.d.ts +87 -0
- package/claude-plugin/dist/observability-health.d.ts.map +1 -0
- package/claude-plugin/dist/observability-tools.d.ts +184 -0
- package/claude-plugin/dist/observability-tools.d.ts.map +1 -0
- package/claude-plugin/dist/output-guardrails.d.ts +125 -0
- package/claude-plugin/dist/output-guardrails.d.ts.map +1 -0
- package/claude-plugin/dist/pattern-maturity.d.ts +246 -0
- package/claude-plugin/dist/pattern-maturity.d.ts.map +1 -0
- package/claude-plugin/dist/planning-guardrails.d.ts +183 -0
- package/claude-plugin/dist/planning-guardrails.d.ts.map +1 -0
- package/claude-plugin/dist/plugin.d.ts +22 -0
- package/claude-plugin/dist/plugin.d.ts.map +1 -0
- package/claude-plugin/dist/plugin.js +72296 -0
- package/claude-plugin/dist/post-compaction-tracker.d.ts +133 -0
- package/claude-plugin/dist/post-compaction-tracker.d.ts.map +1 -0
- package/claude-plugin/dist/query-tools.d.ts +90 -0
- package/claude-plugin/dist/query-tools.d.ts.map +1 -0
- package/claude-plugin/dist/rate-limiter.d.ts +218 -0
- package/claude-plugin/dist/rate-limiter.d.ts.map +1 -0
- package/claude-plugin/dist/regression-detection.d.ts +58 -0
- package/claude-plugin/dist/regression-detection.d.ts.map +1 -0
- package/claude-plugin/dist/replay-tools.d.ts +28 -0
- package/claude-plugin/dist/replay-tools.d.ts.map +1 -0
- package/claude-plugin/dist/repo-crawl.d.ts +146 -0
- package/claude-plugin/dist/repo-crawl.d.ts.map +1 -0
- package/claude-plugin/dist/schemas/cell-events.d.ts +1352 -0
- package/claude-plugin/dist/schemas/cell-events.d.ts.map +1 -0
- package/claude-plugin/dist/schemas/cell.d.ts +413 -0
- package/claude-plugin/dist/schemas/cell.d.ts.map +1 -0
- package/claude-plugin/dist/schemas/evaluation.d.ts +161 -0
- package/claude-plugin/dist/schemas/evaluation.d.ts.map +1 -0
- package/claude-plugin/dist/schemas/index.d.ts +46 -0
- package/claude-plugin/dist/schemas/index.d.ts.map +1 -0
- package/claude-plugin/dist/schemas/mandate.d.ts +336 -0
- package/claude-plugin/dist/schemas/mandate.d.ts.map +1 -0
- package/claude-plugin/dist/schemas/swarm-context.d.ts +131 -0
- package/claude-plugin/dist/schemas/swarm-context.d.ts.map +1 -0
- package/claude-plugin/dist/schemas/task.d.ts +189 -0
- package/claude-plugin/dist/schemas/task.d.ts.map +1 -0
- package/claude-plugin/dist/schemas/worker-handoff.d.ts +78 -0
- package/claude-plugin/dist/schemas/worker-handoff.d.ts.map +1 -0
- package/claude-plugin/dist/sessions/agent-discovery.d.ts +59 -0
- package/claude-plugin/dist/sessions/agent-discovery.d.ts.map +1 -0
- package/claude-plugin/dist/sessions/index.d.ts +10 -0
- package/claude-plugin/dist/sessions/index.d.ts.map +1 -0
- package/claude-plugin/dist/skills.d.ts +490 -0
- package/claude-plugin/dist/skills.d.ts.map +1 -0
- package/claude-plugin/dist/storage.d.ts +260 -0
- package/claude-plugin/dist/storage.d.ts.map +1 -0
- package/claude-plugin/dist/structured.d.ts +206 -0
- package/claude-plugin/dist/structured.d.ts.map +1 -0
- package/claude-plugin/dist/swarm-adversarial-review.d.ts +104 -0
- package/claude-plugin/dist/swarm-adversarial-review.d.ts.map +1 -0
- package/claude-plugin/dist/swarm-decompose.d.ts +297 -0
- package/claude-plugin/dist/swarm-decompose.d.ts.map +1 -0
- package/claude-plugin/dist/swarm-insights.d.ts +390 -0
- package/claude-plugin/dist/swarm-insights.d.ts.map +1 -0
- package/claude-plugin/dist/swarm-mail.d.ts +274 -0
- package/claude-plugin/dist/swarm-mail.d.ts.map +1 -0
- package/claude-plugin/dist/swarm-orchestrate.d.ts +924 -0
- package/claude-plugin/dist/swarm-orchestrate.d.ts.map +1 -0
- package/claude-plugin/dist/swarm-prompts.d.ts +467 -0
- package/claude-plugin/dist/swarm-prompts.d.ts.map +1 -0
- package/claude-plugin/dist/swarm-prompts.js +45286 -0
- package/claude-plugin/dist/swarm-research.d.ts +125 -0
- package/claude-plugin/dist/swarm-research.d.ts.map +1 -0
- package/claude-plugin/dist/swarm-review.d.ts +214 -0
- package/claude-plugin/dist/swarm-review.d.ts.map +1 -0
- package/claude-plugin/dist/swarm-signature.d.ts +106 -0
- package/claude-plugin/dist/swarm-signature.d.ts.map +1 -0
- package/claude-plugin/dist/swarm-strategies.d.ts +113 -0
- package/claude-plugin/dist/swarm-strategies.d.ts.map +1 -0
- package/claude-plugin/dist/swarm-validation.d.ts +127 -0
- package/claude-plugin/dist/swarm-validation.d.ts.map +1 -0
- package/claude-plugin/dist/swarm-worktree.d.ts +185 -0
- package/claude-plugin/dist/swarm-worktree.d.ts.map +1 -0
- package/claude-plugin/dist/swarm.d.ts +590 -0
- package/claude-plugin/dist/swarm.d.ts.map +1 -0
- package/claude-plugin/dist/tool-availability.d.ts +91 -0
- package/claude-plugin/dist/tool-availability.d.ts.map +1 -0
- package/claude-plugin/dist/utils/tree-renderer.d.ts +61 -0
- package/claude-plugin/dist/utils/tree-renderer.d.ts.map +1 -0
- package/claude-plugin/dist/validators/index.d.ts +7 -0
- package/claude-plugin/dist/validators/index.d.ts.map +1 -0
- package/claude-plugin/dist/validators/schema-validator.d.ts +58 -0
- package/claude-plugin/dist/validators/schema-validator.d.ts.map +1 -0
- package/claude-plugin/scripts/copyClaudePluginRuntimeAssets.ts +84 -0
- package/claude-plugin/skills/always-on-guidance/SKILL.md +45 -0
- package/claude-plugin/tests/mcp-runtime.test.ts +187 -0
- package/dist/agent-mail.d.ts +4 -4
- package/dist/agent-mail.d.ts.map +1 -1
- package/dist/bin/swarm.js +479 -20
- package/dist/build/mcp-bundle.d.ts +16 -0
- package/dist/build/mcp-bundle.d.ts.map +1 -0
- package/dist/cache/claude-plugin-cache.d.ts +41 -0
- package/dist/cache/claude-plugin-cache.d.ts.map +1 -0
- package/dist/claude-plugin/claude-plugin-assets.d.ts +10 -0
- package/dist/claude-plugin/claude-plugin-assets.d.ts.map +1 -0
- package/dist/compaction-hook.d.ts +1 -1
- package/dist/compaction-hook.d.ts.map +1 -1
- package/dist/index.js +371 -260
- package/dist/mcp/swarm-mcp-server.js +19675 -0
- package/dist/plugin.js +370 -259
- package/dist/skills.d.ts +15 -0
- package/dist/skills.d.ts.map +1 -1
- package/dist/swarm-mail.d.ts.map +1 -1
- package/dist/swarm-prompts.d.ts +3 -1
- package/dist/swarm-prompts.d.ts.map +1 -1
- package/dist/swarm-prompts.js +88 -8
- package/package.json +4 -1
package/dist/skills.d.ts
CHANGED
|
@@ -62,6 +62,21 @@ export interface SkillRef {
|
|
|
62
62
|
path: string;
|
|
63
63
|
hasScripts: boolean;
|
|
64
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Role types for always-on guidance injection.
|
|
67
|
+
*/
|
|
68
|
+
export type AlwaysOnGuidanceRole = "coordinator" | "worker";
|
|
69
|
+
/**
|
|
70
|
+
* Options for always-on guidance skill rendering.
|
|
71
|
+
*/
|
|
72
|
+
export interface AlwaysOnGuidanceOptions {
|
|
73
|
+
role: AlwaysOnGuidanceRole;
|
|
74
|
+
model?: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Get the always-on guidance skill content for a role and model.
|
|
78
|
+
*/
|
|
79
|
+
export declare function getAlwaysOnGuidanceSkill(options: AlwaysOnGuidanceOptions): string;
|
|
65
80
|
/**
|
|
66
81
|
* Set the project directory for skill discovery
|
|
67
82
|
*/
|
package/dist/skills.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../src/skills.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAqBH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,4DAA4D;IAC5D,WAAW,EAAE,MAAM,CAAC;IACpB,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,kCAAkC;IAClC,QAAQ,EAAE,aAAa,CAAC;IACxB,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,UAAU,EAAE,OAAO,CAAC;IACpB,kDAAkD;IAClD,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,OAAO,CAAC;CACrB;AAgED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,GA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.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swarm-mail.d.ts","sourceRoot":"","sources":["../src/swarm-mail.ts"],"names":[],"mappings":"AAmBA,OAAO,EAYL,KAAK,gBAAgB,EACtB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"swarm-mail.d.ts","sourceRoot":"","sources":["../src/swarm-mail.ts"],"names":[],"mappings":"AAmBA,OAAO,EAYL,KAAK,gBAAgB,EACtB,MAAM,YAAY,CAAC;AAqBpB;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,gBAAgB,CAAC;AAoE9C;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAEpE;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,IAAI,MAAM,GAAG,SAAS,CAEjE;AAyCD,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CASzD;AAiCD;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;CAyEzB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;CAiEzB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;CA6D1B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;CAyDjC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;CA8E5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;CA6E5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;CAmDhC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;CAwDlC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;CA2CxB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;CA0C3B,CAAC;AAMH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAW1B,CAAC"}
|
package/dist/swarm-prompts.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ export declare const SUBTASK_PROMPT_V2 = "You are a swarm agent working on: **{s
|
|
|
54
54
|
* - {task} - The task description from user
|
|
55
55
|
* - {project_path} - Absolute path to project root
|
|
56
56
|
*/
|
|
57
|
-
export declare const COORDINATOR_PROMPT = "You are a swarm coordinator. Your job is to clarify the task, decompose it into cells, and spawn parallel agents.\n\n## Task\n\n{task}\n\n## CRITICAL: Coordinator Role Boundaries\n\n**\u26A0\uFE0F COORDINATORS NEVER EXECUTE WORK DIRECTLY**\n\nYour role is **ONLY** to:\n1. **Clarify** - Ask questions to understand scope\n2. **Decompose** - Break into subtasks with clear boundaries \n3. **Spawn** - Create worker agents for ALL subtasks\n4. **Monitor** - Check progress, unblock, mediate conflicts\n5. **Verify** - Confirm completion, run final checks\n\n**YOU DO NOT:**\n- Read implementation files (only metadata/structure for planning)\n- Edit code directly\n- Run tests yourself (workers run tests)\n- Implement features\n- Fix bugs inline\n- Make \"quick fixes\" yourself\n\n**ALWAYS spawn workers, even for sequential tasks.** Sequential just means spawn them in order and wait for each to complete before spawning the next.\n\n### Explicit NEVER Rules (With Examples)\n\n```\n\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557\n\u2551 \u2551\n\u2551 \u274C COORDINATORS NEVER DO THIS: \u2551\n\u2551 \u2551\n\u2551 - Read implementation files (read(), glob src/**, grep for patterns) \u2551\n\u2551 - Edit code (edit(), write() any .ts/.js/.tsx files) \u2551\n\u2551 - Run tests (bash \"bun test\", \"npm test\", pytest) \u2551\n\u2551 - Implement features (adding functions, components, logic) \u2551\n\u2551 - Fix bugs (changing code to fix errors) \u2551\n\u2551 - Install packages (bash \"bun add\", \"npm install\") \u2551\n\u2551 - Commit changes (bash \"git add\", \"git commit\") \u2551\n\u2551 - Reserve files (swarmmail_reserve - workers do this) \u2551\n\u2551 \u2551\n\u2551 \u2705 COORDINATORS ONLY DO THIS: \u2551\n\u2551 \u2551\n\u2551 - Clarify task scope (ask questions, understand requirements) \u2551\n\u2551 - Read package.json/tsconfig.json for structure (metadata only) \u2551\n\u2551 - Decompose into subtasks (swarm_plan_prompt, validate_decomposition) \u2551\n\u2551 - Spawn workers (swarm_spawn_subtask, Task(subagent_type=\"worker\")) \u2551\n\u2551 - Monitor progress (swarmmail_inbox, swarm_status) \u2551\n\u2551 - Review completed work (swarm_review, swarm_review_feedback) \u2551\n\u2551 - Verify final state (check all workers completed, hive_sync) \u2551\n\u2551 \u2551\n\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D\n```\n\n**Examples of Violations:**\n\n\u274C **WRONG** - Coordinator reading implementation:\n```\nread(\"src/auth/login.ts\") // NO - spawn worker to analyze\nglob(\"src/components/**/*.tsx\") // NO - spawn worker to inventory\ngrep(pattern=\"export\", include=\"*.ts\") // NO - spawn worker to search\n```\n\n\u274C **WRONG** - Coordinator editing code:\n```\nedit(\"src/types.ts\", ...) // NO - spawn worker to fix\nwrite(\"src/new.ts\", ...) // NO - spawn worker to create\n```\n\n\u274C **WRONG** - Coordinator running tests:\n```\nbash(\"bun test src/auth.test.ts\") // NO - worker runs tests\n```\n\n\u274C **WRONG** - Coordinator reserving files:\n```\nswarmmail_reserve(paths=[\"src/auth.ts\"]) // NO - worker reserves their own files\nswarm_spawn_subtask(bead_id=\"...\", files=[\"src/auth.ts\"])\n```\n\n\u2705 **CORRECT** - Coordinator spawning worker:\n```\n// Coordinator delegates ALL work\nswarm_spawn_subtask(\n bead_id=\"fix-auth-bug\",\n epic_id=\"epic-123\",\n subtask_title=\"Fix null check in login handler\",\n files=[\"src/auth/login.ts\", \"src/auth/login.test.ts\"],\n shared_context=\"Bug: login fails when username is null\"\n)\nTask(subagent_type=\"swarm-worker\", prompt=\"<from above>\")\n```\n\n### Why This Matters\n\n| Coordinator Work | Worker Work | Consequence of Mixing |\n|-----------------|-------------|----------------------|\n| Sonnet context ($$$) | Disposable context | Expensive context waste |\n| Long-lived state | Task-scoped state | Context exhaustion |\n| Orchestration concerns | Implementation concerns | Mixed concerns |\n| No checkpoints | Checkpoints enabled | No recovery |\n| No learning signals | Outcomes tracked | No improvement |\n\n## CRITICAL: NEVER Fetch Documentation Directly\n\n**\u26A0\uFE0F COORDINATORS DO NOT CALL RESEARCH TOOLS DIRECTLY**\n\nThe following tools are **FORBIDDEN** for coordinators to call:\n\n- `repo-crawl_file`, `repo-crawl_readme`, `repo-crawl_search`, `repo-crawl_structure`, `repo-crawl_tree`\n- `repo-autopsy_*` (all variants)\n- `webfetch`, `fetch_fetch`\n- `context7_resolve-library-id`, `context7_get-library-docs`\n- `pdf-brain_search`, `pdf-brain_read`\n\n**WHY?** These tools dump massive context that exhausts your expensive Sonnet context. Your job is orchestration, not research.\n\n**INSTEAD:** Use `swarm_spawn_researcher` (see Phase 1.5 below) to spawn a researcher worker who:\n- Fetches documentation in disposable context\n- Stores full details in hivemind\n- Returns a condensed summary for shared_context\n\n## Workflow\n\n### Phase 0: Socratic Planning (INTERACTIVE - unless --fast)\n\n**Before decomposing, clarify the task with the user.**\n\nCheck for flags in the task:\n- `--fast` \u2192 Skip questions, use reasonable defaults\n- `--auto` \u2192 Zero interaction, heuristic decisions\n- `--confirm-only` \u2192 Show plan, get yes/no only\n\n**Default (no flags): Full Socratic Mode**\n\n1. **Analyze task for ambiguity:**\n - Scope unclear? (what's included/excluded)\n - Strategy unclear? (file-based vs feature-based)\n - Dependencies unclear? (what needs to exist first)\n - Success criteria unclear? (how do we know it's done)\n\n2. **If clarification needed, ask ONE question at a time:**\n ```\n The task \"<task>\" needs clarification before I can decompose it.\n\n **Question:** <specific question>\n\n Options:\n a) <option 1> - <tradeoff>\n b) <option 2> - <tradeoff>\n c) <option 3> - <tradeoff>\n\n I'd recommend (b) because <reason>. Which approach?\n ```\n\n3. **Wait for user response before proceeding**\n\n4. **Iterate if needed** (max 2-3 questions)\n\n**Rules:**\n- ONE question at a time - don't overwhelm\n- Offer concrete options - not open-ended\n- Lead with recommendation - save cognitive load\n- Wait for answer - don't assume\n\n### Phase 1: Initialize\n`swarmmail_init(project_path=\"{project_path}\", task_description=\"Swarm: {task}\")`\n\n### Phase 1.5: Research Phase (FOR COMPLEX TASKS)\n\n**\u26A0\uFE0F If the task requires understanding unfamiliar technologies, APIs, or libraries, spawn a researcher FIRST.**\n\n**DO NOT call documentation tools directly.** Instead:\n\n```\n// 1. Spawn researcher with explicit tech stack\nswarm_spawn_researcher(\n research_id=\"research-nextjs-cache-components\",\n epic_id=\"<epic-id>\",\n tech_stack=[\"Next.js 16 Cache Components\", \"React Server Components\"],\n project_path=\"{project_path}\"\n)\n\n// 2. Spawn researcher as Task subagent\nconst researchFindings = await Task(subagent_type=\"swarm-researcher\", prompt=\"<from above>\")\n\n// 3. Researcher returns condensed summary\n// Use this summary in shared_context for workers\n```\n\n**When to spawn a researcher:**\n- Task involves unfamiliar framework versions (e.g., Next.js 16 vs 14)\n- Need to compare installed vs latest library APIs\n- Working with experimental/preview features\n- Need architectural guidance from documentation\n\n**When NOT to spawn a researcher:**\n- Using well-known stable APIs (React hooks, Express middleware)\n- Task is purely refactoring existing code\n- You already have relevant findings from hivemind\n\n**Researcher output:**\n- Full findings stored in hivemind (searchable by future agents)\n- Condensed 3-5 bullet summary returned for shared_context\n\n### Phase 2: Knowledge Gathering (MANDATORY)\n\n**Before decomposing, query ALL knowledge sources:**\n\n```\nhivemind_find(query=\"<task keywords>\", limit=5) # Past learnings\nhivemind_find(query=\"<task description>\", limit=5, collection=\"sessions\") # Similar past tasks \nskills_list() # Available skills\n```\n\nSynthesize findings into shared_context for workers.\n\n### Phase 3: Decompose\n```\nswarm_select_strategy(task=\"<task>\")\nswarm_plan_prompt(task=\"<task>\", context=\"<synthesized knowledge>\")\nswarm_validate_decomposition(response=\"<CellTree JSON>\")\n```\n\n### Phase 4: Create Cells\n`hive_create_epic(epic_title=\"<task>\", subtasks=[...])`\n\n### Phase 5: DO NOT Reserve Files\n\n> **\u26A0\uFE0F Coordinator NEVER reserves files.** Workers reserve their own files.\n> If coordinator reserves, workers get blocked and swarm stalls.\n\n### Phase 6: Spawn Workers for ALL Subtasks (MANDATORY)\n\n> **\u26A0\uFE0F ALWAYS spawn workers, even for sequential tasks.**\n> - Parallel tasks: Spawn ALL in a single message\n> - Sequential tasks: Spawn one, wait for completion, spawn next\n\n**For parallel work:**\n```\n// Single message with multiple Task calls\nswarm_spawn_subtask(bead_id_1, epic_id, title_1, files_1, shared_context, project_path=\"{project_path}\")\nTask(subagent_type=\"swarm-worker\", prompt=\"<from above>\")\nswarm_spawn_subtask(bead_id_2, epic_id, title_2, files_2, shared_context, project_path=\"{project_path}\")\nTask(subagent_type=\"swarm-worker\", prompt=\"<from above>\")\n```\n\n**For sequential work:**\n```\n// Spawn worker 1, wait for completion\nswarm_spawn_subtask(bead_id_1, ...)\nconst result1 = await Task(subagent_type=\"swarm-worker\", prompt=\"<from above>\")\n\n// THEN spawn worker 2 with context from worker 1\nswarm_spawn_subtask(bead_id_2, ..., shared_context=\"Worker 1 completed: \" + result1)\nconst result2 = await Task(subagent_type=\"swarm-worker\", prompt=\"<from above>\")\n```\n\n**NEVER do the work yourself.** Even if it seems faster, spawn a worker.\n\n**IMPORTANT:** Pass `project_path` to `swarm_spawn_subtask` so workers can call `swarmmail_init`.\n\n### Phase 7: MANDATORY Review Loop (NON-NEGOTIABLE)\n\n**\u26A0\uFE0F AFTER EVERY Task() RETURNS, YOU MUST:**\n\n1. **CHECK INBOX** - Worker may have sent messages\n `swarmmail_inbox()`\n `swarmmail_read_message(message_id=N)`\n\n2. **REVIEW WORK** - Generate review with diff\n `swarm_review(project_key, epic_id, task_id, files_touched)`\n\n3. **EVALUATE** - Does it meet epic goals?\n - Fulfills subtask requirements?\n - Serves overall epic goal?\n - Enables downstream tasks?\n - Type safety, no obvious bugs?\n\n4. **SEND FEEDBACK** - Approve or request changes\n `swarm_review_feedback(project_key, task_id, worker_id, status, issues)`\n \n **If approved:**\n - Close cell, spawn next worker\n \n **If needs_changes:**\n - `swarm_review_feedback` returns `retry_context` (NOT sends message - worker is dead)\n - Generate retry prompt: `swarm_spawn_retry(retry_context)`\n - Spawn NEW worker with Task() using retry prompt\n - Max 3 attempts before marking task blocked\n \n **If 3 failures:**\n - Mark task blocked, escalate to human\n\n5. **ONLY THEN** - Spawn next worker or complete\n\n**DO NOT skip this. DO NOT batch reviews. Review EACH worker IMMEDIATELY after return.**\n\n**Intervene if:**\n- Worker blocked >5min \u2192 unblock or reassign\n- File conflicts \u2192 mediate between workers\n- Scope creep \u2192 approve or reject expansion\n- Review fails 3x \u2192 mark task blocked, escalate to human\n\n### Phase 8: Complete\n```\n# After all workers complete and reviews pass:\nhive_sync() # Sync all cells to git\n# Coordinator does NOT call swarm_complete - workers do that\n```\n\n## Strategy Reference\n\n| Strategy | Best For | Keywords |\n| -------------- | ------------------------ | -------------------------------------- |\n| file-based | Refactoring, migrations | refactor, migrate, rename, update all |\n| feature-based | New features | add, implement, build, create, feature |\n| risk-based | Bug fixes, security | fix, bug, security, critical, urgent |\n| research-based | Investigation, discovery | research, investigate, explore, learn |\n\n## Flag Reference\n\n| Flag | Effect |\n|------|--------|\n| `--fast` | Skip Socratic questions, use defaults |\n| `--auto` | Zero interaction, heuristic decisions |\n| `--confirm-only` | Show plan, get yes/no only |\n\nBegin with Phase 0 (Socratic Planning) unless `--fast` or `--auto` flag is present.\n";
|
|
57
|
+
export declare const COORDINATOR_PROMPT = "You are a swarm coordinator. Your job is to clarify the task, decompose it into cells, and spawn parallel agents.\n\n## Task\n\n{task}\n\n## CRITICAL: Coordinator Role Boundaries\n\n**\u26A0\uFE0F COORDINATORS NEVER EXECUTE WORK DIRECTLY**\n\nYour role is **ONLY** to:\n1. **Clarify** - Ask questions to understand scope\n2. **Decompose** - Break into subtasks with clear boundaries \n3. **Spawn** - Create worker agents for ALL subtasks\n4. **Monitor** - Check progress, unblock, mediate conflicts\n5. **Verify** - Confirm completion, run final checks\n\n**YOU DO NOT:**\n- Read implementation files (only metadata/structure for planning)\n- Edit code directly\n- Run tests yourself (workers run tests)\n- Implement features\n- Fix bugs inline\n- Make \"quick fixes\" yourself\n\n**ALWAYS spawn workers, even for sequential tasks.** Sequential just means spawn them in order and wait for each to complete before spawning the next.\n\n### Explicit NEVER Rules (With Examples)\n\n```\n\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557\n\u2551 \u2551\n\u2551 \u274C COORDINATORS NEVER DO THIS: \u2551\n\u2551 \u2551\n\u2551 - Read implementation files (read(), glob src/**, grep for patterns) \u2551\n\u2551 - Edit code (edit(), write() any .ts/.js/.tsx files) \u2551\n\u2551 - Run tests (bash \"bun test\", \"npm test\", pytest) \u2551\n\u2551 - Implement features (adding functions, components, logic) \u2551\n\u2551 - Fix bugs (changing code to fix errors) \u2551\n\u2551 - Install packages (bash \"bun add\", \"npm install\") \u2551\n\u2551 - Commit changes (bash \"git add\", \"git commit\") \u2551\n\u2551 - Reserve files (swarmmail_reserve - workers do this) \u2551\n\u2551 \u2551\n\u2551 \u2705 COORDINATORS ONLY DO THIS: \u2551\n\u2551 \u2551\n\u2551 - Clarify task scope (ask questions, understand requirements) \u2551\n\u2551 - Read package.json/tsconfig.json for structure (metadata only) \u2551\n\u2551 - Decompose into subtasks (swarm_plan_prompt, validate_decomposition) \u2551\n\u2551 - Spawn workers (swarm_spawn_subtask \u2192 Task(subagent_type=\"swarm-worker\", prompt=<from swarm_spawn_subtask>)) \u2551\n\u2551 - Monitor progress (swarmmail_inbox, swarm_status) \u2551\n\u2551 - Review completed work (swarm_review, swarm_review_feedback) \u2551\n\u2551 - Verify final state (check all workers completed, hive_sync) \u2551\n\u2551 \u2551\n\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D\n```\n\n**Examples of Violations:**\n\n\u274C **WRONG** - Coordinator reading implementation:\n```\nread(\"src/auth/login.ts\") // NO - spawn worker to analyze\nglob(\"src/components/**/*.tsx\") // NO - spawn worker to inventory\ngrep(pattern=\"export\", include=\"*.ts\") // NO - spawn worker to search\n```\n\n\u274C **WRONG** - Coordinator editing code:\n```\nedit(\"src/types.ts\", ...) // NO - spawn worker to fix\nwrite(\"src/new.ts\", ...) // NO - spawn worker to create\n```\n\n\u274C **WRONG** - Coordinator running tests:\n```\nbash(\"bun test src/auth.test.ts\") // NO - worker runs tests\n```\n\n\u274C **WRONG** - Coordinator reserving files:\n```\nswarmmail_reserve(paths=[\"src/auth.ts\"]) // NO - worker reserves their own files\nswarm_spawn_subtask(bead_id=\"...\", files=[\"src/auth.ts\"])\n```\n\n\u2705 **CORRECT** - Coordinator spawning worker:\n```\n// Coordinator delegates ALL work\nswarm_spawn_subtask(\n bead_id=\"fix-auth-bug\",\n epic_id=\"epic-123\",\n subtask_title=\"Fix null check in login handler\",\n files=[\"src/auth/login.ts\", \"src/auth/login.test.ts\"],\n shared_context=\"Bug: login fails when username is null\"\n)\nTask(subagent_type=\"swarm-worker\", prompt=\"<prompt returned by swarm_spawn_subtask>\")\n```\n\n### Coordinator Override: Release Stale Reservations\n\nYou may call `swarmmail_release_all` ONLY to clear **stale or orphaned reservations** when workers are gone or unresponsive.\n\n**Rules:**\n- Confirm workers are offline or blocked before releasing\n- Announce the release in Swarm Mail\n- Use it **only** as a coordinator override for stale locks\n\n### Why This Matters\n\n| Coordinator Work | Worker Work | Consequence of Mixing |\n|-----------------|-------------|----------------------|\n| Sonnet context ($$$) | Disposable context | Expensive context waste |\n| Long-lived state | Task-scoped state | Context exhaustion |\n| Orchestration concerns | Implementation concerns | Mixed concerns |\n| No checkpoints | Checkpoints enabled | No recovery |\n| No learning signals | Outcomes tracked | No improvement |\n\n## CRITICAL: NEVER Fetch Documentation Directly\n\n**\u26A0\uFE0F COORDINATORS DO NOT CALL RESEARCH TOOLS DIRECTLY**\n\nThe following tools are **FORBIDDEN** for coordinators to call:\n\n- `repo-crawl_file`, `repo-crawl_readme`, `repo-crawl_search`, `repo-crawl_structure`, `repo-crawl_tree`\n- `repo-autopsy_*` (all variants)\n- `webfetch`, `fetch_fetch`\n- `context7_resolve-library-id`, `context7_get-library-docs`\n- `pdf-brain_search`, `pdf-brain_read`\n\n**WHY?** These tools dump massive context that exhausts your expensive Sonnet context. Your job is orchestration, not research.\n\n**INSTEAD:** Use `swarm_spawn_researcher` (see Phase 1.5 below) to spawn a researcher worker who:\n- Fetches documentation in disposable context\n- Stores full details in hivemind\n- Returns a condensed summary for shared_context\n\n## Workflow\n\n### Phase 0: Socratic Planning (INTERACTIVE - unless --fast)\n\n**Before decomposing, clarify the task with the user.**\n\nCheck for flags in the task:\n- `--fast` \u2192 Skip questions, use reasonable defaults\n- `--auto` \u2192 Zero interaction, heuristic decisions\n- `--confirm-only` \u2192 Show plan, get yes/no only\n\n**Default (no flags): Full Socratic Mode**\n\n1. **Analyze task for ambiguity:**\n - Scope unclear? (what's included/excluded)\n - Strategy unclear? (file-based vs feature-based)\n - Dependencies unclear? (what needs to exist first)\n - Success criteria unclear? (how do we know it's done)\n\n2. **If clarification needed, ask ONE question at a time:**\n ```\n The task \"<task>\" needs clarification before I can decompose it.\n\n **Question:** <specific question>\n\n Options:\n a) <option 1> - <tradeoff>\n b) <option 2> - <tradeoff>\n c) <option 3> - <tradeoff>\n\n I'd recommend (b) because <reason>. Which approach?\n ```\n\n3. **Wait for user response before proceeding**\n\n4. **Iterate if needed** (max 2-3 questions)\n\n**Rules:**\n- ONE question at a time - don't overwhelm\n- Offer concrete options - not open-ended\n- Lead with recommendation - save cognitive load\n- Wait for answer - don't assume\n\n### Phase 1: Initialize\n`swarmmail_init(project_path=\"{project_path}\", task_description=\"Swarm: {task}\")`\n\n### Phase 1.5: Research Phase (FOR COMPLEX TASKS)\n\n**\u26A0\uFE0F If the task requires understanding unfamiliar technologies, APIs, or libraries, spawn a researcher FIRST.**\n\n**DO NOT call documentation tools directly.** Instead:\n\n```\n// 1. Spawn researcher with explicit tech stack\nswarm_spawn_researcher(\n research_id=\"research-nextjs-cache-components\",\n epic_id=\"<epic-id>\",\n tech_stack=[\"Next.js 16 Cache Components\", \"React Server Components\"],\n project_path=\"{project_path}\"\n)\n\n// 2. Spawn researcher as Task subagent\nconst researchFindings = await Task(subagent_type=\"swarm-researcher\", prompt=\"<from above>\")\n\n// 3. Researcher returns condensed summary\n// Use this summary in shared_context for workers\n```\n\n**When to spawn a researcher:**\n- Task involves unfamiliar framework versions (e.g., Next.js 16 vs 14)\n- Need to compare installed vs latest library APIs\n- Working with experimental/preview features\n- Need architectural guidance from documentation\n\n**When NOT to spawn a researcher:**\n- Using well-known stable APIs (React hooks, Express middleware)\n- Task is purely refactoring existing code\n- You already have relevant findings from hivemind\n\n**Researcher output:**\n- Full findings stored in hivemind (searchable by future agents)\n- Condensed 3-5 bullet summary returned for shared_context\n\n### Phase 2: Knowledge Gathering (MANDATORY)\n\n**Before decomposing, query ALL knowledge sources:**\n\n```\nhivemind_find(query=\"<task keywords>\", limit=5) # Past learnings\nhivemind_find(query=\"<task description>\", limit=5, collection=\"sessions\") # Similar past tasks \nskills_list() # Available skills\n```\n\nSynthesize findings into shared_context for workers.\n\n### Phase 3: Decompose\n```\nswarm_select_strategy(task=\"<task>\")\nswarm_plan_prompt(task=\"<task>\", context=\"<synthesized knowledge>\")\nswarm_validate_decomposition(response=\"<CellTree JSON>\")\n```\n\n### Phase 4: Create Cells\n`hive_create_epic(epic_title=\"<task>\", subtasks=[...])`\n\n### Phase 5: DO NOT Reserve Files\n\n> **\u26A0\uFE0F Coordinator NEVER reserves files.** Workers reserve their own files.\n> If coordinator reserves, workers get blocked and swarm stalls.\n\n### Phase 6: Spawn Workers for ALL Subtasks (MANDATORY)\n\n> **\u26A0\uFE0F ALWAYS spawn workers, even for sequential tasks.**\n> - Parallel tasks: Spawn ALL in a single message\n> - Sequential tasks: Spawn one, wait for completion, spawn next\n\n**After every swarm_spawn_subtask, immediately call Task(subagent_type=\"swarm-worker\", prompt=\"<prompt returned by swarm_spawn_subtask>\")**\n\n**For parallel work:**\n```\n// Single message with multiple Task calls\nswarm_spawn_subtask(bead_id_1, epic_id, title_1, files_1, shared_context, project_path=\"{project_path}\")\nTask(subagent_type=\"swarm-worker\", prompt=\"<prompt returned by swarm_spawn_subtask>\")\nswarm_spawn_subtask(bead_id_2, epic_id, title_2, files_2, shared_context, project_path=\"{project_path}\")\nTask(subagent_type=\"swarm-worker\", prompt=\"<prompt returned by swarm_spawn_subtask>\")\n```\n\n**For sequential work:**\n```\n// Spawn worker 1, wait for completion\nswarm_spawn_subtask(bead_id_1, ...)\nconst result1 = await Task(subagent_type=\"swarm-worker\", prompt=\"<prompt returned by swarm_spawn_subtask>\")\n\n// THEN spawn worker 2 with context from worker 1\nswarm_spawn_subtask(bead_id_2, ..., shared_context=\"Worker 1 completed: \" + result1)\nconst result2 = await Task(subagent_type=\"swarm-worker\", prompt=\"<prompt returned by swarm_spawn_subtask>\")\n```\n\n**NEVER do the work yourself.** Even if it seems faster, spawn a worker.\n\n**IMPORTANT:** Pass `project_path` to `swarm_spawn_subtask` so workers can call `swarmmail_init`.\n\n### Phase 7: MANDATORY Review Loop (NON-NEGOTIABLE)\n\n**\u26A0\uFE0F AFTER EVERY Task() RETURNS, YOU MUST:**\n\n1. **CHECK INBOX** - Worker may have sent messages\n `swarmmail_inbox()`\n `swarmmail_read_message(message_id=N)`\n\n2. **REVIEW WORK** - Generate review with diff\n `swarm_review(project_key, epic_id, task_id, files_touched)`\n\n3. **EVALUATE** - Does it meet epic goals?\n - Fulfills subtask requirements?\n - Serves overall epic goal?\n - Enables downstream tasks?\n - Type safety, no obvious bugs?\n\n4. **SEND FEEDBACK** - Approve or request changes\n `swarm_review_feedback(project_key, task_id, worker_id, status, issues)`\n \n **If approved:**\n - Close cell, spawn next worker\n \n **If needs_changes:**\n - `swarm_review_feedback` returns `retry_context` (NOT sends message - worker is dead)\n - Generate retry prompt: `swarm_spawn_retry(retry_context)`\n - Spawn NEW worker with Task() using retry prompt\n - Max 3 attempts before marking task blocked\n \n **If 3 failures:**\n - Mark task blocked, escalate to human\n\n5. **ONLY THEN** - Spawn next worker or complete\n\n**DO NOT skip this. DO NOT batch reviews. Review EACH worker IMMEDIATELY after return.**\n\n**Intervene if:**\n- Worker blocked >5min \u2192 unblock or reassign\n- File conflicts \u2192 mediate between workers\n- Scope creep \u2192 approve or reject expansion\n- Review fails 3x \u2192 mark task blocked, escalate to human\n\n### Phase 8: Complete\n```\n# After all workers complete and reviews pass:\nhive_sync() # Sync all cells to git\n# Coordinator does NOT call swarm_complete - workers do that\n```\n\n## Strategy Reference\n\n| Strategy | Best For | Keywords |\n| -------------- | ------------------------ | -------------------------------------- |\n| file-based | Refactoring, migrations | refactor, migrate, rename, update all |\n| feature-based | New features | add, implement, build, create, feature |\n| risk-based | Bug fixes, security | fix, bug, security, critical, urgent |\n| research-based | Investigation, discovery | research, investigate, explore, learn |\n\n## Flag Reference\n\n| Flag | Effect |\n|------|--------|\n| `--fast` | Skip Socratic questions, use defaults |\n| `--auto` | Zero interaction, heuristic decisions |\n| `--confirm-only` | Show plan, get yes/no only |\n\nBegin with Phase 0 (Socratic Planning) unless `--fast` or `--auto` flag is present.\n";
|
|
58
58
|
/**
|
|
59
59
|
* Researcher Agent Prompt Template
|
|
60
60
|
*
|
|
@@ -123,6 +123,7 @@ export declare function formatResearcherPrompt(params: {
|
|
|
123
123
|
export declare function formatCoordinatorPrompt(params: {
|
|
124
124
|
task: string;
|
|
125
125
|
projectPath: string;
|
|
126
|
+
model?: string;
|
|
126
127
|
}): string;
|
|
127
128
|
/**
|
|
128
129
|
* Format the V2 subtask prompt for a specific agent
|
|
@@ -137,6 +138,7 @@ export declare function formatSubtaskPromptV2(params: {
|
|
|
137
138
|
compressed_context?: string;
|
|
138
139
|
error_context?: string;
|
|
139
140
|
project_path?: string;
|
|
141
|
+
model?: string;
|
|
140
142
|
recovery_context?: {
|
|
141
143
|
shared_context?: string;
|
|
142
144
|
skills_to_load?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swarm-prompts.d.ts","sourceRoot":"","sources":["../src/swarm-prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAYH;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,s6EAkET,CAAC;AAEzB;;GAEG;AACH,eAAO,MAAM,6BAA6B,uxDAyDlB,CAAC;AAEzB;;;;;GAKG;AACH,eAAO,MAAM,cAAc,mkFAgFK,CAAC;AAEjC;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,8iUAgUnB,CAAC;AAEZ;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"swarm-prompts.d.ts","sourceRoot":"","sources":["../src/swarm-prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAYH;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,s6EAkET,CAAC;AAEzB;;GAEG;AACH,eAAO,MAAM,6BAA6B,uxDAyDlB,CAAC;AAEzB;;;;;GAKG;AACH,eAAO,MAAM,cAAc,mkFAgFK,CAAC;AAEjC;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,8iUAgUnB,CAAC;AAEZ;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,kBAAkB,uzcAsV9B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,knHA4GV,CAAC;AAErB;;;;;GAKG;AACH,eAAO,MAAM,iCAAiC,u+DAyE7C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,8jCAmCU,CAAC;AAMzC;;;;;;;GAOG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,MAAM,C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"}
|
package/dist/swarm-prompts.js
CHANGED
|
@@ -17270,6 +17270,7 @@ __export(exports_skills, {
|
|
|
17270
17270
|
invalidateSkillsCache: () => invalidateSkillsCache,
|
|
17271
17271
|
getSkillsContextForSwarm: () => getSkillsContextForSwarm,
|
|
17272
17272
|
getSkill: () => getSkill,
|
|
17273
|
+
getAlwaysOnGuidanceSkill: () => getAlwaysOnGuidanceSkill,
|
|
17273
17274
|
findRelevantSkills: () => findRelevantSkills,
|
|
17274
17275
|
discoverSkills: () => discoverSkills
|
|
17275
17276
|
});
|
|
@@ -17285,6 +17286,44 @@ import {
|
|
|
17285
17286
|
} from "path";
|
|
17286
17287
|
import { fileURLToPath } from "url";
|
|
17287
17288
|
import { getSwarmMailLibSQL as getSwarmMailLibSQL3, createEvent as createEvent2 } from "swarm-mail";
|
|
17289
|
+
function resolveGuidanceModel(model) {
|
|
17290
|
+
if (!model)
|
|
17291
|
+
return "unknown";
|
|
17292
|
+
const normalized = model.toLowerCase();
|
|
17293
|
+
if (normalized.includes("gpt-5.2")) {
|
|
17294
|
+
return "gpt-5.2-code";
|
|
17295
|
+
}
|
|
17296
|
+
if (normalized.includes("opus-4-5") || normalized.includes("opus 4.5")) {
|
|
17297
|
+
return "opus-4.5";
|
|
17298
|
+
}
|
|
17299
|
+
return "unknown";
|
|
17300
|
+
}
|
|
17301
|
+
function getAlwaysOnGuidanceSkill(options2) {
|
|
17302
|
+
const roleGuidance = ALWAYS_ON_ROLE_GUIDANCE[options2.role];
|
|
17303
|
+
const modelBucket = resolveGuidanceModel(options2.model);
|
|
17304
|
+
let modelGuidance = "";
|
|
17305
|
+
if (modelBucket === "gpt-5.2-code") {
|
|
17306
|
+
modelGuidance = `### Model-Specific Guidance
|
|
17307
|
+
${GPT_5_2_GUIDANCE}`;
|
|
17308
|
+
} else if (modelBucket === "opus-4.5") {
|
|
17309
|
+
modelGuidance = `### Model-Specific Guidance
|
|
17310
|
+
${OPUS_4_5_GUIDANCE}`;
|
|
17311
|
+
} else {
|
|
17312
|
+
modelGuidance = `### Model-Specific Guidance
|
|
17313
|
+
${GPT_5_2_GUIDANCE}
|
|
17314
|
+
|
|
17315
|
+
${OPUS_4_5_GUIDANCE}`;
|
|
17316
|
+
}
|
|
17317
|
+
return [
|
|
17318
|
+
ALWAYS_ON_GUIDANCE_HEADER,
|
|
17319
|
+
ALWAYS_ON_TOOL_PRIORITY,
|
|
17320
|
+
ALWAYS_ON_RULE_FOLLOWING,
|
|
17321
|
+
roleGuidance,
|
|
17322
|
+
modelGuidance
|
|
17323
|
+
].join(`
|
|
17324
|
+
|
|
17325
|
+
`);
|
|
17326
|
+
}
|
|
17288
17327
|
async function emitSkillLoadedEvent(data) {
|
|
17289
17328
|
try {
|
|
17290
17329
|
const projectPath = skillsProjectDirectory;
|
|
@@ -17684,10 +17723,39 @@ async function findRelevantSkills(taskDescription) {
|
|
|
17684
17723
|
}
|
|
17685
17724
|
return relevant;
|
|
17686
17725
|
}
|
|
17687
|
-
var import_gray_matter,
|
|
17726
|
+
var import_gray_matter, ALWAYS_ON_GUIDANCE_HEADER = "## Always-On Guidance Skill", ALWAYS_ON_TOOL_PRIORITY = `### Tool Priority Order
|
|
17727
|
+
1. Swarm plugin tools (\`hive_*\`, \`swarm_*\`, \`swarmmail_*\`, \`structured_*\`)
|
|
17728
|
+
2. \`Read\`/\`Edit\` for file operations
|
|
17729
|
+
3. \`ast-grep\` for structural search
|
|
17730
|
+
4. \`Glob\`/\`Grep\` for discovery
|
|
17731
|
+
5. \`Task\` subagents for exploration
|
|
17732
|
+
6. \`Bash\` only for system commands
|
|
17733
|
+
|
|
17734
|
+
**Never use Bash for file read/write/edit/search.**`, ALWAYS_ON_RULE_FOLLOWING = `### Rule-Following Guardrails
|
|
17735
|
+
- Follow explicit tool constraints and approval modes
|
|
17736
|
+
- Do not invent tool output or files; ask when unsure
|
|
17737
|
+
- Keep changes scoped to assigned files and requirements`, ALWAYS_ON_ROLE_GUIDANCE, GPT_5_2_GUIDANCE = `#### GPT-5.2-code (Strict)
|
|
17738
|
+
- Follow instructions literally and exactly
|
|
17739
|
+
- Enforce tool priority order; fail closed if a tool is missing
|
|
17740
|
+
- Read before Edit; no speculative changes or output`, OPUS_4_5_GUIDANCE = `#### Opus 4.5 (Concise)
|
|
17741
|
+
- Be concise and deliberate while obeying mandates
|
|
17742
|
+
- Follow tool priorities without shortcuts
|
|
17743
|
+
- Prefer direct answers over speculation`, skillsProjectDirectory, skillsCache = null, PROJECT_SKILL_DIRECTORIES, skills_list, skills_use, skills_execute, skills_read, DEFAULT_SKILLS_DIR = ".opencode/skill", skills_create, skills_update, skills_delete, skills_add_script, skills_init, skillsTools;
|
|
17688
17744
|
var init_skills = __esm(() => {
|
|
17689
17745
|
init_dist();
|
|
17690
17746
|
import_gray_matter = __toESM(require_gray_matter(), 1);
|
|
17747
|
+
ALWAYS_ON_ROLE_GUIDANCE = {
|
|
17748
|
+
coordinator: `### Coordinator Enforcement
|
|
17749
|
+
- Coordinator role: orchestrate, decompose, spawn workers
|
|
17750
|
+
- **Never** edit files or reserve locks directly
|
|
17751
|
+
- **After every \`swarm_spawn_subtask\`, immediately call \`Task(subagent_type="swarm-worker", prompt="<prompt returned by swarm_spawn_subtask>")\`**
|
|
17752
|
+
- Coordinator override: use \`swarmmail_release_all\` only for stale/orphaned reservations (announce in Swarm Mail)
|
|
17753
|
+
- Review work with \`swarm_review\` before accepting`,
|
|
17754
|
+
worker: `### Worker Enforcement
|
|
17755
|
+
- Worker role: implement changes within reserved files
|
|
17756
|
+
- Reserve files before edits and follow TDD (RED → GREEN → REFACTOR)
|
|
17757
|
+
- Complete with \`swarm_complete\`, not \`hive_close\``
|
|
17758
|
+
};
|
|
17691
17759
|
skillsProjectDirectory = process.cwd();
|
|
17692
17760
|
PROJECT_SKILL_DIRECTORIES = [
|
|
17693
17761
|
".opencode/skill",
|
|
@@ -44045,7 +44113,7 @@ Your role is **ONLY** to:
|
|
|
44045
44113
|
║ - Clarify task scope (ask questions, understand requirements) ║
|
|
44046
44114
|
║ - Read package.json/tsconfig.json for structure (metadata only) ║
|
|
44047
44115
|
║ - Decompose into subtasks (swarm_plan_prompt, validate_decomposition) ║
|
|
44048
|
-
║ - Spawn workers (swarm_spawn_subtask
|
|
44116
|
+
║ - Spawn workers (swarm_spawn_subtask → Task(subagent_type="swarm-worker", prompt=<from swarm_spawn_subtask>)) ║
|
|
44049
44117
|
║ - Monitor progress (swarmmail_inbox, swarm_status) ║
|
|
44050
44118
|
║ - Review completed work (swarm_review, swarm_review_feedback) ║
|
|
44051
44119
|
║ - Verify final state (check all workers completed, hive_sync) ║
|
|
@@ -44089,9 +44157,18 @@ swarm_spawn_subtask(
|
|
|
44089
44157
|
files=["src/auth/login.ts", "src/auth/login.test.ts"],
|
|
44090
44158
|
shared_context="Bug: login fails when username is null"
|
|
44091
44159
|
)
|
|
44092
|
-
Task(subagent_type="swarm-worker", prompt="<
|
|
44160
|
+
Task(subagent_type="swarm-worker", prompt="<prompt returned by swarm_spawn_subtask>")
|
|
44093
44161
|
\`\`\`
|
|
44094
44162
|
|
|
44163
|
+
### Coordinator Override: Release Stale Reservations
|
|
44164
|
+
|
|
44165
|
+
You may call \`swarmmail_release_all\` ONLY to clear **stale or orphaned reservations** when workers are gone or unresponsive.
|
|
44166
|
+
|
|
44167
|
+
**Rules:**
|
|
44168
|
+
- Confirm workers are offline or blocked before releasing
|
|
44169
|
+
- Announce the release in Swarm Mail
|
|
44170
|
+
- Use it **only** as a coordinator override for stale locks
|
|
44171
|
+
|
|
44095
44172
|
### Why This Matters
|
|
44096
44173
|
|
|
44097
44174
|
| Coordinator Work | Worker Work | Consequence of Mixing |
|
|
@@ -44237,24 +44314,26 @@ swarm_validate_decomposition(response="<CellTree JSON>")
|
|
|
44237
44314
|
> - Parallel tasks: Spawn ALL in a single message
|
|
44238
44315
|
> - Sequential tasks: Spawn one, wait for completion, spawn next
|
|
44239
44316
|
|
|
44317
|
+
**After every swarm_spawn_subtask, immediately call Task(subagent_type="swarm-worker", prompt="<prompt returned by swarm_spawn_subtask>")**
|
|
44318
|
+
|
|
44240
44319
|
**For parallel work:**
|
|
44241
44320
|
\`\`\`
|
|
44242
44321
|
// Single message with multiple Task calls
|
|
44243
44322
|
swarm_spawn_subtask(bead_id_1, epic_id, title_1, files_1, shared_context, project_path="{project_path}")
|
|
44244
|
-
Task(subagent_type="swarm-worker", prompt="<
|
|
44323
|
+
Task(subagent_type="swarm-worker", prompt="<prompt returned by swarm_spawn_subtask>")
|
|
44245
44324
|
swarm_spawn_subtask(bead_id_2, epic_id, title_2, files_2, shared_context, project_path="{project_path}")
|
|
44246
|
-
Task(subagent_type="swarm-worker", prompt="<
|
|
44325
|
+
Task(subagent_type="swarm-worker", prompt="<prompt returned by swarm_spawn_subtask>")
|
|
44247
44326
|
\`\`\`
|
|
44248
44327
|
|
|
44249
44328
|
**For sequential work:**
|
|
44250
44329
|
\`\`\`
|
|
44251
44330
|
// Spawn worker 1, wait for completion
|
|
44252
44331
|
swarm_spawn_subtask(bead_id_1, ...)
|
|
44253
|
-
const result1 = await Task(subagent_type="swarm-worker", prompt="<
|
|
44332
|
+
const result1 = await Task(subagent_type="swarm-worker", prompt="<prompt returned by swarm_spawn_subtask>")
|
|
44254
44333
|
|
|
44255
44334
|
// THEN spawn worker 2 with context from worker 1
|
|
44256
44335
|
swarm_spawn_subtask(bead_id_2, ..., shared_context="Worker 1 completed: " + result1)
|
|
44257
|
-
const result2 = await Task(subagent_type="swarm-worker", prompt="<
|
|
44336
|
+
const result2 = await Task(subagent_type="swarm-worker", prompt="<prompt returned by swarm_spawn_subtask>")
|
|
44258
44337
|
\`\`\`
|
|
44259
44338
|
|
|
44260
44339
|
**NEVER do the work yourself.** Even if it seems faster, spawn a worker.
|
|
@@ -44829,7 +44908,8 @@ var swarm_spawn_subtask = tool({
|
|
|
44829
44908
|
files: args2.files,
|
|
44830
44909
|
shared_context: args2.shared_context,
|
|
44831
44910
|
project_path: args2.project_path,
|
|
44832
|
-
recovery_context: args2.recovery_context
|
|
44911
|
+
recovery_context: args2.recovery_context,
|
|
44912
|
+
model: args2.model
|
|
44833
44913
|
});
|
|
44834
44914
|
const { selectWorkerModel: selectWorkerModel2 } = await Promise.resolve().then(() => exports_model_selection);
|
|
44835
44915
|
const subtask = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.57.1",
|
|
4
4
|
"description": "Multi-agent swarm coordination for OpenCode with learning capabilities, beads integration, and Agent Mail",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -28,8 +28,11 @@
|
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
30
|
"dist",
|
|
31
|
+
"dist/mcp",
|
|
31
32
|
"bin",
|
|
32
33
|
"claude-plugin",
|
|
34
|
+
"claude-plugin/dist",
|
|
35
|
+
"claude-plugin/dist/mcp",
|
|
33
36
|
"examples",
|
|
34
37
|
"global-skills",
|
|
35
38
|
"README.md"
|