Skip to content

Commit 7ed96c8

Browse files
committed
docs: complete documentation overhaul with auto-generated tool reference
- Add replicator docs command: generates MCP tool reference from live registry (always in sync, 53 tools grouped by category) - Rewrite README: accurate status, badges, all 9 CLI commands, environment variables, MCP client config examples, mermaid architecture diagram, full package layout - Create docs/tools.md: auto-generated schemas + hand-written examples for hive_create, swarmmail_send, swarm_decompose, hivemind_store - Create CONTRIBUTING.md: dev setup, testing conventions, PR workflow - Create CHANGELOG.md: retroactive v0.1.0 and v0.2.0 entries
1 parent b0145c0 commit 7ed96c8

13 files changed

Lines changed: 2037 additions & 34 deletions

File tree

‎AGENTS.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ make install # Install to GOPATH/bin
235235
| `replicator doctor` | Check environment health |
236236
| `replicator stats` | Display activity summary |
237237
| `replicator query` | Run preset SQL analytics queries |
238+
| `replicator docs` | Generate MCP tool reference (markdown) |
238239
| `replicator version` | Print version, commit, build date |
239240

240241
## Project Structure

‎CHANGELOG.md‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format follows [Keep a Changelog](https://keepachangelog.com/) and
6+
this project adheres to [Semantic Versioning](https://semver.org/).
7+
8+
## [0.2.0] - 2026-04-06
9+
10+
### Added
11+
- 53 MCP tools across 4 categories: Hive (11), Swarm Mail (10),
12+
Swarm (24), Memory (8)
13+
- Swarm orchestration with git worktree isolation
14+
- Agent messaging with file reservations
15+
- Dewey memory proxy with graceful degradation
16+
- CLI commands: init, doctor, stats, query, setup
17+
- Parity testing engine (100% shape match vs TypeScript)
18+
- macOS code signing and notarization
19+
- Homebrew distribution via `brew install unbound-force/tap/replicator`
20+
- GoReleaser v2 release pipeline (darwin-arm64, linux-amd64, linux-arm64)
21+
- Dewey MCP tool name update (dewey#28 prefix drop)
22+
- `replicator init` command for per-repo setup
23+
- Constitution and expanded AGENTS.md
24+
25+
### Changed
26+
- Version command now displays commit hash and build date
27+
- Makefile: added release, install targets
28+
29+
## [0.1.0] - 2026-04-04
30+
31+
### Added
32+
- Initial release: Phase 0 scaffold
33+
- MCP JSON-RPC server (stdio transport)
34+
- SQLite database via `modernc.org/sqlite` (pure Go, no CGo)
35+
- Tool registry framework
36+
- 4 hive tools: `hive_cells`, `hive_create`, `hive_close`, `hive_update`
37+
- CLI: `replicator serve`, `replicator cells`, `replicator version`
38+
- 16 tests across 3 packages
39+
- CI workflow (go vet + go test + go build)
40+
- MIT LICENSE with Joel Hooks attribution
41+
42+
[0.2.0]: https://github.com/unbound-force/replicator/releases/tag/v0.2.0
43+
[0.1.0]: https://github.com/unbound-force/replicator/releases/tag/v0.1.0

‎CONTRIBUTING.md‎

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Contributing to Replicator
2+
3+
## Prerequisites
4+
5+
- Go 1.25+
6+
- Git
7+
- Make
8+
9+
## Development Setup
10+
11+
```bash
12+
git clone git@github.com:unbound-force/replicator.git
13+
cd replicator
14+
make check # builds, vets, and runs all tests
15+
```
16+
17+
## Building and Testing
18+
19+
```bash
20+
make build # Build binary to bin/replicator
21+
make test # Run all tests
22+
make vet # Run go vet
23+
make check # Vet + test (use this before submitting PRs)
24+
```
25+
26+
## Testing Conventions
27+
28+
- **Standard library only**: Use `testing` package. No testify, gomega, or
29+
external assertion libraries.
30+
- **Assertions**: Use `t.Errorf` / `t.Fatalf` directly.
31+
- **Naming**: `TestXxx_Description` (e.g., `TestCreateCell_Defaults`).
32+
- **Database tests**: Use `db.OpenMemory()` for in-memory SQLite.
33+
- **Filesystem tests**: Use `t.TempDir()` for temporary directories.
34+
- **HTTP tests**: Use `httptest.NewServer` for mock servers.
35+
- **No shared state**: Each test creates its own fixtures.
36+
- **Git tests**: Guard with `if testing.Short() { t.Skip("requires git") }`.
37+
38+
Always run tests with `-count=1` to disable caching.
39+
40+
## Pull Request Workflow
41+
42+
1. **Create a branch**: Speckit features use `NNN-feature-name`, OpenSpec
43+
changes use `opsx/change-name`.
44+
2. **Spec first**: Non-trivial changes require a spec (either Speckit under
45+
`specs/` or OpenSpec under `openspec/changes/`). When in doubt, use a spec.
46+
3. **Conventional commits**: Use `type: description` format
47+
(feat, fix, docs, chore, refactor, test).
48+
4. **CI must pass**: Run `make check` locally before pushing.
49+
5. **One concern per PR**: Keep changes focused and minimal.
50+
51+
## Coding Conventions
52+
53+
- `gofmt` and `goimports` for formatting
54+
- GoDoc comments on all exported functions and types
55+
- Error wrapping: `fmt.Errorf("context: %w", err)`
56+
- Use `errors.Is` for sentinel errors (not string comparison)
57+
- Import grouping: stdlib, then third-party, then internal
58+
- JSON tags required on serialized struct fields
59+
- No global mutable state
60+
61+
## Project Structure
62+
63+
See [AGENTS.md](AGENTS.md) for the full project structure, constitution,
64+
behavioral constraints, and specification framework.
65+
66+
## License
67+
68+
By contributing, you agree that your contributions will be licensed under
69+
the [MIT License](LICENSE).

‎README.md‎

Lines changed: 145 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,185 @@
11
# Replicator
22

3+
[![CI](https://github.com/unbound-force/replicator/actions/workflows/ci.yml/badge.svg)](https://github.com/unbound-force/replicator/actions/workflows/ci.yml)
4+
![Go 1.25+](https://img.shields.io/badge/Go-1.25+-00ADD8?logo=go&logoColor=white)
5+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
6+
37
Multi-agent coordination for AI coding agents. Single Go binary, zero runtime dependencies.
48

59
> Go rewrite of [cyborg-swarm](https://github.com/unbound-force/cyborg-swarm) (TypeScript). Same tools, same protocol, faster startup, simpler distribution.
610
7-
## Status: Phase 0 (Scaffold)
11+
## Status
12+
13+
**53 MCP tools** | **190+ tests** | **15MB binary** | **<50ms startup**
814

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:
1416

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)
2123

2224
## Install
2325

26+
### Homebrew (macOS)
27+
2428
```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
2733

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
3036
```
3137

38+
### Binary Download
39+
40+
Download from [GitHub Releases](https://github.com/unbound-force/replicator/releases). Available for macOS (arm64), Linux (amd64, arm64).
41+
3242
## Usage
3343

3444
```bash
35-
# Initialize a project for swarm operations
45+
# Per-repo setup (creates .hive/ directory)
3646
replicator init
3747

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)
3952
replicator serve
4053

41-
# List hive cells
54+
# List work items
4255
replicator cells
4356

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
4570
replicator version
4671
```
4772

48-
## Development
73+
## MCP Tools (53)
4974

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+
}
56113
```
57114

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+
58123
## Architecture
59124

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+
60145
```
61-
cmd/replicator/ CLI entrypoint (cobra)
146+
cmd/replicator/ CLI entrypoint (cobra)
62147
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
67159
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
70167
```
71168

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+
72183
## Credits
73184

74185
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

Comments
 (0)