Skip to content

feat: replace Swarm plugin with Replicator #82

Closed

Description

@jflowers

Context

Replicator (github.com/unbound-force/replicator) is a Go rewrite of the Node.js Swarm plugin (opencode-swarm-plugin / cyborg-swarm). It exposes the same 52 MCP tool names, uses the same SQLite schema, but distributes as a single Go binary with zero runtime dependencies.

This issue replaces all Swarm plugin references with Replicator across uf init, uf doctor, and uf setup.

Depends on: unbound-force/replicator#2 (Homebrew distribution)
Supersedes: #5 (cyborg-swarm rename) and #81 (CLI update for renamed plugin) -- close both as superseded.

Key Architecture Change

Aspect Before (Swarm plugin) After (Replicator)
Distribution npm package Go binary via Homebrew
Integration opencode.json plugin array opencode.json mcp server entry
Runtime deps Node.js + bun None (single binary)
Install npm install -g ... brew install unbound-force/tap/replicator
Binary name swarm replicator
MCP tool names 52 tools Same 52 tools (no agent changes needed)

Changes Required

uf init (internal/scaffold/scaffold.go)

  • Remove opencode-swarm-plugin from plugin array logic (~lines 570-583)
  • Add replicator MCP server entry when replicator is in PATH: {"type": "local", "command": ["replicator", "serve"], "enabled": true}
  • Migration: if existing opencode.json has opencode-swarm-plugin in plugin array, remove it and add the MCP entry
  • Update scaffold tests in internal/scaffold/scaffold_test.go (~15 assertions)

uf doctor (internal/doctor/checks.go)

  • Replace checkSwarmPlugin() with checkReplicator() -- check replicator binary in PATH (same pattern as dewey/gaze checks)
  • Remove plugin array check for opencode-swarm-plugin in opencode.json
  • Add MCP server entry check for replicator in opencode.json (same pattern as dewey MCP check)
  • Replace swarm doctor delegation with replicator doctor delegation
  • Update doctor tests in internal/doctor/doctor_test.go

uf doctor hints (internal/doctor/environ.go)

  • Replace all swarm npm install hints with brew install unbound-force/tap/replicator
  • Remove bun add -g swarm hints entirely

uf setup (internal/setup/setup.go)

  • Remove installSwarmPlugin() function (npm/bun install)
  • Remove ensureBun() function (bun no longer needed)
  • Add installReplicator() -- Homebrew install following installGaze() pattern
  • Replace runSwarmSetup() with replicator setup delegation (or remove if uf setup handles init directly)
  • Update setup step count
  • Update setup tests in internal/setup/setup_test.go

opencode.json (repo root)

  • Remove "plugin": ["opencode-swarm-plugin"]
  • Add "replicator": {"type": "local", "command": ["replicator", "serve"], "enabled": true} in the mcp section

Scaffold assets

  • Update internal/scaffold/assets/ copies of any modified agent/command files (if any reference the plugin by name)
  • Verify drift detection tests pass

Documentation

  • AGENTS.md -- add Recent Changes entry, update Active Technologies
  • Update any references to Swarm plugin installation in agent/command files

What Does NOT Change

  • MCP tool names: All 52 tool names are identical between Swarm plugin and Replicator (hive_cells, swarm_worktree_create, swarmmail_send, etc.)
  • Agent files: No changes needed -- agents call tools by name, not by server identity
  • /unleash command: References swarm_worktree_create etc. by tool name -- still works
  • .hive/ directory: Same location, same schema, same git sync behavior
  • Dewey integration: Replicator already proxies hivemind_store/find to Dewey

Migration for Existing Users

  1. Run uf setup -- installs replicator via Homebrew, skips bun/npm
  2. Run uf init -- replaces opencode-swarm-plugin plugin entry with replicator MCP entry in opencode.json
  3. Optional: npm uninstall -g opencode-swarm-plugin to clean up the old Node.js package

Files Modified (Expected)

File Changes
internal/scaffold/scaffold.go Plugin array → MCP entry logic
internal/doctor/checks.go Swarm plugin check → replicator binary check
internal/doctor/environ.go npm install hints → brew install hints
internal/setup/setup.go Remove installSwarmPlugin/ensureBun, add installReplicator
opencode.json Plugin array → MCP entry
internal/scaffold/scaffold_test.go ~15 test updates
internal/doctor/doctor_test.go ~10 test updates
internal/setup/setup_test.go ~15 test updates
AGENTS.md Recent Changes entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions