@monoes/monomindcli 2.9.7 → 2.9.9
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/agents/design/design-monodesign.md +1 -2
- package/.claude/agents/engineering/engineering-ai-data-remediation-engineer.md +1 -2
- package/.claude/agents/engineering/engineering-ai-engineer.md +1 -2
- package/.claude/agents/engineering/engineering-autonomous-optimization-architect.md +0 -1
- package/.claude/agents/engineering/engineering-backend-architect.md +1 -2
- package/.claude/agents/engineering/engineering-code-reviewer.md +1 -2
- package/.claude/agents/engineering/engineering-data-engineer.md +1 -2
- package/.claude/agents/engineering/engineering-database-optimizer.md +1 -2
- package/.claude/agents/engineering/engineering-devops-automator.md +1 -2
- package/.claude/agents/engineering/engineering-embedded-firmware-engineer.md +1 -2
- package/.claude/agents/engineering/engineering-feishu-integration-developer.md +1 -2
- package/.claude/agents/engineering/engineering-frontend-developer.md +1 -2
- package/.claude/agents/engineering/engineering-git-workflow-master.md +1 -2
- package/.claude/agents/engineering/engineering-incident-response-commander.md +0 -1
- package/.claude/agents/engineering/engineering-mobile-app-builder.md +1 -2
- package/.claude/agents/engineering/engineering-rapid-prototyper.md +1 -2
- package/.claude/agents/engineering/engineering-security-engineer.md +1 -2
- package/.claude/agents/engineering/engineering-senior-developer.md +1 -2
- package/.claude/agents/engineering/engineering-software-architect.md +1 -2
- package/.claude/agents/engineering/engineering-solidity-smart-contract-engineer.md +1 -2
- package/.claude/agents/engineering/engineering-sre.md +0 -1
- package/.claude/agents/engineering/engineering-technical-writer.md +1 -2
- package/.claude/agents/engineering/engineering-threat-detection-engineer.md +0 -1
- package/.claude/agents/engineering/engineering-wechat-mini-program-developer.md +1 -2
- package/.claude/agents/github/code-review-swarm.md +0 -1
- package/.claude/agents/github/github-modes.md +0 -1
- package/.claude/agents/github/issue-tracker.md +0 -1
- package/.claude/agents/github/multi-repo-swarm.md +0 -1
- package/.claude/agents/github/pr-manager.md +0 -1
- package/.claude/agents/github/project-board-sync.md +0 -1
- package/.claude/agents/github/release-manager.md +0 -1
- package/.claude/agents/github/repo-architect.md +0 -1
- package/.claude/agents/github/swarm-issue.md +0 -1
- package/.claude/agents/github/swarm-pr.md +0 -1
- package/.claude/agents/github/sync-coordinator.md +0 -1
- package/.claude/agents/github/workflow-automation.md +0 -1
- package/.claude/agents/marketing/marketing-competitive-content.md +1 -2
- package/.claude/agents/marketing/marketing-cro-specialist.md +1 -2
- package/.claude/agents/marketing/marketing-email-specialist.md +1 -2
- package/.claude/agents/marketing/marketing-launch-strategist.md +1 -2
- package/.claude/agents/marketing/marketing-pricing-strategist.md +1 -2
- package/.claude/agents/specialized/agentic-identity-trust.md +0 -1
- package/.claude/agents/specialized/agents-orchestrator.md +1 -2
- package/.claude/agents/specialized/automation-governance-architect.md +1 -2
- package/.claude/agents/specialized/blockchain-security-auditor.md +1 -2
- package/.claude/agents/specialized/compliance-auditor.md +1 -2
- package/.claude/agents/specialized/identity-graph-operator.md +0 -1
- package/.claude/agents/specialized/lsp-index-engineer.md +1 -2
- package/.claude/agents/specialized/mobile/spec-mobile-react-native.md +0 -1
- package/.claude/agents/specialized/specialized-cultural-intelligence-strategist.md +0 -1
- package/.claude/agents/specialized/specialized-developer-advocate.md +1 -2
- package/.claude/agents/specialized/specialized-document-generator.md +1 -2
- package/.claude/agents/specialized/specialized-mcp-builder.md +1 -2
- package/.claude/agents/specialized/specialized-model-qa.md +0 -1
- package/.claude/agents/specialized/specialized-workflow-architect.md +1 -2
- package/.claude/agents/specialized/zk-steward.md +1 -2
- package/.claude/agents/testing/production-validator.md +0 -1
- package/.claude/agents/testing/tdd-london-swarm.md +0 -1
- package/.claude/agents/testing/testing-accessibility-auditor.md +0 -1
- package/.claude/agents/testing/testing-api-tester.md +1 -2
- package/.claude/agents/testing/testing-evidence-collector.md +1 -2
- package/.claude/agents/testing/testing-performance-benchmarker.md +1 -2
- package/.claude/agents/testing/testing-test-results-analyzer.md +1 -2
- package/.claude/agents/testing/testing-tool-evaluator.md +1 -2
- package/.claude/agents/testing/testing-workflow-optimizer.md +1 -2
- package/.claude/commands/hooks/README.md +1 -1
- package/.claude/commands/memory/README.md +6 -7
- package/.claude/commands/monitoring/README.md +1 -1
- package/.claude/helpers/control-start.cjs +37 -8
- package/.claude/helpers/handlers/route-handler.cjs +22 -3
- package/.claude/helpers/handlers/session-handler.cjs +43 -0
- package/.claude/helpers/intelligence.cjs +27 -6
- package/.claude/helpers/statusline.cjs +45 -11
- 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-adapters/SKILL.md +0 -11
- package/.claude/skills/mastermind-agents/SKILL.md +0 -11
- package/.claude/skills/mastermind-backup/SKILL.md +0 -11
- package/.claude/skills/mastermind-bootstrap/SKILL.md +0 -11
- package/.claude/skills/mastermind-delegation/SKILL.md +14 -12
- package/.claude/skills/mastermind-idea/SKILL.md +0 -5
- package/.claude/skills/mastermind-monitor/SKILL.md +0 -15
- package/.claude/skills/mastermind-org-settings/SKILL.md +0 -11
- package/.claude/skills/mastermind-plugins/SKILL.md +0 -11
- package/.claude/skills/mastermind-protocol/SKILL.md +6 -124
- package/.claude/skills/mastermind-repeat/SKILL.md +0 -25
- package/.claude/skills/mastermind-review/SKILL.md +1 -1
- package/.claude/skills/mastermind-stoporg/SKILL.md +0 -19
- package/.claude/skills/memory-toolkit/SKILL.md +12 -11
- package/.claude/skills/monodesign/scripts/detector/engines/browser/drivers.mjs +8 -1
- package/.claude/skills/pair-programming/SKILL.md +1 -1
- package/.claude/skills/performance-analysis/SKILL.md +228 -484
- package/.claude/skills/specialagent/SKILL.md +31 -133
- 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 +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 +7 -1
- 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-project-checks.d.ts.map +1 -1
- package/dist/src/commands/doctor-project-checks.js +3 -37
- 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 +30 -1
- 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 +75 -67
- 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 +41 -10
- package/dist/src/commands/hooks-workers.js.map +1 -1
- package/dist/src/commands/hooks.js +1 -1
- package/dist/src/commands/index.d.ts +1 -1
- package/dist/src/commands/index.d.ts.map +1 -1
- package/dist/src/commands/index.js +20 -4
- package/dist/src/commands/index.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/neural-optimize.d.ts.map +1 -1
- package/dist/src/commands/neural-optimize.js +27 -5
- package/dist/src/commands/neural-optimize.js.map +1 -1
- package/dist/src/commands/org-observe.d.ts.map +1 -1
- package/dist/src/commands/org-observe.js +37 -30
- package/dist/src/commands/org-observe.js.map +1 -1
- package/dist/src/commands/org.d.ts.map +1 -1
- package/dist/src/commands/org.js +129 -2
- 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 +1 -11
- package/dist/src/commands/security-cve.js.map +1 -1
- package/dist/src/commands/security-misc.d.ts +0 -9
- package/dist/src/commands/security-misc.d.ts.map +1 -1
- package/dist/src/commands/security-misc.js +33 -54
- 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 +3 -11
- 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 +7 -2
- package/dist/src/commands/swarm.js.map +1 -1
- package/dist/src/commands/ui.d.ts +8 -0
- package/dist/src/commands/ui.d.ts.map +1 -0
- package/dist/src/commands/ui.js +94 -0
- package/dist/src/commands/ui.js.map +1 -0
- package/dist/src/init/claudemd-generator.d.ts.map +1 -1
- package/dist/src/init/claudemd-generator.js +7 -9
- package/dist/src/init/claudemd-generator.js.map +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.js +1 -1
- package/dist/src/init/write-capabilities.js +7 -7
- package/dist/src/init/write-capabilities.js.map +1 -1
- package/dist/src/knowledge/document-pipeline.d.ts.map +1 -1
- package/dist/src/knowledge/document-pipeline.js +1 -0
- package/dist/src/knowledge/document-pipeline.js.map +1 -1
- package/dist/src/knowledge/eval/golden-set.d.ts.map +1 -1
- package/dist/src/knowledge/eval/golden-set.js +21 -32
- package/dist/src/knowledge/eval/golden-set.js.map +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 +29 -3
- 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 +32 -19
- 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 +48 -18
- 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 +15 -10
- package/dist/src/mcp-tools/performance-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 +8 -0
- package/dist/src/memory/memory-bridge.d.ts.map +1 -1
- package/dist/src/memory/memory-bridge.js +37 -8
- 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/antigravity-runner.d.ts.map +1 -1
- package/dist/src/orgrt/antigravity-runner.js +6 -6
- package/dist/src/orgrt/antigravity-runner.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 +18 -86
- package/dist/src/orgrt/checkpoint-ops.js.map +1 -1
- package/dist/src/orgrt/checkpoint.d.ts +1 -1
- package/dist/src/orgrt/checkpoint.d.ts.map +1 -1
- package/dist/src/orgrt/checkpoint.js +3 -3
- package/dist/src/orgrt/checkpoint.js.map +1 -1
- package/dist/src/orgrt/daemon.d.ts +9 -1
- package/dist/src/orgrt/daemon.d.ts.map +1 -1
- package/dist/src/orgrt/daemon.js +267 -139
- 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/forwarder.d.ts.map +1 -1
- package/dist/src/orgrt/forwarder.js +148 -15
- package/dist/src/orgrt/forwarder.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 +27 -1
- package/dist/src/orgrt/session.d.ts.map +1 -1
- package/dist/src/orgrt/session.js +67 -6
- 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 +26 -2
- package/dist/src/orgrt/templates.js.map +1 -1
- package/dist/src/orgrt/types.d.ts +77 -1
- package/dist/src/orgrt/types.d.ts.map +1 -1
- package/dist/src/orgrt/types.js +28 -2
- 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 +38 -7
- package/dist/src/orgrt/vercel-runner.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- 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
|
@@ -6,689 +6,342 @@ description: |
|
|
|
6
6
|
|
|
7
7
|
# Hive Mind Advanced Skill
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Queen-led multi-agent coordination with shared JSON state, threshold-based voting, and a collective memory blob. Use when a task needs a declared coordinator (queen) plus N workers who must reach a documented decision before proceeding.
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## What Hive-Mind Is — and Is Not
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
**Is:** An MCP-only surface that tracks queen + workers, proposals/votes, and a shared key/value blob in a single JSON state file at `.monomind/hive-mind/state.json`. Real execution happens in Claude Code Task-tool agents; the hive only records bookkeeping.
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
### Architecture Patterns
|
|
18
|
-
|
|
19
|
-
**Queen-Led Coordination**
|
|
20
|
-
- Strategic queen agents orchestrate high-level objectives
|
|
21
|
-
- Tactical queens manage mid-level execution
|
|
22
|
-
- Adaptive queens dynamically adjust strategies based on performance
|
|
23
|
-
|
|
24
|
-
**Worker Specialization**
|
|
25
|
-
- Researcher agents: Analysis and investigation
|
|
26
|
-
- Coder agents: Implementation and development
|
|
27
|
-
- Analyst agents: Data processing and metrics
|
|
28
|
-
- Tester agents: Quality assurance and validation
|
|
29
|
-
- Architect agents: System design and planning
|
|
30
|
-
- Reviewer agents: Code review and improvement
|
|
31
|
-
- Optimizer agents: Performance enhancement
|
|
32
|
-
- Documenter agents: Documentation generation
|
|
33
|
-
|
|
34
|
-
**Collective Memory System**
|
|
35
|
-
- Shared knowledge base across all agents
|
|
36
|
-
- LRU cache with memory pressure handling
|
|
37
|
-
- SQLite persistence with WAL mode
|
|
38
|
-
- Memory consolidation and association
|
|
39
|
-
- Access pattern tracking and optimization
|
|
40
|
-
|
|
41
|
-
### Consensus Mechanisms
|
|
42
|
-
|
|
43
|
-
**Majority Consensus**
|
|
44
|
-
Simple voting where the option with most votes wins.
|
|
15
|
+
**Is not:** A distributed system. The consensus strategies (`bft` / `raft` / `quorum`) are **vote-count thresholds applied to one in-process tally** — not Raft leader election, not Byzantine agreement, not Paxos. There is no log replication, no network model, no adversarial fault model. The strategy names are kept for CLI/API compatibility; see the honesty note in `packages/@monomind/cli/src/mcp-tools/hive-mind-tools.ts:2-12`.
|
|
45
16
|
|
|
46
|
-
|
|
47
|
-
Queen vote counts as 3x weight, providing strategic guidance.
|
|
17
|
+
If you need to actually coordinate work in parallel, use `monomind swarm` (real CLI) — see "Swarm vs Hive-Mind" below.
|
|
48
18
|
|
|
49
|
-
|
|
50
|
-
Requires 2/3 majority for decision approval, ensuring robust consensus even with faulty agents.
|
|
19
|
+
## Visibility Requires `MONOMIND_MCP_SPECULATIVE=1`
|
|
51
20
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
### 1. Initialize Hive Mind
|
|
21
|
+
Only two hive-mind tools are visible to MCP clients by default: `hive-mind_status` and `hive-mind_join`. To see and call the full surface (`init`, `spawn`, `consensus`, `memory`, `broadcast`, `shutdown`, `audit_*`), the MCP server must run with:
|
|
55
22
|
|
|
56
23
|
```bash
|
|
57
|
-
|
|
58
|
-
npx monomind hive-mind init
|
|
59
|
-
|
|
60
|
-
# Force reinitialize
|
|
61
|
-
npx monomind hive-mind init --force
|
|
62
|
-
|
|
63
|
-
# Custom configuration
|
|
64
|
-
npx monomind hive-mind init --config hive-config.json
|
|
24
|
+
MONOMIND_MCP_SPECULATIVE=1
|
|
65
25
|
```
|
|
66
26
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
# Basic spawn with objective
|
|
71
|
-
npx monomind hive-mind spawn "Build microservices architecture"
|
|
72
|
-
|
|
73
|
-
# Strategic queen type
|
|
74
|
-
npx monomind hive-mind spawn "Research AI patterns" --queen-type strategic
|
|
27
|
+
If a tool returns "unknown tool" or isn't listed, this flag is missing. Set it on the `mcp start` invocation (e.g. in `claude mcp add monomind -- env MONOMIND_MCP_SPECULATIVE=1 npx -y monomind@latest mcp start`).
|
|
75
28
|
|
|
76
|
-
|
|
77
|
-
npx monomind hive-mind spawn "Implement API" --queen-type tactical --max-workers 12
|
|
29
|
+
## Core Concepts
|
|
78
30
|
|
|
79
|
-
|
|
80
|
-
npx monomind hive-mind spawn "Optimize system" --queen-type adaptive --consensus byzantine
|
|
31
|
+
### Queen / Worker Roles
|
|
81
32
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
33
|
+
- **Queen** — the agent ID recorded as hive coordinator at `hive-mind_init`. Pure bookkeeping label; the queen has no special powers in code. Strategic/tactical/adaptive "queen types" from older docs are **not implemented** — pick the queen by passing its `queenId`.
|
|
34
|
+
- **Worker** — generalist agent joined to the hive.
|
|
35
|
+
- **Specialist** — worker with a defined specialty.
|
|
36
|
+
- **Scout** — worker role for exploration / information gathering.
|
|
85
37
|
|
|
86
|
-
###
|
|
38
|
+
### Topologies (recorded on state, not enforced)
|
|
87
39
|
|
|
88
|
-
|
|
89
|
-
# Check hive mind status
|
|
90
|
-
npx monomind hive-mind status
|
|
40
|
+
`mesh`, `hierarchical`, `ring`, `star`. The topology is a label stored on the state file; nothing in the hive-mind tools routes messages differently based on it. Real coordination topology comes from how **you** spawn and instruct Task-tool agents.
|
|
91
41
|
|
|
92
|
-
|
|
93
|
-
npx monomind hive-mind metrics
|
|
42
|
+
### Consensus Strategies — Honest Definitions
|
|
94
43
|
|
|
95
|
-
|
|
96
|
-
npx monomind hive-mind memory
|
|
97
|
-
```
|
|
44
|
+
Source: `hive-mind-tools.ts:98-124` and `hive-mind_consensus` description at `hive-mind-tools.ts:662-663`.
|
|
98
45
|
|
|
99
|
-
|
|
46
|
+
| Strategy | Required votes to resolve | Tolerates | Notes |
|
|
47
|
+
|---|---|---|---|
|
|
48
|
+
| `bft` (CLI alias: `byzantine`) | `floor(2n/3) + 1` | `f < n/3` "faulty" voters | Cross-proposal conflicting votes are flagged in `byzantineVoters`. Still a single-process tally. |
|
|
49
|
+
| `raft` | `floor(n/2) + 1` (majority) | `f < n/2` | One pending proposal per `term`. Re-proposal timeout defaults to 30s. No leader election. |
|
|
50
|
+
| `quorum` | Configurable preset | depends on preset | Presets: `majority`, `supermajority`, `unanimous`. `unanimous` rejects on the first dissent. |
|
|
100
51
|
|
|
101
|
-
|
|
52
|
+
**Not implemented:** `gossip` and `crdt`. Passing them to `hive-mind_init` or `hive-mind_consensus` returns an explicit error.
|
|
102
53
|
|
|
103
|
-
**
|
|
54
|
+
**O-Information anti-groupthink gate** (`minDivergenceRounds`, optional): forces a proposal to wait through N rounds of non-unanimous votes before it can resolve, even if the threshold is already met. Source: arXiv:2510.05174. Off by default.
|
|
104
55
|
|
|
105
|
-
|
|
106
|
-
# List active sessions
|
|
107
|
-
npx monomind hive-mind sessions
|
|
108
|
-
|
|
109
|
-
# Pause a session
|
|
110
|
-
npx monomind hive-mind pause <session-id>
|
|
56
|
+
## Swarm vs Hive-Mind — Pick the Right Surface
|
|
111
57
|
|
|
112
|
-
|
|
113
|
-
|
|
58
|
+
| Need | Use |
|
|
59
|
+
|---|---|
|
|
60
|
+
| Real CLI to register agents, set topology, run an objective | `monomind swarm init/start/status/stop` (real commands) |
|
|
61
|
+
| Threshold-vote a decision and keep an audit trail | `mcp__monomind__hive-mind_*` (this skill) |
|
|
62
|
+
| Both at once | Initialize a swarm for execution **and** a hive-mind for the decision record |
|
|
114
63
|
|
|
115
|
-
|
|
116
|
-
npx monomind hive-mind stop <session-id>
|
|
117
|
-
```
|
|
64
|
+
Hive-mind tools do **not** spawn processes. `hive-mind_spawn` writes agent records into the agent store and joins their IDs to the hive state file — actual work happens in Task-tool agents you start yourself.
|
|
118
65
|
|
|
119
|
-
|
|
120
|
-
- Automatic checkpoint creation
|
|
121
|
-
- Progress tracking with completion percentages
|
|
122
|
-
- Parent-child process management
|
|
123
|
-
- Session logs with event tracking
|
|
124
|
-
- Export/import capabilities
|
|
66
|
+
## MCP Tool Reference
|
|
125
67
|
|
|
126
|
-
|
|
68
|
+
All tools are called as `mcp__monomind__<tool_name>` from inside Claude Code.
|
|
127
69
|
|
|
128
|
-
|
|
70
|
+
### Lifecycle
|
|
129
71
|
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
// - confidence: Vote percentage
|
|
140
|
-
// - votes: Individual agent votes
|
|
72
|
+
```
|
|
73
|
+
mcp__monomind__hive-mind_init {
|
|
74
|
+
topology: "mesh" | "hierarchical" | "ring" | "star", // default: mesh
|
|
75
|
+
queenId: "<agent-id>", // default: queen-<ts>
|
|
76
|
+
consensus: "byzantine" | "bft" | "raft" | "quorum", // default: byzantine
|
|
77
|
+
maxAgents: 15, // default: 15
|
|
78
|
+
persist: true,
|
|
79
|
+
memoryBackend: "hybrid"
|
|
80
|
+
}
|
|
141
81
|
```
|
|
142
82
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
1. **Majority** - Simple democratic voting
|
|
146
|
-
2. **Weighted** - Queen has 3x voting power
|
|
147
|
-
3. **Byzantine** - 2/3 supermajority required
|
|
148
|
-
|
|
149
|
-
### Collective Memory
|
|
150
|
-
|
|
151
|
-
**Storing Knowledge**
|
|
83
|
+
Persists `state.json` with empty workers. Returns `hiveId`, elected queen, and the resolved consensus strategy. The strategy chosen here governs `hive-mind_consensus` propose/vote when the caller doesn't pass one explicitly.
|
|
152
84
|
|
|
153
|
-
```javascript
|
|
154
|
-
// Store in collective memory
|
|
155
|
-
await memory.store('api-patterns', {
|
|
156
|
-
rest: { pros: [...], cons: [...] },
|
|
157
|
-
graphql: { pros: [...], cons: [...] }
|
|
158
|
-
}, 'knowledge', { confidence: 0.95 });
|
|
159
85
|
```
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
-
|
|
165
|
-
|
|
166
|
-
- `error`: Error logs (24 hour TTL)
|
|
167
|
-
- `metric`: Performance metrics (1 hour TTL)
|
|
168
|
-
- `consensus`: Decision records (permanent)
|
|
169
|
-
- `system`: System configuration (permanent)
|
|
170
|
-
|
|
171
|
-
**Searching and Retrieval**
|
|
172
|
-
|
|
173
|
-
```javascript
|
|
174
|
-
// Search memory by pattern
|
|
175
|
-
const results = await memory.search('api*', {
|
|
176
|
-
type: 'knowledge',
|
|
177
|
-
minConfidence: 0.8,
|
|
178
|
-
limit: 50
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
// Get related memories
|
|
182
|
-
const related = await memory.getRelated('api-patterns', 10);
|
|
183
|
-
|
|
184
|
-
// Build associations
|
|
185
|
-
await memory.associate('rest-api', 'authentication', 0.9);
|
|
86
|
+
mcp__monomind__hive-mind_spawn {
|
|
87
|
+
count: 1, // 1-20 per call
|
|
88
|
+
role: "worker" | "specialist" | "scout", // default: worker
|
|
89
|
+
agentType: "worker", // recorded on agent record
|
|
90
|
+
prefix: "hive-worker" // agent-id prefix
|
|
91
|
+
}
|
|
186
92
|
```
|
|
187
93
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
**Automatic Worker Assignment**
|
|
191
|
-
|
|
192
|
-
The system intelligently assigns tasks based on:
|
|
193
|
-
- Keyword matching with agent specialization
|
|
194
|
-
- Historical performance metrics
|
|
195
|
-
- Worker availability and load
|
|
196
|
-
- Task complexity analysis
|
|
94
|
+
Creates agent records **and** joins them to the hive in one call. Caps: 20 workers per call, 100 workers max in the hive.
|
|
197
95
|
|
|
198
|
-
```javascript
|
|
199
|
-
// Create task (auto-assigned)
|
|
200
|
-
const task = await hiveMind.createTask(
|
|
201
|
-
'Implement user authentication',
|
|
202
|
-
priority: 8,
|
|
203
|
-
{ estimatedDuration: 30000 }
|
|
204
|
-
);
|
|
205
96
|
```
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
```javascript
|
|
210
|
-
// Configure auto-scaling
|
|
211
|
-
const config = {
|
|
212
|
-
autoScale: true,
|
|
213
|
-
maxWorkers: 12,
|
|
214
|
-
scaleUpThreshold: 2, // Pending tasks per idle worker
|
|
215
|
-
scaleDownThreshold: 2 // Idle workers above pending tasks
|
|
216
|
-
};
|
|
97
|
+
mcp__monomind__hive-mind_join { agentId, role } // join an existing agent
|
|
98
|
+
mcp__monomind__hive-mind_leave { agentId } // remove from hive
|
|
217
99
|
```
|
|
218
100
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
### With Claude Code
|
|
101
|
+
Use `join` when the agent was created elsewhere (e.g. via `monomind agent spawn`). `agentId` must match `^[a-zA-Z0-9_-]+$` and is capped at 128 chars.
|
|
222
102
|
|
|
223
|
-
Generate Claude Code spawn commands directly:
|
|
224
|
-
|
|
225
|
-
```bash
|
|
226
|
-
npx monomind hive-mind spawn "Build REST API" --claude
|
|
227
103
|
```
|
|
228
|
-
|
|
229
|
-
Output:
|
|
230
|
-
```javascript
|
|
231
|
-
Task("Queen Coordinator", "Orchestrate REST API development...", "coordinator")
|
|
232
|
-
Task("Backend Developer", "Implement Express routes...", "backend-dev")
|
|
233
|
-
Task("Database Architect", "Design PostgreSQL schema...", "code-analyzer")
|
|
234
|
-
Task("Test Engineer", "Create Jest test suite...", "tester")
|
|
104
|
+
mcp__monomind__hive-mind_shutdown { graceful: true, force: false }
|
|
235
105
|
```
|
|
236
106
|
|
|
237
|
-
|
|
107
|
+
Removes worker records from the agent store and clears pending proposals. Graceful shutdown refuses to run with pending proposals unless `force: true`. Consensus **history** is kept for audit.
|
|
238
108
|
|
|
239
|
-
|
|
240
|
-
# Repository analysis with hive mind
|
|
241
|
-
npx monomind hive-mind spawn "Analyze repo quality" --objective "owner/repo"
|
|
109
|
+
### Status & Memory
|
|
242
110
|
|
|
243
|
-
|
|
244
|
-
|
|
111
|
+
```
|
|
112
|
+
mcp__monomind__hive-mind_status { verbose: false }
|
|
245
113
|
```
|
|
246
114
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
### Memory Optimization
|
|
250
|
-
|
|
251
|
-
The collective memory system includes advanced optimizations:
|
|
252
|
-
|
|
253
|
-
**LRU Cache**
|
|
254
|
-
- Configurable cache size (default: 1000 entries)
|
|
255
|
-
- Memory pressure handling (default: 50MB)
|
|
256
|
-
- Automatic eviction of least-used entries
|
|
257
|
-
|
|
258
|
-
**Database Optimization**
|
|
259
|
-
- WAL (Write-Ahead Logging) mode
|
|
260
|
-
- 64MB cache size
|
|
261
|
-
- 256MB memory mapping
|
|
262
|
-
- Prepared statements for common queries
|
|
263
|
-
- Automatic ANALYZE and OPTIMIZE
|
|
264
|
-
|
|
265
|
-
**Object Pooling**
|
|
266
|
-
- Query result pooling
|
|
267
|
-
- Memory entry pooling
|
|
268
|
-
- Reduced garbage collection pressure
|
|
269
|
-
|
|
270
|
-
### Performance Metrics
|
|
271
|
-
|
|
272
|
-
```javascript
|
|
273
|
-
// Get performance insights
|
|
274
|
-
const insights = hiveMind.getPerformanceInsights();
|
|
115
|
+
Returns hive state: queen, worker count, pending/history proposals, and task counters computed from the task store.
|
|
275
116
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
//
|
|
280
|
-
//
|
|
281
|
-
|
|
117
|
+
```
|
|
118
|
+
mcp__monomind__hive-mind_memory {
|
|
119
|
+
action: "get" | "set" | "delete" | "list",
|
|
120
|
+
key: "<string>", // required for get/set/delete, ≤256 chars
|
|
121
|
+
value: <any> // required for set, ≤1 MiB string or any JSON
|
|
122
|
+
}
|
|
282
123
|
```
|
|
283
124
|
|
|
284
|
-
|
|
125
|
+
Plain key/value blob on `state.sharedMemory`. Bounded: 1000 keys max, 1 MiB per string value. `set` also mirrors the entry into the searchable memory bridge (`namespace: hive-memory`) so `memory search` can find it. This is **not** a replicated KV store — it's JSON on disk.
|
|
285
126
|
|
|
286
|
-
|
|
287
|
-
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
127
|
+
```
|
|
128
|
+
mcp__monomind__hive-mind_broadcast {
|
|
129
|
+
message: "<text>", // ≤1 MiB
|
|
130
|
+
priority: "low" | "normal" | "high" | "critical",
|
|
131
|
+
fromId: "<agent-id>"
|
|
132
|
+
}
|
|
133
|
+
```
|
|
291
134
|
|
|
292
|
-
**
|
|
293
|
-
- 10-20x faster batch spawning
|
|
294
|
-
- 2.8-4.4x speed improvement overall
|
|
295
|
-
- 32.3% token reduction
|
|
296
|
-
- 84.8% SWE-Bench solve rate
|
|
135
|
+
Appends to a capped 100-entry noticeboard on `state.sharedMemory.broadcasts`. **Not message delivery** — no listener is notified. A worker sees a broadcast only when something later reads `hive-mind_status` or `hive-mind_memory get`. `recipients` in the response is just `state.workers.length`.
|
|
297
136
|
|
|
298
|
-
|
|
137
|
+
### Consensus
|
|
299
138
|
|
|
300
|
-
### Hive Mind Config
|
|
301
|
-
|
|
302
|
-
```javascript
|
|
303
|
-
{
|
|
304
|
-
"objective": "Build microservices",
|
|
305
|
-
"name": "my-hive",
|
|
306
|
-
"queenType": "strategic", // strategic | tactical | adaptive
|
|
307
|
-
"maxWorkers": 8,
|
|
308
|
-
"consensusAlgorithm": "byzantine", // majority | weighted | byzantine
|
|
309
|
-
"autoScale": true,
|
|
310
|
-
"memorySize": 100, // MB
|
|
311
|
-
"taskTimeout": 60, // minutes
|
|
312
|
-
"encryption": false
|
|
313
|
-
}
|
|
314
139
|
```
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
"
|
|
321
|
-
"
|
|
322
|
-
"
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
140
|
+
mcp__monomind__hive-mind_consensus {
|
|
141
|
+
action: "propose" | "vote" | "status" | "list",
|
|
142
|
+
// propose:
|
|
143
|
+
type: "<proposal-type>", // ≤128 chars, e.g. "architecture"
|
|
144
|
+
value: <any>, // ≤64 KiB if string
|
|
145
|
+
voterId: "<agent-id>", // recorded as proposedBy
|
|
146
|
+
strategy: "bft" | "raft" | "quorum", // default: from hive-mind_init, then "raft"
|
|
147
|
+
quorumPreset: "majority" | "supermajority" | "unanimous",
|
|
148
|
+
term: 1, // raft only
|
|
149
|
+
timeoutMs: 30000, // raft re-proposal timeout
|
|
150
|
+
minDivergenceRounds: 0, // O-Information gate, default 0 (off)
|
|
151
|
+
// vote / status:
|
|
152
|
+
proposalId: "<id>",
|
|
153
|
+
vote: true | false
|
|
327
154
|
}
|
|
328
155
|
```
|
|
329
156
|
|
|
330
|
-
|
|
157
|
+
**propose** creates a pending proposal, computes required votes from current worker count, and (for raft) blocks duplicate proposals in the same term. **vote** records a boolean vote and tries to resolve: approved if `votesFor >= required`, rejected if `votesAgainst >= required` (or, for `unanimous`, on any dissent). Deadlock (neither side can reach threshold) rejects. **status** / **list** read pending and historical proposals.
|
|
331
158
|
|
|
332
|
-
|
|
159
|
+
Each resolved decision is HMAC-signed and appended to a tamper-evident JSONL audit trail at `.monomind/consensus/`. The signing secret comes from `MONOMIND_SESSION_SECRET` if set, otherwise a per-project generated secret at `.monomind/hive-mind/session-secret`.
|
|
333
160
|
|
|
334
|
-
|
|
335
|
-
- Auto-assign agents by file type
|
|
336
|
-
- Validate objective complexity
|
|
337
|
-
- Optimize topology selection
|
|
338
|
-
- Cache search patterns
|
|
161
|
+
### Audit
|
|
339
162
|
|
|
340
|
-
|
|
341
|
-
-
|
|
342
|
-
-
|
|
343
|
-
|
|
344
|
-
- Analyze performance bottlenecks
|
|
163
|
+
```
|
|
164
|
+
mcp__monomind__hive-mind_audit_list { swarmId?, limit: 50 } // max 500
|
|
165
|
+
mcp__monomind__hive-mind_audit_verify { decisionId }
|
|
166
|
+
```
|
|
345
167
|
|
|
346
|
-
|
|
347
|
-
- Generate session summaries
|
|
348
|
-
- Persist checkpoint data
|
|
349
|
-
- Track comprehensive metrics
|
|
350
|
-
- Restore execution context
|
|
168
|
+
List signed decision records, or verify that all vote signatures and the record signature on a specific decision still validate against the project secret.
|
|
351
169
|
|
|
352
|
-
##
|
|
170
|
+
## Workflow Patterns
|
|
353
171
|
|
|
354
|
-
### 1
|
|
172
|
+
### Pattern 1: Decide-then-Build (queen + workers + vote)
|
|
355
173
|
|
|
356
|
-
|
|
357
|
-
```bash
|
|
358
|
-
npx monomind hive-mind spawn "Research ML frameworks" --queen-type strategic
|
|
359
|
-
```
|
|
360
|
-
|
|
361
|
-
**Tactical Queens** - For implementation and execution
|
|
362
|
-
```bash
|
|
363
|
-
npx monomind hive-mind spawn "Build authentication" --queen-type tactical
|
|
364
|
-
```
|
|
365
|
-
|
|
366
|
-
**Adaptive Queens** - For optimization and dynamic tasks
|
|
367
|
-
```bash
|
|
368
|
-
npx monomind hive-mind spawn "Optimize performance" --queen-type adaptive
|
|
369
|
-
```
|
|
174
|
+
Use when an architectural choice must be documented before implementation begins.
|
|
370
175
|
|
|
371
|
-
### 2. Leverage Consensus
|
|
372
|
-
|
|
373
|
-
Use consensus for critical decisions:
|
|
374
|
-
- Architecture pattern selection
|
|
375
|
-
- Technology stack choices
|
|
376
|
-
- Implementation approach
|
|
377
|
-
- Code review approval
|
|
378
|
-
- Release readiness
|
|
379
|
-
|
|
380
|
-
### 3. Utilize Collective Memory
|
|
381
|
-
|
|
382
|
-
**Store Learnings**
|
|
383
|
-
```javascript
|
|
384
|
-
// After successful pattern implementation
|
|
385
|
-
await memory.store('auth-pattern', {
|
|
386
|
-
approach: 'JWT with refresh tokens',
|
|
387
|
-
pros: ['Stateless', 'Scalable'],
|
|
388
|
-
cons: ['Token size', 'Revocation complexity'],
|
|
389
|
-
implementation: {...}
|
|
390
|
-
}, 'knowledge', { confidence: 0.95 });
|
|
391
176
|
```
|
|
177
|
+
# 1. Initialize hive with a known queen and byzantine threshold
|
|
178
|
+
mcp__monomind__hive-mind_init {
|
|
179
|
+
topology: "hierarchical",
|
|
180
|
+
queenId: "architect-1",
|
|
181
|
+
consensus: "byzantine"
|
|
182
|
+
}
|
|
392
183
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
// Link related concepts
|
|
396
|
-
await memory.associate('jwt-auth', 'refresh-tokens', 0.9);
|
|
397
|
-
await memory.associate('jwt-auth', 'oauth2', 0.7);
|
|
398
|
-
```
|
|
184
|
+
# 2. Spawn or join workers (specialist role for SMEs)
|
|
185
|
+
mcp__monomind__hive-mind_spawn { count: 4, role: "specialist", agentType: "reviewer" }
|
|
399
186
|
|
|
400
|
-
|
|
187
|
+
# 3. Queen proposes the architecture decision
|
|
188
|
+
mcp__monomind__hive-mind_consensus {
|
|
189
|
+
action: "propose",
|
|
190
|
+
type: "architecture",
|
|
191
|
+
value: { pattern: "modular-monolith", modules: ["auth","billing","shipping"] },
|
|
192
|
+
voterId: "architect-1"
|
|
193
|
+
}
|
|
194
|
+
# → returns proposalId
|
|
401
195
|
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
196
|
+
# 4. Each worker votes (in parallel Task-tool agents)
|
|
197
|
+
mcp__monomind__hive-mind_consensus {
|
|
198
|
+
action: "vote", proposalId: "<id>",
|
|
199
|
+
vote: true, voterId: "reviewer-2"
|
|
200
|
+
}
|
|
405
201
|
|
|
406
|
-
#
|
|
407
|
-
|
|
202
|
+
# 5. Once threshold reached, store the decision rationale
|
|
203
|
+
mcp__monomind__hive-mind_memory {
|
|
204
|
+
action: "set", key: "decision-architecture-v1",
|
|
205
|
+
value: { summary: "...", proposalId: "<id>", decidedAt: "..." }
|
|
206
|
+
}
|
|
408
207
|
|
|
409
|
-
#
|
|
410
|
-
|
|
208
|
+
# 6. Spin up a real swarm to execute, sharing the decision via memory namespace
|
|
209
|
+
# (CLI)
|
|
210
|
+
npx monomind@latest swarm init --topology hierarchical --max-agents 6
|
|
211
|
+
npx monomind@latest swarm start --objective "Implement modular monolith per decision-architecture-v1"
|
|
411
212
|
```
|
|
412
213
|
|
|
413
|
-
###
|
|
214
|
+
### Pattern 2: Release Gate (raft majority for go/no-go)
|
|
414
215
|
|
|
415
|
-
**Checkpoint Frequently**
|
|
416
|
-
```javascript
|
|
417
|
-
// Create checkpoints at key milestones
|
|
418
|
-
await sessionManager.saveCheckpoint(
|
|
419
|
-
sessionId,
|
|
420
|
-
'api-routes-complete',
|
|
421
|
-
{ completedRoutes: [...], remaining: [...] }
|
|
422
|
-
);
|
|
423
216
|
```
|
|
217
|
+
mcp__monomind__hive-mind_init { topology: "star", queenId: "release-manager", consensus: "raft" }
|
|
218
|
+
mcp__monomind__hive-mind_spawn { count: 3, role: "specialist", agentType: "reviewer" }
|
|
424
219
|
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
220
|
+
# One proposal per term — propose "ship v2.9.5"
|
|
221
|
+
mcp__monomind__hive-mind_consensus {
|
|
222
|
+
action: "propose", type: "release-gate",
|
|
223
|
+
value: { version: "2.9.5" }, voterId: "release-manager", term: 1
|
|
224
|
+
}
|
|
225
|
+
# Reviewers vote; majority of 4 nodes = 3 votes needed
|
|
429
226
|
```
|
|
430
227
|
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
### Memory Issues
|
|
434
|
-
|
|
435
|
-
**High Memory Usage**
|
|
436
|
-
```bash
|
|
437
|
-
# Run garbage collection
|
|
438
|
-
npx monomind hive-mind memory --gc
|
|
228
|
+
If the term times out (30s default), re-propose with `term: 2`.
|
|
439
229
|
|
|
440
|
-
|
|
441
|
-
npx monomind hive-mind memory --optimize
|
|
230
|
+
### Pattern 3: Unanimous Consent (quorum/unanimous for high-bar decisions)
|
|
442
231
|
|
|
443
|
-
# Export and clear
|
|
444
|
-
npx monomind hive-mind memory --export --clear
|
|
445
232
|
```
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
{
|
|
451
|
-
"cacheSize": 2000,
|
|
452
|
-
"cacheMemoryMB": 100
|
|
233
|
+
mcp__monomind__hive-mind_consensus {
|
|
234
|
+
action: "propose", type: "policy-change",
|
|
235
|
+
value: "...", strategy: "quorum", quorumPreset: "unanimous",
|
|
236
|
+
voterId: "queen-1"
|
|
453
237
|
}
|
|
238
|
+
# Any single dissent rejects the proposal immediately.
|
|
454
239
|
```
|
|
455
240
|
|
|
456
|
-
###
|
|
241
|
+
### Pattern 4: Shared Scratchpad (no voting, just memory)
|
|
457
242
|
|
|
458
|
-
|
|
459
|
-
```javascript
|
|
460
|
-
// Enable worker type caching
|
|
461
|
-
// The system caches best worker matches for 5 minutes
|
|
462
|
-
// Automatic - no configuration needed
|
|
463
|
-
```
|
|
243
|
+
For loose coordination without a formal vote — skip consensus entirely.
|
|
464
244
|
|
|
465
|
-
**High Queue Utilization**
|
|
466
|
-
```javascript
|
|
467
|
-
// Increase async queue concurrency
|
|
468
|
-
{
|
|
469
|
-
"asyncQueueConcurrency": 20 // Default: min(maxWorkers * 2, 20)
|
|
470
|
-
}
|
|
471
245
|
```
|
|
246
|
+
mcp__monomind__hive-mind_init { topology: "mesh", queenId: "coord-1", consensus: "raft" }
|
|
247
|
+
mcp__monomind__hive-mind_join { agentId: "agent-a", role: "worker" }
|
|
248
|
+
mcp__monomind__hive-mind_join { agentId: "agent-b", role: "worker" }
|
|
472
249
|
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
```bash
|
|
477
|
-
# Switch to weighted consensus for more decisive results
|
|
478
|
-
npx monomind hive-mind spawn "..." --consensus weighted
|
|
479
|
-
|
|
480
|
-
# Or use simple majority
|
|
481
|
-
npx monomind hive-mind spawn "..." --consensus majority
|
|
250
|
+
# Agents write findings into shared memory via MCP, in their Task-tool bodies
|
|
251
|
+
mcp__monomind__hive-mind_memory { action: "set", key: "auth-findings", value: { ... } }
|
|
252
|
+
mcp__monomind__hive-mind_memory { action: "list" }
|
|
482
253
|
```
|
|
483
254
|
|
|
484
|
-
##
|
|
255
|
+
## Configuration
|
|
485
256
|
|
|
486
|
-
|
|
257
|
+
The hive config is the `state.json` written by `hive-mind_init`. There is no separate config file. Notable fields persisted:
|
|
487
258
|
|
|
488
|
-
|
|
259
|
+
| Field | Meaning |
|
|
260
|
+
|---|---|
|
|
261
|
+
| `hiveId` | Random `hive-<ts>-<rand>` identifier |
|
|
262
|
+
| `topology` | One of `mesh` / `hierarchical` / `ring` / `star` (label only) |
|
|
263
|
+
| `queen` | `{ agentId, electedAt, term }` |
|
|
264
|
+
| `consensusStrategy` | `bft` / `raft` / `quorum` — the default for `hive-mind_consensus` |
|
|
265
|
+
| `workers` | Array of joined agent IDs (≤100) |
|
|
266
|
+
| `sharedMemory` | Free-form key/value object (≤1000 keys) |
|
|
267
|
+
| `consensus.pending` / `consensus.history` | Open and resolved proposals (history capped at 1000) |
|
|
489
268
|
|
|
490
|
-
|
|
491
|
-
name: security-auditor
|
|
492
|
-
type: specialist
|
|
493
|
-
capabilities:
|
|
494
|
-
- vulnerability-scanning
|
|
495
|
-
- security-review
|
|
496
|
-
- penetration-testing
|
|
497
|
-
- compliance-checking
|
|
498
|
-
priority: high
|
|
499
|
-
```
|
|
269
|
+
Hive state file is capped at 10 MiB; larger files are treated as corrupt and reset to defaults.
|
|
500
270
|
|
|
501
|
-
|
|
271
|
+
## Best Practices
|
|
502
272
|
|
|
503
|
-
|
|
273
|
+
### 1. Pick the strategy by decision shape
|
|
504
274
|
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
// Improves future task matching
|
|
510
|
-
```
|
|
275
|
+
- **High-bar policy / breaking change** → `quorum` with `unanimous` or `supermajority`
|
|
276
|
+
- **Adversarial review with distrusted input** → `bft` (raises threshold to 2/3, flags conflicting voters)
|
|
277
|
+
- **Standard majority decision** → `raft` (simple majority, one proposal per term)
|
|
278
|
+
- **Quick informal coordination** → skip consensus, use `hive-mind_memory` only
|
|
511
279
|
|
|
512
|
-
###
|
|
280
|
+
### 2. Initialize before spawn/join
|
|
513
281
|
|
|
514
|
-
|
|
282
|
+
`spawn`, `join`, `consensus`, `broadcast`, and `memory` all error with `"Hive-mind not initialized"` until `hive-mind_init` has written `state.json`.
|
|
515
283
|
|
|
516
|
-
|
|
517
|
-
# Frontend hive
|
|
518
|
-
npx monomind hive-mind spawn "Build UI" --name frontend-hive
|
|
284
|
+
### 3. Set `MONOMIND_MCP_SPECULATIVE=1` once, up front
|
|
519
285
|
|
|
520
|
-
|
|
521
|
-
npx monomind hive-mind spawn "Build API" --name backend-hive
|
|
286
|
+
Without it only `status` and `join` are exposed. If `init`, `spawn`, `consensus`, `memory`, `broadcast`, `shutdown`, or `audit_*` are reported as unknown tools, the flag is missing.
|
|
522
287
|
|
|
523
|
-
|
|
524
|
-
```
|
|
288
|
+
### 4. Real parallelism comes from Task-tool agents
|
|
525
289
|
|
|
526
|
-
|
|
290
|
+
`hive-mind_spawn` writes records; it does not start anything. For each worker, spawn a Task-tool agent with `run_in_background: true` in **one** message, and let each agent call `hive-mind_consensus vote` / `hive-mind_memory set` via MCP from inside its work.
|
|
527
291
|
|
|
528
|
-
|
|
529
|
-
# Export session for backup
|
|
530
|
-
npx monomind hive-mind export <session-id> --output backup.json
|
|
292
|
+
### 5. Don't use the broadcast tool as a message bus
|
|
531
293
|
|
|
532
|
-
|
|
533
|
-
npx monomind hive-mind import backup.json
|
|
534
|
-
```
|
|
294
|
+
`hive-mind_broadcast` is a noticeboard, not delivery. For real task assignment use `mcp__monomind__task_create` / `task_assign`, or pass instructions in each Task-tool agent's prompt directly.
|
|
535
295
|
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
### HiveMindCore
|
|
539
|
-
|
|
540
|
-
```javascript
|
|
541
|
-
const hiveMind = new HiveMindCore({
|
|
542
|
-
objective: 'Build system',
|
|
543
|
-
queenType: 'strategic',
|
|
544
|
-
maxWorkers: 8,
|
|
545
|
-
consensusAlgorithm: 'byzantine'
|
|
546
|
-
});
|
|
547
|
-
|
|
548
|
-
await hiveMind.initialize();
|
|
549
|
-
await hiveMind.spawnQueen(queenData);
|
|
550
|
-
await hiveMind.spawnWorkers(['coder', 'tester']);
|
|
551
|
-
await hiveMind.createTask('Implement feature', 7);
|
|
552
|
-
const decision = await hiveMind.buildConsensus('topic', options);
|
|
553
|
-
const status = hiveMind.getStatus();
|
|
554
|
-
await hiveMind.shutdown();
|
|
555
|
-
```
|
|
296
|
+
### 6. Verify important decisions cryptographically
|
|
556
297
|
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
```javascript
|
|
560
|
-
const memory = new CollectiveMemory({
|
|
561
|
-
swarmId: 'hive-123',
|
|
562
|
-
maxSize: 100,
|
|
563
|
-
cacheSize: 1000
|
|
564
|
-
});
|
|
565
|
-
|
|
566
|
-
await memory.store(key, value, type, metadata);
|
|
567
|
-
const data = await memory.retrieve(key);
|
|
568
|
-
const results = await memory.search(pattern, options);
|
|
569
|
-
const related = await memory.getRelated(key, limit);
|
|
570
|
-
await memory.associate(key1, key2, strength);
|
|
571
|
-
const stats = memory.getStatistics();
|
|
572
|
-
const analytics = memory.getAnalytics();
|
|
573
|
-
const health = await memory.healthCheck();
|
|
574
|
-
```
|
|
298
|
+
For any decision that will be cited later (release gates, architecture calls), record the `decisionId` and run `hive-mind_audit_verify` after the fact to prove the vote signatures still validate.
|
|
575
299
|
|
|
576
|
-
|
|
300
|
+
## Troubleshooting
|
|
577
301
|
|
|
578
|
-
|
|
579
|
-
const sessionManager = new HiveMindSessionManager();
|
|
302
|
+
### "Hive-mind not initialized"
|
|
580
303
|
|
|
581
|
-
|
|
582
|
-
swarmId, swarmName, objective, metadata
|
|
583
|
-
);
|
|
304
|
+
Run `mcp__monomind__hive-mind_init` first. The state file lives at `.monomind/hive-mind/state.json` — if it's missing or >10 MiB, the hive resets to the uninitialized default.
|
|
584
305
|
|
|
585
|
-
|
|
586
|
-
const sessions = await sessionManager.getActiveSessions();
|
|
587
|
-
const session = await sessionManager.getSession(sessionId);
|
|
588
|
-
await sessionManager.pauseSession(sessionId);
|
|
589
|
-
await sessionManager.resumeSession(sessionId);
|
|
590
|
-
await sessionManager.stopSession(sessionId);
|
|
591
|
-
await sessionManager.completeSession(sessionId);
|
|
592
|
-
```
|
|
306
|
+
### "Consensus strategy X is not implemented"
|
|
593
307
|
|
|
594
|
-
|
|
308
|
+
`gossip` and `crdt` are rejected. Use `bft`, `raft`, or `quorum` (`byzantine` is accepted as an alias for `bft` at init time only).
|
|
595
309
|
|
|
596
|
-
###
|
|
310
|
+
### "Raft term N already has a pending proposal"
|
|
597
311
|
|
|
598
|
-
|
|
599
|
-
# Initialize hive mind
|
|
600
|
-
npx monomind hive-mind init
|
|
601
|
-
|
|
602
|
-
# Spawn full-stack hive
|
|
603
|
-
npx monomind hive-mind spawn "Build e-commerce platform" \
|
|
604
|
-
--queen-type strategic \
|
|
605
|
-
--max-workers 10 \
|
|
606
|
-
--consensus weighted \
|
|
607
|
-
--claude
|
|
608
|
-
|
|
609
|
-
# Output generates Claude Code commands:
|
|
610
|
-
# - Queen coordinator
|
|
611
|
-
# - Frontend developers (React)
|
|
612
|
-
# - Backend developers (Node.js)
|
|
613
|
-
# - Database architects
|
|
614
|
-
# - DevOps engineers
|
|
615
|
-
# - Security auditors
|
|
616
|
-
# - Test engineers
|
|
617
|
-
# - Documentation specialists
|
|
618
|
-
```
|
|
312
|
+
Either wait for the current proposal in that term to resolve, re-propose with a higher `term`, or switch strategy. One pending raft proposal per term is allowed.
|
|
619
313
|
|
|
620
|
-
###
|
|
314
|
+
### "Cannot gracefully shutdown with N pending consensus items"
|
|
621
315
|
|
|
622
|
-
|
|
623
|
-
# Spawn research hive
|
|
624
|
-
npx monomind hive-mind spawn "Research GraphQL vs REST" \
|
|
625
|
-
--queen-type adaptive \
|
|
626
|
-
--consensus byzantine
|
|
627
|
-
|
|
628
|
-
# Researchers gather data
|
|
629
|
-
# Analysts process findings
|
|
630
|
-
# Queen builds consensus on recommendation
|
|
631
|
-
# Results stored in collective memory
|
|
632
|
-
```
|
|
316
|
+
Resolve the proposals (vote them through or let them reject) or pass `force: true`.
|
|
633
317
|
|
|
634
|
-
###
|
|
318
|
+
### "Shared memory full (max 1000 keys)"
|
|
635
319
|
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
--queen-type tactical \
|
|
640
|
-
--max-workers 6
|
|
641
|
-
|
|
642
|
-
# Spawns:
|
|
643
|
-
# - Code analyzers
|
|
644
|
-
# - Security reviewers
|
|
645
|
-
# - Performance reviewers
|
|
646
|
-
# - Test coverage analyzers
|
|
647
|
-
# - Documentation reviewers
|
|
648
|
-
# - Consensus on approval/changes
|
|
649
|
-
```
|
|
320
|
+
Delete unused keys with `hive-mind_memory delete`, or move bulk context to the regular memory store (`mcp__monomind__memory_store`) under a hive namespace.
|
|
321
|
+
|
|
322
|
+
### Tool isn't visible
|
|
650
323
|
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
### Beginner
|
|
654
|
-
1. Initialize hive mind
|
|
655
|
-
2. Spawn basic swarms
|
|
656
|
-
3. Monitor status
|
|
657
|
-
4. Use majority consensus
|
|
658
|
-
|
|
659
|
-
### Intermediate
|
|
660
|
-
1. Configure queen types
|
|
661
|
-
2. Implement session management
|
|
662
|
-
3. Use weighted consensus
|
|
663
|
-
4. Access collective memory
|
|
664
|
-
5. Enable auto-scaling
|
|
665
|
-
|
|
666
|
-
### Advanced
|
|
667
|
-
1. Byzantine fault tolerance
|
|
668
|
-
2. Memory optimization
|
|
669
|
-
3. Custom worker types
|
|
670
|
-
4. Multi-hive coordination
|
|
671
|
-
5. Neural pattern training
|
|
672
|
-
6. Session export/import
|
|
673
|
-
7. Performance tuning
|
|
324
|
+
Set `MONOMIND_MCP_SPECULATIVE=1` on the MCP server process. Only `hive-mind_status` and `hive-mind_join` are unconditionally visible.
|
|
674
325
|
|
|
675
326
|
## Related Skills
|
|
676
327
|
|
|
677
|
-
- `swarm-orchestration
|
|
678
|
-
- `
|
|
679
|
-
- `
|
|
680
|
-
- `
|
|
328
|
+
- `swarm-orchestration` — real CLI swarm coordination (the execution side)
|
|
329
|
+
- `swarm-advanced` — advanced swarm patterns
|
|
330
|
+
- `mastermind-debug` — systematic root-cause debugging protocol
|
|
331
|
+
- `verification-quality` — truth scoring and rollback
|
|
681
332
|
|
|
682
333
|
## References
|
|
683
334
|
|
|
684
|
-
-
|
|
685
|
-
-
|
|
686
|
-
-
|
|
687
|
-
-
|
|
335
|
+
- Implementation: `packages/@monomind/cli/src/mcp-tools/hive-mind-tools.ts`
|
|
336
|
+
- Honest scope note: `hive-mind-tools.ts:2-12`
|
|
337
|
+
- Vote-threshold math: `hive-mind-tools.ts:98-124`
|
|
338
|
+
- Consensus description: `hive-mind-tools.ts:662-663`
|
|
339
|
+
- State file: `.monomind/hive-mind/state.json` (capped at 10 MiB)
|
|
340
|
+
- Audit trail: `.monomind/consensus/` (HMAC-signed JSONL)
|
|
341
|
+
- Concepts doc: `doc/concepts/swarm.md` (Hive-Mind Consensus section)
|
|
688
342
|
|
|
689
343
|
---
|
|
690
344
|
|
|
691
|
-
**Skill Version**:
|
|
692
|
-
**Last Updated**:
|
|
345
|
+
**Skill Version**: 2.0.0
|
|
346
|
+
**Last Updated**: 2026-08-12
|
|
693
347
|
**Maintained By**: Monomind Team
|
|
694
|
-
**License**: MIT
|