|
1 | 1 | # Replicator |
2 | 2 |
|
| 3 | +[](https://github.com/unbound-force/replicator/actions/workflows/ci.yml) |
| 4 | + |
| 5 | +[](LICENSE) |
| 6 | + |
3 | 7 | Multi-agent coordination for AI coding agents. Single Go binary, zero runtime dependencies. |
4 | 8 |
|
5 | 9 | > Go rewrite of [cyborg-swarm](https://github.com/unbound-force/cyborg-swarm) (TypeScript). Same tools, same protocol, faster startup, simpler distribution. |
6 | 10 |
|
7 | | -## Status: Phase 0 (Scaffold) |
| 11 | +## Status |
| 12 | + |
| 13 | +**53 MCP tools** | **190+ tests** | **15MB binary** | **<50ms startup** |
8 | 14 |
|
9 | | -Working: |
10 | | -- [x] SQLite database with hive schema (cells, events, agents) |
11 | | -- [x] MCP JSON-RPC server (stdio transport) |
12 | | -- [x] 4 tools: `hive_cells`, `hive_create`, `hive_close`, `hive_update` |
13 | | -- [x] CLI: `replicator serve`, `replicator cells`, `replicator version` |
| 15 | +All 5 implementation phases are complete: |
14 | 16 |
|
15 | | -Planned: |
16 | | -- [ ] Phase 1: Remaining hive tools + swarm mail messaging |
17 | | -- [ ] Phase 2: Swarm orchestration (decompose, spawn, worktrees) |
18 | | -- [ ] Phase 3: Memory (Dewey proxy, Zen LLM client) |
19 | | -- [ ] Phase 4: Full CLI (setup, doctor, stats, query, dashboard) |
20 | | -- [ ] Phase 5: Parity testing against cyborg-swarm |
| 17 | +- [x] Phase 0: MCP server, SQLite, tool registry |
| 18 | +- [x] Phase 1: Hive (11 tools) + Swarm Mail (10 tools) |
| 19 | +- [x] Phase 2: Swarm Orchestration (24 tools) |
| 20 | +- [x] Phase 3: Memory / Dewey proxy (8 tools) |
| 21 | +- [x] Phase 4: CLI (9 commands) |
| 22 | +- [x] Phase 5: Parity testing (100% shape match) |
21 | 23 |
|
22 | 24 | ## Install |
23 | 25 |
|
| 26 | +### Homebrew (macOS) |
| 27 | + |
24 | 28 | ```bash |
25 | | -# From source |
26 | | -go install github.com/unbound-force/replicator/cmd/replicator@latest |
| 29 | +brew install unbound-force/tap/replicator |
| 30 | +``` |
| 31 | + |
| 32 | +### Go Install |
27 | 33 |
|
28 | | -# Or download binary from releases |
29 | | -# https://github.com/unbound-force/replicator/releases |
| 34 | +```bash |
| 35 | +go install github.com/unbound-force/replicator/cmd/replicator@latest |
30 | 36 | ``` |
31 | 37 |
|
| 38 | +### Binary Download |
| 39 | + |
| 40 | +Download from [GitHub Releases](https://github.com/unbound-force/replicator/releases). Available for macOS (arm64), Linux (amd64, arm64). |
| 41 | + |
32 | 42 | ## Usage |
33 | 43 |
|
34 | 44 | ```bash |
35 | | -# Initialize a project for swarm operations |
| 45 | +# Per-repo setup (creates .hive/ directory) |
36 | 46 | replicator init |
37 | 47 |
|
38 | | -# Start MCP server (for AI agent connections) |
| 48 | +# Per-machine setup (creates ~/.config/swarm-tools/ + SQLite DB) |
| 49 | +replicator setup |
| 50 | + |
| 51 | +# Start MCP server (AI agents connect via stdio) |
39 | 52 | replicator serve |
40 | 53 |
|
41 | | -# List hive cells |
| 54 | +# List work items |
42 | 55 | replicator cells |
43 | 56 |
|
44 | | -# Version |
| 57 | +# Check environment health |
| 58 | +replicator doctor |
| 59 | + |
| 60 | +# Activity summary |
| 61 | +replicator stats |
| 62 | + |
| 63 | +# Run preset analytics queries |
| 64 | +replicator query cells_by_status |
| 65 | + |
| 66 | +# Generate tool reference docs |
| 67 | +replicator docs |
| 68 | + |
| 69 | +# Version info |
45 | 70 | replicator version |
46 | 71 | ``` |
47 | 72 |
|
48 | | -## Development |
| 73 | +## MCP Tools (53) |
49 | 74 |
|
50 | | -```bash |
51 | | -make build # Build binary to bin/replicator |
52 | | -make test # Run all tests |
53 | | -make vet # Go vet |
54 | | -make check # vet + test |
55 | | -make serve # Build and run MCP server |
| 75 | +Replicator exposes 53 tools via the [MCP protocol](https://modelcontextprotocol.io/) over stdio JSON-RPC: |
| 76 | + |
| 77 | +| Category | Tools | Purpose | |
| 78 | +|----------|-------|---------| |
| 79 | +| **Hive** | 11 | Work item tracking: create, query, update, close, epics, sessions, sync | |
| 80 | +| **Swarm Mail** | 10 | Agent messaging: send, inbox, ack, file reservations | |
| 81 | +| **Swarm** | 24 | Orchestration: decompose, spawn, worktrees, progress, review, insights | |
| 82 | +| **Memory** | 8 | Dewey proxy: store/find learnings, deprecated tool stubs | |
| 83 | + |
| 84 | +See the full [Tool Reference](docs/tools.md) for schemas and examples. |
| 85 | + |
| 86 | +## Connecting an AI Agent |
| 87 | + |
| 88 | +Add replicator to your `opencode.json`: |
| 89 | + |
| 90 | +```json |
| 91 | +{ |
| 92 | + "mcp": { |
| 93 | + "replicator": { |
| 94 | + "type": "stdio", |
| 95 | + "command": "replicator", |
| 96 | + "args": ["serve"] |
| 97 | + } |
| 98 | + } |
| 99 | +} |
| 100 | +``` |
| 101 | + |
| 102 | +For Claude Code, add to `mcp_servers` in your config: |
| 103 | + |
| 104 | +```json |
| 105 | +{ |
| 106 | + "mcp_servers": { |
| 107 | + "replicator": { |
| 108 | + "command": "replicator", |
| 109 | + "args": ["serve"] |
| 110 | + } |
| 111 | + } |
| 112 | +} |
56 | 113 | ``` |
57 | 114 |
|
| 115 | +## Environment Variables |
| 116 | + |
| 117 | +| Variable | Default | Purpose | |
| 118 | +|----------|---------|---------| |
| 119 | +| `REPLICATOR_DB` | `~/.config/swarm-tools/swarm.db` | SQLite database path | |
| 120 | +| `DEWEY_MCP_URL` | `http://localhost:3333/mcp/` | Dewey semantic memory endpoint | |
| 121 | +| `ZEN_API_KEY` | *(none)* | OpenCode Zen gateway for LLM calls | |
| 122 | + |
58 | 123 | ## Architecture |
59 | 124 |
|
| 125 | +```mermaid |
| 126 | +flowchart LR |
| 127 | + Agent["AI Agent\n(OpenCode, Claude)"] |
| 128 | + MCP["MCP Server\n(stdio JSON-RPC)"] |
| 129 | + Reg["Tool Registry\n(53 tools)"] |
| 130 | + Domain["Domain Logic\n(hive, swarm, mail)"] |
| 131 | + DB["SQLite\n(WAL mode)"] |
| 132 | + Dewey["Dewey\n(semantic memory)"] |
| 133 | + Git["Git\n(worktrees)"] |
| 134 | +
|
| 135 | + Agent -->|stdin/stdout| MCP |
| 136 | + MCP --> Reg |
| 137 | + Reg --> Domain |
| 138 | + Domain --> DB |
| 139 | + Domain -->|HTTP proxy| Dewey |
| 140 | + Domain -->|os/exec| Git |
| 141 | +``` |
| 142 | + |
| 143 | +### Package Layout |
| 144 | + |
60 | 145 | ``` |
61 | | -cmd/replicator/ CLI entrypoint (cobra) |
| 146 | +cmd/replicator/ CLI entrypoint (cobra) |
62 | 147 | internal/ |
63 | | - config/ Configuration (env vars, defaults) |
64 | | - db/ SQLite connection + migrations |
65 | | - hive/ Cell (work item) domain logic |
66 | | - mcp/ MCP JSON-RPC server |
| 148 | + config/ Configuration (env vars, defaults) |
| 149 | + db/ SQLite + migrations (7 tables) |
| 150 | + hive/ Cell CRUD, epics, sessions, sync |
| 151 | + swarmmail/ Agent messaging, file reservations |
| 152 | + swarm/ Decomposition, spawning, worktrees, review, insights |
| 153 | + memory/ Dewey proxy, deprecated tool stubs |
| 154 | + gitutil/ Git worktree operations (os/exec) |
| 155 | + doctor/ Health check engine |
| 156 | + stats/ Database activity summary |
| 157 | + query/ Preset SQL analytics |
| 158 | + mcp/ MCP JSON-RPC server |
67 | 159 | tools/ |
68 | | - registry/ Tool registration framework |
69 | | - hive/ Hive MCP tool handlers |
| 160 | + registry/ Tool registration framework |
| 161 | + hive/ Hive tool handlers (11) |
| 162 | + swarmmail/ Swarm mail tool handlers (10) |
| 163 | + swarm/ Swarm tool handlers (24) |
| 164 | + memory/ Memory tool handlers (8) |
| 165 | +test/parity/ Shape comparison engine + fixtures |
| 166 | +docs/ Generated tool reference |
70 | 167 | ``` |
71 | 168 |
|
| 169 | +## Development |
| 170 | + |
| 171 | +```bash |
| 172 | +make build # Build binary to bin/replicator |
| 173 | +make test # Run all tests |
| 174 | +make vet # Go vet |
| 175 | +make check # Vet + test |
| 176 | +make serve # Build and run MCP server |
| 177 | +make release # GoReleaser dry-run (local) |
| 178 | +make install # Install to GOPATH/bin |
| 179 | +``` |
| 180 | + |
| 181 | +See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and PR workflow. |
| 182 | + |
72 | 183 | ## Credits |
73 | 184 |
|
74 | 185 | Go rewrite of [cyborg-swarm](https://github.com/unbound-force/cyborg-swarm), originally forked from [swarm-tools](https://github.com/joelhooks/swarm-tools) by [Joel Hooks](https://github.com/joelhooks). See [LICENSE](LICENSE). |
0 commit comments