claude-flow-novice 1.3.5 → 1.5.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 (356) hide show
  1. package/.claude/agents/analysis/code-analyzer.md +3 -20
  2. package/.claude/agents/analysis/code-review/analyze-code-quality.md +1 -1
  3. package/.claude/agents/analyst.md +300 -0
  4. package/.claude/agents/architect.md +557 -0
  5. package/.claude/agents/architecture/system-architect.md +630 -0
  6. package/.claude/agents/architecture/system-design/arch-system-design.md +1 -1
  7. package/.claude/agents/base-template-generator.md +24 -1
  8. package/.claude/agents/coder.md +180 -0
  9. package/.claude/agents/consensus/byzantine-coordinator.md +4 -21
  10. package/.claude/agents/consensus/consensus-builder.md +3 -20
  11. package/.claude/agents/consensus/crdt-synchronizer.md +4 -21
  12. package/.claude/agents/consensus/gossip-coordinator.md +4 -21
  13. package/.claude/agents/consensus/performance-benchmarker.md +4 -21
  14. package/.claude/agents/consensus/quorum-manager.md +4 -21
  15. package/.claude/agents/consensus/raft-manager.md +4 -21
  16. package/.claude/agents/consensus/security-manager.md +4 -21
  17. package/.claude/agents/coordinator.md +842 -0
  18. package/.claude/agents/data/ml/data-ml-model.md +2 -2
  19. package/.claude/agents/development/backend/dev-backend-api.md +2 -2
  20. package/.claude/agents/devops/ci-cd/ops-cicd-github.md +2 -2
  21. package/.claude/agents/devops/devops-engineer.md +638 -0
  22. package/.claude/agents/documentation/api-docs/docs-api-openapi.md +2 -2
  23. package/.claude/agents/github/code-review-swarm.md +1 -1
  24. package/.claude/agents/github/github-specialist.md +856 -0
  25. package/.claude/agents/github/pr-manager.md +1 -1
  26. package/.claude/agents/github/release-manager.md +1 -1
  27. package/.claude/agents/neural/neural-pattern-agent.md +762 -0
  28. package/.claude/agents/optimization/benchmark-suite.md +1 -1
  29. package/.claude/agents/optimization/perf-analyzer.md +725 -0
  30. package/.claude/agents/optimization/performance-monitor.md +1 -1
  31. package/.claude/agents/planner.md +135 -0
  32. package/.claude/agents/researcher.md +185 -0
  33. package/.claude/agents/reviewer.md +291 -0
  34. package/.claude/agents/security/security-specialist.md +978 -0
  35. package/.claude/agents/sparc/architecture.md +1 -1
  36. package/.claude/agents/sparc/pseudocode.md +1 -1
  37. package/.claude/agents/sparc/refinement.md +1 -1
  38. package/.claude/agents/sparc/specification.md +1 -1
  39. package/.claude/agents/specialized/mobile/spec-mobile-react-native.md +2 -2
  40. package/.claude/agents/swarm/adaptive-coordinator-enhanced.md +746 -0
  41. package/.claude/agents/tester.md +663 -0
  42. package/.claude/agents/testing/unit/tdd-london-swarm.md +1 -1
  43. package/.claude/agents/testing/validation/production-validator.md +1 -1
  44. package/.claude/commands/claude-soul.js +1 -1
  45. package/.claude/hooks.json +12 -15
  46. package/{.claude → .claude-flow-novice/.claude}/agents/MIGRATION_SUMMARY.md +1 -1
  47. package/.claude-flow-novice/.claude/agents/analysis/code-analyzer.md +192 -0
  48. package/.claude-flow-novice/.claude/agents/analysis/code-review/analyze-code-quality.md +180 -0
  49. package/.claude-flow-novice/.claude/agents/analyst.md +300 -0
  50. package/.claude-flow-novice/.claude/agents/architect.md +557 -0
  51. package/.claude-flow-novice/.claude/agents/architecture/system-architect.md +630 -0
  52. package/.claude-flow-novice/.claude/agents/architecture/system-design/arch-system-design.md +156 -0
  53. package/.claude-flow-novice/.claude/agents/backend-dev.json +42 -0
  54. package/.claude-flow-novice/.claude/agents/base-template-generator.md +65 -0
  55. package/.claude-flow-novice/.claude/agents/code-analyzer.json +39 -0
  56. package/.claude-flow-novice/.claude/agents/coder.json +42 -0
  57. package/.claude-flow-novice/.claude/agents/coder.md +180 -0
  58. package/.claude-flow-novice/.claude/agents/consensus/byzantine-coordinator.md +46 -0
  59. package/.claude-flow-novice/.claude/agents/consensus/consensus-builder.md +225 -0
  60. package/.claude-flow-novice/.claude/agents/consensus/crdt-synchronizer.md +980 -0
  61. package/.claude-flow-novice/.claude/agents/consensus/gossip-coordinator.md +46 -0
  62. package/.claude-flow-novice/.claude/agents/consensus/performance-benchmarker.md +834 -0
  63. package/.claude-flow-novice/.claude/agents/consensus/quorum-manager.md +806 -0
  64. package/.claude-flow-novice/.claude/agents/consensus/raft-manager.md +46 -0
  65. package/.claude-flow-novice/.claude/agents/consensus/security-manager.md +605 -0
  66. package/.claude-flow-novice/.claude/agents/coordinator.md +842 -0
  67. package/.claude-flow-novice/.claude/agents/data/ml/data-ml-model.md +193 -0
  68. package/.claude-flow-novice/.claude/agents/development/backend/dev-backend-api.md +142 -0
  69. package/.claude-flow-novice/.claude/agents/devops/ci-cd/ops-cicd-github.md +164 -0
  70. package/.claude-flow-novice/.claude/agents/devops/devops-engineer.md +638 -0
  71. package/.claude-flow-novice/.claude/agents/documentation/api-docs/docs-api-openapi.md +174 -0
  72. package/.claude-flow-novice/.claude/agents/github/code-review-swarm.md +538 -0
  73. package/.claude-flow-novice/.claude/agents/github/github-modes.md +173 -0
  74. package/.claude-flow-novice/.claude/agents/github/github-specialist.md +856 -0
  75. package/.claude-flow-novice/.claude/agents/github/issue-tracker.md +319 -0
  76. package/.claude-flow-novice/.claude/agents/github/multi-repo-swarm.md +553 -0
  77. package/.claude-flow-novice/.claude/agents/github/pr-manager.md +191 -0
  78. package/.claude-flow-novice/.claude/agents/github/project-board-sync.md +509 -0
  79. package/.claude-flow-novice/.claude/agents/github/release-manager.md +367 -0
  80. package/.claude-flow-novice/.claude/agents/github/release-swarm.md +583 -0
  81. package/.claude-flow-novice/.claude/agents/github/repo-architect.md +398 -0
  82. package/.claude-flow-novice/.claude/agents/github/swarm-issue.md +573 -0
  83. package/.claude-flow-novice/.claude/agents/github/swarm-pr.md +428 -0
  84. package/.claude-flow-novice/.claude/agents/github/sync-coordinator.md +452 -0
  85. package/.claude-flow-novice/.claude/agents/github/workflow-automation.md +635 -0
  86. package/.claude-flow-novice/.claude/agents/goal/goal-planner.md +73 -0
  87. package/.claude-flow-novice/.claude/agents/neural/neural-pattern-agent.md +762 -0
  88. package/.claude-flow-novice/.claude/agents/neural/safla-neural.md +74 -0
  89. package/.claude-flow-novice/.claude/agents/optimization/benchmark-suite.md +665 -0
  90. package/.claude-flow-novice/.claude/agents/optimization/load-balancer.md +431 -0
  91. package/.claude-flow-novice/.claude/agents/optimization/perf-analyzer.md +725 -0
  92. package/.claude-flow-novice/.claude/agents/optimization/performance-monitor.md +672 -0
  93. package/.claude-flow-novice/.claude/agents/optimization/resource-allocator.md +674 -0
  94. package/.claude-flow-novice/.claude/agents/optimization/topology-optimizer.md +808 -0
  95. package/.claude-flow-novice/.claude/agents/planner.json +41 -0
  96. package/.claude-flow-novice/.claude/agents/planner.md +135 -0
  97. package/.claude-flow-novice/.claude/agents/researcher.json +41 -0
  98. package/.claude-flow-novice/.claude/agents/researcher.md +185 -0
  99. package/.claude-flow-novice/.claude/agents/reviewer.json +39 -0
  100. package/.claude-flow-novice/.claude/agents/reviewer.md +291 -0
  101. package/.claude-flow-novice/.claude/agents/security/security-specialist.md +978 -0
  102. package/.claude-flow-novice/.claude/agents/sparc/architecture.md +472 -0
  103. package/.claude-flow-novice/.claude/agents/sparc/pseudocode.md +318 -0
  104. package/.claude-flow-novice/.claude/agents/sparc/refinement.md +525 -0
  105. package/.claude-flow-novice/.claude/agents/sparc/specification.md +276 -0
  106. package/.claude-flow-novice/.claude/agents/specialized/mobile/spec-mobile-react-native.md +226 -0
  107. package/.claude-flow-novice/.claude/agents/sublinear/consciousness-evolution-agent.md +499 -0
  108. package/.claude-flow-novice/.claude/agents/sublinear/matrix-solver-agent.md +113 -0
  109. package/.claude-flow-novice/.claude/agents/sublinear/nanosecond-scheduler-agent.md +644 -0
  110. package/.claude-flow-novice/.claude/agents/sublinear/pagerank-agent.md +699 -0
  111. package/.claude-flow-novice/.claude/agents/sublinear/phi-calculator-agent.md +749 -0
  112. package/.claude-flow-novice/.claude/agents/sublinear/psycho-symbolic-agent.md +543 -0
  113. package/.claude-flow-novice/.claude/agents/sublinear/sublinear.md +816 -0
  114. package/.claude-flow-novice/.claude/agents/sublinear/temporal-advantage-agent.md +360 -0
  115. package/.claude-flow-novice/.claude/agents/swarm/adaptive-coordinator-enhanced.md +746 -0
  116. package/.claude-flow-novice/.claude/agents/swarm/adaptive-coordinator.md +396 -0
  117. package/.claude-flow-novice/.claude/agents/swarm/hierarchical-coordinator.md +300 -0
  118. package/.claude-flow-novice/.claude/agents/swarm/mesh-coordinator.md +435 -0
  119. package/.claude-flow-novice/.claude/agents/system-architect.json +40 -0
  120. package/.claude-flow-novice/.claude/agents/templates/automation-smart-agent.md +205 -0
  121. package/.claude-flow-novice/.claude/agents/templates/coordinator-swarm-init.md +90 -0
  122. package/.claude-flow-novice/.claude/agents/templates/github-pr-manager.md +177 -0
  123. package/.claude-flow-novice/.claude/agents/templates/implementer-sparc-coder.md +259 -0
  124. package/.claude-flow-novice/.claude/agents/templates/memory-coordinator.md +187 -0
  125. package/.claude-flow-novice/.claude/agents/templates/migration-plan.md +746 -0
  126. package/.claude-flow-novice/.claude/agents/templates/orchestrator-task.md +139 -0
  127. package/.claude-flow-novice/.claude/agents/templates/performance-analyzer.md +199 -0
  128. package/.claude-flow-novice/.claude/agents/templates/sparc-coordinator.md +183 -0
  129. package/.claude-flow-novice/.claude/agents/tester.json +40 -0
  130. package/.claude-flow-novice/.claude/agents/tester.md +663 -0
  131. package/.claude-flow-novice/.claude/agents/testing/e2e/playwright-agent.md +249 -0
  132. package/.claude-flow-novice/.claude/agents/testing/unit/tdd-london-swarm.md +244 -0
  133. package/.claude-flow-novice/.claude/agents/testing/validation/production-validator.md +395 -0
  134. package/.claude-flow-novice/dist/index.js +12 -24
  135. package/.claude-flow-novice/dist/index.js.map +1 -0
  136. package/.claude-flow-novice/dist/src/agents/agent-manager.js +123 -69
  137. package/.claude-flow-novice/dist/src/agents/agent-manager.js.map +1 -1
  138. package/.claude-flow-novice/dist/src/agents/github/utils/hook-integration.js +7 -7
  139. package/.claude-flow-novice/dist/src/agents/github/utils/hook-integration.js.map +1 -1
  140. package/.claude-flow-novice/dist/src/agents/stage3-integration-validator.js +485 -0
  141. package/.claude-flow-novice/dist/src/agents/stage3-integration-validator.js.map +1 -0
  142. package/.claude-flow-novice/dist/src/agents/unified-ultra-fast-agent-manager.js +630 -0
  143. package/.claude-flow-novice/dist/src/agents/unified-ultra-fast-agent-manager.js.map +1 -0
  144. package/.claude-flow-novice/dist/src/cli/commands/agent.js +1 -1
  145. package/.claude-flow-novice/dist/src/cli/commands/agent.js.map +1 -1
  146. package/.claude-flow-novice/dist/src/cli/commands/config-integration.js +6 -6
  147. package/.claude-flow-novice/dist/src/cli/commands/enterprise.js +18 -18
  148. package/.claude-flow-novice/dist/src/cli/commands/enterprise.js.map +1 -1
  149. package/.claude-flow-novice/dist/src/cli/commands/goal-init.js +4 -4
  150. package/.claude-flow-novice/dist/src/cli/commands/help-new.js +23 -23
  151. package/.claude-flow-novice/dist/src/cli/commands/help-new.js.map +1 -1
  152. package/.claude-flow-novice/dist/src/cli/commands/help.js +74 -74
  153. package/.claude-flow-novice/dist/src/cli/commands/help.js.map +1 -1
  154. package/.claude-flow-novice/dist/src/cli/commands/hive-mind/pause.js +2 -2
  155. package/.claude-flow-novice/dist/src/cli/commands/hive-mind/pause.js.map +1 -1
  156. package/.claude-flow-novice/dist/src/cli/commands/hive.js +4 -4
  157. package/.claude-flow-novice/dist/src/cli/commands/index.js +103 -132
  158. package/.claude-flow-novice/dist/src/cli/commands/index.js.map +1 -1
  159. package/.claude-flow-novice/dist/src/cli/commands/mcp.js +1 -1
  160. package/.claude-flow-novice/dist/src/cli/commands/migrate.js +4 -4
  161. package/.claude-flow-novice/dist/src/cli/commands/migrate.js.map +1 -1
  162. package/.claude-flow-novice/dist/src/cli/commands/monitor.js +1 -1
  163. package/.claude-flow-novice/dist/src/cli/commands/neural-init.js +4 -4
  164. package/.claude-flow-novice/dist/src/cli/commands/ruv-swarm.js +8 -8
  165. package/.claude-flow-novice/dist/src/cli/commands/sparc.js +12 -12
  166. package/.claude-flow-novice/dist/src/cli/commands/sparc.js.map +1 -1
  167. package/.claude-flow-novice/dist/src/cli/commands/start/start-command.js +3 -3
  168. package/.claude-flow-novice/dist/src/cli/commands/status.js +1 -1
  169. package/.claude-flow-novice/dist/src/cli/commands/swarm.js +7 -7
  170. package/.claude-flow-novice/dist/src/cli/commands/swarm.js.map +1 -1
  171. package/.claude-flow-novice/dist/src/cli/commands/verification.js +18 -18
  172. package/.claude-flow-novice/dist/src/cli/completion.js +54 -54
  173. package/.claude-flow-novice/dist/src/cli/completion.js.map +1 -1
  174. package/.claude-flow-novice/dist/src/cli/consolidated/ConsolidatedCLI.js +11 -11
  175. package/.claude-flow-novice/dist/src/cli/consolidated/ConsolidatedCLI.js.map +1 -1
  176. package/.claude-flow-novice/dist/src/cli/consolidated/core/CommandHandlers.js +31 -31
  177. package/.claude-flow-novice/dist/src/cli/consolidated/core/TierManager.js +39 -39
  178. package/.claude-flow-novice/dist/src/cli/consolidated/core/TierManager.js.map +1 -1
  179. package/.claude-flow-novice/dist/src/cli/consolidated/help/InteractiveHelp.js +25 -25
  180. package/.claude-flow-novice/dist/src/cli/consolidated/help/InteractiveHelp.js.map +1 -1
  181. package/.claude-flow-novice/dist/src/cli/consolidated/routing/CommandRouter.js +8 -8
  182. package/.claude-flow-novice/dist/src/cli/consolidated/routing/CommandRouter.js.map +1 -1
  183. package/.claude-flow-novice/dist/src/cli/consolidated/utils/IntelligentDefaults.js +6 -6
  184. package/.claude-flow-novice/dist/src/cli/consolidated/utils/IntelligentDefaults.js.map +1 -1
  185. package/.claude-flow-novice/dist/src/cli/consolidated/utils/PerformanceOptimizer.js +7 -7
  186. package/.claude-flow-novice/dist/src/cli/consolidated/utils/PerformanceOptimizer.js.map +1 -1
  187. package/.claude-flow-novice/dist/src/cli/index-remote.js +10 -10
  188. package/.claude-flow-novice/dist/src/cli/index.js +1 -1
  189. package/.claude-flow-novice/dist/src/cli/init/directory-structure.js +8 -8
  190. package/.claude-flow-novice/dist/src/cli/init/index.js +3 -3
  191. package/.claude-flow-novice/dist/src/cli/init/sparc-environment.js +67 -67
  192. package/.claude-flow-novice/dist/src/cli/init/swarm-commands.js +18 -18
  193. package/.claude-flow-novice/dist/src/cli/node-repl.js +2 -2
  194. package/.claude-flow-novice/dist/src/cli/repl.js +1 -1
  195. package/.claude-flow-novice/dist/src/cli/simple-cli.js +68 -68
  196. package/.claude-flow-novice/dist/src/cli/simple-cli.js.map +1 -1
  197. package/.claude-flow-novice/dist/src/cli/simple-commands/session-start-soul.js +271 -0
  198. package/.claude-flow-novice/dist/src/cli/simple-orchestrator.js +7 -7
  199. package/.claude-flow-novice/dist/src/cli/simple-orchestrator.js.map +1 -1
  200. package/.claude-flow-novice/dist/src/cli/ui/fallback-handler.js +7 -7
  201. package/.claude-flow-novice/dist/src/communication/enhanced-event-bus.js +816 -0
  202. package/.claude-flow-novice/dist/src/communication/enhanced-event-bus.js.map +1 -0
  203. package/.claude-flow-novice/dist/src/communication/failure-recovery-system.js +812 -0
  204. package/.claude-flow-novice/dist/src/communication/failure-recovery-system.js.map +1 -0
  205. package/.claude-flow-novice/dist/src/communication/optimized-serialization.js +369 -0
  206. package/.claude-flow-novice/dist/src/communication/optimized-serialization.js.map +1 -0
  207. package/.claude-flow-novice/dist/src/communication/performance-optimizations.js +526 -0
  208. package/.claude-flow-novice/dist/src/communication/performance-optimizations.js.map +1 -0
  209. package/.claude-flow-novice/dist/src/communication/performance-validator.js +532 -0
  210. package/.claude-flow-novice/dist/src/communication/performance-validator.js.map +1 -0
  211. package/.claude-flow-novice/dist/src/communication/priority-message-queue.js +525 -0
  212. package/.claude-flow-novice/dist/src/communication/priority-message-queue.js.map +1 -0
  213. package/.claude-flow-novice/dist/src/communication/shared-buffer-bus.js +218 -0
  214. package/.claude-flow-novice/dist/src/communication/shared-buffer-bus.js.map +1 -0
  215. package/.claude-flow-novice/dist/src/communication/ultra-fast-communication-bus.js +521 -0
  216. package/.claude-flow-novice/dist/src/communication/ultra-fast-communication-bus.js.map +1 -0
  217. package/.claude-flow-novice/dist/src/communication/ultra-fast-serialization.js +563 -0
  218. package/.claude-flow-novice/dist/src/communication/ultra-fast-serialization.js.map +1 -0
  219. package/.claude-flow-novice/dist/src/communication/websocket-cluster.js +344 -0
  220. package/.claude-flow-novice/dist/src/communication/websocket-cluster.js.map +1 -0
  221. package/.claude-flow-novice/dist/src/communication/zero-copy-structures.js +369 -0
  222. package/.claude-flow-novice/dist/src/communication/zero-copy-structures.js.map +1 -0
  223. package/.claude-flow-novice/dist/src/config/config-manager.js +1 -1
  224. package/.claude-flow-novice/dist/src/config/config-manager.js.map +1 -1
  225. package/.claude-flow-novice/dist/src/config/core/intelligent-configuration-manager.js +1 -1
  226. package/.claude-flow-novice/dist/src/config/integration/hooks-integration.js +6 -6
  227. package/.claude-flow-novice/dist/src/config/integration/hooks-integration.js.map +1 -1
  228. package/.claude-flow-novice/dist/src/config/migration/config-migration.js +1 -1
  229. package/.claude-flow-novice/dist/src/config/ruv-swarm-integration.js +1 -1
  230. package/.claude-flow-novice/dist/src/config/utils/zero-config-setup.js +1 -1
  231. package/.claude-flow-novice/dist/src/config/utils/zero-config-setup.js.map +1 -1
  232. package/.claude-flow-novice/dist/src/config/web-portal-config.js +0 -9
  233. package/.claude-flow-novice/dist/src/config/web-portal-config.js.map +1 -1
  234. package/.claude-flow-novice/dist/src/config/zero-config-setup.js +18 -18
  235. package/.claude-flow-novice/dist/src/config/zero-config-setup.js.map +1 -1
  236. package/.claude-flow-novice/dist/src/core/logger.js +33 -10
  237. package/.claude-flow-novice/dist/src/core/logger.js.map +1 -1
  238. package/.claude-flow-novice/dist/src/migration/index.js +1 -1
  239. package/.claude-flow-novice/dist/src/migration/index.js.map +1 -1
  240. package/.claude-flow-novice/dist/src/migration/migration-runner.js +4 -4
  241. package/.claude-flow-novice/dist/src/migration/migration-runner.js.map +1 -1
  242. package/.claude-flow-novice/dist/src/monitoring/agent-health-monitor.js +430 -0
  243. package/.claude-flow-novice/dist/src/monitoring/agent-health-monitor.js.map +1 -0
  244. package/.claude-flow-novice/dist/src/slash-commands/claude-soul.js +248 -365
  245. package/.claude-flow-novice/dist/src/slash-commands/register-all-commands.js +1 -1
  246. package/.claude-flow-novice/dist/src/swarm/claude-code-interface.js +1 -1
  247. package/.claude-flow-novice/dist/src/swarm/claude-flow-executor.js +1 -1
  248. package/.claude-flow-novice/dist/src/swarm/consensus-coordinator.js +471 -0
  249. package/.claude-flow-novice/dist/src/swarm/consensus-coordinator.js.map +1 -0
  250. package/.claude-flow-novice/dist/src/swarm/hive-mind-integration.js +1 -1
  251. package/.claude-flow-novice/dist/src/swarm/large-scale-coordinator.js +543 -0
  252. package/.claude-flow-novice/dist/src/swarm/large-scale-coordinator.js.map +1 -0
  253. package/.claude-flow-novice/dist/src/swarm/optimizations/connection-pool.js +1 -1
  254. package/.claude-flow-novice/dist/src/swarm/optimizations/optimized-executor.js +1 -1
  255. package/.claude-flow-novice/dist/src/swarm/types.js.map +1 -1
  256. package/.claude-flow-novice/dist/src/swarm-fullstack/integrations/communication-bridge.js +709 -0
  257. package/.claude-flow-novice/dist/src/swarm-fullstack/integrations/communication-bridge.js.map +1 -0
  258. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/api-contract-validator.js +612 -0
  259. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/api-contract-validator.js.map +1 -0
  260. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/backend-test-orchestrator.js +679 -0
  261. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/backend-test-orchestrator.js.map +1 -0
  262. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/frontend-test-orchestrator.js +654 -0
  263. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/frontend-test-orchestrator.js.map +1 -0
  264. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/visual-regression.js +402 -0
  265. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/visual-regression.js.map +1 -0
  266. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/convergence-detector.js +459 -0
  267. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/convergence-detector.js.map +1 -0
  268. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/fix-coordinator.js +513 -0
  269. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/fix-coordinator.js.map +1 -0
  270. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/index.js +19 -0
  271. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/index.js.map +1 -0
  272. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/iterative-build-test.js +568 -0
  273. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/iterative-build-test.js.map +1 -0
  274. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/regression-test-manager.js +418 -0
  275. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/regression-test-manager.js.map +1 -0
  276. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/test-result-analyzer.js +530 -0
  277. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/test-result-analyzer.js.map +1 -0
  278. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/workflow-metrics.js +250 -0
  279. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/workflow-metrics.js.map +1 -0
  280. package/.claude-flow-novice/dist/src/task/index.js +7 -7
  281. package/.claude-flow-novice/dist/src/validation/fullstack-integration-validator.js +420 -0
  282. package/.claude-flow-novice/dist/src/validation/fullstack-integration-validator.js.map +1 -0
  283. package/.claude-flow-novice/dist/src/validation/production-validator.js +1435 -0
  284. package/.claude-flow-novice/dist/src/validation/production-validator.js.map +1 -0
  285. package/.claude-flow-novice/dist/src/verification/cli-integration.js +3 -3
  286. package/.claude-flow-novice/dist/src/verification/hooks.js +1 -1
  287. package/CHANGELOG.md +13 -0
  288. package/CLAUDE.md +1032 -61
  289. package/README.md +0 -1
  290. package/config/build/babel.config.cjs +19 -11
  291. package/config/typescript/tsconfig.json +1 -1
  292. package/examples/02-workflows/claude-workflow.json +5 -5
  293. package/examples/claude-api-error-handling.ts +2 -2
  294. package/examples/frontend-testing-demo.ts +470 -0
  295. package/examples/litellm/config/config.yaml +1 -1
  296. package/package.json +13 -7
  297. package/scripts/build/unified-builder.sh +6 -6
  298. package/scripts/build/validate-agents.js +238 -0
  299. package/scripts/post-install-claude-md.js +28 -0
  300. package/scripts/run-production-validation.ts +590 -0
  301. package/scripts/test/test-coordination-features.ts +2 -2
  302. package/scripts/validate-stage3-performance.ts +377 -0
  303. package/src/cli/simple-commands/hooks.js +1 -0
  304. package/src/cli/simple-commands/init/agent-copier.js +0 -2
  305. package/src/cli/simple-commands/init/index.js +18 -110
  306. package/src/cli/simple-commands/init/templates/CLAUDE.md +162 -1158
  307. package/src/cli/simple-commands/init/templates/claude-md.js +38 -157
  308. package/src/swarm-fullstack/integrations/communication-bridge.ts +931 -0
  309. package/src/swarm-fullstack/testing/api-contract-validator.ts +909 -0
  310. package/src/swarm-fullstack/testing/backend-test-orchestrator.ts +791 -0
  311. package/src/swarm-fullstack/testing/frontend-test-orchestrator.ts +853 -0
  312. package/src/swarm-fullstack/testing/visual-regression.ts +507 -0
  313. package/src/swarm-fullstack/workflows/convergence-detector.ts +736 -0
  314. package/src/swarm-fullstack/workflows/fix-coordinator.ts +677 -0
  315. package/src/swarm-fullstack/workflows/index.ts +75 -0
  316. package/src/swarm-fullstack/workflows/iterative-build-test.ts +829 -0
  317. package/src/swarm-fullstack/workflows/regression-test-manager.ts +590 -0
  318. package/src/swarm-fullstack/workflows/test-result-analyzer.ts +739 -0
  319. package/src/swarm-fullstack/workflows/workflow-metrics.ts +399 -0
  320. package/wiki/command-reference/README.md +1 -2
  321. package/wiki/command-reference/mcp-tools/README.md +1 -1
  322. package/wiki/getting-started/claude-code-mcp/README.md +1 -2
  323. package/wiki/getting-started/installation/README.md +2 -10
  324. package/.claude/agents/backend-dev.json +0 -9
  325. package/.claude/agents/code-analyzer.json +0 -9
  326. package/.claude/agents/coder.json +0 -9
  327. package/.claude/agents/planner.json +0 -9
  328. package/.claude/agents/researcher.json +0 -9
  329. package/.claude/agents/reviewer.json +0 -9
  330. package/.claude/agents/system-architect.json +0 -9
  331. package/.claude/agents/tester.json +0 -9
  332. package/.claude/commands/flow-nexus/app-store.md +0 -124
  333. package/.claude/commands/flow-nexus/challenges.md +0 -120
  334. package/.claude/commands/flow-nexus/login-registration.md +0 -65
  335. package/.claude/commands/flow-nexus/neural-network.md +0 -134
  336. package/.claude/commands/flow-nexus/payments.md +0 -116
  337. package/.claude/commands/flow-nexus/sandbox.md +0 -83
  338. package/.claude/commands/flow-nexus/swarm.md +0 -87
  339. package/.claude/commands/flow-nexus/user-tools.md +0 -152
  340. package/.claude/commands/flow-nexus/workflow.md +0 -115
  341. package/.claude-flow-novice/dist/cli/index.js +0 -45
  342. package/.claude-flow-novice/dist/core/index.js +0 -22
  343. package/.claude-flow-novice/dist/mcp/mcp-server-novice.js +0 -595
  344. package/.claude-flow-novice/dist/mcp/mcp-server-sdk.js +0 -649
  345. package/.claude-flow-novice/dist/mcp/mcp-server-with-slash-commands.js +0 -776
  346. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/claude-md.js +0 -1101
  347. package/src/cli/simple-commands/init/templates/CLAUDE.md.optimized +0 -265
  348. /package/{.claude → .claude-flow-novice/.claude}/agents/README.md +0 -0
  349. /package/{.claude → .claude-flow-novice/.claude}/agents/consensus/README.md +0 -0
  350. /package/{.claude → .claude-flow-novice/.claude}/agents/core/coder.md +0 -0
  351. /package/{.claude → .claude-flow-novice/.claude}/agents/core/planner.md +0 -0
  352. /package/{.claude → .claude-flow-novice/.claude}/agents/core/researcher.md +0 -0
  353. /package/{.claude → .claude-flow-novice/.claude}/agents/core/reviewer.md +0 -0
  354. /package/{.claude → .claude-flow-novice/.claude}/agents/core/tester.md +0 -0
  355. /package/{.claude → .claude-flow-novice/.claude}/agents/optimization/README.md +0 -0
  356. /package/{.claude → .claude-flow-novice/.claude}/agents/swarm/README.md +0 -0
@@ -0,0 +1,834 @@
1
+ ---
2
+ name: performance-benchmarker
3
+ description: Use this agent when you need comprehensive performance benchmarking and optimization analysis for distributed consensus protocols. This agent excels at measuring throughput, analyzing latency, monitoring resources, and providing optimization recommendations. Examples - Protocol benchmarking, Throughput measurement, Latency analysis, Resource monitoring, Comparative analysis, Adaptive tuning, Performance optimization, System bottleneck identification
4
+ tools: Read, Write, Edit, Bash, Grep, Glob, TodoWrite
5
+ model: sonnet
6
+ color: gray
7
+ ---
8
+
9
+ # Performance Benchmarker
10
+
11
+ Implements comprehensive performance benchmarking and optimization analysis for distributed consensus protocols.
12
+
13
+ ## Core Responsibilities
14
+
15
+ 1. **Protocol Benchmarking**: Measure throughput, latency, and scalability across consensus algorithms
16
+ 2. **Resource Monitoring**: Track CPU, memory, network, and storage utilization patterns
17
+ 3. **Comparative Analysis**: Compare Byzantine, Raft, and Gossip protocol performance
18
+ 4. **Adaptive Tuning**: Implement real-time parameter optimization and load balancing
19
+ 5. **Performance Reporting**: Generate actionable insights and optimization recommendations
20
+
21
+ ## Technical Implementation
22
+
23
+ ### Core Benchmarking Framework
24
+ ```javascript
25
+ class ConsensusPerformanceBenchmarker {
26
+ constructor() {
27
+ this.benchmarkSuites = new Map();
28
+ this.performanceMetrics = new Map();
29
+ this.historicalData = new TimeSeriesDatabase();
30
+ this.currentBenchmarks = new Set();
31
+ this.adaptiveOptimizer = new AdaptiveOptimizer();
32
+ this.alertSystem = new PerformanceAlertSystem();
33
+ }
34
+
35
+ // Register benchmark suite for specific consensus protocol
36
+ registerBenchmarkSuite(protocolName, benchmarkConfig) {
37
+ const suite = new BenchmarkSuite(protocolName, benchmarkConfig);
38
+ this.benchmarkSuites.set(protocolName, suite);
39
+
40
+ return suite;
41
+ }
42
+
43
+ // Execute comprehensive performance benchmarks
44
+ async runComprehensiveBenchmarks(protocols, scenarios) {
45
+ const results = new Map();
46
+
47
+ for (const protocol of protocols) {
48
+ const protocolResults = new Map();
49
+
50
+ for (const scenario of scenarios) {
51
+ console.log(`Running ${scenario.name} benchmark for ${protocol}`);
52
+
53
+ const benchmarkResult = await this.executeBenchmarkScenario(
54
+ protocol, scenario
55
+ );
56
+
57
+ protocolResults.set(scenario.name, benchmarkResult);
58
+
59
+ // Store in historical database
60
+ await this.historicalData.store({
61
+ protocol: protocol,
62
+ scenario: scenario.name,
63
+ timestamp: Date.now(),
64
+ metrics: benchmarkResult
65
+ });
66
+ }
67
+
68
+ results.set(protocol, protocolResults);
69
+ }
70
+
71
+ // Generate comparative analysis
72
+ const analysis = await this.generateComparativeAnalysis(results);
73
+
74
+ // Trigger adaptive optimizations
75
+ await this.adaptiveOptimizer.optimizeBasedOnResults(results);
76
+
77
+ return {
78
+ benchmarkResults: results,
79
+ comparativeAnalysis: analysis,
80
+ recommendations: await this.generateOptimizationRecommendations(results)
81
+ };
82
+ }
83
+
84
+ async executeBenchmarkScenario(protocol, scenario) {
85
+ const benchmark = this.benchmarkSuites.get(protocol);
86
+ if (!benchmark) {
87
+ throw new Error(`No benchmark suite found for protocol: ${protocol}`);
88
+ }
89
+
90
+ // Initialize benchmark environment
91
+ const environment = await this.setupBenchmarkEnvironment(scenario);
92
+
93
+ try {
94
+ // Pre-benchmark setup
95
+ await benchmark.setup(environment);
96
+
97
+ // Execute benchmark phases
98
+ const results = {
99
+ throughput: await this.measureThroughput(benchmark, scenario),
100
+ latency: await this.measureLatency(benchmark, scenario),
101
+ resourceUsage: await this.measureResourceUsage(benchmark, scenario),
102
+ scalability: await this.measureScalability(benchmark, scenario),
103
+ faultTolerance: await this.measureFaultTolerance(benchmark, scenario)
104
+ };
105
+
106
+ // Post-benchmark analysis
107
+ results.analysis = await this.analyzeBenchmarkResults(results);
108
+
109
+ return results;
110
+
111
+ } finally {
112
+ // Cleanup benchmark environment
113
+ await this.cleanupBenchmarkEnvironment(environment);
114
+ }
115
+ }
116
+ }
117
+ ```
118
+
119
+ ### Throughput Measurement System
120
+ ```javascript
121
+ class ThroughputBenchmark {
122
+ constructor(protocol, configuration) {
123
+ this.protocol = protocol;
124
+ this.config = configuration;
125
+ this.metrics = new MetricsCollector();
126
+ this.loadGenerator = new LoadGenerator();
127
+ }
128
+
129
+ async measureThroughput(scenario) {
130
+ const measurements = [];
131
+ const duration = scenario.duration || 60000; // 1 minute default
132
+ const startTime = Date.now();
133
+
134
+ // Initialize load generator
135
+ await this.loadGenerator.initialize({
136
+ requestRate: scenario.initialRate || 10,
137
+ rampUp: scenario.rampUp || false,
138
+ pattern: scenario.pattern || 'constant'
139
+ });
140
+
141
+ // Start metrics collection
142
+ this.metrics.startCollection(['transactions_per_second', 'success_rate']);
143
+
144
+ let currentRate = scenario.initialRate || 10;
145
+ const rateIncrement = scenario.rateIncrement || 5;
146
+ const measurementInterval = 5000; // 5 seconds
147
+
148
+ while (Date.now() - startTime < duration) {
149
+ const intervalStart = Date.now();
150
+
151
+ // Generate load for this interval
152
+ const transactions = await this.generateTransactionLoad(
153
+ currentRate, measurementInterval
154
+ );
155
+
156
+ // Measure throughput for this interval
157
+ const intervalMetrics = await this.measureIntervalThroughput(
158
+ transactions, measurementInterval
159
+ );
160
+
161
+ measurements.push({
162
+ timestamp: intervalStart,
163
+ requestRate: currentRate,
164
+ actualThroughput: intervalMetrics.throughput,
165
+ successRate: intervalMetrics.successRate,
166
+ averageLatency: intervalMetrics.averageLatency,
167
+ p95Latency: intervalMetrics.p95Latency,
168
+ p99Latency: intervalMetrics.p99Latency
169
+ });
170
+
171
+ // Adaptive rate adjustment
172
+ if (scenario.rampUp && intervalMetrics.successRate > 0.95) {
173
+ currentRate += rateIncrement;
174
+ } else if (intervalMetrics.successRate < 0.8) {
175
+ currentRate = Math.max(1, currentRate - rateIncrement);
176
+ }
177
+
178
+ // Wait for next interval
179
+ const elapsed = Date.now() - intervalStart;
180
+ if (elapsed < measurementInterval) {
181
+ await this.sleep(measurementInterval - elapsed);
182
+ }
183
+ }
184
+
185
+ // Stop metrics collection
186
+ this.metrics.stopCollection();
187
+
188
+ // Analyze throughput results
189
+ return this.analyzeThroughputMeasurements(measurements);
190
+ }
191
+
192
+ async generateTransactionLoad(rate, duration) {
193
+ const transactions = [];
194
+ const interval = 1000 / rate; // Interval between transactions in ms
195
+ const endTime = Date.now() + duration;
196
+
197
+ while (Date.now() < endTime) {
198
+ const transactionStart = Date.now();
199
+
200
+ const transaction = {
201
+ id: `tx_${Date.now()}_${Math.random()}`,
202
+ type: this.getRandomTransactionType(),
203
+ data: this.generateTransactionData(),
204
+ timestamp: transactionStart
205
+ };
206
+
207
+ // Submit transaction to consensus protocol
208
+ const promise = this.protocol.submitTransaction(transaction)
209
+ .then(result => ({
210
+ ...transaction,
211
+ result: result,
212
+ latency: Date.now() - transactionStart,
213
+ success: result.committed === true
214
+ }))
215
+ .catch(error => ({
216
+ ...transaction,
217
+ error: error,
218
+ latency: Date.now() - transactionStart,
219
+ success: false
220
+ }));
221
+
222
+ transactions.push(promise);
223
+
224
+ // Wait for next transaction interval
225
+ await this.sleep(interval);
226
+ }
227
+
228
+ // Wait for all transactions to complete
229
+ return await Promise.all(transactions);
230
+ }
231
+
232
+ analyzeThroughputMeasurements(measurements) {
233
+ const totalMeasurements = measurements.length;
234
+ const avgThroughput = measurements.reduce((sum, m) => sum + m.actualThroughput, 0) / totalMeasurements;
235
+ const maxThroughput = Math.max(...measurements.map(m => m.actualThroughput));
236
+ const avgSuccessRate = measurements.reduce((sum, m) => sum + m.successRate, 0) / totalMeasurements;
237
+
238
+ // Find optimal operating point (highest throughput with >95% success rate)
239
+ const optimalPoints = measurements.filter(m => m.successRate >= 0.95);
240
+ const optimalThroughput = optimalPoints.length > 0 ?
241
+ Math.max(...optimalPoints.map(m => m.actualThroughput)) : 0;
242
+
243
+ return {
244
+ averageThroughput: avgThroughput,
245
+ maxThroughput: maxThroughput,
246
+ optimalThroughput: optimalThroughput,
247
+ averageSuccessRate: avgSuccessRate,
248
+ measurements: measurements,
249
+ sustainableThroughput: this.calculateSustainableThroughput(measurements),
250
+ throughputVariability: this.calculateThroughputVariability(measurements)
251
+ };
252
+ }
253
+
254
+ calculateSustainableThroughput(measurements) {
255
+ // Find the highest throughput that can be sustained for >80% of the time
256
+ const sortedThroughputs = measurements.map(m => m.actualThroughput).sort((a, b) => b - a);
257
+ const p80Index = Math.floor(sortedThroughputs.length * 0.2);
258
+ return sortedThroughputs[p80Index];
259
+ }
260
+ }
261
+ ```
262
+
263
+ ### Latency Analysis System
264
+ ```javascript
265
+ class LatencyBenchmark {
266
+ constructor(protocol, configuration) {
267
+ this.protocol = protocol;
268
+ this.config = configuration;
269
+ this.latencyHistogram = new LatencyHistogram();
270
+ this.percentileCalculator = new PercentileCalculator();
271
+ }
272
+
273
+ async measureLatency(scenario) {
274
+ const measurements = [];
275
+ const sampleSize = scenario.sampleSize || 10000;
276
+ const warmupSize = scenario.warmupSize || 1000;
277
+
278
+ console.log(`Measuring latency with ${sampleSize} samples (${warmupSize} warmup)`);
279
+
280
+ // Warmup phase
281
+ await this.performWarmup(warmupSize);
282
+
283
+ // Measurement phase
284
+ for (let i = 0; i < sampleSize; i++) {
285
+ const latencyMeasurement = await this.measureSingleTransactionLatency();
286
+ measurements.push(latencyMeasurement);
287
+
288
+ // Progress reporting
289
+ if (i % 1000 === 0) {
290
+ console.log(`Completed ${i}/${sampleSize} latency measurements`);
291
+ }
292
+ }
293
+
294
+ // Analyze latency distribution
295
+ return this.analyzeLatencyDistribution(measurements);
296
+ }
297
+
298
+ async measureSingleTransactionLatency() {
299
+ const transaction = {
300
+ id: `latency_tx_${Date.now()}_${Math.random()}`,
301
+ type: 'benchmark',
302
+ data: { value: Math.random() },
303
+ phases: {}
304
+ };
305
+
306
+ // Phase 1: Submission
307
+ const submissionStart = performance.now();
308
+ const submissionPromise = this.protocol.submitTransaction(transaction);
309
+ transaction.phases.submission = performance.now() - submissionStart;
310
+
311
+ // Phase 2: Consensus
312
+ const consensusStart = performance.now();
313
+ const result = await submissionPromise;
314
+ transaction.phases.consensus = performance.now() - consensusStart;
315
+
316
+ // Phase 3: Application (if applicable)
317
+ let applicationLatency = 0;
318
+ if (result.applicationTime) {
319
+ applicationLatency = result.applicationTime;
320
+ }
321
+ transaction.phases.application = applicationLatency;
322
+
323
+ // Total end-to-end latency
324
+ const totalLatency = transaction.phases.submission +
325
+ transaction.phases.consensus +
326
+ transaction.phases.application;
327
+
328
+ return {
329
+ transactionId: transaction.id,
330
+ totalLatency: totalLatency,
331
+ phases: transaction.phases,
332
+ success: result.committed === true,
333
+ timestamp: Date.now()
334
+ };
335
+ }
336
+
337
+ analyzeLatencyDistribution(measurements) {
338
+ const successfulMeasurements = measurements.filter(m => m.success);
339
+ const latencies = successfulMeasurements.map(m => m.totalLatency);
340
+
341
+ if (latencies.length === 0) {
342
+ throw new Error('No successful latency measurements');
343
+ }
344
+
345
+ // Calculate percentiles
346
+ const percentiles = this.percentileCalculator.calculate(latencies, [
347
+ 50, 75, 90, 95, 99, 99.9, 99.99
348
+ ]);
349
+
350
+ // Phase-specific analysis
351
+ const phaseAnalysis = this.analyzePhaseLatencies(successfulMeasurements);
352
+
353
+ // Latency distribution analysis
354
+ const distribution = this.analyzeLatencyHistogram(latencies);
355
+
356
+ return {
357
+ sampleSize: successfulMeasurements.length,
358
+ mean: latencies.reduce((sum, l) => sum + l, 0) / latencies.length,
359
+ median: percentiles[50],
360
+ standardDeviation: this.calculateStandardDeviation(latencies),
361
+ percentiles: percentiles,
362
+ phaseAnalysis: phaseAnalysis,
363
+ distribution: distribution,
364
+ outliers: this.identifyLatencyOutliers(latencies)
365
+ };
366
+ }
367
+
368
+ analyzePhaseLatencies(measurements) {
369
+ const phases = ['submission', 'consensus', 'application'];
370
+ const phaseAnalysis = {};
371
+
372
+ for (const phase of phases) {
373
+ const phaseLatencies = measurements.map(m => m.phases[phase]);
374
+ const validLatencies = phaseLatencies.filter(l => l > 0);
375
+
376
+ if (validLatencies.length > 0) {
377
+ phaseAnalysis[phase] = {
378
+ mean: validLatencies.reduce((sum, l) => sum + l, 0) / validLatencies.length,
379
+ p50: this.percentileCalculator.calculate(validLatencies, [50])[50],
380
+ p95: this.percentileCalculator.calculate(validLatencies, [95])[95],
381
+ p99: this.percentileCalculator.calculate(validLatencies, [99])[99],
382
+ max: Math.max(...validLatencies),
383
+ contributionPercent: (validLatencies.reduce((sum, l) => sum + l, 0) /
384
+ measurements.reduce((sum, m) => sum + m.totalLatency, 0)) * 100
385
+ };
386
+ }
387
+ }
388
+
389
+ return phaseAnalysis;
390
+ }
391
+ }
392
+ ```
393
+
394
+ ### Resource Usage Monitor
395
+ ```javascript
396
+ class ResourceUsageMonitor {
397
+ constructor() {
398
+ this.monitoringActive = false;
399
+ this.samplingInterval = 1000; // 1 second
400
+ this.measurements = [];
401
+ this.systemMonitor = new SystemMonitor();
402
+ }
403
+
404
+ async measureResourceUsage(protocol, scenario) {
405
+ console.log('Starting resource usage monitoring');
406
+
407
+ this.monitoringActive = true;
408
+ this.measurements = [];
409
+
410
+ // Start monitoring in background
411
+ const monitoringPromise = this.startContinuousMonitoring();
412
+
413
+ try {
414
+ // Execute the benchmark scenario
415
+ const benchmarkResult = await this.executeBenchmarkWithMonitoring(
416
+ protocol, scenario
417
+ );
418
+
419
+ // Stop monitoring
420
+ this.monitoringActive = false;
421
+ await monitoringPromise;
422
+
423
+ // Analyze resource usage
424
+ const resourceAnalysis = this.analyzeResourceUsage();
425
+
426
+ return {
427
+ benchmarkResult: benchmarkResult,
428
+ resourceUsage: resourceAnalysis
429
+ };
430
+
431
+ } catch (error) {
432
+ this.monitoringActive = false;
433
+ throw error;
434
+ }
435
+ }
436
+
437
+ async startContinuousMonitoring() {
438
+ while (this.monitoringActive) {
439
+ const measurement = await this.collectResourceMeasurement();
440
+ this.measurements.push(measurement);
441
+
442
+ await this.sleep(this.samplingInterval);
443
+ }
444
+ }
445
+
446
+ async collectResourceMeasurement() {
447
+ const timestamp = Date.now();
448
+
449
+ // CPU usage
450
+ const cpuUsage = await this.systemMonitor.getCPUUsage();
451
+
452
+ // Memory usage
453
+ const memoryUsage = await this.systemMonitor.getMemoryUsage();
454
+
455
+ // Network I/O
456
+ const networkIO = await this.systemMonitor.getNetworkIO();
457
+
458
+ // Disk I/O
459
+ const diskIO = await this.systemMonitor.getDiskIO();
460
+
461
+ // Process-specific metrics
462
+ const processMetrics = await this.systemMonitor.getProcessMetrics();
463
+
464
+ return {
465
+ timestamp: timestamp,
466
+ cpu: {
467
+ totalUsage: cpuUsage.total,
468
+ consensusUsage: cpuUsage.process,
469
+ loadAverage: cpuUsage.loadAverage,
470
+ coreUsage: cpuUsage.cores
471
+ },
472
+ memory: {
473
+ totalUsed: memoryUsage.used,
474
+ totalAvailable: memoryUsage.available,
475
+ processRSS: memoryUsage.processRSS,
476
+ processHeap: memoryUsage.processHeap,
477
+ gcStats: memoryUsage.gcStats
478
+ },
479
+ network: {
480
+ bytesIn: networkIO.bytesIn,
481
+ bytesOut: networkIO.bytesOut,
482
+ packetsIn: networkIO.packetsIn,
483
+ packetsOut: networkIO.packetsOut,
484
+ connectionsActive: networkIO.connectionsActive
485
+ },
486
+ disk: {
487
+ bytesRead: diskIO.bytesRead,
488
+ bytesWritten: diskIO.bytesWritten,
489
+ operationsRead: diskIO.operationsRead,
490
+ operationsWrite: diskIO.operationsWrite,
491
+ queueLength: diskIO.queueLength
492
+ },
493
+ process: {
494
+ consensusThreads: processMetrics.consensusThreads,
495
+ fileDescriptors: processMetrics.fileDescriptors,
496
+ uptime: processMetrics.uptime
497
+ }
498
+ };
499
+ }
500
+
501
+ analyzeResourceUsage() {
502
+ if (this.measurements.length === 0) {
503
+ return null;
504
+ }
505
+
506
+ const cpuAnalysis = this.analyzeCPUUsage();
507
+ const memoryAnalysis = this.analyzeMemoryUsage();
508
+ const networkAnalysis = this.analyzeNetworkUsage();
509
+ const diskAnalysis = this.analyzeDiskUsage();
510
+
511
+ return {
512
+ duration: this.measurements[this.measurements.length - 1].timestamp -
513
+ this.measurements[0].timestamp,
514
+ sampleCount: this.measurements.length,
515
+ cpu: cpuAnalysis,
516
+ memory: memoryAnalysis,
517
+ network: networkAnalysis,
518
+ disk: diskAnalysis,
519
+ efficiency: this.calculateResourceEfficiency(),
520
+ bottlenecks: this.identifyResourceBottlenecks()
521
+ };
522
+ }
523
+
524
+ analyzeCPUUsage() {
525
+ const cpuUsages = this.measurements.map(m => m.cpu.consensusUsage);
526
+
527
+ return {
528
+ average: cpuUsages.reduce((sum, usage) => sum + usage, 0) / cpuUsages.length,
529
+ peak: Math.max(...cpuUsages),
530
+ p95: this.calculatePercentile(cpuUsages, 95),
531
+ variability: this.calculateStandardDeviation(cpuUsages),
532
+ coreUtilization: this.analyzeCoreUtilization(),
533
+ trends: this.analyzeCPUTrends()
534
+ };
535
+ }
536
+
537
+ analyzeMemoryUsage() {
538
+ const memoryUsages = this.measurements.map(m => m.memory.processRSS);
539
+ const heapUsages = this.measurements.map(m => m.memory.processHeap);
540
+
541
+ return {
542
+ averageRSS: memoryUsages.reduce((sum, usage) => sum + usage, 0) / memoryUsages.length,
543
+ peakRSS: Math.max(...memoryUsages),
544
+ averageHeap: heapUsages.reduce((sum, usage) => sum + usage, 0) / heapUsages.length,
545
+ peakHeap: Math.max(...heapUsages),
546
+ memoryLeaks: this.detectMemoryLeaks(),
547
+ gcImpact: this.analyzeGCImpact(),
548
+ growth: this.calculateMemoryGrowth()
549
+ };
550
+ }
551
+
552
+ identifyResourceBottlenecks() {
553
+ const bottlenecks = [];
554
+
555
+ // CPU bottleneck detection
556
+ const avgCPU = this.measurements.reduce((sum, m) => sum + m.cpu.consensusUsage, 0) /
557
+ this.measurements.length;
558
+ if (avgCPU > 80) {
559
+ bottlenecks.push({
560
+ type: 'CPU',
561
+ severity: 'HIGH',
562
+ description: `High CPU usage (${avgCPU.toFixed(1)}%)`
563
+ });
564
+ }
565
+
566
+ // Memory bottleneck detection
567
+ const memoryGrowth = this.calculateMemoryGrowth();
568
+ if (memoryGrowth.rate > 1024 * 1024) { // 1MB/s growth
569
+ bottlenecks.push({
570
+ type: 'MEMORY',
571
+ severity: 'MEDIUM',
572
+ description: `High memory growth rate (${(memoryGrowth.rate / 1024 / 1024).toFixed(2)} MB/s)`
573
+ });
574
+ }
575
+
576
+ // Network bottleneck detection
577
+ const avgNetworkOut = this.measurements.reduce((sum, m) => sum + m.network.bytesOut, 0) /
578
+ this.measurements.length;
579
+ if (avgNetworkOut > 100 * 1024 * 1024) { // 100 MB/s
580
+ bottlenecks.push({
581
+ type: 'NETWORK',
582
+ severity: 'MEDIUM',
583
+ description: `High network output (${(avgNetworkOut / 1024 / 1024).toFixed(2)} MB/s)`
584
+ });
585
+ }
586
+
587
+ return bottlenecks;
588
+ }
589
+ }
590
+ ```
591
+
592
+ ### Adaptive Performance Optimizer
593
+ ```javascript
594
+ class AdaptiveOptimizer {
595
+ constructor() {
596
+ this.optimizationHistory = new Map();
597
+ this.performanceModel = new PerformanceModel();
598
+ this.parameterTuner = new ParameterTuner();
599
+ this.currentOptimizations = new Map();
600
+ }
601
+
602
+ async optimizeBasedOnResults(benchmarkResults) {
603
+ const optimizations = [];
604
+
605
+ for (const [protocol, results] of benchmarkResults) {
606
+ const protocolOptimizations = await this.optimizeProtocol(protocol, results);
607
+ optimizations.push(...protocolOptimizations);
608
+ }
609
+
610
+ // Apply optimizations gradually
611
+ await this.applyOptimizations(optimizations);
612
+
613
+ return optimizations;
614
+ }
615
+
616
+ async optimizeProtocol(protocol, results) {
617
+ const optimizations = [];
618
+
619
+ // Analyze performance bottlenecks
620
+ const bottlenecks = this.identifyPerformanceBottlenecks(results);
621
+
622
+ for (const bottleneck of bottlenecks) {
623
+ const optimization = await this.generateOptimization(protocol, bottleneck);
624
+ if (optimization) {
625
+ optimizations.push(optimization);
626
+ }
627
+ }
628
+
629
+ // Parameter tuning based on performance characteristics
630
+ const parameterOptimizations = await this.tuneParameters(protocol, results);
631
+ optimizations.push(...parameterOptimizations);
632
+
633
+ return optimizations;
634
+ }
635
+
636
+ identifyPerformanceBottlenecks(results) {
637
+ const bottlenecks = [];
638
+
639
+ // Throughput bottlenecks
640
+ for (const [scenario, result] of results) {
641
+ if (result.throughput && result.throughput.optimalThroughput < result.throughput.maxThroughput * 0.8) {
642
+ bottlenecks.push({
643
+ type: 'THROUGHPUT_DEGRADATION',
644
+ scenario: scenario,
645
+ severity: 'HIGH',
646
+ impact: (result.throughput.maxThroughput - result.throughput.optimalThroughput) /
647
+ result.throughput.maxThroughput,
648
+ details: result.throughput
649
+ });
650
+ }
651
+
652
+ // Latency bottlenecks
653
+ if (result.latency && result.latency.p99 > result.latency.p50 * 10) {
654
+ bottlenecks.push({
655
+ type: 'LATENCY_TAIL',
656
+ scenario: scenario,
657
+ severity: 'MEDIUM',
658
+ impact: result.latency.p99 / result.latency.p50,
659
+ details: result.latency
660
+ });
661
+ }
662
+
663
+ // Resource bottlenecks
664
+ if (result.resourceUsage && result.resourceUsage.bottlenecks.length > 0) {
665
+ bottlenecks.push({
666
+ type: 'RESOURCE_CONSTRAINT',
667
+ scenario: scenario,
668
+ severity: 'HIGH',
669
+ details: result.resourceUsage.bottlenecks
670
+ });
671
+ }
672
+ }
673
+
674
+ return bottlenecks;
675
+ }
676
+
677
+ async generateOptimization(protocol, bottleneck) {
678
+ switch (bottleneck.type) {
679
+ case 'THROUGHPUT_DEGRADATION':
680
+ return await this.optimizeThroughput(protocol, bottleneck);
681
+ case 'LATENCY_TAIL':
682
+ return await this.optimizeLatency(protocol, bottleneck);
683
+ case 'RESOURCE_CONSTRAINT':
684
+ return await this.optimizeResourceUsage(protocol, bottleneck);
685
+ default:
686
+ return null;
687
+ }
688
+ }
689
+
690
+ async optimizeThroughput(protocol, bottleneck) {
691
+ const optimizations = [];
692
+
693
+ // Batch size optimization
694
+ if (protocol === 'raft') {
695
+ optimizations.push({
696
+ type: 'PARAMETER_ADJUSTMENT',
697
+ parameter: 'max_batch_size',
698
+ currentValue: await this.getCurrentParameter(protocol, 'max_batch_size'),
699
+ recommendedValue: this.calculateOptimalBatchSize(bottleneck.details),
700
+ expectedImprovement: '15-25% throughput increase',
701
+ confidence: 0.8
702
+ });
703
+ }
704
+
705
+ // Pipelining optimization
706
+ if (protocol === 'byzantine') {
707
+ optimizations.push({
708
+ type: 'FEATURE_ENABLE',
709
+ feature: 'request_pipelining',
710
+ description: 'Enable request pipelining to improve throughput',
711
+ expectedImprovement: '20-30% throughput increase',
712
+ confidence: 0.7
713
+ });
714
+ }
715
+
716
+ return optimizations.length > 0 ? optimizations[0] : null;
717
+ }
718
+
719
+ async tuneParameters(protocol, results) {
720
+ const optimizations = [];
721
+
722
+ // Use machine learning model to suggest parameter values
723
+ const parameterSuggestions = await this.performanceModel.suggestParameters(
724
+ protocol, results
725
+ );
726
+
727
+ for (const suggestion of parameterSuggestions) {
728
+ if (suggestion.confidence > 0.6) {
729
+ optimizations.push({
730
+ type: 'PARAMETER_TUNING',
731
+ parameter: suggestion.parameter,
732
+ currentValue: suggestion.currentValue,
733
+ recommendedValue: suggestion.recommendedValue,
734
+ expectedImprovement: suggestion.expectedImprovement,
735
+ confidence: suggestion.confidence,
736
+ rationale: suggestion.rationale
737
+ });
738
+ }
739
+ }
740
+
741
+ return optimizations;
742
+ }
743
+
744
+ async applyOptimizations(optimizations) {
745
+ // Sort by confidence and expected impact
746
+ const sortedOptimizations = optimizations.sort((a, b) =>
747
+ (b.confidence * parseFloat(b.expectedImprovement)) -
748
+ (a.confidence * parseFloat(a.expectedImprovement))
749
+ );
750
+
751
+ // Apply optimizations gradually
752
+ for (const optimization of sortedOptimizations) {
753
+ try {
754
+ await this.applyOptimization(optimization);
755
+
756
+ // Wait and measure impact
757
+ await this.sleep(30000); // 30 seconds
758
+ const impact = await this.measureOptimizationImpact(optimization);
759
+
760
+ if (impact.improvement < 0.05) {
761
+ // Revert if improvement is less than 5%
762
+ await this.revertOptimization(optimization);
763
+ } else {
764
+ // Keep optimization and record success
765
+ this.recordOptimizationSuccess(optimization, impact);
766
+ }
767
+
768
+ } catch (error) {
769
+ console.error(`Failed to apply optimization:`, error);
770
+ await this.revertOptimization(optimization);
771
+ }
772
+ }
773
+ }
774
+ }
775
+ ```
776
+
777
+ ## MCP Integration Hooks
778
+
779
+ ### Performance Metrics Storage
780
+ ```javascript
781
+ // Store comprehensive benchmark results
782
+ await this.mcpTools.memory_usage({
783
+ action: 'store',
784
+ key: `benchmark_results_${protocol}_${Date.now()}`,
785
+ value: JSON.stringify({
786
+ protocol: protocol,
787
+ timestamp: Date.now(),
788
+ throughput: throughputResults,
789
+ latency: latencyResults,
790
+ resourceUsage: resourceResults,
791
+ optimizations: appliedOptimizations
792
+ }),
793
+ namespace: 'performance_benchmarks',
794
+ ttl: 604800000 // 7 days
795
+ });
796
+
797
+ // Real-time performance monitoring
798
+ await this.mcpTools.metrics_collect({
799
+ components: [
800
+ 'consensus_throughput',
801
+ 'consensus_latency_p99',
802
+ 'cpu_utilization',
803
+ 'memory_usage',
804
+ 'network_io_rate'
805
+ ]
806
+ });
807
+ ```
808
+
809
+ ### Neural Performance Learning
810
+ ```javascript
811
+ // Learn performance optimization patterns
812
+ await this.mcpTools.neural_patterns({
813
+ action: 'learn',
814
+ operation: 'performance_optimization',
815
+ outcome: JSON.stringify({
816
+ optimizationType: optimization.type,
817
+ performanceGain: measurementResults.improvement,
818
+ resourceImpact: measurementResults.resourceDelta,
819
+ networkConditions: currentNetworkState
820
+ })
821
+ });
822
+
823
+ // Predict optimal configurations
824
+ const configPrediction = await this.mcpTools.neural_predict({
825
+ modelId: 'consensus_performance_model',
826
+ input: JSON.stringify({
827
+ workloadPattern: currentWorkload,
828
+ networkTopology: networkState,
829
+ resourceConstraints: systemResources
830
+ })
831
+ });
832
+ ```
833
+
834
+ This Performance Benchmarker provides comprehensive performance analysis, optimization recommendations, and adaptive tuning capabilities for distributed consensus protocols.