@monoes/monomindcli 2.9.4 → 2.9.6
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/commands/mastermind/approvev1.md +94 -0
- package/.claude/commands/mastermind/architect.md +52 -0
- package/.claude/commands/mastermind/autodev.md +28 -0
- package/.claude/commands/mastermind/build.md +23 -0
- package/.claude/commands/mastermind/finish.md +17 -0
- package/.claude/commands/mastermind/runorgv1.md +159 -0
- package/.claude/commands/mastermind/taskdev.md +23 -0
- package/.claude/commands/mastermind/tdd.md +19 -0
- package/.claude/commands/mastermind/verify.md +19 -0
- package/.claude/helpers/intelligence.cjs +6 -27
- package/.claude/skills/agentic-jujutsu/SKILL.md +15 -17
- package/.claude/skills/hive-mind-advanced/SKILL.md +559 -212
- package/.claude/skills/hooks-automation/SKILL.md +1 -1
- package/.claude/skills/mastermind-approvev1/SKILL.md +191 -0
- package/.claude/skills/mastermind-architect/SKILL.md +862 -0
- package/.claude/skills/mastermind-autodev/SKILL.md +360 -0
- package/.claude/skills/mastermind-build/SKILL.md +169 -0
- package/.claude/skills/mastermind-companies/SKILL.md +256 -0
- package/.claude/skills/mastermind-content/SKILL.md +197 -0
- package/.claude/skills/mastermind-costs/SKILL.md +151 -0
- package/.claude/skills/mastermind-finance/SKILL.md +166 -0
- package/.claude/skills/mastermind-finish/SKILL.md +251 -0
- package/.claude/skills/mastermind-heartbeatv1/SKILL.md +167 -0
- package/.claude/skills/mastermind-instance-settings/SKILL.md +315 -0
- package/.claude/skills/mastermind-marketing/SKILL.md +228 -0
- package/.claude/skills/mastermind-marketing/references/copywriting-frameworks.md +181 -0
- package/.claude/skills/mastermind-marketing/references/persuasion-psychology.md +158 -0
- package/.claude/skills/mastermind-ops/SKILL.md +168 -0
- package/.claude/skills/mastermind-org-chart/SKILL.md +209 -0
- package/.claude/skills/mastermind-project-detail/SKILL.md +249 -0
- package/.claude/skills/mastermind-project-workspace/SKILL.md +244 -0
- package/.claude/skills/mastermind-projects/SKILL.md +167 -0
- package/.claude/skills/mastermind-runorgv1/SKILL.md +731 -0
- package/.claude/skills/mastermind-sales/SKILL.md +170 -0
- package/.claude/skills/mastermind-taskdev/SKILL.md +377 -0
- package/.claude/skills/mastermind-taskdev/code-quality-reviewer-prompt.md +60 -0
- package/.claude/skills/mastermind-taskdev/final-reviewer-prompt.md +144 -0
- package/.claude/skills/mastermind-taskdev/implementer-prompt.md +114 -0
- package/.claude/skills/mastermind-taskdev/spec-reviewer-prompt.md +80 -0
- package/.claude/skills/mastermind-tdd/SKILL.md +424 -0
- package/.claude/skills/mastermind-verify/SKILL.md +196 -0
- package/.claude/skills/mastermind-wiki/SKILL.md +314 -0
- package/.claude/skills/monolean-review/SKILL.md +57 -0
- package/.claude/skills/pair-programming/SKILL.md +1 -1
- package/.claude/skills/performance-analysis/SKILL.md +484 -228
- package/.claude/skills/swarm-advanced/SKILL.md +2 -2
- package/.claude/skills/swarm-orchestration/SKILL.md +150 -220
- package/.claude/skills/verification-quality/SKILL.md +571 -247
- package/README.md +3 -3
- 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 +1 -7
- 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 +3 -14
- 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-project-checks.d.ts.map +1 -1
- package/dist/src/commands/doctor-project-checks.js +37 -3
- package/dist/src/commands/doctor-project-checks.js.map +1 -1
- package/dist/src/commands/doctor.d.ts.map +1 -1
- package/dist/src/commands/doctor.js +1 -30
- package/dist/src/commands/doctor.js.map +1 -1
- package/dist/src/commands/hooks-coverage-commands.d.ts.map +1 -1
- package/dist/src/commands/hooks-coverage-commands.js +67 -75
- package/dist/src/commands/hooks-coverage-commands.js.map +1 -1
- package/dist/src/commands/hooks-workers.d.ts.map +1 -1
- package/dist/src/commands/hooks-workers.js +10 -41
- package/dist/src/commands/hooks-workers.js.map +1 -1
- package/dist/src/commands/hooks.js +1 -1
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +7 -80
- 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 +2 -78
- package/dist/src/commands/mcp.js.map +1 -1
- package/dist/src/commands/org.d.ts.map +1 -1
- package/dist/src/commands/org.js +3 -116
- 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/security-cve.d.ts.map +1 -1
- package/dist/src/commands/security-cve.js +11 -1
- package/dist/src/commands/security-cve.js.map +1 -1
- package/dist/src/commands/security-misc.d.ts +9 -0
- package/dist/src/commands/security-misc.d.ts.map +1 -1
- package/dist/src/commands/security-misc.js +54 -33
- package/dist/src/commands/security-misc.js.map +1 -1
- package/dist/src/commands/security-scan.d.ts.map +1 -1
- package/dist/src/commands/security-scan.js +11 -3
- package/dist/src/commands/security-scan.js.map +1 -1
- package/dist/src/commands/swarm.d.ts.map +1 -1
- package/dist/src/commands/swarm.js +2 -7
- 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 +3 -13
- package/dist/src/init/executor.js.map +1 -1
- package/dist/src/init/kimi-generator.d.ts +2 -3
- package/dist/src/init/kimi-generator.d.ts.map +1 -1
- package/dist/src/init/kimi-generator.js +13 -45
- 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.js +1 -1
- package/dist/src/mcp-tools/embeddings-tools.js +2 -2
- package/dist/src/mcp-tools/embeddings-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 +3 -29
- 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 +19 -32
- package/dist/src/mcp-tools/hooks-routing.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 +18 -48
- package/dist/src/mcp-tools/monograph/query-tools.js.map +1 -1
- package/dist/src/mcp-tools/performance-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/performance-tools.js +10 -15
- package/dist/src/mcp-tools/performance-tools.js.map +1 -1
- package/dist/src/memory/embedding-operations.d.ts +0 -4
- package/dist/src/memory/embedding-operations.d.ts.map +1 -1
- package/dist/src/memory/embedding-operations.js +32 -125
- 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-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/monovector/diff-classifier.js +3 -3
- package/dist/src/monovector/diff-classifier.js.map +1 -1
- package/dist/src/orgrt/checkpoint-ops.d.ts +1 -11
- package/dist/src/orgrt/checkpoint-ops.d.ts.map +1 -1
- package/dist/src/orgrt/checkpoint-ops.js +1 -15
- 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 +0 -6
- package/dist/src/orgrt/daemon.d.ts.map +1 -1
- package/dist/src/orgrt/daemon.js +0 -26
- package/dist/src/orgrt/daemon.js.map +1 -1
- package/dist/src/orgrt/decisions.d.ts +0 -13
- package/dist/src/orgrt/decisions.d.ts.map +1 -1
- package/dist/src/orgrt/decisions.js +0 -95
- package/dist/src/orgrt/decisions.js.map +1 -1
- package/dist/src/orgrt/kimicode-runner.js +1 -1
- package/dist/src/orgrt/kimicode-runner.js.map +1 -1
- package/dist/src/orgrt/opencode-runner.js +1 -1
- package/dist/src/orgrt/opencode-runner.js.map +1 -1
- package/dist/src/orgrt/session.d.ts +1 -27
- package/dist/src/orgrt/session.d.ts.map +1 -1
- package/dist/src/orgrt/session.js +3 -42
- package/dist/src/orgrt/session.js.map +1 -1
- package/dist/src/orgrt/task-dag.d.ts +1 -11
- package/dist/src/orgrt/task-dag.d.ts.map +1 -1
- package/dist/src/orgrt/task-dag.js +2 -93
- 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 +0 -24
- package/dist/src/orgrt/templates.js.map +1 -1
- package/dist/src/orgrt/types.d.ts +1 -70
- package/dist/src/orgrt/types.d.ts.map +1 -1
- package/dist/src/orgrt/types.js +0 -19
- 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 +4 -9
- package/dist/src/orgrt/vercel-providers.js.map +1 -1
- package/dist/src/orgrt/vercel-runner.d.ts +23 -0
- package/dist/src/orgrt/vercel-runner.d.ts.map +1 -1
- package/dist/src/orgrt/vercel-runner.js +1 -26
- package/dist/src/orgrt/vercel-runner.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
|
@@ -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@alpha
|
|
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@alpha mcp start
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
### Basic Pattern
|
|
@@ -1,249 +1,179 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: swarm-orchestration
|
|
3
|
-
description: Orchestrate
|
|
3
|
+
description: "Orchestrate multi-agent swarms with monomind for parallel task execution, dynamic topology, and intelligent coordination. Use when scaling beyond single agents, implementing complex workflows, or building distributed AI systems."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Swarm Orchestration
|
|
7
7
|
|
|
8
8
|
## What This Skill Does
|
|
9
9
|
|
|
10
|
-
|
|
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.)
|
|
10
|
+
Orchestrates multi-agent swarms using monomind's advanced coordination system. Supports mesh, hierarchical, and adaptive topologies with automatic task distribution, load balancing, and fault tolerance.
|
|
19
11
|
|
|
20
12
|
## Prerequisites
|
|
21
13
|
|
|
22
|
-
- monomind
|
|
23
|
-
-
|
|
24
|
-
-
|
|
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
|
|
14
|
+
- monomind v1.8.0+
|
|
15
|
+
- Node.js 18+
|
|
16
|
+
- Understanding of distributed systems (helpful)
|
|
50
17
|
|
|
51
|
-
|
|
18
|
+
## Quick Start
|
|
52
19
|
|
|
53
20
|
```bash
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
npx monomind
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
```
|
|
21
|
+
# Initialize swarm
|
|
22
|
+
npx monomind swarm init --topology mesh --max-agents 5
|
|
23
|
+
|
|
24
|
+
# Spawn agents
|
|
25
|
+
npx monomind agent spawn --type coder
|
|
26
|
+
npx monomind agent spawn --type tester
|
|
27
|
+
npx monomind agent spawn --type reviewer
|
|
28
|
+
|
|
29
|
+
# Orchestrate task
|
|
30
|
+
npx monomind task run \
|
|
31
|
+
--task "Build REST API with tests" \
|
|
32
|
+
--mode parallel
|
|
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
|
+
```
|
|
67
145
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
### 3. Start work
|
|
146
|
+
## Integration with Hooks
|
|
71
147
|
|
|
72
148
|
```bash
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
--strategy specialized \
|
|
76
|
-
--agents 4
|
|
77
|
-
```
|
|
149
|
+
# Pre-task coordination
|
|
150
|
+
npx monomind hooks pre-task --description "Build API"
|
|
78
151
|
|
|
79
|
-
|
|
152
|
+
# Post-task synchronization
|
|
153
|
+
npx monomind hooks post-task --task-id "task-123"
|
|
80
154
|
|
|
81
|
-
|
|
82
|
-
npx monomind
|
|
83
|
-
npx monomind@latest agent list
|
|
84
|
-
npx monomind@latest agent status <id>
|
|
85
|
-
npx monomind@latest swarm stop
|
|
155
|
+
# Session restore
|
|
156
|
+
npx monomind hooks session-restore --session-id "swarm-001"
|
|
86
157
|
```
|
|
87
158
|
|
|
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
|
-
|
|
225
159
|
## Best Practices
|
|
226
160
|
|
|
227
|
-
1. **
|
|
228
|
-
2. **
|
|
229
|
-
3. **
|
|
230
|
-
4. **
|
|
231
|
-
5. **
|
|
232
|
-
6. **Set clear boundaries.** Every subtask needs clear inputs and outputs, or agents will thrash.
|
|
161
|
+
1. **Start small**: Begin with 2-3 agents, scale up
|
|
162
|
+
2. **Use memory**: Share context through swarm memory
|
|
163
|
+
3. **Monitor metrics**: Track performance and bottlenecks
|
|
164
|
+
4. **Enable hooks**: Automatic coordination and sync
|
|
165
|
+
5. **Set timeouts**: Prevent hung tasks
|
|
233
166
|
|
|
234
167
|
## Troubleshooting
|
|
235
168
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
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` |
|
|
169
|
+
### Issue: Agents not coordinating
|
|
170
|
+
**Solution**: Verify memory access and enable hooks
|
|
171
|
+
|
|
172
|
+
### Issue: Poor performance
|
|
173
|
+
**Solution**: Check topology (use adaptive) and enable load balancing
|
|
243
174
|
|
|
244
175
|
## Learn More
|
|
245
176
|
|
|
246
|
-
-
|
|
247
|
-
-
|
|
248
|
-
-
|
|
249
|
-
- Org runtime: `npx monomind@latest org --help`
|
|
177
|
+
- Swarm Guide: docs/swarm/orchestration.md
|
|
178
|
+
- Topology Patterns: docs/swarm/topologies.md
|
|
179
|
+
- Hooks Integration: docs/hooks/coordination.md
|