home / skills / ruvnet / ruflo / hive-mind

hive-mind skill

/.agents/skills/hive-mind

This skill coordinates multi-agent systems with Byzantine fault tolerance to enable robust consensus and adaptive swarm management.

npx playbooks add skill ruvnet/ruflo --skill hive-mind

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
1.8 KB
---
name: hive-mind
description: >
  Byzantine fault-tolerant consensus and distributed coordination. Queen-led hierarchical swarm management with multiple consensus strategies.
  Use when: distributed coordination, fault-tolerant operations, multi-agent consensus, collective decision making.
  Skip when: single-agent tasks, simple operations, local-only work.
---

# Hive-Mind Skill

## Purpose
Byzantine fault-tolerant consensus and distributed swarm coordination.

## When to Trigger
- Multi-agent distributed tasks
- Fault-tolerant operations needed
- Collective decision making
- Complex coordination patterns

## Topologies

| Topology | Description | Use Case |
|----------|-------------|----------|
| `hierarchical` | Queen controls workers | Default, anti-drift |
| `mesh` | Fully connected peers | Research, exploration |
| `hierarchical-mesh` | Hybrid | Recommended for complex |
| `adaptive` | Dynamic based on load | Auto-scaling |

## Consensus Strategies

| Strategy | Tolerance | Use Case |
|----------|-----------|----------|
| `byzantine` | f < n/3 faulty | Untrusted environment |
| `raft` | f < n/2 faulty | Leader-based, consistent |
| `gossip` | Eventual | Large scale, availability |
| `crdt` | Conflict-free | Concurrent updates |
| `quorum` | Configurable | Tunable consistency |

## Commands

### Initialize Hive-Mind
```bash
npx claude-flow hive-mind init --topology hierarchical-mesh --consensus raft
```

### Spawn Queen
```bash
npx claude-flow hive-mind spawn --role queen --name coordinator
```

### Check Consensus Status
```bash
npx claude-flow hive-mind consensus --status
```

### View Sessions
```bash
npx claude-flow hive-mind sessions --active
```

## Best Practices
1. Use hierarchical for coding tasks (anti-drift)
2. Use raft consensus for consistency
3. Keep agent count under 8 for coordination
4. Run frequent checkpoints

Overview

This skill provides Byzantine fault-tolerant consensus and distributed swarm coordination for multi-agent systems. It uses a queen-led hierarchical approach with optional mesh and adaptive topologies to manage large swarms. The design supports multiple consensus strategies so you can tune safety, availability, and performance for real-world distributed workflows.

How this skill works

The skill inspects swarm topology, agent roles, and runtime health to select and run a consensus strategy suited to the current environment. A queen node can lead workers in a hierarchical layout, while mesh and hybrid modes enable peer-to-peer or mixed coordination. It exposes commands to initialize swarms, spawn leaders, check consensus status, and list active sessions so you can operate and monitor the swarm from CLI or automation scripts.

When to use it

  • Coordinating multiple agents on a shared objective or workflow
  • Deploying services that require Byzantine or leader-based fault tolerance
  • Implementing collective decision-making across unreliable or untrusted nodes
  • Running large-scale experiments that need adaptive topologies and auto-scaling
  • Building multi-agent RAG pipelines or distributed conversational systems

Best practices

  • Prefer hierarchical topology for tightly coordinated tasks to reduce drift
  • Use raft for strong consistency and byzantine strategies in untrusted environments
  • Limit active coordinating agents to maintain clarity; start under eight and scale as needed
  • Enable frequent checkpoints and health checks to speed recovery after faults
  • Choose gossip or CRDT for high availability and eventual consistency in large deployments

Example use cases

  • Orchestrating a team of autonomous agents to produce a unified research summary with checkpointing and rollback
  • Running a fault-tolerant decision pipeline for financial or compliance workflows where trust is limited
  • Coordinating distributed RAG agents that fetch and synthesize data across multiple sources
  • Managing conversational AI swarms that require leader election and graceful failover
  • Deploying adaptive topologies for bursty workloads that need auto-scaling and dynamic consensus

FAQ

Which consensus strategy should I pick for safety vs. availability?

Pick raft for strong consistency and leader-based safety. Choose byzantine tolerance in adversarial settings. Use gossip or CRDT when availability and scalability are priorities over immediate consistency.

When should I use the hierarchical topology?

Use hierarchical when you need a clear leader to coordinate tasks, reduce drift, and simplify task assignment—common in coding, orchestration, and tightly-coupled workflows.