agentic-qe 1.1.0 → 1.2.0

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.
Files changed (297) hide show
  1. package/.claude/agents/qe-coverage-analyzer.md +8 -0
  2. package/.claude/agents/qe-flaky-test-hunter.md +9 -1
  3. package/.claude/agents/qe-test-generator.md +7 -0
  4. package/.claude/agents/reasoning/agent.md +816 -0
  5. package/.claude/agents/reasoning/goal-planner.md +73 -0
  6. package/.claude/settings.json +21 -20
  7. package/.claude/skills/README.md +124 -0
  8. package/.claude/skills/agentdb-advanced/SKILL.md +550 -0
  9. package/.claude/skills/agentdb-learning/SKILL.md +545 -0
  10. package/.claude/skills/agentdb-memory-patterns/SKILL.md +339 -0
  11. package/.claude/skills/agentdb-optimization/SKILL.md +509 -0
  12. package/.claude/skills/agentdb-vector-search/SKILL.md +339 -0
  13. package/.claude/skills/agentic-quality-engineering/SKILL.md +604 -0
  14. package/.claude/skills/api-testing-patterns/SKILL.md +686 -0
  15. package/.claude/skills/bug-reporting-excellence/SKILL.md +632 -0
  16. package/.claude/skills/code-review-quality/SKILL.md +683 -0
  17. package/.claude/skills/consultancy-practices/SKILL.md +540 -0
  18. package/.claude/skills/context-driven-testing/SKILL.md +466 -0
  19. package/.claude/skills/exploratory-testing-advanced/SKILL.md +676 -0
  20. package/.claude/skills/flow-nexus-neural/SKILL.md +738 -0
  21. package/.claude/skills/flow-nexus-platform/SKILL.md +1157 -0
  22. package/.claude/skills/flow-nexus-swarm/SKILL.md +610 -0
  23. package/.claude/skills/github-code-review/SKILL.md +1140 -0
  24. package/.claude/skills/github-multi-repo/SKILL.md +874 -0
  25. package/.claude/skills/github-project-management/SKILL.md +1277 -0
  26. package/.claude/skills/github-release-management/SKILL.md +1081 -0
  27. package/.claude/skills/github-workflow-automation/SKILL.md +1065 -0
  28. package/.claude/skills/hive-mind-advanced/SKILL.md +712 -0
  29. package/.claude/skills/holistic-testing-pact/SKILL.md +225 -0
  30. package/.claude/skills/hooks-automation/SKILL.md +1201 -0
  31. package/.claude/skills/pair-programming/SKILL.md +1202 -0
  32. package/.claude/skills/performance-analysis/SKILL.md +563 -0
  33. package/.claude/skills/performance-testing/SKILL.md +662 -0
  34. package/.claude/skills/quality-metrics/SKILL.md +592 -0
  35. package/.claude/skills/reasoningbank-agentdb/SKILL.md +446 -0
  36. package/.claude/skills/reasoningbank-intelligence/SKILL.md +201 -0
  37. package/.claude/skills/refactoring-patterns/SKILL.md +778 -0
  38. package/.claude/skills/risk-based-testing/SKILL.md +721 -0
  39. package/.claude/skills/security-testing/SKILL.md +651 -0
  40. package/.claude/skills/skill-builder/SKILL.md +910 -0
  41. package/.claude/skills/sparc-methodology/SKILL.md +1115 -0
  42. package/.claude/skills/stream-chain/SKILL.md +563 -0
  43. package/.claude/skills/swarm-advanced/SKILL.md +973 -0
  44. package/.claude/skills/swarm-orchestration/SKILL.md +179 -0
  45. package/.claude/skills/tdd-london-chicago/SKILL.md +567 -0
  46. package/.claude/skills/technical-writing/SKILL.md +235 -0
  47. package/.claude/skills/test-automation-strategy/SKILL.md +842 -0
  48. package/.claude/skills/verification-quality/SKILL.md +649 -0
  49. package/.claude/skills/xp-practices/SKILL.md +671 -0
  50. package/.claude/statusline-command.sh +176 -0
  51. package/CHANGELOG.md +536 -1
  52. package/README.md +92 -3
  53. package/config/improvement-loop.config.ts +323 -0
  54. package/config/neural-agent.config.ts +197 -0
  55. package/dist/adapters/MemoryStoreAdapter.d.ts +16 -16
  56. package/dist/adapters/MemoryStoreAdapter.d.ts.map +1 -1
  57. package/dist/adapters/MemoryStoreAdapter.js +16 -16
  58. package/dist/adapters/MemoryStoreAdapter.js.map +1 -1
  59. package/dist/agents/BaseAgent.d.ts +69 -0
  60. package/dist/agents/BaseAgent.d.ts.map +1 -1
  61. package/dist/agents/BaseAgent.js +382 -1
  62. package/dist/agents/BaseAgent.js.map +1 -1
  63. package/dist/agents/CoverageAnalyzerAgent.d.ts +13 -2
  64. package/dist/agents/CoverageAnalyzerAgent.d.ts.map +1 -1
  65. package/dist/agents/CoverageAnalyzerAgent.js +105 -6
  66. package/dist/agents/CoverageAnalyzerAgent.js.map +1 -1
  67. package/dist/agents/DeploymentReadinessAgent.d.ts.map +1 -1
  68. package/dist/agents/DeploymentReadinessAgent.js +13 -13
  69. package/dist/agents/DeploymentReadinessAgent.js.map +1 -1
  70. package/dist/agents/FlakyTestHunterAgent.d.ts +28 -0
  71. package/dist/agents/FlakyTestHunterAgent.d.ts.map +1 -1
  72. package/dist/agents/FlakyTestHunterAgent.js +159 -4
  73. package/dist/agents/FlakyTestHunterAgent.js.map +1 -1
  74. package/dist/agents/FleetCommanderAgent.d.ts.map +1 -1
  75. package/dist/agents/FleetCommanderAgent.js +2 -2
  76. package/dist/agents/FleetCommanderAgent.js.map +1 -1
  77. package/dist/agents/LearningAgent.d.ts +14 -5
  78. package/dist/agents/LearningAgent.d.ts.map +1 -1
  79. package/dist/agents/LearningAgent.js +36 -16
  80. package/dist/agents/LearningAgent.js.map +1 -1
  81. package/dist/agents/NeuralAgentExtension.d.ts +117 -0
  82. package/dist/agents/NeuralAgentExtension.d.ts.map +1 -0
  83. package/dist/agents/NeuralAgentExtension.js +288 -0
  84. package/dist/agents/NeuralAgentExtension.js.map +1 -0
  85. package/dist/agents/PerformanceTesterAgent.d.ts.map +1 -1
  86. package/dist/agents/PerformanceTesterAgent.js +4 -3
  87. package/dist/agents/PerformanceTesterAgent.js.map +1 -1
  88. package/dist/agents/ProductionIntelligenceAgent.js +7 -7
  89. package/dist/agents/ProductionIntelligenceAgent.js.map +1 -1
  90. package/dist/agents/QualityAnalyzerAgent.d.ts.map +1 -1
  91. package/dist/agents/QualityAnalyzerAgent.js +2 -2
  92. package/dist/agents/QualityAnalyzerAgent.js.map +1 -1
  93. package/dist/agents/QualityGateAgent.js +5 -5
  94. package/dist/agents/QualityGateAgent.js.map +1 -1
  95. package/dist/agents/RegressionRiskAnalyzerAgent.js +7 -7
  96. package/dist/agents/RegressionRiskAnalyzerAgent.js.map +1 -1
  97. package/dist/agents/RequirementsValidatorAgent.d.ts.map +1 -1
  98. package/dist/agents/RequirementsValidatorAgent.js +1 -1
  99. package/dist/agents/RequirementsValidatorAgent.js.map +1 -1
  100. package/dist/agents/SecurityScannerAgent.js +6 -6
  101. package/dist/agents/SecurityScannerAgent.js.map +1 -1
  102. package/dist/agents/TestExecutorAgent.d.ts.map +1 -1
  103. package/dist/agents/TestExecutorAgent.js +1 -3
  104. package/dist/agents/TestExecutorAgent.js.map +1 -1
  105. package/dist/agents/TestGeneratorAgent.d.ts +15 -4
  106. package/dist/agents/TestGeneratorAgent.d.ts.map +1 -1
  107. package/dist/agents/TestGeneratorAgent.js +165 -43
  108. package/dist/agents/TestGeneratorAgent.js.map +1 -1
  109. package/dist/agents/mixins/NeuralCapableMixin.d.ts +130 -0
  110. package/dist/agents/mixins/NeuralCapableMixin.d.ts.map +1 -0
  111. package/dist/agents/mixins/NeuralCapableMixin.js +358 -0
  112. package/dist/agents/mixins/NeuralCapableMixin.js.map +1 -0
  113. package/dist/agents/mixins/QUICCapableMixin.d.ts +34 -0
  114. package/dist/agents/mixins/QUICCapableMixin.d.ts.map +1 -0
  115. package/dist/agents/mixins/QUICCapableMixin.js +346 -0
  116. package/dist/agents/mixins/QUICCapableMixin.js.map +1 -0
  117. package/dist/cli/commands/agent/index.d.ts +5 -0
  118. package/dist/cli/commands/agent/index.d.ts.map +1 -1
  119. package/dist/cli/commands/agent/index.js +11 -6
  120. package/dist/cli/commands/agent/index.js.map +1 -1
  121. package/dist/cli/commands/agent/kill.d.ts +13 -0
  122. package/dist/cli/commands/agent/kill.d.ts.map +1 -0
  123. package/dist/cli/commands/agent/kill.js +65 -0
  124. package/dist/cli/commands/agent/kill.js.map +1 -0
  125. package/dist/cli/commands/agent/list.d.ts +19 -0
  126. package/dist/cli/commands/agent/list.d.ts.map +1 -0
  127. package/dist/cli/commands/agent/list.js +92 -0
  128. package/dist/cli/commands/agent/list.js.map +1 -0
  129. package/dist/cli/commands/agent/logs.d.ts +14 -0
  130. package/dist/cli/commands/agent/logs.d.ts.map +1 -0
  131. package/dist/cli/commands/agent/logs.js +77 -0
  132. package/dist/cli/commands/agent/logs.js.map +1 -0
  133. package/dist/cli/commands/agent/metrics.d.ts +21 -0
  134. package/dist/cli/commands/agent/metrics.d.ts.map +1 -0
  135. package/dist/cli/commands/agent/metrics.js +87 -0
  136. package/dist/cli/commands/agent/metrics.js.map +1 -0
  137. package/dist/cli/commands/agent/spawn.d.ts +28 -0
  138. package/dist/cli/commands/agent/spawn.d.ts.map +1 -0
  139. package/dist/cli/commands/agent/spawn.js +83 -0
  140. package/dist/cli/commands/agent/spawn.js.map +1 -0
  141. package/dist/cli/commands/init.d.ts +24 -0
  142. package/dist/cli/commands/init.d.ts.map +1 -1
  143. package/dist/cli/commands/init.js +475 -7
  144. package/dist/cli/commands/init.js.map +1 -1
  145. package/dist/cli/commands/skills/index.d.ts +51 -0
  146. package/dist/cli/commands/skills/index.d.ts.map +1 -0
  147. package/dist/cli/commands/skills/index.js +364 -0
  148. package/dist/cli/commands/skills/index.js.map +1 -0
  149. package/dist/cli/index.js +92 -1
  150. package/dist/cli/index.js.map +1 -1
  151. package/dist/core/EventBus.d.ts +38 -0
  152. package/dist/core/EventBus.d.ts.map +1 -1
  153. package/dist/core/EventBus.js +176 -31
  154. package/dist/core/EventBus.js.map +1 -1
  155. package/dist/core/FleetManager.d.ts +35 -1
  156. package/dist/core/FleetManager.d.ts.map +1 -1
  157. package/dist/core/FleetManager.js +121 -45
  158. package/dist/core/FleetManager.js.map +1 -1
  159. package/dist/core/MemoryManager.d.ts +19 -1
  160. package/dist/core/MemoryManager.d.ts.map +1 -1
  161. package/dist/core/MemoryManager.js +25 -1
  162. package/dist/core/MemoryManager.js.map +1 -1
  163. package/dist/core/embeddings/EmbeddingCache.d.ts +134 -0
  164. package/dist/core/embeddings/EmbeddingCache.d.ts.map +1 -0
  165. package/dist/core/embeddings/EmbeddingCache.js +239 -0
  166. package/dist/core/embeddings/EmbeddingCache.js.map +1 -0
  167. package/dist/core/embeddings/EmbeddingGenerator.d.ts +224 -0
  168. package/dist/core/embeddings/EmbeddingGenerator.d.ts.map +1 -0
  169. package/dist/core/embeddings/EmbeddingGenerator.js +459 -0
  170. package/dist/core/embeddings/EmbeddingGenerator.js.map +1 -0
  171. package/dist/core/embeddings/index.d.ts +15 -0
  172. package/dist/core/embeddings/index.d.ts.map +1 -0
  173. package/dist/core/embeddings/index.js +22 -0
  174. package/dist/core/embeddings/index.js.map +1 -0
  175. package/dist/core/memory/AgentDBIntegration.d.ts +35 -0
  176. package/dist/core/memory/AgentDBIntegration.d.ts.map +1 -0
  177. package/dist/core/memory/AgentDBIntegration.js +75 -0
  178. package/dist/core/memory/AgentDBIntegration.js.map +1 -0
  179. package/dist/core/memory/AgentDBManager.d.ts +200 -0
  180. package/dist/core/memory/AgentDBManager.d.ts.map +1 -0
  181. package/dist/core/memory/AgentDBManager.js +263 -0
  182. package/dist/core/memory/AgentDBManager.js.map +1 -0
  183. package/dist/core/memory/AgentDBService.d.ts +160 -0
  184. package/dist/core/memory/AgentDBService.d.ts.map +1 -0
  185. package/dist/core/memory/AgentDBService.js +450 -0
  186. package/dist/core/memory/AgentDBService.js.map +1 -0
  187. package/dist/core/memory/RealAgentDBAdapter.d.ts +51 -0
  188. package/dist/core/memory/RealAgentDBAdapter.d.ts.map +1 -0
  189. package/dist/core/memory/RealAgentDBAdapter.js +230 -0
  190. package/dist/core/memory/RealAgentDBAdapter.js.map +1 -0
  191. package/dist/core/memory/ReasoningBankAdapter.d.ts +58 -0
  192. package/dist/core/memory/ReasoningBankAdapter.d.ts.map +1 -0
  193. package/dist/core/memory/ReasoningBankAdapter.js +80 -0
  194. package/dist/core/memory/ReasoningBankAdapter.js.map +1 -0
  195. package/dist/core/memory/SwarmMemoryManager.d.ts +75 -3
  196. package/dist/core/memory/SwarmMemoryManager.d.ts.map +1 -1
  197. package/dist/core/memory/SwarmMemoryManager.js +236 -52
  198. package/dist/core/memory/SwarmMemoryManager.js.map +1 -1
  199. package/dist/core/memory/index.d.ts +4 -0
  200. package/dist/core/memory/index.d.ts.map +1 -1
  201. package/dist/core/memory/index.js +9 -1
  202. package/dist/core/memory/index.js.map +1 -1
  203. package/dist/core/neural/NeuralTrainer.d.ts +137 -0
  204. package/dist/core/neural/NeuralTrainer.d.ts.map +1 -0
  205. package/dist/core/neural/NeuralTrainer.js +543 -0
  206. package/dist/core/neural/NeuralTrainer.js.map +1 -0
  207. package/dist/core/neural/index.d.ts +8 -0
  208. package/dist/core/neural/index.d.ts.map +1 -0
  209. package/dist/core/neural/index.js +24 -0
  210. package/dist/core/neural/index.js.map +1 -0
  211. package/dist/core/neural/types.d.ts +216 -0
  212. package/dist/core/neural/types.d.ts.map +1 -0
  213. package/dist/core/neural/types.js +8 -0
  214. package/dist/core/neural/types.js.map +1 -0
  215. package/dist/core/security/CertificateValidator.d.ts +130 -0
  216. package/dist/core/security/CertificateValidator.d.ts.map +1 -0
  217. package/dist/core/security/CertificateValidator.js +376 -0
  218. package/dist/core/security/CertificateValidator.js.map +1 -0
  219. package/dist/core/transport/QUICTransport.d.ts +62 -0
  220. package/dist/core/transport/QUICTransport.d.ts.map +1 -0
  221. package/dist/core/transport/QUICTransport.js +381 -0
  222. package/dist/core/transport/QUICTransport.js.map +1 -0
  223. package/dist/core/transport/SecureQUICTransport.d.ts +71 -0
  224. package/dist/core/transport/SecureQUICTransport.d.ts.map +1 -0
  225. package/dist/core/transport/SecureQUICTransport.js +253 -0
  226. package/dist/core/transport/SecureQUICTransport.js.map +1 -0
  227. package/dist/learning/AdvancedFeatureExtractor.d.ts +123 -0
  228. package/dist/learning/AdvancedFeatureExtractor.d.ts.map +1 -0
  229. package/dist/learning/AdvancedFeatureExtractor.js +423 -0
  230. package/dist/learning/AdvancedFeatureExtractor.js.map +1 -0
  231. package/dist/learning/FlakyPredictionModel.d.ts +11 -1
  232. package/dist/learning/FlakyPredictionModel.d.ts.map +1 -1
  233. package/dist/learning/FlakyPredictionModel.js +82 -35
  234. package/dist/learning/FlakyPredictionModel.js.map +1 -1
  235. package/dist/learning/FlakyTestDetector.d.ts +9 -0
  236. package/dist/learning/FlakyTestDetector.d.ts.map +1 -1
  237. package/dist/learning/FlakyTestDetector.js +28 -6
  238. package/dist/learning/FlakyTestDetector.js.map +1 -1
  239. package/dist/learning/ImprovementLoop.d.ts +16 -2
  240. package/dist/learning/ImprovementLoop.d.ts.map +1 -1
  241. package/dist/learning/ImprovementLoop.js +67 -8
  242. package/dist/learning/ImprovementLoop.js.map +1 -1
  243. package/dist/learning/ImprovementWorker.d.ts +83 -0
  244. package/dist/learning/ImprovementWorker.d.ts.map +1 -0
  245. package/dist/learning/ImprovementWorker.js +164 -0
  246. package/dist/learning/ImprovementWorker.js.map +1 -0
  247. package/dist/learning/NeuralPatternMatcher.d.ts +184 -0
  248. package/dist/learning/NeuralPatternMatcher.d.ts.map +1 -0
  249. package/dist/learning/NeuralPatternMatcher.js +702 -0
  250. package/dist/learning/NeuralPatternMatcher.js.map +1 -0
  251. package/dist/learning/NeuralTrainer.d.ts +209 -0
  252. package/dist/learning/NeuralTrainer.d.ts.map +1 -0
  253. package/dist/learning/NeuralTrainer.js +478 -0
  254. package/dist/learning/NeuralTrainer.js.map +1 -0
  255. package/dist/learning/index.d.ts +13 -7
  256. package/dist/learning/index.d.ts.map +1 -1
  257. package/dist/learning/index.js +27 -11
  258. package/dist/learning/index.js.map +1 -1
  259. package/dist/learning/types.d.ts +1 -0
  260. package/dist/learning/types.d.ts.map +1 -1
  261. package/dist/learning/types.js +16 -0
  262. package/dist/learning/types.js.map +1 -1
  263. package/dist/mcp/MCPToolRegistry.d.ts +34 -0
  264. package/dist/mcp/MCPToolRegistry.d.ts.map +1 -0
  265. package/dist/mcp/MCPToolRegistry.js +48 -0
  266. package/dist/mcp/MCPToolRegistry.js.map +1 -0
  267. package/dist/mcp/server.d.ts +4 -4
  268. package/dist/mcp/services/AgentRegistry.d.ts.map +1 -1
  269. package/dist/mcp/services/AgentRegistry.js +7 -1
  270. package/dist/mcp/services/AgentRegistry.js.map +1 -1
  271. package/dist/transport/QUICTransport.d.ts +340 -0
  272. package/dist/transport/QUICTransport.d.ts.map +1 -0
  273. package/dist/transport/QUICTransport.js +814 -0
  274. package/dist/transport/QUICTransport.js.map +1 -0
  275. package/dist/transport/UDPTransport.d.ts +348 -0
  276. package/dist/transport/UDPTransport.d.ts.map +1 -0
  277. package/dist/transport/UDPTransport.js +820 -0
  278. package/dist/transport/UDPTransport.js.map +1 -0
  279. package/dist/types/errors.d.ts +1 -1
  280. package/dist/types/index.d.ts +37 -0
  281. package/dist/types/index.d.ts.map +1 -1
  282. package/dist/types/index.js +2 -0
  283. package/dist/types/index.js.map +1 -1
  284. package/dist/types/quic.d.ts +339 -0
  285. package/dist/types/quic.d.ts.map +1 -0
  286. package/dist/types/quic.js +48 -0
  287. package/dist/types/quic.js.map +1 -0
  288. package/dist/utils/Config.js +1 -1
  289. package/dist/utils/Config.js.map +1 -1
  290. package/dist/utils/Database.d.ts +14 -0
  291. package/dist/utils/Database.d.ts.map +1 -1
  292. package/dist/utils/Database.js +51 -4
  293. package/dist/utils/Database.js.map +1 -1
  294. package/dist/utils/Logger.d.ts.map +1 -1
  295. package/dist/utils/Logger.js +111 -26
  296. package/dist/utils/Logger.js.map +1 -1
  297. package/package.json +30 -7
@@ -0,0 +1,712 @@
1
+ ---
2
+ name: hive-mind-advanced
3
+ description: Advanced Hive Mind collective intelligence system for queen-led multi-agent coordination with consensus mechanisms and persistent memory
4
+ version: 1.0.0
5
+ category: coordination
6
+ tags: [hive-mind, swarm, queen-worker, consensus, collective-intelligence, multi-agent, coordination]
7
+ author: Claude Flow Team
8
+ ---
9
+
10
+ # Hive Mind Advanced Skill
11
+
12
+ Master the advanced Hive Mind collective intelligence system for sophisticated multi-agent coordination using queen-led architecture, Byzantine consensus, and collective memory.
13
+
14
+ ## Overview
15
+
16
+ The 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.
17
+
18
+ ## Core Concepts
19
+
20
+ ### Architecture Patterns
21
+
22
+ **Queen-Led Coordination**
23
+ - Strategic queen agents orchestrate high-level objectives
24
+ - Tactical queens manage mid-level execution
25
+ - Adaptive queens dynamically adjust strategies based on performance
26
+
27
+ **Worker Specialization**
28
+ - Researcher agents: Analysis and investigation
29
+ - Coder agents: Implementation and development
30
+ - Analyst agents: Data processing and metrics
31
+ - Tester agents: Quality assurance and validation
32
+ - Architect agents: System design and planning
33
+ - Reviewer agents: Code review and improvement
34
+ - Optimizer agents: Performance enhancement
35
+ - Documenter agents: Documentation generation
36
+
37
+ **Collective Memory System**
38
+ - Shared knowledge base across all agents
39
+ - LRU cache with memory pressure handling
40
+ - SQLite persistence with WAL mode
41
+ - Memory consolidation and association
42
+ - Access pattern tracking and optimization
43
+
44
+ ### Consensus Mechanisms
45
+
46
+ **Majority Consensus**
47
+ Simple voting where the option with most votes wins.
48
+
49
+ **Weighted Consensus**
50
+ Queen vote counts as 3x weight, providing strategic guidance.
51
+
52
+ **Byzantine Fault Tolerance**
53
+ Requires 2/3 majority for decision approval, ensuring robust consensus even with faulty agents.
54
+
55
+ ## Getting Started
56
+
57
+ ### 1. Initialize Hive Mind
58
+
59
+ ```bash
60
+ # Basic initialization
61
+ npx claude-flow hive-mind init
62
+
63
+ # Force reinitialize
64
+ npx claude-flow hive-mind init --force
65
+
66
+ # Custom configuration
67
+ npx claude-flow hive-mind init --config hive-config.json
68
+ ```
69
+
70
+ ### 2. Spawn a Swarm
71
+
72
+ ```bash
73
+ # Basic spawn with objective
74
+ npx claude-flow hive-mind spawn "Build microservices architecture"
75
+
76
+ # Strategic queen type
77
+ npx claude-flow hive-mind spawn "Research AI patterns" --queen-type strategic
78
+
79
+ # Tactical queen with max workers
80
+ npx claude-flow hive-mind spawn "Implement API" --queen-type tactical --max-workers 12
81
+
82
+ # Adaptive queen with consensus
83
+ npx claude-flow hive-mind spawn "Optimize system" --queen-type adaptive --consensus byzantine
84
+
85
+ # Generate Claude Code commands
86
+ npx claude-flow hive-mind spawn "Build full-stack app" --claude
87
+ ```
88
+
89
+ ### 3. Monitor Status
90
+
91
+ ```bash
92
+ # Check hive mind status
93
+ npx claude-flow hive-mind status
94
+
95
+ # Get detailed metrics
96
+ npx claude-flow hive-mind metrics
97
+
98
+ # Monitor collective memory
99
+ npx claude-flow hive-mind memory
100
+ ```
101
+
102
+ ## Advanced Workflows
103
+
104
+ ### Session Management
105
+
106
+ **Create and Manage Sessions**
107
+
108
+ ```bash
109
+ # List active sessions
110
+ npx claude-flow hive-mind sessions
111
+
112
+ # Pause a session
113
+ npx claude-flow hive-mind pause <session-id>
114
+
115
+ # Resume a paused session
116
+ npx claude-flow hive-mind resume <session-id>
117
+
118
+ # Stop a running session
119
+ npx claude-flow hive-mind stop <session-id>
120
+ ```
121
+
122
+ **Session Features**
123
+ - Automatic checkpoint creation
124
+ - Progress tracking with completion percentages
125
+ - Parent-child process management
126
+ - Session logs with event tracking
127
+ - Export/import capabilities
128
+
129
+ ### Consensus Building
130
+
131
+ The Hive Mind builds consensus through structured voting:
132
+
133
+ ```javascript
134
+ // Programmatic consensus building
135
+ const decision = await hiveMind.buildConsensus(
136
+ 'Architecture pattern selection',
137
+ ['microservices', 'monolith', 'serverless']
138
+ );
139
+
140
+ // Result includes:
141
+ // - decision: Winning option
142
+ // - confidence: Vote percentage
143
+ // - votes: Individual agent votes
144
+ ```
145
+
146
+ **Consensus Algorithms**
147
+
148
+ 1. **Majority** - Simple democratic voting
149
+ 2. **Weighted** - Queen has 3x voting power
150
+ 3. **Byzantine** - 2/3 supermajority required
151
+
152
+ ### Collective Memory
153
+
154
+ **Storing Knowledge**
155
+
156
+ ```javascript
157
+ // Store in collective memory
158
+ await memory.store('api-patterns', {
159
+ rest: { pros: [...], cons: [...] },
160
+ graphql: { pros: [...], cons: [...] }
161
+ }, 'knowledge', { confidence: 0.95 });
162
+ ```
163
+
164
+ **Memory Types**
165
+ - `knowledge`: Permanent insights (no TTL)
166
+ - `context`: Session context (1 hour TTL)
167
+ - `task`: Task-specific data (30 min TTL)
168
+ - `result`: Execution results (permanent, compressed)
169
+ - `error`: Error logs (24 hour TTL)
170
+ - `metric`: Performance metrics (1 hour TTL)
171
+ - `consensus`: Decision records (permanent)
172
+ - `system`: System configuration (permanent)
173
+
174
+ **Searching and Retrieval**
175
+
176
+ ```javascript
177
+ // Search memory by pattern
178
+ const results = await memory.search('api*', {
179
+ type: 'knowledge',
180
+ minConfidence: 0.8,
181
+ limit: 50
182
+ });
183
+
184
+ // Get related memories
185
+ const related = await memory.getRelated('api-patterns', 10);
186
+
187
+ // Build associations
188
+ await memory.associate('rest-api', 'authentication', 0.9);
189
+ ```
190
+
191
+ ### Task Distribution
192
+
193
+ **Automatic Worker Assignment**
194
+
195
+ The system intelligently assigns tasks based on:
196
+ - Keyword matching with agent specialization
197
+ - Historical performance metrics
198
+ - Worker availability and load
199
+ - Task complexity analysis
200
+
201
+ ```javascript
202
+ // Create task (auto-assigned)
203
+ const task = await hiveMind.createTask(
204
+ 'Implement user authentication',
205
+ priority: 8,
206
+ { estimatedDuration: 30000 }
207
+ );
208
+ ```
209
+
210
+ **Auto-Scaling**
211
+
212
+ ```javascript
213
+ // Configure auto-scaling
214
+ const config = {
215
+ autoScale: true,
216
+ maxWorkers: 12,
217
+ scaleUpThreshold: 2, // Pending tasks per idle worker
218
+ scaleDownThreshold: 2 // Idle workers above pending tasks
219
+ };
220
+ ```
221
+
222
+ ## Integration Patterns
223
+
224
+ ### With Claude Code
225
+
226
+ Generate Claude Code spawn commands directly:
227
+
228
+ ```bash
229
+ npx claude-flow hive-mind spawn "Build REST API" --claude
230
+ ```
231
+
232
+ Output:
233
+ ```javascript
234
+ Task("Queen Coordinator", "Orchestrate REST API development...", "coordinator")
235
+ Task("Backend Developer", "Implement Express routes...", "backend-dev")
236
+ Task("Database Architect", "Design PostgreSQL schema...", "code-analyzer")
237
+ Task("Test Engineer", "Create Jest test suite...", "tester")
238
+ ```
239
+
240
+ ### With SPARC Methodology
241
+
242
+ ```bash
243
+ # Use hive mind for SPARC workflow
244
+ npx claude-flow sparc tdd "User authentication" --hive-mind
245
+
246
+ # Spawns:
247
+ # - Specification agent
248
+ # - Architecture agent
249
+ # - Coder agents
250
+ # - Tester agents
251
+ # - Reviewer agents
252
+ ```
253
+
254
+ ### With GitHub Integration
255
+
256
+ ```bash
257
+ # Repository analysis with hive mind
258
+ npx claude-flow hive-mind spawn "Analyze repo quality" --objective "owner/repo"
259
+
260
+ # PR review coordination
261
+ npx claude-flow hive-mind spawn "Review PR #123" --queen-type tactical
262
+ ```
263
+
264
+ ## Performance Optimization
265
+
266
+ ### Memory Optimization
267
+
268
+ The collective memory system includes advanced optimizations:
269
+
270
+ **LRU Cache**
271
+ - Configurable cache size (default: 1000 entries)
272
+ - Memory pressure handling (default: 50MB)
273
+ - Automatic eviction of least-used entries
274
+
275
+ **Database Optimization**
276
+ - WAL (Write-Ahead Logging) mode
277
+ - 64MB cache size
278
+ - 256MB memory mapping
279
+ - Prepared statements for common queries
280
+ - Automatic ANALYZE and OPTIMIZE
281
+
282
+ **Object Pooling**
283
+ - Query result pooling
284
+ - Memory entry pooling
285
+ - Reduced garbage collection pressure
286
+
287
+ ### Performance Metrics
288
+
289
+ ```javascript
290
+ // Get performance insights
291
+ const insights = hiveMind.getPerformanceInsights();
292
+
293
+ // Includes:
294
+ // - asyncQueue utilization
295
+ // - Batch processing stats
296
+ // - Success rates
297
+ // - Average processing times
298
+ // - Memory efficiency
299
+ ```
300
+
301
+ ### Task Execution
302
+
303
+ **Parallel Processing**
304
+ - Batch agent spawning (5 agents per batch)
305
+ - Concurrent task orchestration
306
+ - Async operation optimization
307
+ - Non-blocking task assignment
308
+
309
+ **Benchmarks**
310
+ - 10-20x faster batch spawning
311
+ - 2.8-4.4x speed improvement overall
312
+ - 32.3% token reduction
313
+ - 84.8% SWE-Bench solve rate
314
+
315
+ ## Configuration
316
+
317
+ ### Hive Mind Config
318
+
319
+ ```javascript
320
+ {
321
+ "objective": "Build microservices",
322
+ "name": "my-hive",
323
+ "queenType": "strategic", // strategic | tactical | adaptive
324
+ "maxWorkers": 8,
325
+ "consensusAlgorithm": "byzantine", // majority | weighted | byzantine
326
+ "autoScale": true,
327
+ "memorySize": 100, // MB
328
+ "taskTimeout": 60, // minutes
329
+ "encryption": false
330
+ }
331
+ ```
332
+
333
+ ### Memory Config
334
+
335
+ ```javascript
336
+ {
337
+ "maxSize": 100, // MB
338
+ "compressionThreshold": 1024, // bytes
339
+ "gcInterval": 300000, // 5 minutes
340
+ "cacheSize": 1000,
341
+ "cacheMemoryMB": 50,
342
+ "enablePooling": true,
343
+ "enableAsyncOperations": true
344
+ }
345
+ ```
346
+
347
+ ## Hooks Integration
348
+
349
+ Hive Mind integrates with Claude Flow hooks for automation:
350
+
351
+ **Pre-Task Hooks**
352
+ - Auto-assign agents by file type
353
+ - Validate objective complexity
354
+ - Optimize topology selection
355
+ - Cache search patterns
356
+
357
+ **Post-Task Hooks**
358
+ - Auto-format deliverables
359
+ - Train neural patterns
360
+ - Update collective memory
361
+ - Analyze performance bottlenecks
362
+
363
+ **Session Hooks**
364
+ - Generate session summaries
365
+ - Persist checkpoint data
366
+ - Track comprehensive metrics
367
+ - Restore execution context
368
+
369
+ ## Best Practices
370
+
371
+ ### 1. Choose the Right Queen Type
372
+
373
+ **Strategic Queens** - For research, planning, and analysis
374
+ ```bash
375
+ npx claude-flow hive-mind spawn "Research ML frameworks" --queen-type strategic
376
+ ```
377
+
378
+ **Tactical Queens** - For implementation and execution
379
+ ```bash
380
+ npx claude-flow hive-mind spawn "Build authentication" --queen-type tactical
381
+ ```
382
+
383
+ **Adaptive Queens** - For optimization and dynamic tasks
384
+ ```bash
385
+ npx claude-flow hive-mind spawn "Optimize performance" --queen-type adaptive
386
+ ```
387
+
388
+ ### 2. Leverage Consensus
389
+
390
+ Use consensus for critical decisions:
391
+ - Architecture pattern selection
392
+ - Technology stack choices
393
+ - Implementation approach
394
+ - Code review approval
395
+ - Release readiness
396
+
397
+ ### 3. Utilize Collective Memory
398
+
399
+ **Store Learnings**
400
+ ```javascript
401
+ // After successful pattern implementation
402
+ await memory.store('auth-pattern', {
403
+ approach: 'JWT with refresh tokens',
404
+ pros: ['Stateless', 'Scalable'],
405
+ cons: ['Token size', 'Revocation complexity'],
406
+ implementation: {...}
407
+ }, 'knowledge', { confidence: 0.95 });
408
+ ```
409
+
410
+ **Build Associations**
411
+ ```javascript
412
+ // Link related concepts
413
+ await memory.associate('jwt-auth', 'refresh-tokens', 0.9);
414
+ await memory.associate('jwt-auth', 'oauth2', 0.7);
415
+ ```
416
+
417
+ ### 4. Monitor Performance
418
+
419
+ ```bash
420
+ # Regular status checks
421
+ npx claude-flow hive-mind status
422
+
423
+ # Track metrics
424
+ npx claude-flow hive-mind metrics
425
+
426
+ # Analyze memory usage
427
+ npx claude-flow hive-mind memory
428
+ ```
429
+
430
+ ### 5. Session Management
431
+
432
+ **Checkpoint Frequently**
433
+ ```javascript
434
+ // Create checkpoints at key milestones
435
+ await sessionManager.saveCheckpoint(
436
+ sessionId,
437
+ 'api-routes-complete',
438
+ { completedRoutes: [...], remaining: [...] }
439
+ );
440
+ ```
441
+
442
+ **Resume Sessions**
443
+ ```bash
444
+ # Resume from any previous state
445
+ npx claude-flow hive-mind resume <session-id>
446
+ ```
447
+
448
+ ## Troubleshooting
449
+
450
+ ### Memory Issues
451
+
452
+ **High Memory Usage**
453
+ ```bash
454
+ # Run garbage collection
455
+ npx claude-flow hive-mind memory --gc
456
+
457
+ # Optimize database
458
+ npx claude-flow hive-mind memory --optimize
459
+
460
+ # Export and clear
461
+ npx claude-flow hive-mind memory --export --clear
462
+ ```
463
+
464
+ **Low Cache Hit Rate**
465
+ ```javascript
466
+ // Increase cache size in config
467
+ {
468
+ "cacheSize": 2000,
469
+ "cacheMemoryMB": 100
470
+ }
471
+ ```
472
+
473
+ ### Performance Issues
474
+
475
+ **Slow Task Assignment**
476
+ ```javascript
477
+ // Enable worker type caching
478
+ // The system caches best worker matches for 5 minutes
479
+ // Automatic - no configuration needed
480
+ ```
481
+
482
+ **High Queue Utilization**
483
+ ```javascript
484
+ // Increase async queue concurrency
485
+ {
486
+ "asyncQueueConcurrency": 20 // Default: min(maxWorkers * 2, 20)
487
+ }
488
+ ```
489
+
490
+ ### Consensus Failures
491
+
492
+ **No Consensus Reached (Byzantine)**
493
+ ```bash
494
+ # Switch to weighted consensus for more decisive results
495
+ npx claude-flow hive-mind spawn "..." --consensus weighted
496
+
497
+ # Or use simple majority
498
+ npx claude-flow hive-mind spawn "..." --consensus majority
499
+ ```
500
+
501
+ ## Advanced Topics
502
+
503
+ ### Custom Worker Types
504
+
505
+ Define specialized workers in `.claude/agents/`:
506
+
507
+ ```yaml
508
+ name: security-auditor
509
+ type: specialist
510
+ capabilities:
511
+ - vulnerability-scanning
512
+ - security-review
513
+ - penetration-testing
514
+ - compliance-checking
515
+ priority: high
516
+ ```
517
+
518
+ ### Neural Pattern Training
519
+
520
+ The system trains on successful patterns:
521
+
522
+ ```javascript
523
+ // Automatic pattern learning
524
+ // Happens after successful task completion
525
+ // Stores in collective memory
526
+ // Improves future task matching
527
+ ```
528
+
529
+ ### Multi-Hive Coordination
530
+
531
+ Run multiple hive minds simultaneously:
532
+
533
+ ```bash
534
+ # Frontend hive
535
+ npx claude-flow hive-mind spawn "Build UI" --name frontend-hive
536
+
537
+ # Backend hive
538
+ npx claude-flow hive-mind spawn "Build API" --name backend-hive
539
+
540
+ # They share collective memory for coordination
541
+ ```
542
+
543
+ ### Export/Import Sessions
544
+
545
+ ```bash
546
+ # Export session for backup
547
+ npx claude-flow hive-mind export <session-id> --output backup.json
548
+
549
+ # Import session
550
+ npx claude-flow hive-mind import backup.json
551
+ ```
552
+
553
+ ## API Reference
554
+
555
+ ### HiveMindCore
556
+
557
+ ```javascript
558
+ const hiveMind = new HiveMindCore({
559
+ objective: 'Build system',
560
+ queenType: 'strategic',
561
+ maxWorkers: 8,
562
+ consensusAlgorithm: 'byzantine'
563
+ });
564
+
565
+ await hiveMind.initialize();
566
+ await hiveMind.spawnQueen(queenData);
567
+ await hiveMind.spawnWorkers(['coder', 'tester']);
568
+ await hiveMind.createTask('Implement feature', 7);
569
+ const decision = await hiveMind.buildConsensus('topic', options);
570
+ const status = hiveMind.getStatus();
571
+ await hiveMind.shutdown();
572
+ ```
573
+
574
+ ### CollectiveMemory
575
+
576
+ ```javascript
577
+ const memory = new CollectiveMemory({
578
+ swarmId: 'hive-123',
579
+ maxSize: 100,
580
+ cacheSize: 1000
581
+ });
582
+
583
+ await memory.store(key, value, type, metadata);
584
+ const data = await memory.retrieve(key);
585
+ const results = await memory.search(pattern, options);
586
+ const related = await memory.getRelated(key, limit);
587
+ await memory.associate(key1, key2, strength);
588
+ const stats = memory.getStatistics();
589
+ const analytics = memory.getAnalytics();
590
+ const health = await memory.healthCheck();
591
+ ```
592
+
593
+ ### HiveMindSessionManager
594
+
595
+ ```javascript
596
+ const sessionManager = new HiveMindSessionManager();
597
+
598
+ const sessionId = await sessionManager.createSession(
599
+ swarmId, swarmName, objective, metadata
600
+ );
601
+
602
+ await sessionManager.saveCheckpoint(sessionId, name, data);
603
+ const sessions = await sessionManager.getActiveSessions();
604
+ const session = await sessionManager.getSession(sessionId);
605
+ await sessionManager.pauseSession(sessionId);
606
+ await sessionManager.resumeSession(sessionId);
607
+ await sessionManager.stopSession(sessionId);
608
+ await sessionManager.completeSession(sessionId);
609
+ ```
610
+
611
+ ## Examples
612
+
613
+ ### Full-Stack Development
614
+
615
+ ```bash
616
+ # Initialize hive mind
617
+ npx claude-flow hive-mind init
618
+
619
+ # Spawn full-stack hive
620
+ npx claude-flow hive-mind spawn "Build e-commerce platform" \
621
+ --queen-type strategic \
622
+ --max-workers 10 \
623
+ --consensus weighted \
624
+ --claude
625
+
626
+ # Output generates Claude Code commands:
627
+ # - Queen coordinator
628
+ # - Frontend developers (React)
629
+ # - Backend developers (Node.js)
630
+ # - Database architects
631
+ # - DevOps engineers
632
+ # - Security auditors
633
+ # - Test engineers
634
+ # - Documentation specialists
635
+ ```
636
+
637
+ ### Research and Analysis
638
+
639
+ ```bash
640
+ # Spawn research hive
641
+ npx claude-flow hive-mind spawn "Research GraphQL vs REST" \
642
+ --queen-type adaptive \
643
+ --consensus byzantine
644
+
645
+ # Researchers gather data
646
+ # Analysts process findings
647
+ # Queen builds consensus on recommendation
648
+ # Results stored in collective memory
649
+ ```
650
+
651
+ ### Code Review
652
+
653
+ ```bash
654
+ # Review coordination
655
+ npx claude-flow hive-mind spawn "Review PR #456" \
656
+ --queen-type tactical \
657
+ --max-workers 6
658
+
659
+ # Spawns:
660
+ # - Code analyzers
661
+ # - Security reviewers
662
+ # - Performance reviewers
663
+ # - Test coverage analyzers
664
+ # - Documentation reviewers
665
+ # - Consensus on approval/changes
666
+ ```
667
+
668
+ ## Skill Progression
669
+
670
+ ### Beginner
671
+ 1. Initialize hive mind
672
+ 2. Spawn basic swarms
673
+ 3. Monitor status
674
+ 4. Use majority consensus
675
+
676
+ ### Intermediate
677
+ 1. Configure queen types
678
+ 2. Implement session management
679
+ 3. Use weighted consensus
680
+ 4. Access collective memory
681
+ 5. Enable auto-scaling
682
+
683
+ ### Advanced
684
+ 1. Byzantine fault tolerance
685
+ 2. Memory optimization
686
+ 3. Custom worker types
687
+ 4. Multi-hive coordination
688
+ 5. Neural pattern training
689
+ 6. Session export/import
690
+ 7. Performance tuning
691
+
692
+ ## Related Skills
693
+
694
+ - `swarm-orchestration`: Basic swarm coordination
695
+ - `consensus-mechanisms`: Distributed decision making
696
+ - `memory-systems`: Advanced memory management
697
+ - `sparc-methodology`: Structured development workflow
698
+ - `github-integration`: Repository coordination
699
+
700
+ ## References
701
+
702
+ - [Hive Mind Documentation](https://github.com/ruvnet/claude-flow/docs/hive-mind)
703
+ - [Collective Intelligence Patterns](https://github.com/ruvnet/claude-flow/docs/patterns)
704
+ - [Byzantine Consensus](https://github.com/ruvnet/claude-flow/docs/consensus)
705
+ - [Memory Optimization](https://github.com/ruvnet/claude-flow/docs/memory)
706
+
707
+ ---
708
+
709
+ **Skill Version**: 1.0.0
710
+ **Last Updated**: 2025-10-19
711
+ **Maintained By**: Claude Flow Team
712
+ **License**: MIT