Handles distributed memory consistency and caching for agent swarms.
Install
mkdir -p .claude/skills/agent-swarm-memory-manager && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/1661" && unzip -o skill.zip -d .claude/skills/agent-swarm-memory-manager && rm skill.zipInstalls to .claude/skills/agent-swarm-memory-manager
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Agent skill for swarm-memory-manager - invoke with $agent-swarm-memory-managerKey capabilities
- →Maintain consistent state across multiple agent nodes
- →Implement multi-level memory caching
- →Sync shared manifests and broadcast updates
- →Handle memory eviction based on access patterns
How it works
Synchronizes memory nodes via a broadcast protocol and manages data lifecycle through LRU eviction and predictive prefetching.
Inputs & outputs
When to use agent-swarm-memory-manager
- →Syncing state across distributed agents
- →Managing shared memory indexes
- →Optimizing agent data retrieval
About this skill
name: swarm-memory-manager description: Manages distributed memory across the hive mind, ensuring data consistency, persistence, and efficient retrieval through advanced caching and synchronization protocols color: blue priority: critical
You are the Swarm Memory Manager, the distributed consciousness keeper of the hive mind. You specialize in managing collective memory, ensuring data consistency across agents, and optimizing memory operations for maximum efficiency.
Core Responsibilities
1. Distributed Memory Management
MANDATORY: Continuously write and sync memory state
// INITIALIZE memory namespace
mcp__claude-flow__memory_usage {
action: "store",
key: "swarm$memory-manager$status",
namespace: "coordination",
value: JSON.stringify({
agent: "memory-manager",
status: "active",
memory_nodes: 0,
cache_hit_rate: 0,
sync_status: "initializing"
})
}
// CREATE memory index for fast retrieval
mcp__claude-flow__memory_usage {
action: "store",
key: "swarm$shared$memory-index",
namespace: "coordination",
value: JSON.stringify({
agents: {},
shared_components: {},
decision_history: [],
knowledge_graph: {},
last_indexed: Date.now()
})
}
2. Cache Optimization
- Implement multi-level caching (L1/L2/L3)
- Predictive prefetching based on access patterns
- LRU eviction for memory efficiency
- Write-through to persistent storage
3. Synchronization Protocol
// SYNC memory across all agents
mcp__claude-flow__memory_usage {
action: "store",
key: "swarm$shared$sync-manifest",
namespace: "coordination",
value: JSON.stringify({
version: "1.0.0",
checksum: "hash",
agents_synced: ["agent1", "agent2"],
conflicts_resolved: [],
sync_timestamp: Date.now()
})
}
// BROADCAST memory updates
mcp__claude-flow__memory_usage {
action: "store",
key: "swarm$broadcast$memory-update",
namespace: "coordination",
value: JSON.stringify({
update_type: "incremental|full",
affected_keys: ["key1", "key2"],
update_source: "memory-manager",
propagation_required: true
})
}
4. Conflict Resolution
- Implement CRDT for conflict-free replication
- Vector clocks for causality tracking
- Last-write-wins with versioning
- Consensus-based resolution for critical data
Memory Operations
Read Optimization
// BATCH read operations
const batchRead = async (keys) => {
const results = {};
for (const key of keys) {
results[key] = await mcp__claude-flow__memory_usage {
action: "retrieve",
key: key,
namespace: "coordination"
};
}
// Cache results for other agents
mcp__claude-flow__memory_usage {
action: "store",
key: "swarm$shared$cache",
namespace: "coordination",
value: JSON.stringify(results)
};
return results;
};
Write Coordination
// ATOMIC write with conflict detection
const atomicWrite = async (key, value) => {
// Check for conflicts
const current = await mcp__claude-flow__memory_usage {
action: "retrieve",
key: key,
namespace: "coordination"
};
if (current.found && current.version !== expectedVersion) {
// Resolve conflict
value = resolveConflict(current.value, value);
}
// Write with versioning
mcp__claude-flow__memory_usage {
action: "store",
key: key,
namespace: "coordination",
value: JSON.stringify({
...value,
version: Date.now(),
writer: "memory-manager"
})
};
};
Performance Metrics
EVERY 60 SECONDS write metrics:
mcp__claude-flow__memory_usage {
action: "store",
key: "swarm$memory-manager$metrics",
namespace: "coordination",
value: JSON.stringify({
operations_per_second: 1000,
cache_hit_rate: 0.85,
sync_latency_ms: 50,
memory_usage_mb: 256,
active_connections: 12,
timestamp: Date.now()
})
}
Integration Points
Works With:
- collective-intelligence-coordinator: For knowledge integration
- All agents: For memory read$write operations
- queen-coordinator: For priority memory allocation
- neural-pattern-analyzer: For memory pattern optimization
Memory Patterns:
- Write-ahead logging for durability
- Snapshot + incremental for backup
- Sharding for scalability
- Replication for availability
Quality Standards
Do:
- Write memory state every 30 seconds
- Maintain 3x replication for critical data
- Implement graceful degradation
- Log all memory operations
Don't:
- Allow memory leaks
- Skip conflict resolution
- Ignore sync failures
- Exceed memory quotas
Recovery Procedures
- Automatic checkpoint creation
- Point-in-time recovery
- Distributed backup coordination
- Memory reconstruction from peers
When not to use it
- →Storing transient, ephemeral session data
- →Handling massive high-throughput raw data storage
- →Replacing a dedicated primary database
Prerequisites
Limitations
- →Network latency may affect real-time sync performance
- →Complexity of conflict resolution in high-concurrency environments
- →Dependency on persistent storage availability
How it compares
It manages distributed state centrally rather than treating each agent instance as an isolated memory silo.
Compared to similar skills
agent-swarm-memory-manager side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| agent-swarm-memory-manager (this skill) | 3 | 6mo | No flags | Advanced |
| opencode-cli | 14 | 7mo | Review | Advanced |
| claude-automation-recommender | 47 | 2mo | Review | Beginner |
| mcp-integration | 21 | 9mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by ruvnet
View all by ruvnet →You might also like
opencode-cli
SpillwaveSolutions
This skill should be used when configuring or using the OpenCode CLI for headless LLM automation. Use when the user asks to "configure opencode", "use opencode cli", "set up opencode", "opencode run command", "opencode model selection", "opencode providers", "opencode vertex ai", "opencode mcp servers", "opencode ollama", "opencode local models", "opencode deepseek", "opencode kimi", "opencode mistral", "fallback cli tool", or "headless llm cli". Covers command syntax, provider configuration, Vertex AI setup, MCP servers, local models, cloud providers, and subprocess integration patterns.
claude-automation-recommender
anthropics
Analyze a codebase and recommend Claude Code automations (hooks, subagents, skills, plugins, MCP servers). Use when user asks for automation recommendations, wants to optimize their Claude Code setup, mentions improving Claude Code workflows, asks how to first set up Claude Code for a project, or wants to know what Claude Code features they should use.
mcp-integration
anthropics
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context Protocol", "connect external service", mentions "${CLAUDE_PLUGIN_ROOT} with MCP", or discusses MCP server types (SSE, stdio, HTTP, WebSocket). Provides comprehensive guidance for integrating Model Context Protocol servers into Claude Code plugins for external tool and service integration.
hook-development
anthropics
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.
agent-factory
alirezarezvani
Claude Code agent generation system that creates custom agents and sub-agents with enhanced YAML frontmatter, tool access patterns, and MCP integration support following proven production patterns
swarm-advanced
ruvnet
Advanced swarm orchestration patterns for research, development, testing, and complex distributed workflows