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,739 @@
1
+ /**
2
+ * Test Result Analyzer - Intelligent Failure Categorization and Analysis
3
+ *
4
+ * Analyzes test results to categorize failures, identify patterns, and provide
5
+ * actionable insights for fixing issues.
6
+ *
7
+ * Key Features:
8
+ * - Failure pattern recognition
9
+ * - Root cause analysis
10
+ * - Impact assessment
11
+ * - Priority classification
12
+ * - Suggested fix strategies
13
+ */
14
+
15
+ import { EventEmitter } from 'events';
16
+ import { ILogger } from '../../core/logger.js';
17
+ import { TestExecutionResult, TestFailure, TestWarning } from './iterative-build-test.js';
18
+
19
+ export interface FailureAnalysis {
20
+ testResults: TestExecutionResult;
21
+ summary: FailureSummary;
22
+ categories: Map<string, TestFailure[]>;
23
+ patterns: FailurePattern[];
24
+ rootCauses: RootCause[];
25
+ recommendations: AnalysisRecommendation[];
26
+ impactAssessment: ImpactAssessment;
27
+ }
28
+
29
+ export interface FailureSummary {
30
+ totalFailures: number;
31
+ criticalFailures: number;
32
+ highFailures: number;
33
+ mediumFailures: number;
34
+ lowFailures: number;
35
+ byLayer: Map<string, number>;
36
+ byCategory: Map<string, number>;
37
+ bySeverity: Map<string, number>;
38
+ }
39
+
40
+ export interface FailurePattern {
41
+ id: string;
42
+ pattern: string;
43
+ description: string;
44
+ occurrences: number;
45
+ affectedTests: string[];
46
+ confidence: number; // 0-1
47
+ suggestedFix: string;
48
+ relatedPatterns: string[];
49
+ }
50
+
51
+ export interface RootCause {
52
+ id: string;
53
+ category: string;
54
+ description: string;
55
+ evidence: string[];
56
+ confidence: number; // 0-1
57
+ affectedComponents: string[];
58
+ potentialSolutions: string[];
59
+ priority: number; // 0-100
60
+ }
61
+
62
+ export interface AnalysisRecommendation {
63
+ type: 'fix' | 'refactor' | 'investigate' | 'monitor';
64
+ priority: 'critical' | 'high' | 'medium' | 'low';
65
+ description: string;
66
+ reasoning: string;
67
+ estimatedEffort: number; // minutes
68
+ expectedImpact: number; // 0-100, percentage of failures addressed
69
+ }
70
+
71
+ export interface ImpactAssessment {
72
+ usersAffected: 'none' | 'few' | 'many' | 'all';
73
+ featuresAffected: string[];
74
+ businessImpact: 'low' | 'medium' | 'high' | 'critical';
75
+ urgency: number; // 0-100
76
+ riskLevel: 'low' | 'medium' | 'high' | 'critical';
77
+ }
78
+
79
+ export class TestResultAnalyzer extends EventEmitter {
80
+ private knownPatterns = new Map<string, FailurePattern>();
81
+ private failureHistory = new Map<string, TestFailure[]>();
82
+
83
+ constructor(private logger: ILogger) {
84
+ super();
85
+ this.initializeKnownPatterns();
86
+ }
87
+
88
+ /**
89
+ * Analyze test failures and provide comprehensive analysis
90
+ */
91
+ async analyzeFailures(testResults: TestExecutionResult): Promise<FailureAnalysis> {
92
+ this.logger.info('Analyzing test failures', {
93
+ totalFailures: testResults.failed,
94
+ totalTests: testResults.totalTests,
95
+ });
96
+
97
+ try {
98
+ // Generate failure summary
99
+ const summary = this.generateFailureSummary(testResults);
100
+
101
+ // Categorize failures
102
+ const categories = this.categorizeFailures(testResults.failures);
103
+
104
+ // Detect patterns
105
+ const patterns = await this.detectPatterns(testResults.failures);
106
+
107
+ // Identify root causes
108
+ const rootCauses = await this.identifyRootCauses(testResults.failures, patterns);
109
+
110
+ // Generate recommendations
111
+ const recommendations = this.generateRecommendations(
112
+ testResults.failures,
113
+ patterns,
114
+ rootCauses,
115
+ );
116
+
117
+ // Assess impact
118
+ const impactAssessment = this.assessImpact(testResults.failures);
119
+
120
+ const analysis: FailureAnalysis = {
121
+ testResults,
122
+ summary,
123
+ categories,
124
+ patterns,
125
+ rootCauses,
126
+ recommendations,
127
+ impactAssessment,
128
+ };
129
+
130
+ this.emit('analysis:completed', { analysis });
131
+
132
+ return analysis;
133
+ } catch (error) {
134
+ this.logger.error('Failed to analyze test failures', { error });
135
+ throw error;
136
+ }
137
+ }
138
+
139
+ /**
140
+ * Generate failure summary statistics
141
+ */
142
+ private generateFailureSummary(testResults: TestExecutionResult): FailureSummary {
143
+ const failures = testResults.failures;
144
+
145
+ const summary: FailureSummary = {
146
+ totalFailures: failures.length,
147
+ criticalFailures: failures.filter((f) => f.severity === 'critical').length,
148
+ highFailures: failures.filter((f) => f.severity === 'high').length,
149
+ mediumFailures: failures.filter((f) => f.severity === 'medium').length,
150
+ lowFailures: failures.filter((f) => f.severity === 'low').length,
151
+ byLayer: new Map(),
152
+ byCategory: new Map(),
153
+ bySeverity: new Map(),
154
+ };
155
+
156
+ // Group by layer
157
+ for (const failure of failures) {
158
+ const layerCount = summary.byLayer.get(failure.layer) || 0;
159
+ summary.byLayer.set(failure.layer, layerCount + 1);
160
+
161
+ const categoryCount = summary.byCategory.get(failure.category) || 0;
162
+ summary.byCategory.set(failure.category, categoryCount + 1);
163
+
164
+ const severityCount = summary.bySeverity.get(failure.severity) || 0;
165
+ summary.bySeverity.set(failure.severity, severityCount + 1);
166
+ }
167
+
168
+ return summary;
169
+ }
170
+
171
+ /**
172
+ * Categorize failures by characteristics
173
+ */
174
+ private categorizeFailures(failures: TestFailure[]): Map<string, TestFailure[]> {
175
+ const categories = new Map<string, TestFailure[]>();
176
+
177
+ for (const failure of failures) {
178
+ const category = this.determineCategory(failure);
179
+
180
+ if (!categories.has(category)) {
181
+ categories.set(category, []);
182
+ }
183
+ categories.get(category)!.push(failure);
184
+ }
185
+
186
+ return categories;
187
+ }
188
+
189
+ /**
190
+ * Determine failure category from error patterns
191
+ */
192
+ private determineCategory(failure: TestFailure): string {
193
+ const error = failure.error.toLowerCase();
194
+ const stack = failure.stackTrace.toLowerCase();
195
+
196
+ // API/Network failures
197
+ if (
198
+ error.includes('fetch') ||
199
+ error.includes('network') ||
200
+ error.includes('xhr') ||
201
+ error.includes('api')
202
+ ) {
203
+ return 'network-api';
204
+ }
205
+
206
+ // Database/Data failures
207
+ if (
208
+ error.includes('database') ||
209
+ error.includes('query') ||
210
+ error.includes('connection') ||
211
+ error.includes('transaction')
212
+ ) {
213
+ return 'database';
214
+ }
215
+
216
+ // Rendering/UI failures
217
+ if (
218
+ error.includes('render') ||
219
+ error.includes('component') ||
220
+ error.includes('dom') ||
221
+ error.includes('element not found')
222
+ ) {
223
+ return 'rendering';
224
+ }
225
+
226
+ // State management failures
227
+ if (
228
+ error.includes('state') ||
229
+ error.includes('store') ||
230
+ error.includes('reducer') ||
231
+ error.includes('dispatch')
232
+ ) {
233
+ return 'state-management';
234
+ }
235
+
236
+ // Authentication/Authorization failures
237
+ if (
238
+ error.includes('auth') ||
239
+ error.includes('permission') ||
240
+ error.includes('unauthorized') ||
241
+ error.includes('forbidden')
242
+ ) {
243
+ return 'authentication';
244
+ }
245
+
246
+ // Validation failures
247
+ if (
248
+ error.includes('validation') ||
249
+ error.includes('invalid') ||
250
+ error.includes('required field')
251
+ ) {
252
+ return 'validation';
253
+ }
254
+
255
+ // Timing/Race condition failures
256
+ if (
257
+ error.includes('timeout') ||
258
+ error.includes('race') ||
259
+ error.includes('async') ||
260
+ error.includes('promise')
261
+ ) {
262
+ return 'timing-async';
263
+ }
264
+
265
+ // Memory/Resource failures
266
+ if (
267
+ error.includes('memory') ||
268
+ error.includes('heap') ||
269
+ error.includes('resource') ||
270
+ error.includes('leak')
271
+ ) {
272
+ return 'resource';
273
+ }
274
+
275
+ // Configuration failures
276
+ if (
277
+ error.includes('config') ||
278
+ error.includes('environment') ||
279
+ error.includes('variable')
280
+ ) {
281
+ return 'configuration';
282
+ }
283
+
284
+ // Dependency failures
285
+ if (
286
+ error.includes('module') ||
287
+ error.includes('import') ||
288
+ error.includes('require') ||
289
+ error.includes('dependency')
290
+ ) {
291
+ return 'dependency';
292
+ }
293
+
294
+ return 'unknown';
295
+ }
296
+
297
+ /**
298
+ * Detect patterns in failures
299
+ */
300
+ private async detectPatterns(failures: TestFailure[]): Promise<FailurePattern[]> {
301
+ const patterns: FailurePattern[] = [];
302
+ const errorGroups = new Map<string, TestFailure[]>();
303
+
304
+ // Group by similar errors
305
+ for (const failure of failures) {
306
+ const errorKey = this.extractErrorKey(failure.error);
307
+ if (!errorGroups.has(errorKey)) {
308
+ errorGroups.set(errorKey, []);
309
+ }
310
+ errorGroups.get(errorKey)!.push(failure);
311
+ }
312
+
313
+ // Create patterns for groups with multiple occurrences
314
+ for (const [errorKey, groupFailures] of errorGroups) {
315
+ if (groupFailures.length > 1) {
316
+ const pattern: FailurePattern = {
317
+ id: `pattern_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
318
+ pattern: errorKey,
319
+ description: this.generatePatternDescription(groupFailures),
320
+ occurrences: groupFailures.length,
321
+ affectedTests: groupFailures.map((f) => f.testName),
322
+ confidence: Math.min(groupFailures.length / 10, 1),
323
+ suggestedFix: this.suggestFixForPattern(errorKey, groupFailures),
324
+ relatedPatterns: [],
325
+ };
326
+
327
+ patterns.push(pattern);
328
+ }
329
+ }
330
+
331
+ // Check against known patterns
332
+ for (const pattern of this.knownPatterns.values()) {
333
+ const matchingFailures = failures.filter((f) =>
334
+ this.matchesPattern(f, pattern.pattern),
335
+ );
336
+
337
+ if (matchingFailures.length > 0) {
338
+ patterns.push({
339
+ ...pattern,
340
+ occurrences: matchingFailures.length,
341
+ affectedTests: matchingFailures.map((f) => f.testName),
342
+ });
343
+ }
344
+ }
345
+
346
+ return patterns;
347
+ }
348
+
349
+ /**
350
+ * Extract error key for grouping
351
+ */
352
+ private extractErrorKey(error: string): string {
353
+ // Remove specific values and keep structure
354
+ return error
355
+ .replace(/\d+/g, 'N') // Replace numbers
356
+ .replace(/'[^']*'/g, 'STRING') // Replace strings
357
+ .replace(/"[^"]*"/g, 'STRING')
358
+ .replace(/\b[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}\b/gi, 'UUID') // Replace UUIDs
359
+ .replace(/\s+/g, ' ') // Normalize whitespace
360
+ .trim()
361
+ .toLowerCase();
362
+ }
363
+
364
+ /**
365
+ * Generate pattern description
366
+ */
367
+ private generatePatternDescription(failures: TestFailure[]): string {
368
+ const layers = [...new Set(failures.map((f) => f.layer))];
369
+ const categories = [...new Set(failures.map((f) => f.category))];
370
+
371
+ return `Pattern affecting ${failures.length} tests in ${layers.join(', ')} layer(s), ${categories.join(', ')} test(s)`;
372
+ }
373
+
374
+ /**
375
+ * Suggest fix for pattern
376
+ */
377
+ private suggestFixForPattern(errorKey: string, failures: TestFailure[]): string {
378
+ const category = this.determineCategory(failures[0]);
379
+
380
+ const suggestions: Record<string, string> = {
381
+ 'network-api': 'Review API endpoint configurations and network connectivity',
382
+ database: 'Check database connection strings and query syntax',
383
+ rendering: 'Verify component props and DOM structure',
384
+ 'state-management': 'Validate state updates and action dispatchers',
385
+ authentication: 'Review authentication tokens and permission checks',
386
+ validation: 'Update validation schemas and error handling',
387
+ 'timing-async': 'Add proper async/await handling and increase timeouts',
388
+ resource: 'Review resource allocation and cleanup logic',
389
+ configuration: 'Verify environment configuration and variables',
390
+ dependency: 'Update dependencies and check import paths',
391
+ };
392
+
393
+ return suggestions[category] || 'Investigate root cause and apply targeted fix';
394
+ }
395
+
396
+ /**
397
+ * Check if failure matches pattern
398
+ */
399
+ private matchesPattern(failure: TestFailure, pattern: string): boolean {
400
+ const errorKey = this.extractErrorKey(failure.error);
401
+ return errorKey.includes(pattern.toLowerCase()) || pattern.toLowerCase().includes(errorKey);
402
+ }
403
+
404
+ /**
405
+ * Identify root causes
406
+ */
407
+ private async identifyRootCauses(
408
+ failures: TestFailure[],
409
+ patterns: FailurePattern[],
410
+ ): Promise<RootCause[]> {
411
+ const rootCauses: RootCause[] = [];
412
+ const causesMap = new Map<string, RootCause>();
413
+
414
+ // Analyze patterns for root causes
415
+ for (const pattern of patterns) {
416
+ const category = this.determineCategory(failures[0]);
417
+ const causeId = `cause_${category}`;
418
+
419
+ if (!causesMap.has(causeId)) {
420
+ const rootCause: RootCause = {
421
+ id: causeId,
422
+ category,
423
+ description: this.generateRootCauseDescription(category, pattern),
424
+ evidence: [pattern.description],
425
+ confidence: pattern.confidence,
426
+ affectedComponents: this.extractAffectedComponents(failures),
427
+ potentialSolutions: this.generatePotentialSolutions(category),
428
+ priority: this.calculateRootCausePriority(failures),
429
+ };
430
+
431
+ causesMap.set(causeId, rootCause);
432
+ } else {
433
+ const existing = causesMap.get(causeId)!;
434
+ existing.evidence.push(pattern.description);
435
+ existing.confidence = Math.min(existing.confidence + 0.1, 1);
436
+ }
437
+ }
438
+
439
+ return Array.from(causesMap.values());
440
+ }
441
+
442
+ /**
443
+ * Generate root cause description
444
+ */
445
+ private generateRootCauseDescription(category: string, pattern: FailurePattern): string {
446
+ const descriptions: Record<string, string> = {
447
+ 'network-api': 'API communication or network connectivity issues',
448
+ database: 'Database query or connection problems',
449
+ rendering: 'Component rendering or DOM manipulation issues',
450
+ 'state-management': 'State synchronization or update problems',
451
+ authentication: 'Authentication or authorization failures',
452
+ validation: 'Data validation or schema mismatch issues',
453
+ 'timing-async': 'Asynchronous operation or timing problems',
454
+ resource: 'Resource management or memory issues',
455
+ configuration: 'Configuration or environment setup problems',
456
+ dependency: 'Module dependency or import issues',
457
+ };
458
+
459
+ return descriptions[category] || `${category} related issues`;
460
+ }
461
+
462
+ /**
463
+ * Extract affected components
464
+ */
465
+ private extractAffectedComponents(failures: TestFailure[]): string[] {
466
+ const components = new Set<string>();
467
+
468
+ for (const failure of failures) {
469
+ if (failure.affectedComponents && Array.isArray(failure.affectedComponents)) {
470
+ failure.affectedComponents.forEach(comp => components.add(comp));
471
+ }
472
+ }
473
+
474
+ return Array.from(components);
475
+ }
476
+
477
+ /**
478
+ * Generate potential solutions
479
+ */
480
+ private generatePotentialSolutions(category: string): string[] {
481
+ const solutions: Record<string, string[]> = {
482
+ 'network-api': [
483
+ 'Verify API endpoint URLs',
484
+ 'Check CORS configuration',
485
+ 'Add proper error handling for network failures',
486
+ 'Implement retry logic with exponential backoff',
487
+ ],
488
+ database: [
489
+ 'Verify database connection strings',
490
+ 'Check query syntax and parameters',
491
+ 'Add proper transaction handling',
492
+ 'Implement connection pooling',
493
+ ],
494
+ rendering: [
495
+ 'Verify component props are correctly passed',
496
+ 'Check for null/undefined values before rendering',
497
+ 'Add proper error boundaries',
498
+ 'Use conditional rendering for optional elements',
499
+ ],
500
+ 'state-management': [
501
+ 'Verify action dispatchers are correctly wired',
502
+ 'Check reducer logic for state updates',
503
+ 'Add proper state initialization',
504
+ 'Use immutable update patterns',
505
+ ],
506
+ authentication: [
507
+ 'Verify token generation and validation',
508
+ 'Check permission configurations',
509
+ 'Add proper session management',
510
+ 'Implement token refresh logic',
511
+ ],
512
+ validation: [
513
+ 'Update validation schemas',
514
+ 'Add comprehensive error messages',
515
+ 'Implement client-side validation',
516
+ 'Use consistent validation rules',
517
+ ],
518
+ 'timing-async': [
519
+ 'Add proper async/await handling',
520
+ 'Increase timeout values',
521
+ 'Implement proper promise chaining',
522
+ 'Use Promise.all for parallel operations',
523
+ ],
524
+ resource: [
525
+ 'Implement proper cleanup in useEffect/componentWillUnmount',
526
+ 'Check for memory leaks',
527
+ 'Add resource pooling',
528
+ 'Implement proper caching strategies',
529
+ ],
530
+ configuration: [
531
+ 'Verify environment variables',
532
+ 'Check configuration file syntax',
533
+ 'Add proper default values',
534
+ 'Use configuration validation',
535
+ ],
536
+ dependency: [
537
+ 'Update outdated dependencies',
538
+ 'Check import paths',
539
+ 'Verify package.json configurations',
540
+ 'Use consistent module resolution',
541
+ ],
542
+ };
543
+
544
+ return solutions[category] || ['Investigate and apply appropriate fix'];
545
+ }
546
+
547
+ /**
548
+ * Calculate root cause priority
549
+ */
550
+ private calculateRootCausePriority(failures: TestFailure[]): number {
551
+ let priority = 50;
552
+
553
+ // Severity impact
554
+ const criticalCount = failures.filter((f) => f.severity === 'critical').length;
555
+ const highCount = failures.filter((f) => f.severity === 'high').length;
556
+
557
+ priority += criticalCount * 10;
558
+ priority += highCount * 5;
559
+
560
+ // Quantity impact
561
+ priority += Math.min(failures.length * 2, 30);
562
+
563
+ return Math.min(priority, 100);
564
+ }
565
+
566
+ /**
567
+ * Generate recommendations
568
+ */
569
+ private generateRecommendations(
570
+ failures: TestFailure[],
571
+ patterns: FailurePattern[],
572
+ rootCauses: RootCause[],
573
+ ): AnalysisRecommendation[] {
574
+ const recommendations: AnalysisRecommendation[] = [];
575
+
576
+ // Recommendations from root causes
577
+ for (const cause of rootCauses) {
578
+ const recommendation: AnalysisRecommendation = {
579
+ type: cause.priority > 70 ? 'fix' : cause.priority > 50 ? 'refactor' : 'investigate',
580
+ priority: this.mapPriorityToLevel(cause.priority),
581
+ description: cause.potentialSolutions[0],
582
+ reasoning: `Root cause: ${cause.description}. Affects ${cause.affectedComponents.length} component(s).`,
583
+ estimatedEffort: this.estimateEffort(cause.priority, cause.affectedComponents.length),
584
+ expectedImpact: this.estimateImpact(failures, cause),
585
+ };
586
+
587
+ recommendations.push(recommendation);
588
+ }
589
+
590
+ // Pattern-based recommendations
591
+ for (const pattern of patterns.slice(0, 3)) {
592
+ // Top 3 patterns
593
+ if (pattern.occurrences > 2) {
594
+ recommendations.push({
595
+ type: 'fix',
596
+ priority: 'high',
597
+ description: pattern.suggestedFix,
598
+ reasoning: `Pattern detected in ${pattern.occurrences} tests`,
599
+ estimatedEffort: 30,
600
+ expectedImpact: (pattern.occurrences / failures.length) * 100,
601
+ });
602
+ }
603
+ }
604
+
605
+ // General recommendations
606
+ if (failures.filter((f) => f.category === 'e2e').length > failures.length * 0.5) {
607
+ recommendations.push({
608
+ type: 'investigate',
609
+ priority: 'medium',
610
+ description: 'High number of E2E test failures - review integration points',
611
+ reasoning: 'E2E failures often indicate integration or environment issues',
612
+ estimatedEffort: 45,
613
+ expectedImpact: 40,
614
+ });
615
+ }
616
+
617
+ return recommendations.sort((a, b) => {
618
+ const priorityOrder = { critical: 4, high: 3, medium: 2, low: 1 };
619
+ return priorityOrder[b.priority] - priorityOrder[a.priority];
620
+ });
621
+ }
622
+
623
+ /**
624
+ * Map priority number to level
625
+ */
626
+ private mapPriorityToLevel(priority: number): 'critical' | 'high' | 'medium' | 'low' {
627
+ if (priority >= 80) return 'critical';
628
+ if (priority >= 60) return 'high';
629
+ if (priority >= 40) return 'medium';
630
+ return 'low';
631
+ }
632
+
633
+ /**
634
+ * Estimate effort
635
+ */
636
+ private estimateEffort(priority: number, componentCount: number): number {
637
+ const basEffort = 20; // minutes
638
+ const priorityMultiplier = priority / 50;
639
+ const complexityMultiplier = 1 + componentCount * 0.2;
640
+
641
+ return Math.round(basEffort * priorityMultiplier * complexityMultiplier);
642
+ }
643
+
644
+ /**
645
+ * Estimate impact
646
+ */
647
+ private estimateImpact(failures: TestFailure[], cause: RootCause): number {
648
+ const relatedFailures = failures.filter((f) =>
649
+ cause.affectedComponents.some((c) => f.affectedComponents.includes(c)),
650
+ );
651
+
652
+ return (relatedFailures.length / failures.length) * 100;
653
+ }
654
+
655
+ /**
656
+ * Assess impact
657
+ */
658
+ private assessImpact(failures: TestFailure[]): ImpactAssessment {
659
+ const criticalFailures = failures.filter((f) => f.severity === 'critical').length;
660
+ const highFailures = failures.filter((f) => f.severity === 'high').length;
661
+
662
+ // Determine users affected
663
+ let usersAffected: ImpactAssessment['usersAffected'] = 'none';
664
+ if (failures.length > 10) usersAffected = 'all';
665
+ else if (failures.length > 5) usersAffected = 'many';
666
+ else if (failures.length > 2) usersAffected = 'few';
667
+
668
+ // Features affected
669
+ const featuresAffected = [...new Set(failures.flatMap((f) => f.affectedComponents))];
670
+
671
+ // Business impact
672
+ let businessImpact: ImpactAssessment['businessImpact'] = 'low';
673
+ if (criticalFailures > 0) businessImpact = 'critical';
674
+ else if (highFailures > 3) businessImpact = 'high';
675
+ else if (failures.length > 5) businessImpact = 'medium';
676
+
677
+ // Urgency
678
+ const urgency = Math.min(
679
+ 50 + criticalFailures * 20 + highFailures * 10 + failures.length * 2,
680
+ 100,
681
+ );
682
+
683
+ // Risk level
684
+ let riskLevel: ImpactAssessment['riskLevel'] = 'low';
685
+ if (criticalFailures > 0) riskLevel = 'critical';
686
+ else if (highFailures > 2) riskLevel = 'high';
687
+ else if (failures.length > 5) riskLevel = 'medium';
688
+
689
+ return {
690
+ usersAffected,
691
+ featuresAffected,
692
+ businessImpact,
693
+ urgency,
694
+ riskLevel,
695
+ };
696
+ }
697
+
698
+ /**
699
+ * Initialize known patterns
700
+ */
701
+ private initializeKnownPatterns(): void {
702
+ const commonPatterns: FailurePattern[] = [
703
+ {
704
+ id: 'api-timeout',
705
+ pattern: 'timeout',
706
+ description: 'API request timeout pattern',
707
+ occurrences: 0,
708
+ affectedTests: [],
709
+ confidence: 0.9,
710
+ suggestedFix: 'Increase timeout values or optimize API response time',
711
+ relatedPatterns: ['network-api'],
712
+ },
713
+ {
714
+ id: 'null-reference',
715
+ pattern: 'cannot read property',
716
+ description: 'Null reference error pattern',
717
+ occurrences: 0,
718
+ affectedTests: [],
719
+ confidence: 0.95,
720
+ suggestedFix: 'Add null checks and proper initialization',
721
+ relatedPatterns: ['rendering', 'state-management'],
722
+ },
723
+ {
724
+ id: 'async-race',
725
+ pattern: 'promise',
726
+ description: 'Asynchronous operation race condition',
727
+ occurrences: 0,
728
+ affectedTests: [],
729
+ confidence: 0.8,
730
+ suggestedFix: 'Add proper async/await handling and synchronization',
731
+ relatedPatterns: ['timing-async'],
732
+ },
733
+ ];
734
+
735
+ for (const pattern of commonPatterns) {
736
+ this.knownPatterns.set(pattern.id, pattern);
737
+ }
738
+ }
739
+ }