@monoes/monomindcli 2.9.3 → 2.9.4
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/.claude/helpers/intelligence.cjs +27 -6
- package/.claude/skills/agentic-jujutsu/SKILL.md +17 -15
- package/.claude/skills/hive-mind-advanced/SKILL.md +212 -559
- package/.claude/skills/hooks-automation/SKILL.md +1 -1
- package/.claude/skills/mastermind-createorg/SKILL.md +2 -1
- package/.claude/skills/pair-programming/SKILL.md +1 -1
- package/.claude/skills/performance-analysis/SKILL.md +228 -484
- package/.claude/skills/swarm-advanced/SKILL.md +2 -2
- package/.claude/skills/swarm-orchestration/SKILL.md +220 -150
- package/.claude/skills/verification-quality/SKILL.md +247 -571
- package/README.md +6 -2
- package/dist/src/autopilot-state.d.ts +16 -4
- package/dist/src/autopilot-state.d.ts.map +1 -1
- package/dist/src/autopilot-state.js +42 -19
- package/dist/src/autopilot-state.js.map +1 -1
- package/dist/src/commands/agent-lifecycle.js +3 -3
- package/dist/src/commands/agent-lifecycle.js.map +1 -1
- package/dist/src/commands/autopilot.d.ts.map +1 -1
- package/dist/src/commands/autopilot.js +113 -26
- package/dist/src/commands/autopilot.js.map +1 -1
- package/dist/src/commands/doc.d.ts.map +1 -1
- package/dist/src/commands/doc.js +14 -3
- package/dist/src/commands/doc.js.map +1 -1
- package/dist/src/commands/doctor-env-checks.d.ts +1 -1
- package/dist/src/commands/doctor-env-checks.d.ts.map +1 -1
- package/dist/src/commands/doctor.d.ts.map +1 -1
- package/dist/src/commands/doctor.js +30 -1
- package/dist/src/commands/doctor.js.map +1 -1
- package/dist/src/commands/hooks-routing-commands.d.ts.map +1 -1
- package/dist/src/commands/hooks-routing-commands.js +12 -26
- package/dist/src/commands/hooks-routing-commands.js.map +1 -1
- package/dist/src/commands/hooks-workers.js +8 -8
- package/dist/src/commands/hooks-workers.js.map +1 -1
- package/dist/src/commands/hooks.d.ts.map +1 -1
- package/dist/src/commands/hooks.js +96 -54
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +80 -7
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/mcp.d.ts.map +1 -1
- package/dist/src/commands/mcp.js +78 -2
- package/dist/src/commands/mcp.js.map +1 -1
- package/dist/src/commands/memory-list.d.ts.map +1 -1
- package/dist/src/commands/memory-list.js +79 -36
- package/dist/src/commands/memory-list.js.map +1 -1
- package/dist/src/commands/org.d.ts.map +1 -1
- package/dist/src/commands/org.js +114 -1
- package/dist/src/commands/org.js.map +1 -1
- package/dist/src/commands/performance.js +1 -1
- package/dist/src/commands/performance.js.map +1 -1
- package/dist/src/commands/swarm.d.ts.map +1 -1
- package/dist/src/commands/swarm.js +144 -98
- package/dist/src/commands/swarm.js.map +1 -1
- package/dist/src/init/claudemd-generator.js +1 -1
- package/dist/src/init/executor.d.ts.map +1 -1
- package/dist/src/init/executor.js +13 -3
- package/dist/src/init/executor.js.map +1 -1
- package/dist/src/init/kimi-generator.d.ts +3 -2
- package/dist/src/init/kimi-generator.d.ts.map +1 -1
- package/dist/src/init/kimi-generator.js +45 -13
- package/dist/src/init/kimi-generator.js.map +1 -1
- package/dist/src/init/statusline-generator.d.ts +1 -1
- package/dist/src/init/statusline-generator.d.ts.map +1 -1
- package/dist/src/init/statusline-generator.js +48 -46
- package/dist/src/init/statusline-generator.js.map +1 -1
- package/dist/src/init/types.d.ts +1 -1
- package/dist/src/init/types.d.ts.map +1 -1
- package/dist/src/init/types.js +5 -1
- package/dist/src/init/types.js.map +1 -1
- package/dist/src/mcp-server.d.ts +6 -0
- package/dist/src/mcp-server.d.ts.map +1 -1
- package/dist/src/mcp-server.js +47 -22
- package/dist/src/mcp-server.js.map +1 -1
- package/dist/src/mcp-tools/hive-mind-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/hive-mind-tools.js +13 -11
- package/dist/src/mcp-tools/hive-mind-tools.js.map +1 -1
- package/dist/src/mcp-tools/hooks-intelligence.d.ts.map +1 -1
- package/dist/src/mcp-tools/hooks-intelligence.js +97 -40
- package/dist/src/mcp-tools/hooks-intelligence.js.map +1 -1
- package/dist/src/mcp-tools/hooks-routing.d.ts.map +1 -1
- package/dist/src/mcp-tools/hooks-routing.js +406 -205
- package/dist/src/mcp-tools/hooks-routing.js.map +1 -1
- package/dist/src/mcp-tools/monograph/impact-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/monograph/impact-tools.js +109 -44
- package/dist/src/mcp-tools/monograph/impact-tools.js.map +1 -1
- package/dist/src/mcp-tools/monograph/query-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/monograph/query-tools.js +48 -18
- package/dist/src/mcp-tools/monograph/query-tools.js.map +1 -1
- package/dist/src/mcp-tools/system-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/system-tools.js +100 -38
- package/dist/src/mcp-tools/system-tools.js.map +1 -1
- package/dist/src/memory/embedding-operations.d.ts +4 -0
- package/dist/src/memory/embedding-operations.d.ts.map +1 -1
- package/dist/src/memory/embedding-operations.js +125 -32
- package/dist/src/memory/embedding-operations.js.map +1 -1
- package/dist/src/memory/hnsw-operations.d.ts +1 -1
- package/dist/src/memory/hnsw-operations.js +1 -1
- package/dist/src/memory/memory-bridge.d.ts.map +1 -1
- package/dist/src/memory/memory-bridge.js +172 -69
- package/dist/src/memory/memory-bridge.js.map +1 -1
- package/dist/src/memory/memory-read.d.ts +1 -1
- package/dist/src/memory/memory-read.js +2 -2
- package/dist/src/memory/memory-read.js.map +1 -1
- package/dist/src/orgrt/checkpoint-ops.d.ts +11 -1
- package/dist/src/orgrt/checkpoint-ops.d.ts.map +1 -1
- package/dist/src/orgrt/checkpoint-ops.js +15 -1
- package/dist/src/orgrt/checkpoint-ops.js.map +1 -1
- package/dist/src/orgrt/checkpoint.js +1 -1
- package/dist/src/orgrt/checkpoint.js.map +1 -1
- package/dist/src/orgrt/daemon.d.ts +11 -3
- package/dist/src/orgrt/daemon.d.ts.map +1 -1
- package/dist/src/orgrt/daemon.js +317 -93
- package/dist/src/orgrt/daemon.js.map +1 -1
- package/dist/src/orgrt/decisions.d.ts +13 -0
- package/dist/src/orgrt/decisions.d.ts.map +1 -1
- package/dist/src/orgrt/decisions.js +95 -0
- package/dist/src/orgrt/decisions.js.map +1 -1
- package/dist/src/orgrt/remote.d.ts.map +1 -1
- package/dist/src/orgrt/remote.js +12 -6
- package/dist/src/orgrt/remote.js.map +1 -1
- package/dist/src/orgrt/server.d.ts.map +1 -1
- package/dist/src/orgrt/server.js +71 -14
- package/dist/src/orgrt/server.js.map +1 -1
- package/dist/src/orgrt/session.d.ts +27 -1
- package/dist/src/orgrt/session.d.ts.map +1 -1
- package/dist/src/orgrt/session.js +42 -3
- package/dist/src/orgrt/session.js.map +1 -1
- package/dist/src/orgrt/task-dag.d.ts +11 -1
- package/dist/src/orgrt/task-dag.d.ts.map +1 -1
- package/dist/src/orgrt/task-dag.js +93 -2
- package/dist/src/orgrt/task-dag.js.map +1 -1
- package/dist/src/orgrt/templates.d.ts.map +1 -1
- package/dist/src/orgrt/templates.js +24 -0
- package/dist/src/orgrt/templates.js.map +1 -1
- package/dist/src/orgrt/types.d.ts +70 -1
- package/dist/src/orgrt/types.d.ts.map +1 -1
- package/dist/src/orgrt/types.js +19 -0
- package/dist/src/orgrt/types.js.map +1 -1
- package/dist/src/orgrt/vercel-providers.d.ts.map +1 -1
- package/dist/src/orgrt/vercel-providers.js +9 -4
- package/dist/src/orgrt/vercel-providers.js.map +1 -1
- package/dist/src/orgrt/vercel-runner.d.ts +0 -23
- package/dist/src/orgrt/vercel-runner.d.ts.map +1 -1
- package/dist/src/orgrt/vercel-runner.js +26 -1
- package/dist/src/orgrt/vercel-runner.js.map +1 -1
- package/dist/src/types.d.ts +1 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/ui/server.mjs +2647 -838
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/.claude/commands/mastermind/approvev1.md +0 -94
- package/.claude/commands/mastermind/architect.md +0 -52
- package/.claude/commands/mastermind/autodev.md +0 -28
- package/.claude/commands/mastermind/build.md +0 -23
- package/.claude/commands/mastermind/finish.md +0 -17
- package/.claude/commands/mastermind/runorgv1.md +0 -159
- package/.claude/commands/mastermind/taskdev.md +0 -23
- package/.claude/commands/mastermind/tdd.md +0 -19
- package/.claude/commands/mastermind/verify.md +0 -19
- package/.claude/skills/mastermind-approvev1/SKILL.md +0 -191
- package/.claude/skills/mastermind-architect/SKILL.md +0 -862
- package/.claude/skills/mastermind-autodev/SKILL.md +0 -360
- package/.claude/skills/mastermind-build/SKILL.md +0 -169
- package/.claude/skills/mastermind-companies/SKILL.md +0 -256
- package/.claude/skills/mastermind-content/SKILL.md +0 -197
- package/.claude/skills/mastermind-costs/SKILL.md +0 -151
- package/.claude/skills/mastermind-finance/SKILL.md +0 -166
- package/.claude/skills/mastermind-finish/SKILL.md +0 -251
- package/.claude/skills/mastermind-heartbeatv1/SKILL.md +0 -167
- package/.claude/skills/mastermind-instance-settings/SKILL.md +0 -315
- package/.claude/skills/mastermind-marketing/SKILL.md +0 -228
- package/.claude/skills/mastermind-marketing/references/copywriting-frameworks.md +0 -181
- package/.claude/skills/mastermind-marketing/references/persuasion-psychology.md +0 -158
- package/.claude/skills/mastermind-ops/SKILL.md +0 -168
- package/.claude/skills/mastermind-org-chart/SKILL.md +0 -209
- package/.claude/skills/mastermind-project-detail/SKILL.md +0 -249
- package/.claude/skills/mastermind-project-workspace/SKILL.md +0 -244
- package/.claude/skills/mastermind-projects/SKILL.md +0 -167
- package/.claude/skills/mastermind-runorgv1/SKILL.md +0 -731
- package/.claude/skills/mastermind-sales/SKILL.md +0 -170
- package/.claude/skills/mastermind-taskdev/SKILL.md +0 -377
- package/.claude/skills/mastermind-taskdev/code-quality-reviewer-prompt.md +0 -60
- package/.claude/skills/mastermind-taskdev/final-reviewer-prompt.md +0 -144
- package/.claude/skills/mastermind-taskdev/implementer-prompt.md +0 -114
- package/.claude/skills/mastermind-taskdev/spec-reviewer-prompt.md +0 -80
- package/.claude/skills/mastermind-tdd/SKILL.md +0 -424
- package/.claude/skills/mastermind-verify/SKILL.md +0 -196
- package/.claude/skills/mastermind-wiki/SKILL.md +0 -314
- package/.claude/skills/monolean-review/SKILL.md +0 -57
|
@@ -13,10 +13,10 @@ Master advanced swarm patterns for distributed research, development, and testin
|
|
|
13
13
|
### Prerequisites
|
|
14
14
|
```bash
|
|
15
15
|
# Ensure Monomind is installed
|
|
16
|
-
npm install -g monomind@
|
|
16
|
+
npm install -g monomind@latest
|
|
17
17
|
|
|
18
18
|
# Add MCP server (if using MCP tools)
|
|
19
|
-
claude mcp add monomind npx monomind@
|
|
19
|
+
claude mcp add monomind npx monomind@latest mcp start
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
### Basic Pattern
|
|
@@ -1,179 +1,249 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: swarm-orchestration
|
|
3
|
-
description:
|
|
3
|
+
description: Orchestrate in-process multi-agent swarms with monomind for parallel task execution, topology selection, and shared memory coordination. Use when scaling beyond a single agent on tasks with clear decomposition.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Swarm Orchestration
|
|
7
7
|
|
|
8
8
|
## What This Skill Does
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Coordinates multiple Claude Code Task-tool agents inside a single monomind process. The swarm layer tracks topology, agent lifecycle, and task assignment. **Real work happens in spawned Task-tool agents** — the swarm coordinates, agents execute.
|
|
11
|
+
|
|
12
|
+
## What Swarm Is (and Is Not)
|
|
13
|
+
|
|
14
|
+
**Is:** In-process coordination — topology bookkeeping, agent lifecycle, task routing, vote-count consensus. State persists to `.monomind/swarm/`.
|
|
15
|
+
|
|
16
|
+
**Is not:** A distributed system. There is no networking between separate machines. "Consensus" strategies (`raft`, `bft`, `quorum`) are vote-count thresholds applied inside one process — not Raft/Paxos protocols.
|
|
17
|
+
|
|
18
|
+
If you need persistent, scheduled, autonomous agent organizations, use `monomind org run` instead. **Swarm coordinates a single task; org runtime governs a long-running org.** (See "Successor: Org Runtime" below.)
|
|
11
19
|
|
|
12
20
|
## Prerequisites
|
|
13
21
|
|
|
14
|
-
- monomind
|
|
15
|
-
-
|
|
16
|
-
-
|
|
22
|
+
- monomind v2.9.4+
|
|
23
|
+
- Claude Code's Task tool available (agents execute via Task tool, not CLI alone)
|
|
24
|
+
- A task that decomposes into 2+ independent subtasks
|
|
25
|
+
|
|
26
|
+
## Topology Selection
|
|
27
|
+
|
|
28
|
+
Choose topology by task shape:
|
|
29
|
+
|
|
30
|
+
| Topology | When | Example |
|
|
31
|
+
|---|---|---|
|
|
32
|
+
| `hierarchical` | Default — clear task decomposition, one coordinator | Feature build (architect → coders → testers) |
|
|
33
|
+
| `mesh` | Peer-to-peer exploration, research, knowledge sharing | Multi-source research synthesis |
|
|
34
|
+
| `hierarchical-mesh` | 10+ agents — hierarchy with peer side-channels | Large refactor touching many modules |
|
|
35
|
+
| `ring` | Circular handoff (review → fix → re-review) | Code review cycle |
|
|
36
|
+
| `star` | Central hub with specialist spokes | Coordinator dispatching to niche experts |
|
|
37
|
+
| `hybrid` | Mixed work needing both hierarchy and peer comms | Migration + new feature in parallel |
|
|
38
|
+
|
|
39
|
+
**Rule of thumb:** ≤8 agents → `hierarchical`. 10+ agents → `hierarchical-mesh`. Research/exploration → `mesh`.
|
|
40
|
+
|
|
41
|
+
## Strategy Selection
|
|
42
|
+
|
|
43
|
+
| Strategy | When |
|
|
44
|
+
|---|---|
|
|
45
|
+
| `specialized` | Fixed roles (default for feature work) |
|
|
46
|
+
| `balanced` | Even work distribution, homogeneous tasks |
|
|
47
|
+
| `development` | Dev pipeline (plan → code → test → review) |
|
|
48
|
+
|
|
49
|
+
## Lifecycle
|
|
17
50
|
|
|
18
|
-
|
|
51
|
+
### 1. Initialize
|
|
19
52
|
|
|
20
53
|
```bash
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
npx monomind
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Topology Patterns
|
|
36
|
-
|
|
37
|
-
### 1. Mesh (Peer-to-Peer)
|
|
38
|
-
```typescript
|
|
39
|
-
// Equal peers, distributed decision-making
|
|
40
|
-
await swarm.init({
|
|
41
|
-
topology: 'mesh',
|
|
42
|
-
agents: ['coder', 'tester', 'reviewer'],
|
|
43
|
-
communication: 'broadcast'
|
|
44
|
-
});
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### 2. Hierarchical (Queen-Worker)
|
|
48
|
-
```typescript
|
|
49
|
-
// Centralized coordination, specialized workers
|
|
50
|
-
await swarm.init({
|
|
51
|
-
topology: 'hierarchical',
|
|
52
|
-
queen: 'architect',
|
|
53
|
-
workers: ['backend-dev', 'frontend-dev', 'db-designer']
|
|
54
|
-
});
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
### 3. Adaptive (Dynamic)
|
|
58
|
-
```typescript
|
|
59
|
-
// Automatically switches topology based on task
|
|
60
|
-
await swarm.init({
|
|
61
|
-
topology: 'adaptive',
|
|
62
|
-
optimization: 'task-complexity'
|
|
63
|
-
});
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
## Task Orchestration
|
|
67
|
-
|
|
68
|
-
### Parallel Execution
|
|
69
|
-
```typescript
|
|
70
|
-
// Execute tasks concurrently
|
|
71
|
-
const results = await swarm.execute({
|
|
72
|
-
tasks: [
|
|
73
|
-
{ agent: 'coder', task: 'Implement API endpoints' },
|
|
74
|
-
{ agent: 'frontend', task: 'Build UI components' },
|
|
75
|
-
{ agent: 'tester', task: 'Write test suite' }
|
|
76
|
-
],
|
|
77
|
-
mode: 'parallel',
|
|
78
|
-
timeout: 300000 // 5 minutes
|
|
79
|
-
});
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
### Pipeline Execution
|
|
83
|
-
```typescript
|
|
84
|
-
// Sequential pipeline with dependencies
|
|
85
|
-
await swarm.pipeline([
|
|
86
|
-
{ stage: 'design', agent: 'architect' },
|
|
87
|
-
{ stage: 'implement', agent: 'coder', after: 'design' },
|
|
88
|
-
{ stage: 'test', agent: 'tester', after: 'implement' },
|
|
89
|
-
{ stage: 'review', agent: 'reviewer', after: 'test' }
|
|
90
|
-
]);
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
### Adaptive Execution
|
|
94
|
-
```typescript
|
|
95
|
-
// Let swarm decide execution strategy
|
|
96
|
-
await swarm.autoOrchestrate({
|
|
97
|
-
goal: 'Build production-ready API',
|
|
98
|
-
constraints: {
|
|
99
|
-
maxTime: 3600,
|
|
100
|
-
maxAgents: 8,
|
|
101
|
-
quality: 'high'
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
## Memory Coordination
|
|
107
|
-
|
|
108
|
-
```typescript
|
|
109
|
-
// Share state across swarm
|
|
110
|
-
await swarm.memory.store('api-schema', {
|
|
111
|
-
endpoints: [...],
|
|
112
|
-
models: [...]
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
// Agents read shared memory
|
|
116
|
-
const schema = await swarm.memory.retrieve('api-schema');
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
## Advanced Features
|
|
120
|
-
|
|
121
|
-
### Load Balancing
|
|
122
|
-
```typescript
|
|
123
|
-
// Automatic work distribution
|
|
124
|
-
await swarm.enableLoadBalancing({
|
|
125
|
-
strategy: 'dynamic',
|
|
126
|
-
metrics: ['cpu', 'memory', 'task-queue']
|
|
127
|
-
});
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
### Fault Tolerance
|
|
131
|
-
```typescript
|
|
132
|
-
// Handle agent failures
|
|
133
|
-
await swarm.setResiliency({
|
|
134
|
-
retry: { maxAttempts: 3, backoff: 'exponential' },
|
|
135
|
-
fallback: 'reassign-task'
|
|
136
|
-
});
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
### Performance Monitoring
|
|
140
|
-
```typescript
|
|
141
|
-
// Track swarm metrics
|
|
142
|
-
const metrics = await swarm.getMetrics();
|
|
143
|
-
// { throughput, latency, success_rate, agent_utilization }
|
|
144
|
-
```
|
|
54
|
+
npx monomind@latest swarm init \
|
|
55
|
+
--topology hierarchical \
|
|
56
|
+
--max-agents 8 \
|
|
57
|
+
--strategy specialized
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 2. Spawn agents (CLI or MCP)
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npx monomind@latest agent spawn -t coordinator --name lead
|
|
64
|
+
npx monomind@latest agent spawn -t coder --name impl
|
|
65
|
+
npx monomind@latest agent spawn -t tester --name qa
|
|
66
|
+
```
|
|
145
67
|
|
|
146
|
-
|
|
68
|
+
Equivalent MCP: `mcp__monomind__agent_spawn { type: "...", name: "..." }`.
|
|
69
|
+
|
|
70
|
+
### 3. Start work
|
|
147
71
|
|
|
148
72
|
```bash
|
|
149
|
-
|
|
150
|
-
|
|
73
|
+
npx monomind@latest swarm start \
|
|
74
|
+
--objective "Add OAuth2 login with tests" \
|
|
75
|
+
--strategy specialized \
|
|
76
|
+
--agents 4
|
|
77
|
+
```
|
|
151
78
|
|
|
152
|
-
|
|
153
|
-
npx monomind hooks post-task --task-id "task-123"
|
|
79
|
+
### 4. Monitor and stop
|
|
154
80
|
|
|
155
|
-
|
|
156
|
-
npx monomind
|
|
81
|
+
```bash
|
|
82
|
+
npx monomind@latest swarm status
|
|
83
|
+
npx monomind@latest agent list
|
|
84
|
+
npx monomind@latest agent status <id>
|
|
85
|
+
npx monomind@latest swarm stop
|
|
157
86
|
```
|
|
158
87
|
|
|
88
|
+
## Agent Role Assignment
|
|
89
|
+
|
|
90
|
+
Match agent type to task category. Use `mcp__monomind__hooks_route` to auto-pick instead of guessing:
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
mcp__monomind__hooks_route { task: "implement JWT auth" }
|
|
94
|
+
# → returns the recommended agent type
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Common assignments (see `doc/concepts/swarm.md` for the full routing table):
|
|
98
|
+
|
|
99
|
+
| Task | Recommended agents |
|
|
100
|
+
|---|---|
|
|
101
|
+
| Bug fix | coordinator, researcher, coder, tester |
|
|
102
|
+
| Feature | coordinator, architect, coder, tester, reviewer |
|
|
103
|
+
| Refactor | coordinator, architect, coder, reviewer |
|
|
104
|
+
| Performance | coordinator, performance-engineer, coder |
|
|
105
|
+
| Security | coordinator, security-architect, security-auditor |
|
|
106
|
+
| Docs | researcher, documenter |
|
|
107
|
+
|
|
108
|
+
## Workflow Patterns
|
|
109
|
+
|
|
110
|
+
### Sequential pipeline (design → code → test → review)
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
npx monomind@latest swarm init --topology hierarchical --strategy development --max-agents 4
|
|
114
|
+
npx monomind@latest swarm start --objective "Build user-profile API with full test coverage"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Drive each stage via task assignment — the next stage picks up when the previous completes:
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
mcp__monomind__task_create { description: "Design schema", agent_type: "architect" }
|
|
121
|
+
# after architect completes:
|
|
122
|
+
mcp__monomind__task_assign { task_id: "...", agent_id: "<coder-id>" }
|
|
123
|
+
# after coder completes:
|
|
124
|
+
mcp__monomind__task_assign { task_id: "...", agent_id: "<tester-id>" }
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Parallel fan-out (independent subtasks)
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
npx monomind@latest swarm init --topology mesh --strategy balanced --max-agents 6
|
|
131
|
+
npx monomind@latest swarm start --objective "Audit 6 modules for security issues" --agents 6
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Spawn one Task-tool agent per module; each writes findings to the shared namespace.
|
|
135
|
+
|
|
136
|
+
### Mixed (parallel sub-trees, sequential stages)
|
|
137
|
+
|
|
138
|
+
Use `hierarchical-mesh` — the coordinator fans out parallel work while stages run sequentially. Best for 10+ agent workloads:
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
mcp__monomind__swarm_init { topology: "hierarchical-mesh", max_agents: 12, strategy: "specialized" }
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Memory Sharing Across Agents
|
|
145
|
+
|
|
146
|
+
Swarm agents share state through monomind memory (SQLite/JSON) — there is no separate "swarm memory" API. Each agent reads/writes the same namespace.
|
|
147
|
+
|
|
148
|
+
Store context once (CLI), or via MCP inside an agent:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
npx monomind@latest memory store \
|
|
152
|
+
--key "feature-spec" \
|
|
153
|
+
--value "OAuth2 with PKCE, refresh tokens, 15-min access TTL" \
|
|
154
|
+
--namespace swarm-001 --tags spec,auth
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
mcp__monomind__memory_kg_ingest { key: "feature-spec", value: "...", namespace: "swarm-001" }
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Retrieve during work:
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
npx monomind@latest memory retrieve --key feature-spec --namespace swarm-001
|
|
165
|
+
npx monomind@latest memory search --query "auth requirements"
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
**Use one shared namespace per swarm run** so every agent sees the same context.
|
|
169
|
+
|
|
170
|
+
## Load Balancing (Concept)
|
|
171
|
+
|
|
172
|
+
In-process "load balancing" is task routing, not network LB. Two mechanisms: `hooks_route` (picks the optimal agent type from the routing table) and `strategy` (`balanced` evens work, `specialized` keeps roles fixed).
|
|
173
|
+
|
|
174
|
+
For uneven workloads, scale up and reassign stalled tasks:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
npx monomind@latest swarm scale --agents 12
|
|
178
|
+
npx monomind@latest swarm status
|
|
179
|
+
npx monomind@latest agent status <id>
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
mcp__monomind__task_assign { task_id: "...", agent_id: "<idle-agent-id>" }
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Full Example: Feature Build
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
npx monomind@latest swarm init --topology hierarchical --max-agents 5 --strategy specialized
|
|
190
|
+
|
|
191
|
+
# Share the spec once — all agents read this
|
|
192
|
+
npx monomind@latest memory store \
|
|
193
|
+
--key "feature-spec" \
|
|
194
|
+
--value "Add CSV import: parse, validate, persist, report errors" \
|
|
195
|
+
--namespace swarm-csv
|
|
196
|
+
|
|
197
|
+
npx monomind@latest agent spawn -t coordinator --name lead
|
|
198
|
+
npx monomind@latest agent spawn -t coder --name impl
|
|
199
|
+
npx monomind@latest agent spawn -t tester --name qa
|
|
200
|
+
npx monomind@latest agent spawn -t reviewer --name audit
|
|
201
|
+
|
|
202
|
+
npx monomind@latest swarm start --objective "Implement CSV import end-to-end" --agents 4
|
|
203
|
+
npx monomind@latest swarm status
|
|
204
|
+
npx monomind@latest swarm stop
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Execution happens in Claude Code Task-tool agents. The CLI coordinates; Task agents do the work.
|
|
208
|
+
|
|
209
|
+
## Successor: Org Runtime
|
|
210
|
+
|
|
211
|
+
For autonomous, recurring, or long-running work, prefer `monomind org run`:
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
npx monomind@latest org run my-team --task "Maintain CI hygiene"
|
|
215
|
+
npx monomind@latest org status
|
|
216
|
+
npx monomind@latest org logs my-team --follow
|
|
217
|
+
npx monomind@latest org stop my-team
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Org runtime adds: scheduled wakeups, governance gates, budget enforcement, persistent state across runs. **Swarm is a single coordinated session; org runtime is a durable organization.**
|
|
221
|
+
|
|
222
|
+
- Use **swarm** for: one-off parallel tasks today.
|
|
223
|
+
- Use **org runtime** for: recurring autonomous work, scheduled agents, multi-session goals.
|
|
224
|
+
|
|
159
225
|
## Best Practices
|
|
160
226
|
|
|
161
|
-
1. **
|
|
162
|
-
2. **
|
|
163
|
-
3. **
|
|
164
|
-
4. **
|
|
165
|
-
5. **
|
|
227
|
+
1. **Right-size the swarm.** Start with 3–4 agents; scale only when utilization is high.
|
|
228
|
+
2. **One shared memory namespace per run.** All agents read/write the same context.
|
|
229
|
+
3. **Pick topology by agent count.** ≤8 → `hierarchical`; 10+ → `hierarchical-mesh`.
|
|
230
|
+
4. **Route before assigning.** `hooks_route` picks better agent types than guessing.
|
|
231
|
+
5. **Let Task-tool agents do the work.** CLI coordinates; execution lives in Claude Code Task agents.
|
|
232
|
+
6. **Set clear boundaries.** Every subtask needs clear inputs and outputs, or agents will thrash.
|
|
166
233
|
|
|
167
234
|
## Troubleshooting
|
|
168
235
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
236
|
+
| Symptom | Likely cause | Fix |
|
|
237
|
+
|---|---|---|
|
|
238
|
+
| Agents not coordinating | Different namespace per agent | Use one shared `--namespace` |
|
|
239
|
+
| Stalled agent | Blocked on upstream stage | `agent status <id>`, then reassign task |
|
|
240
|
+
| Poor throughput | Wrong topology for count | Switch to `hierarchical-mesh` at 10+ agents |
|
|
241
|
+
| Duplicate work | No shared memory | `memory store` the spec; agents `retrieve` before acting |
|
|
242
|
+
| Swarm won't start | Bad topology/strategy combo | Verify flags against `doc/concepts/swarm.md` |
|
|
174
243
|
|
|
175
244
|
## Learn More
|
|
176
245
|
|
|
177
|
-
-
|
|
178
|
-
-
|
|
179
|
-
-
|
|
246
|
+
- `doc/concepts/swarm.md` — honest scope, topologies, agent types, full MCP tool list
|
|
247
|
+
- Hive-mind (MCP only): `mcp__monomind__hive-mind_*` tools for vote-count consensus
|
|
248
|
+
- `/mastermind:topology` — interactive topology picker
|
|
249
|
+
- Org runtime: `npx monomind@latest org --help`
|