[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M74B5J40C8646J4J26MA2SN3":3,"skill-same:01M74B5J40C8646J4J26MA2SN3":43},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":13,"repositoryHtmlUrl":26,"repositoryHomepageUrl":6,"ownerHtmlUrl":27,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":28,"install":29,"resources":42},"01M74B5J40C8646J4J26MA2SN3","hive-mind-advanced",null,"Advanced Hive Mind collective intelligence system for queen-led multi-agent coordination with consensus mechanisms and persistent memory","aicreator350\u002FaurionOFFICIELLE","aicreator350","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F217751428?v=4","01M731QVHB22WCM6PDX5VFN1RV","01M731QVJ0TAD058M1SW9MY548",0,"MIT","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fhive-mind-advanced\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: hive-mind-advanced\ndescription: |\n  Advanced Hive Mind collective intelligence system for queen-led multi-agent coordination with consensus mechanisms and persistent memory\n---\n\n# Hive Mind Advanced Skill\n\nMaster the advanced Hive Mind collective intelligence system for sophisticated multi-agent coordination using queen-led architecture, Byzantine consensus, and collective memory.\n\n## Overview\n\nThe Hive Mind system represents the pinnacle of multi-agent coordination in Claude Flow, implementing a queen-led hierarchical architecture where a strategic queen coordinator directs specialized worker agents through collective decision-making and shared memory.\n\n## Core Concepts\n\n### Architecture Patterns\n\n**Queen-Led Coordination**\n- Strategic queen agents orchestrate high-level objectives\n- Tactical queens manage mid-level execution\n- Adaptive queens dynamically adjust strategies based on performance\n\n**Worker Specialization**\n- Researcher agents: Analysis and investigation\n- Coder agents: Implementation and development\n- Analyst agents: Data processing and metrics\n- Tester agents: Quality assurance and validation\n- Architect agents: System design and planning\n- Reviewer agents: Code review and improvement\n- Optimizer agents: Performance enhancement\n- Documenter agents: Documentation generation\n\n**Collective Memory System**\n- Shared knowledge base across all agents\n- LRU cache with memory pressure handling\n- SQLite persistence with WAL mode\n- Memory consolidation and association\n- Access pattern tracking and optimization\n\n### Consensus Mechanisms\n\n**Majority Consensus**\nSimple voting where the option with most votes wins.\n\n**Weighted Consensus**\nQueen vote counts as 3x weight, providing strategic guidance.\n\n**Byzantine Fault Tolerance**\nRequires 2\u002F3 majority for decision approval, ensuring robust consensus even with faulty agents.\n\n## Getting Started\n\n### 1. Initialize Hive Mind\n\n```bash\n# Basic initialization\nnpx claude-flow hive-mind init\n\n# Force reinitialize\nnpx claude-flow hive-mind init --force\n\n# Custom configuration\nnpx claude-flow hive-mind init --config hive-config.json\n```\n\n### 2. Spawn a Swarm\n\n```bash\n# Basic spawn with objective\nnpx claude-flow hive-mind spawn \"Build microservices architecture\"\n\n# Strategic queen type\nnpx claude-flow hive-mind spawn \"Research AI patterns\" --queen-type strategic\n\n# Tactical queen with max workers\nnpx claude-flow hive-mind spawn \"Implement API\" --queen-type tactical --max-workers 12\n\n# Adaptive queen with consensus\nnpx claude-flow hive-mind spawn \"Optimize system\" --queen-type adaptive --consensus byzantine\n\n# Generate Claude Code commands\nnpx claude-flow hive-mind spawn \"Build full-stack app\" --claude\n```\n\n### 3. Monitor Status\n\n```bash\n# Check hive mind status\nnpx claude-flow hive-mind status\n\n# Get detailed metrics\nnpx claude-flow hive-mind metrics\n\n# Monitor collective memory\nnpx claude-flow hive-mind memory\n```\n\n## Advanced Workflows\n\n### Session Management\n\n**Create and Manage Sessions**\n\n```bash\n# List active sessions\nnpx claude-flow hive-mind sessions\n\n# Pause a session\nnpx claude-flow hive-mind pause \u003Csession-id>\n\n# Resume a paused session\nnpx claude-flow hive-mind resume \u003Csession-id>\n\n# Stop a running session\nnpx claude-flow hive-mind stop \u003Csession-id>\n```\n\n**Session Features**\n- Automatic checkpoint creation\n- Progress tracking with completion percentages\n- Parent-child process management\n- Session logs with event tracking\n- Export\u002Fimport capabilities\n\n### Consensus Building\n\nThe Hive Mind builds consensus through structured voting:\n\n```javascript\n\u002F\u002F Programmatic consensus building\nconst decision = await hiveMind.buildConsensus(\n  'Architecture pattern selection',\n  ['microservices', 'monolith', 'serverless']\n);\n\n\u002F\u002F Result includes:\n\u002F\u002F - decision: Winning option\n\u002F\u002F - confidence: Vote percentage\n\u002F\u002F - votes: Individual agent votes\n```\n\n**Consensus Algorithms**\n\n1. **Majority** - Simple democratic voting\n2. **Weighted** - Queen has 3x voting power\n3. **Byzantine** - 2\u002F3 supermajority required\n\n### Collective Memory\n\n**Storing Knowledge**\n\n```javascript\n\u002F\u002F Store in collective memory\nawait memory.store('api-patterns', {\n  rest: { pros: [...], cons: [...] },\n  graphql: { pros: [...], cons: [...] }\n}, 'knowledge', { confidence: 0.95 });\n```\n\n**Memory Types**\n- `knowledge`: Permanent insights (no TTL)\n- `context`: Session context (1 hour TTL)\n- `task`: Task-specific data (30 min TTL)\n- `result`: Execution results (permanent, compressed)\n- `error`: Error logs (24 hour TTL)\n- `metric`: Performance metrics (1 hour TTL)\n- `consensus`: Decision records (permanent)\n- `system`: System configuration (permanent)\n\n**Searching and Retrieval**\n\n```javascript\n\u002F\u002F Search memory by pattern\nconst results = await memory.search('api*', {\n  type: 'knowledge',\n  minConfidence: 0.8,\n  limit: 50\n});\n\n\u002F\u002F Get related memories\nconst related = await memory.getRelated('api-patterns', 10);\n\n\u002F\u002F Build associations\nawait memory.associate('rest-api', 'authentication', 0.9);\n```\n\n### Task Distribution\n\n**Automatic Worker Assignment**\n\nThe system intelligently assigns tasks based on:\n- Keyword matching with agent specialization\n- Historical performance metrics\n- Worker availability and load\n- Task complexity analysis\n\n```javascript\n\u002F\u002F Create task (auto-assigned)\nconst task = await hiveMind.createTask(\n  'Implement user authentication',\n  priority: 8,\n  { estimatedDuration: 30000 }\n);\n```\n\n**Auto-Scaling**\n\n```javascript\n\u002F\u002F Configure auto-scaling\nconst config = {\n  autoScale: true,\n  maxWorkers: 12,\n  scaleUpThreshold: 2, \u002F\u002F Pending tasks per idle worker\n  scaleDownThreshold: 2 \u002F\u002F Idle workers above pending tasks\n};\n```\n\n## Integration Patterns\n\n### With Claude Code\n\nGenerate Claude Code spawn commands directly:\n\n```bash\nnpx claude-flow hive-mind spawn \"Build REST API\" --claude\n```\n\nOutput:\n```javascript\nTask(\"Queen Coordinator\", \"Orchestrate REST API development...\", \"coordinator\")\nTask(\"Backend Developer\", \"Implement Express routes...\", \"backend-dev\")\nTask(\"Database Architect\", \"Design PostgreSQL schema...\", \"code-analyzer\")\nTask(\"Test Engineer\", \"Create Jest test suite...\", \"tester\")\n```\n\n### With SPARC Methodology\n\n```bash\n# Use hive mind for SPARC workflow\nnpx claude-flow sparc tdd \"User authentication\" --hive-mind\n\n# Spawns:\n# - Specification agent\n# - Architecture agent\n# - Coder agents\n# - Tester agents\n# - Reviewer agents\n```\n\n### With GitHub Integration\n\n```bash\n# Repository analysis with hive mind\nnpx claude-flow hive-mind spawn \"Analyze repo quality\" --objective \"owner\u002Frepo\"\n\n# PR review coordination\nnpx claude-flow hive-mind spawn \"Review PR #123\" --queen-type tactical\n```\n\n## Performance Optimization\n\n### Memory Optimization\n\nThe collective memory system includes advanced optimizations:\n\n**LRU Cache**\n- Configurable cache size (default: 1000 entries)\n- Memory pressure handling (default: 50MB)\n- Automatic eviction of least-used entries\n\n**Database Optimization**\n- WAL (Write-Ahead Logging) mode\n- 64MB cache size\n- 256MB memory mapping\n- Prepared statements for common queries\n- Automatic ANALYZE and OPTIMIZE\n\n**Object Pooling**\n- Query result pooling\n- Memory entry pooling\n- Reduced garbage collection pressure\n\n### Performance Metrics\n\n```javascript\n\u002F\u002F Get performance insights\nconst insights = hiveMind.getPerformanceInsights();\n\n\u002F\u002F Includes:\n\u002F\u002F - asyncQueue utilization\n\u002F\u002F - Batch processing stats\n\u002F\u002F - Success rates\n\u002F\u002F - Average processing times\n\u002F\u002F - Memory efficiency\n```\n\n### Task Execution\n\n**Parallel Processing**\n- Batch agent spawning (5 agents per batch)\n- Concurrent task orchestration\n- Async operation optimization\n- Non-blocking task assignment\n\n**Benchmarks**\n- 10-20x faster batch spawning\n- 2.8-4.4x speed improvement overall\n- 32.3% token reduction\n- 84.8% SWE-Bench solve rate\n\n## Configuration\n\n### Hive Mind Config\n\n```javascript\n{\n  \"objective\": \"Build microservices\",\n  \"name\": \"my-hive\",\n  \"queenType\": \"strategic\", \u002F\u002F strategic | tactical | adaptive\n  \"maxWorkers\": 8,\n  \"consensusAlgorithm\": \"byzantine\", \u002F\u002F majority | weighted | byzantine\n  \"autoScale\": true,\n  \"memorySize\": 100, \u002F\u002F MB\n  \"taskTimeout\": 60, \u002F\u002F minutes\n  \"encryption\": false\n}\n```\n\n### Memory Config\n\n```javascript\n{\n  \"maxSize\": 100, \u002F\u002F MB\n  \"compressionThreshold\": 1024, \u002F\u002F bytes\n  \"gcInterval\": 300000, \u002F\u002F 5 minutes\n  \"cacheSize\": 1000,\n  \"cacheMemoryMB\": 50,\n  \"enablePooling\": true,\n  \"enableAsyncOperations\": true\n}\n```\n\n## Hooks Integration\n\nHive Mind integrates with Claude Flow hooks for automation:\n\n**Pre-Task Hooks**\n- Auto-assign agents by file type\n- Validate objective complexity\n- Optimize topology selection\n- Cache search patterns\n\n**Post-Task Hooks**\n- Auto-format deliverables\n- Train neural patterns\n- Update collective memory\n- Analyze performance bottlenecks\n\n**Session Hooks**\n- Generate session summaries\n- Persist checkpoint data\n- Track comprehensive metrics\n- Restore execution context\n\n## Best Practices\n\n### 1. Choose the Right Queen Type\n\n**Strategic Queens** - For research, planning, and analysis\n```bash\nnpx claude-flow hive-mind spawn \"Research ML frameworks\" --queen-type strategic\n```\n\n**Tactical Queens** - For implementation and execution\n```bash\nnpx claude-flow hive-mind spawn \"Build authentication\" --queen-type tactical\n```\n\n**Adaptive Queens** - For optimization and dynamic tasks\n```bash\nnpx claude-flow hive-mind spawn \"Optimize performance\" --queen-type adaptive\n```\n\n### 2. Leverage Consensus\n\nUse consensus for critical decisions:\n- Architecture pattern selection\n- Technology stack choices\n- Implementation approach\n- Code review approval\n- Release readiness\n\n### 3. Utilize Collective Memory\n\n**Store Learnings**\n```javascript\n\u002F\u002F After successful pattern implementation\nawait memory.store('auth-pattern', {\n  approach: 'JWT with refresh tokens',\n  pros: ['Stateless', 'Scalable'],\n  cons: ['Token size', 'Revocation complexity'],\n  implementation: {...}\n}, 'knowledge', { confidence: 0.95 });\n```\n\n**Build Associations**\n```javascript\n\u002F\u002F Link related concepts\nawait memory.associate('jwt-auth', 'refresh-tokens', 0.9);\nawait memory.associate('jwt-auth', 'oauth2', 0.7);\n```\n\n### 4. Monitor Performance\n\n```bash\n# Regular status checks\nnpx claude-flow hive-mind status\n\n# Track metrics\nnpx claude-flow hive-mind metrics\n\n# Analyze memory usage\nnpx claude-flow hive-mind memory\n```\n\n### 5. Session Management\n\n**Checkpoint Frequently**\n```javascript\n\u002F\u002F Create checkpoints at key milestones\nawait sessionManager.saveCheckpoint(\n  sessionId,\n  'api-routes-complete',\n  { completedRoutes: [...], remaining: [...] }\n);\n```\n\n**Resume Sessions**\n```bash\n# Resume from any previous state\nnpx claude-flow hive-mind resume \u003Csession-id>\n```\n\n## Troubleshooting\n\n### Memory Issues\n\n**High Memory Usage**\n```bash\n# Run garbage collection\nnpx claude-flow hive-mind memory --gc\n\n# Optimize database\nnpx claude-flow hive-mind memory --optimize\n\n# Export and clear\nnpx claude-flow hive-mind memory --export --clear\n```\n\n**Low Cache Hit Rate**\n```javascript\n\u002F\u002F Increase cache size in config\n{\n  \"cacheSize\": 2000,\n  \"cacheMemoryMB\": 100\n}\n```\n\n### Performance Issues\n\n**Slow Task Assignment**\n```javascript\n\u002F\u002F Enable worker type caching\n\u002F\u002F The system caches best worker matches for 5 minutes\n\u002F\u002F Automatic - no configuration needed\n```\n\n**High Queue Utilization**\n```javascript\n\u002F\u002F Increase async queue concurrency\n{\n  \"asyncQueueConcurrency\": 20 \u002F\u002F Default: min(maxWorkers * 2, 20)\n}\n```\n\n### Consensus Failures\n\n**No Consensus Reached (Byzantine)**\n```bash\n# Switch to weighted consensus for more decisive results\nnpx claude-flow hive-mind spawn \"...\" --consensus weighted\n\n# Or use simple majority\nnpx claude-flow hive-mind spawn \"...\" --consensus majority\n```\n\n## Advanced Topics\n\n### Custom Worker Types\n\nDefine specialized workers in `.claude\u002Fagents\u002F`:\n\n```yaml\nname: security-auditor\ntype: specialist\ncapabilities:\n  - vulnerability-scanning\n  - security-review\n  - penetration-testing\n  - compliance-checking\npriority: high\n```\n\n### Neural Pattern Training\n\nThe system trains on successful patterns:\n\n```javascript\n\u002F\u002F Automatic pattern learning\n\u002F\u002F Happens after successful task completion\n\u002F\u002F Stores in collective memory\n\u002F\u002F Improves future task matching\n```\n\n### Multi-Hive Coordination\n\nRun multiple hive minds simultaneously:\n\n```bash\n# Frontend hive\nnpx claude-flow hive-mind spawn \"Build UI\" --name frontend-hive\n\n# Backend hive\nnpx claude-flow hive-mind spawn \"Build API\" --name backend-hive\n\n# They share collective memory for coordination\n```\n\n### Export\u002FImport Sessions\n\n```bash\n# Export session for backup\nnpx claude-flow hive-mind export \u003Csession-id> --output backup.json\n\n# Import session\nnpx claude-flow hive-mind import backup.json\n```\n\n## API Reference\n\n### HiveMindCore\n\n```javascript\nconst hiveMind = new HiveMindCore({\n  objective: 'Build system',\n  queenType: 'strategic',\n  maxWorkers: 8,\n  consensusAlgorithm: 'byzantine'\n});\n\nawait hiveMind.initialize();\nawait hiveMind.spawnQueen(queenData);\nawait hiveMind.spawnWorkers(['coder', 'tester']);\nawait hiveMind.createTask('Implement feature', 7);\nconst decision = await hiveMind.buildConsensus('topic', options);\nconst status = hiveMind.getStatus();\nawait hiveMind.shutdown();\n```\n\n### CollectiveMemory\n\n```javascript\nconst memory = new CollectiveMemory({\n  swarmId: 'hive-123',\n  maxSize: 100,\n  cacheSize: 1000\n});\n\nawait memory.store(key, value, type, metadata);\nconst data = await memory.retrieve(key);\nconst results = await memory.search(pattern, options);\nconst related = await memory.getRelated(key, limit);\nawait memory.associate(key1, key2, strength);\nconst stats = memory.getStatistics();\nconst analytics = memory.getAnalytics();\nconst health = await memory.healthCheck();\n```\n\n### HiveMindSessionManager\n\n```javascript\nconst sessionManager = new HiveMindSessionManager();\n\nconst sessionId = await sessionManager.createSession(\n  swarmId, swarmName, objective, metadata\n);\n\nawait sessionManager.saveCheckpoint(sessionId, name, data);\nconst sessions = await sessionManager.getActiveSessions();\nconst session = await sessionManager.getSession(sessionId);\nawait sessionManager.pauseSession(sessionId);\nawait sessionManager.resumeSession(sessionId);\nawait sessionManager.stopSession(sessionId);\nawait sessionManager.completeSession(sessionId);\n```\n\n## Examples\n\n### Full-Stack Development\n\n```bash\n# Initialize hive mind\nnpx claude-flow hive-mind init\n\n# Spawn full-stack hive\nnpx claude-flow hive-mind spawn \"Build e-commerce platform\" \\\n  --queen-type strategic \\\n  --max-workers 10 \\\n  --consensus weighted \\\n  --claude\n\n# Output generates Claude Code commands:\n# - Queen coordinator\n# - Frontend developers (React)\n# - Backend developers (Node.js)\n# - Database architects\n# - DevOps engineers\n# - Security auditors\n# - Test engineers\n# - Documentation specialists\n```\n\n### Research and Analysis\n\n```bash\n# Spawn research hive\nnpx claude-flow hive-mind spawn \"Research GraphQL vs REST\" \\\n  --queen-type adaptive \\\n  --consensus byzantine\n\n# Researchers gather data\n# Analysts process findings\n# Queen builds consensus on recommendation\n# Results stored in collective memory\n```\n\n### Code Review\n\n```bash\n# Review coordination\nnpx claude-flow hive-mind spawn \"Review PR #456\" \\\n  --queen-type tactical \\\n  --max-workers 6\n\n# Spawns:\n# - Code analyzers\n# - Security reviewers\n# - Performance reviewers\n# - Test coverage analyzers\n# - Documentation reviewers\n# - Consensus on approval\u002Fchanges\n```\n\n## Skill Progression\n\n### Beginner\n1. Initialize hive mind\n2. Spawn basic swarms\n3. Monitor status\n4. Use majority consensus\n\n### Intermediate\n1. Configure queen types\n2. Implement session management\n3. Use weighted consensus\n4. Access collective memory\n5. Enable auto-scaling\n\n### Advanced\n1. Byzantine fault tolerance\n2. Memory optimization\n3. Custom worker types\n4. Multi-hive coordination\n5. Neural pattern training\n6. Session export\u002Fimport\n7. Performance tuning\n\n## Related Skills\n\n- `swarm-orchestration`: Basic swarm coordination\n- `consensus-mechanisms`: Distributed decision making\n- `memory-systems`: Advanced memory management\n- `sparc-methodology`: Structured development workflow\n- `github-integration`: Repository coordination\n\n## References\n\n- [Hive Mind Documentation](https:\u002F\u002Fgithub.com\u002Fruvnet\u002Fclaude-flow\u002Fdocs\u002Fhive-mind)\n- [Collective Intelligence Patterns](https:\u002F\u002Fgithub.com\u002Fruvnet\u002Fclaude-flow\u002Fdocs\u002Fpatterns)\n- [Byzantine Consensus](https:\u002F\u002Fgithub.com\u002Fruvnet\u002Fclaude-flow\u002Fdocs\u002Fconsensus)\n- [Memory Optimization](https:\u002F\u002Fgithub.com\u002Fruvnet\u002Fclaude-flow\u002Fdocs\u002Fmemory)\n\n---\n\n**Skill Version**: 1.0.0\n**Last Updated**: 2025-10-19\n**Maintained By**: Claude Flow Team\n**License**: MIT\n","# Hive Mind Advanced Skill\n\nMaster the advanced Hive Mind collective intelligence system for sophisticated multi-agent coordination using queen-led architecture, Byzantine consensus, and collective memory.\n\n## Overview\n\nThe Hive Mind system represents the pinnacle of multi-agent coordination in Claude Flow, implementing a queen-led hierarchical architecture where a strategic queen coordinator directs specialized worker agents through collective decision-making and shared memory.\n\n## Core Concepts\n\n### Architecture Patterns\n\n**Queen-Led Coordination**\n- Strategic queen agents orchestrate high-level objectives\n- Tactical queens manage mid-level execution\n- Adaptive queens dynamically adjust strategies based on performance\n\n**Worker Specialization**\n- Researcher agents: Analysis and investigation\n- Coder agents: Implementation and development\n- Analyst agents: Data processing and metrics\n- Tester agents: Quality assurance and validation\n- Architect agents: System design and planning\n- Reviewer agents: Code review and improvement\n- Optimizer agents: Performance enhancement\n- Documenter agents: Documentation generation\n\n**Collective Memory System**\n- Shared knowledge base across all agents\n- LRU cache with memory pressure handling\n- SQLite persistence with WAL mode\n- Memory consolidation and association\n- Access pattern tracking and optimization\n\n### Consensus Mechanisms\n\n**Majority Consensus**\nSimple voting where the option with most votes wins.\n\n**Weighted Consensus**\nQueen vote counts as 3x weight, providing strategic guidance.\n\n**Byzantine Fault Tolerance**\nRequires 2\u002F3 majority for decision approval, ensuring robust consensus even with faulty agents.\n\n## Getting Started\n\n### 1. Initialize Hive Mind\n\n```bash\n# Basic initialization\nnpx claude-flow hive-mind init\n\n# Force reinitialize\nnpx claude-flow hive-mind init --force\n\n# Custom configuration\nnpx claude-flow hive-mind init --config hive-config.json\n```\n\n### 2. Spawn a Swarm\n\n```bash\n# Basic spawn with objective\nnpx claude-flow hive-mind spawn \"Build microservices architecture\"\n\n# Strategic queen type\nnpx claude-flow hive-mind spawn \"Research AI patterns\" --queen-type strategic\n\n# Tactical queen with max workers\nnpx claude-flow hive-mind spawn \"Implement API\" --queen-type tactical --max-workers 12\n\n# Adaptive queen with consensus\nnpx claude-flow hive-mind spawn \"Optimize system\" --queen-type adaptive --consensus byzantine\n\n# Generate Claude Code commands\nnpx claude-flow hive-mind spawn \"Build full-stack app\" --claude\n```\n\n### 3. Monitor Status\n\n```bash\n# Check hive mind status\nnpx claude-flow hive-mind status\n\n# Get detailed metrics\nnpx claude-flow hive-mind metrics\n\n# Monitor collective memory\nnpx claude-flow hive-mind memory\n```\n\n## Advanced Workflows\n\n### Session Management\n\n**Create and Manage Sessions**\n\n```bash\n# List active sessions\nnpx claude-flow hive-mind sessions\n\n# Pause a session\nnpx claude-flow hive-mind pause \u003Csession-id>\n\n# Resume a paused session\nnpx claude-flow hive-mind resume \u003Csession-id>\n\n# Stop a running session\nnpx claude-flow hive-mind stop \u003Csession-id>\n```\n\n**Session Features**\n- Automatic checkpoint creation\n- Progress tracking with completion percentages\n- Parent-child process management\n- Session logs with event tracking\n- Export\u002Fimport capabilities\n\n### Consensus Building\n\nThe Hive Mind builds consensus through structured voting:\n\n```javascript\n\u002F\u002F Programmatic consensus building\nconst decision = await hiveMind.buildConsensus(\n  'Architecture pattern selection',\n  ['microservices', 'monolith', 'serverless']\n);\n\n\u002F\u002F Result includes:\n\u002F\u002F - decision: Winning option\n\u002F\u002F - confidence: Vote percentage\n\u002F\u002F - votes: Individual agent votes\n```\n\n**Consensus Algorithms**\n\n1. **Majority** - Simple democratic voting\n2. **Weighted** - Queen has 3x voting power\n3. **Byzantine** - 2\u002F3 supermajority required\n\n### Collective Memory\n\n**Storing Knowledge**\n\n```javascript\n\u002F\u002F Store in collective memory\nawait memory.store('api-patterns', {\n  rest: { pros: [...], cons: [...] },\n  graphql: { pros: [...], cons: [...] }\n}, 'knowledge', { confidence: 0.95 });\n```\n\n**Memory Types**\n- `knowledge`: Permanent insights (no TTL)\n- `context`: Session context (1 hour TTL)\n- `task`: Task-specific data (30 min TTL)\n- `result`: Execution results (permanent, compressed)\n- `error`: Error logs (24 hour TTL)\n- `metric`: Performance metrics (1 hour TTL)\n- `consensus`: Decision records (permanent)\n- `system`: System configuration (permanent)\n\n**Searching and Retrieval**\n\n```javascript\n\u002F\u002F Search memory by pattern\nconst results = await memory.search('api*', {\n  type: 'knowledge',\n  minConfidence: 0.8,\n  limit: 50\n});\n\n\u002F\u002F Get related memories\nconst related = await memory.getRelated('api-patterns', 10);\n\n\u002F\u002F Build associations\nawait memory.associate('rest-api', 'authentication', 0.9);\n```\n\n### Task Distribution\n\n**Automatic Worker Assignment**\n\nThe system intelligently assigns tasks based on:\n- Keyword matching with agent specialization\n- Historical performance metrics\n- Worker availability and load\n- Task complexity analysis\n\n```javascript\n\u002F\u002F Create task (auto-assigned)\nconst task = await hiveMind.createTask(\n  'Implement user authentication',\n  priority: 8,\n  { estimatedDuration: 30000 }\n);\n```\n\n**Auto-Scaling**\n\n```javascript\n\u002F\u002F Configure auto-scaling\nconst config = {\n  autoScale: true,\n  maxWorkers: 12,\n  scaleUpThreshold: 2, \u002F\u002F Pending tasks per idle worker\n  scaleDownThreshold: 2 \u002F\u002F Idle workers above pending tasks\n};\n```\n\n## Integration Patterns\n\n### With Claude Code\n\nGenerate Claude Code spawn commands directly:\n\n```bash\nnpx claude-flow hive-mind spawn \"Build REST API\" --claude\n```\n\nOutput:\n```javascript\nTask(\"Queen Coordinator\", \"Orchestrate REST API development...\", \"coordinator\")\nTask(\"Backend Developer\", \"Implement Express routes...\", \"backend-dev\")\nTask(\"Database Architect\", \"Design PostgreSQL schema...\", \"code-analyzer\")\nTask(\"Test Engineer\", \"Create Jest test suite...\", \"tester\")\n```\n\n### With SPARC Methodology\n\n```bash\n# Use hive mind for SPARC workflow\nnpx claude-flow sparc tdd \"User authentication\" --hive-mind\n\n# Spawns:\n# - Specification agent\n# - Architecture agent\n# - Coder agents\n# - Tester agents\n# - Reviewer agents\n```\n\n### With GitHub Integration\n\n```bash\n# Repository analysis with hive mind\nnpx claude-flow hive-mind spawn \"Analyze repo quality\" --objective \"owner\u002Frepo\"\n\n# PR review coordination\nnpx claude-flow hive-mind spawn \"Review PR #123\" --queen-type tactical\n```\n\n## Performance Optimization\n\n### Memory Optimization\n\nThe collective memory system includes advanced optimizations:\n\n**LRU Cache**\n- Configurable cache size (default: 1000 entries)\n- Memory pressure handling (default: 50MB)\n- Automatic eviction of least-used entries\n\n**Database Optimization**\n- WAL (Write-Ahead Logging) mode\n- 64MB cache size\n- 256MB memory mapping\n- Prepared statements for common queries\n- Automatic ANALYZE and OPTIMIZE\n\n**Object Pooling**\n- Query result pooling\n- Memory entry pooling\n- Reduced garbage collection pressure\n\n### Performance Metrics\n\n```javascript\n\u002F\u002F Get performance insights\nconst insights = hiveMind.getPerformanceInsights();\n\n\u002F\u002F Includes:\n\u002F\u002F - asyncQueue utilization\n\u002F\u002F - Batch processing stats\n\u002F\u002F - Success rates\n\u002F\u002F - Average processing times\n\u002F\u002F - Memory efficiency\n```\n\n### Task Execution\n\n**Parallel Processing**\n- Batch agent spawning (5 agents per batch)\n- Concurrent task orchestration\n- Async operation optimization\n- Non-blocking task assignment\n\n**Benchmarks**\n- 10-20x faster batch spawning\n- 2.8-4.4x speed improvement overall\n- 32.3% token reduction\n- 84.8% SWE-Bench solve rate\n\n## Configuration\n\n### Hive Mind Config\n\n```javascript\n{\n  \"objective\": \"Build microservices\",\n  \"name\": \"my-hive\",\n  \"queenType\": \"strategic\", \u002F\u002F strategic | tactical | adaptive\n  \"maxWorkers\": 8,\n  \"consensusAlgorithm\": \"byzantine\", \u002F\u002F majority | weighted | byzantine\n  \"autoScale\": true,\n  \"memorySize\": 100, \u002F\u002F MB\n  \"taskTimeout\": 60, \u002F\u002F minutes\n  \"encryption\": false\n}\n```\n\n### Memory Config\n\n```javascript\n{\n  \"maxSize\": 100, \u002F\u002F MB\n  \"compressionThreshold\": 1024, \u002F\u002F bytes\n  \"gcInterval\": 300000, \u002F\u002F 5 minutes\n  \"cacheSize\": 1000,\n  \"cacheMemoryMB\": 50,\n  \"enablePooling\": true,\n  \"enableAsyncOperations\": true\n}\n```\n\n## Hooks Integration\n\nHive Mind integrates with Claude Flow hooks for automation:\n\n**Pre-Task Hooks**\n- Auto-assign agents by file type\n- Validate objective complexity\n- Optimize topology selection\n- Cache search patterns\n\n**Post-Task Hooks**\n- Auto-format deliverables\n- Train neural patterns\n- Update collective memory\n- Analyze performance bottlenecks\n\n**Session Hooks**\n- Generate session summaries\n- Persist checkpoint data\n- Track comprehensive metrics\n- Restore execution context\n\n## Best Practices\n\n### 1. Choose the Right Queen Type\n\n**Strategic Queens** - For research, planning, and analysis\n```bash\nnpx claude-flow hive-mind spawn \"Research ML frameworks\" --queen-type strategic\n```\n\n**Tactical Queens** - For implementation and execution\n```bash\nnpx claude-flow hive-mind spawn \"Build authentication\" --queen-type tactical\n```\n\n**Adaptive Queens** - For optimization and dynamic tasks\n```bash\nnpx claude-flow hive-mind spawn \"Optimize performance\" --queen-type adaptive\n```\n\n### 2. Leverage Consensus\n\nUse consensus for critical decisions:\n- Architecture pattern selection\n- Technology stack choices\n- Implementation approach\n- Code review approval\n- Release readiness\n\n### 3. Utilize Collective Memory\n\n**Store Learnings**\n```javascript\n\u002F\u002F After successful pattern implementation\nawait memory.store('auth-pattern', {\n  approach: 'JWT with refresh tokens',\n  pros: ['Stateless', 'Scalable'],\n  cons: ['Token size', 'Revocation complexity'],\n  implementation: {...}\n}, 'knowledge', { confidence: 0.95 });\n```\n\n**Build Associations**\n```javascript\n\u002F\u002F Link related concepts\nawait memory.associate('jwt-auth', 'refresh-tokens', 0.9);\nawait memory.associate('jwt-auth', 'oauth2', 0.7);\n```\n\n### 4. Monitor Performance\n\n```bash\n# Regular status checks\nnpx claude-flow hive-mind status\n\n# Track metrics\nnpx claude-flow hive-mind metrics\n\n# Analyze memory usage\nnpx claude-flow hive-mind memory\n```\n\n### 5. Session Management\n\n**Checkpoint Frequently**\n```javascript\n\u002F\u002F Create checkpoints at key milestones\nawait sessionManager.saveCheckpoint(\n  sessionId,\n  'api-routes-complete',\n  { completedRoutes: [...], remaining: [...] }\n);\n```\n\n**Resume Sessions**\n```bash\n# Resume from any previous state\nnpx claude-flow hive-mind resume \u003Csession-id>\n```\n\n## Troubleshooting\n\n### Memory Issues\n\n**High Memory Usage**\n```bash\n# Run garbage collection\nnpx claude-flow hive-mind memory --gc\n\n# Optimize database\nnpx claude-flow hive-mind memory --optimize\n\n# Export and clear\nnpx claude-flow hive-mind memory --export --clear\n```\n\n**Low Cache Hit Rate**\n```javascript\n\u002F\u002F Increase cache size in config\n{\n  \"cacheSize\": 2000,\n  \"cacheMemoryMB\": 100\n}\n```\n\n### Performance Issues\n\n**Slow Task Assignment**\n```javascript\n\u002F\u002F Enable worker type caching\n\u002F\u002F The system caches best worker matches for 5 minutes\n\u002F\u002F Automatic - no configuration needed\n```\n\n**High Queue Utilization**\n```javascript\n\u002F\u002F Increase async queue concurrency\n{\n  \"asyncQueueConcurrency\": 20 \u002F\u002F Default: min(maxWorkers * 2, 20)\n}\n```\n\n### Consensus Failures\n\n**No Consensus Reached (Byzantine)**\n```bash\n# Switch to weighted consensus for more decisive results\nnpx claude-flow hive-mind spawn \"...\" --consensus weighted\n\n# Or use simple majority\nnpx claude-flow hive-mind spawn \"...\" --consensus majority\n```\n\n## Advanced Topics\n\n### Custom Worker Types\n\nDefine specialized workers in `.claude\u002Fagents\u002F`:\n\n```yaml\nname: security-auditor\ntype: specialist\ncapabilities:\n  - vulnerability-scanning\n  - security-review\n  - penetration-testing\n  - compliance-checking\npriority: high\n```\n\n### Neural Pattern Training\n\nThe system trains on successful patterns:\n\n```javascript\n\u002F\u002F Automatic pattern learning\n\u002F\u002F Happens after successful task completion\n\u002F\u002F Stores in collective memory\n\u002F\u002F Improves future task matching\n```\n\n### Multi-Hive Coordination\n\nRun multiple hive minds simultaneously:\n\n```bash\n# Frontend hive\nnpx claude-flow hive-mind spawn \"Build UI\" --name frontend-hive\n\n# Backend hive\nnpx claude-flow hive-mind spawn \"Build API\" --name backend-hive\n\n# They share collective memory for coordination\n```\n\n### Export\u002FImport Sessions\n\n```bash\n# Export session for backup\nnpx claude-flow hive-mind export \u003Csession-id> --output backup.json\n\n# Import session\nnpx claude-flow hive-mind import backup.json\n```\n\n## API Reference\n\n### HiveMindCore\n\n```javascript\nconst hiveMind = new HiveMindCore({\n  objective: 'Build system',\n  queenType: 'strategic',\n  maxWorkers: 8,\n  consensusAlgorithm: 'byzantine'\n});\n\nawait hiveMind.initialize();\nawait hiveMind.spawnQueen(queenData);\nawait hiveMind.spawnWorkers(['coder', 'tester']);\nawait hiveMind.createTask('Implement feature', 7);\nconst decision = await hiveMind.buildConsensus('topic', options);\nconst status = hiveMind.getStatus();\nawait hiveMind.shutdown();\n```\n\n### CollectiveMemory\n\n```javascript\nconst memory = new CollectiveMemory({\n  swarmId: 'hive-123',\n  maxSize: 100,\n  cacheSize: 1000\n});\n\nawait memory.store(key, value, type, metadata);\nconst data = await memory.retrieve(key);\nconst results = await memory.search(pattern, options);\nconst related = await memory.getRelated(key, limit);\nawait memory.associate(key1, key2, strength);\nconst stats = memory.getStatistics();\nconst analytics = memory.getAnalytics();\nconst health = await memory.healthCheck();\n```\n\n### HiveMindSessionManager\n\n```javascript\nconst sessionManager = new HiveMindSessionManager();\n\nconst sessionId = await sessionManager.createSession(\n  swarmId, swarmName, objective, metadata\n);\n\nawait sessionManager.saveCheckpoint(sessionId, name, data);\nconst sessions = await sessionManager.getActiveSessions();\nconst session = await sessionManager.getSession(sessionId);\nawait sessionManager.pauseSession(sessionId);\nawait sessionManager.resumeSession(sessionId);\nawait sessionManager.stopSession(sessionId);\nawait sessionManager.completeSession(sessionId);\n```\n\n## Examples\n\n### Full-Stack Development\n\n```bash\n# Initialize hive mind\nnpx claude-flow hive-mind init\n\n# Spawn full-stack hive\nnpx claude-flow hive-mind spawn \"Build e-commerce platform\" \\\n  --queen-type strategic \\\n  --max-workers 10 \\\n  --consensus weighted \\\n  --claude\n\n# Output generates Claude Code commands:\n# - Queen coordinator\n# - Frontend developers (React)\n# - Backend developers (Node.js)\n# - Database architects\n# - DevOps engineers\n# - Security auditors\n# - Test engineers\n# - Documentation specialists\n```\n\n### Research and Analysis\n\n```bash\n# Spawn research hive\nnpx claude-flow hive-mind spawn \"Research GraphQL vs REST\" \\\n  --queen-type adaptive \\\n  --consensus byzantine\n\n# Researchers gather data\n# Analysts process findings\n# Queen builds consensus on recommendation\n# Results stored in collective memory\n```\n\n### Code Review\n\n```bash\n# Review coordination\nnpx claude-flow hive-mind spawn \"Review PR #456\" \\\n  --queen-type tactical \\\n  --max-workers 6\n\n# Spawns:\n# - Code analyzers\n# - Security reviewers\n# - Performance reviewers\n# - Test coverage analyzers\n# - Documentation reviewers\n# - Consensus on approval\u002Fchanges\n```\n\n## Skill Progression\n\n### Beginner\n1. Initialize hive mind\n2. Spawn basic swarms\n3. Monitor status\n4. Use majority consensus\n\n### Intermediate\n1. Configure queen types\n2. Implement session management\n3. Use weighted consensus\n4. Access collective memory\n5. Enable auto-scaling\n\n### Advanced\n1. Byzantine fault tolerance\n2. Memory optimization\n3. Custom worker types\n4. Multi-hive coordination\n5. Neural pattern training\n6. Session export\u002Fimport\n7. Performance tuning\n\n## Related Skills\n\n- `swarm-orchestration`: Basic swarm coordination\n- `consensus-mechanisms`: Distributed decision making\n- `memory-systems`: Advanced memory management\n- `sparc-methodology`: Structured development workflow\n- `github-integration`: Repository coordination\n\n## References\n\n- [Hive Mind Documentation](https:\u002F\u002Fgithub.com\u002Fruvnet\u002Fclaude-flow\u002Fdocs\u002Fhive-mind)\n- [Collective Intelligence Patterns](https:\u002F\u002Fgithub.com\u002Fruvnet\u002Fclaude-flow\u002Fdocs\u002Fpatterns)\n- [Byzantine Consensus](https:\u002F\u002Fgithub.com\u002Fruvnet\u002Fclaude-flow\u002Fdocs\u002Fconsensus)\n- [Memory Optimization](https:\u002F\u002Fgithub.com\u002Fruvnet\u002Fclaude-flow\u002Fdocs\u002Fmemory)\n\n---\n\n**Skill Version**: 1.0.0\n**Last Updated**: 2025-10-19\n**Maintained By**: Claude Flow Team\n**License**: MIT\n",{"name":5,"description":7},"main","5593cf3c72898ea9fc67225d452fe38f866ba6dd",".claude\u002Fskills\u002Fhive-mind-advanced","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE","https:\u002F\u002Fgithub.com\u002Faicreator350","2026-05-18 03:39:30",{"source":8,"skillName":5,"commands":30,"prompt":40,"zipAvailable":41},[31,34,37],{"tool":32,"command":33},"npx","npx skills add aicreator350\u002FaurionOFFICIELLE --skill hive-mind-advanced",{"tool":35,"command":36},"bunx","bunx skills add aicreator350\u002FaurionOFFICIELLE --skill hive-mind-advanced",{"tool":38,"command":39},"pnpm","pnpm dlx skills add aicreator350\u002FaurionOFFICIELLE --skill hive-mind-advanced","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fhive-mind-advanced\u002FSKILL.md",true,[],[44,53,60,67,74,81],{"skillNo":45,"name":46,"nameZh":6,"description":47,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":48,"licenseFileUrl":49,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":18},"01M74CAJWR9WB6DX1HF2V461Y0","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002Fskills\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002Fskills\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":18},"01M74CAFWC2H75GJ81B39C9RSW","web-design-guidelines","Review UI code for Web Interface Guidelines compliance. Use when asked to \"review my UI\", \"check accessibility\", \"audit design\", \"review UX\", or \"check my site against best practices\".","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002Fskills\u002Fweb-design-guidelines\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":18},"01M74CA9N2HTGCKJ93AE9NQMHA","vercel-react-view-transitions","Guide for implementing smooth, native-feeling animations using React's View Transition API (`\u003CViewTransition>` component, `addTransitionType`, and CSS view transition pseudo-elements). Use this skill whenever the user wants to add page transitions, animate route changes, create shared element animations, animate enter\u002Fexit of components, animate list reorder, implement directional (forward\u002Fback) navigation animations, or integrate view transitions in Next.js. Also use when the user mentions view transitions, `startViewTransition`, `ViewTransition`, transition types, or asks about animating between UI states in React without third-party animation libraries.","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-react-view-transitions\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":18},"01M74CA364D4EVDXZZQRVK1Z73","vercel-react-best-practices","React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React\u002FNext.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-react-best-practices\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":18},"01M74C9YQZX1GVS18V0AYCYPZE","vercel-composition-patterns","React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-composition-patterns\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":18},"01M74C9SEYD6F764Q1JACZX3A6","vercel-cli-with-tokens","Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. \"deploy to vercel\", \"set up vercel\", \"add environment variables to vercel\".","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-cli-with-tokens\u002FSKILL.md",[],[]]