OpenCode swarm plugin for side-by-side multi-agent workflows.
swarm.create— create a swarm (child sessions)swarm.discover— recover a swarm from existing sessions and registry stateswarm.status— show members + session IDsswarm.parallel— run a prompt across members (parallel where possible)swarm.send— message another member (routes as a prompt)swarm.forget— forget local swarm mapping (sessions remain)swarm.max— MAX mode: parallel editor tries in isolated git worktrees + selector picks winner (optional apply)swarm.jam— collaborative run in the same worktree (no isolation)
Supported agent IDs:
planbuildexploregeneraloraclemetismomuslibrarian
Legacy aliases remain supported:
planner→planresearcher→explorecoder→buildreviewer→general
The plugin is verified against the local registry tests in plugins/registry.test.ts and plugins/registry-roundtrip.test.ts.
tmux,curl,jq,lsof, andopencodemust be onPATHbin/oc-swarmstarts one headless OpenCode server plus four side-by-side panes- the project must contain
.opencode/plugins/omoc-swarm.tsfor the launcher workflow opencodeshould supportserveandattachas used bybin/oc-swarm
The live E2E test suite (scripts/oc-swarm-e2e.test.sh) validates the actual OpenCode runtime:
- Tests real OpenCode server startup and API endpoints
- Validates session creation and management
- Verifies tmux integration
- Checks all required dependencies
Run with: bun run test:e2e
For CI: bun run ci:with-e2e (runs all CI checks + live E2E)
Note: The live E2E tests will skip gracefully if opencode is not available on PATH.
Copy the plugin into your project so plain opencode can auto-load it:
mkdir -p .opencode/plugins
cp /path/to/Plugin-SIN-Swarm/plugins/omoc-swarm.ts .opencode/plugins/omoc-swarm.tsFor the side-by-side wrapper:
mkdir -p bin
cp /path/to/Plugin-SIN-Swarm/bin/oc-swarm bin/oc-swarm
cp /path/to/Plugin-SIN-Swarm/templates/bin/opencode bin/opencode
cp /path/to/Plugin-SIN-Swarm/templates/.envrc .envrc
chmod +x bin/oc-swarm bin/opencode
direnv allow./bin/oc-swarm --dir /path/to/projectbun run plugins/registry.test.ts
bun run plugins/registry-roundtrip.test.ts
bash scripts/oc-swarm-smoke.test.shbun run observe stats
bun run observe history <swarmId>
bun run observe export <swarmId> json
bun run memory list
bun run eval- Queue runner support is not implemented.
- Title parsing is only a legacy discovery fallback; registry state is the source of truth for agent identity.
This repository follows the Global Dev Docs Standard.
For contribution guidelines, see CONTRIBUTING.md. For security policy, see SECURITY.md. For the complete OpenSIN ecosystem, see OpenSIN-AI Organization.