claude-flow 2.0.0-alpha.2 → 2.0.0-alpha.21

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 (1018) hide show
  1. package/.claude/settings.json +30 -110
  2. package/README.md +301 -605
  3. package/bin/claude-flow +26 -2
  4. package/cli.mjs +2 -19
  5. package/package.json +3 -2
  6. package/scripts/claude-flow-wrapper.sh +35 -0
  7. package/src/cli/cli-core.ts +1 -1
  8. package/src/cli/command-registry.js +1 -1
  9. package/src/cli/commands/hook-types.ts +126 -0
  10. package/src/cli/commands/hook-validator.ts +191 -0
  11. package/src/cli/commands/hook.ts +346 -0
  12. package/src/cli/commands/index.ts +37 -0
  13. package/src/cli/commands/start/start-command.ts +3 -3
  14. package/src/cli/commands/swarm-new.ts +763 -353
  15. package/src/cli/commands/swarm-spawn.ts +8 -13
  16. package/src/cli/commands/swarm.ts +1 -1
  17. package/src/cli/commands/task.ts +51 -7
  18. package/src/cli/commands/workflow.ts +746 -10
  19. package/src/cli/index-remote.ts +1 -1
  20. package/src/cli/index.ts +35 -29
  21. package/src/cli/node-compat.js +2 -71
  22. package/src/cli/node-repl.ts +3 -5
  23. package/src/cli/repl.ts +33 -57
  24. package/src/cli/simple-cli.ts +27 -85
  25. package/src/cli/simple-commands/hive-mind/core.js +3 -1
  26. package/src/cli/simple-commands/hive-mind/mcp-wrapper.js +4 -1
  27. package/src/cli/simple-commands/hive-mind/memory.js +19 -5
  28. package/src/cli/simple-commands/hive-mind.js +390 -636
  29. package/src/cli/simple-commands/init/executable-wrapper.js +8 -5
  30. package/src/cli/simple-commands/init/help.js +6 -2
  31. package/src/cli/simple-commands/init/index.js +201 -168
  32. package/src/cli/simple-commands/init/templates/claude-flow-universal +78 -0
  33. package/src/cli/simple-commands/init/templates/commands/hooks/notification.md +102 -0
  34. package/src/cli/simple-commands/init/templates/commands/hooks/post-command.md +105 -0
  35. package/src/cli/simple-commands/init/templates/commands/hooks/post-edit.md +106 -0
  36. package/src/cli/simple-commands/init/templates/commands/hooks/post-task.md +101 -0
  37. package/src/cli/simple-commands/init/templates/commands/hooks/pre-command.md +102 -0
  38. package/src/cli/simple-commands/init/templates/commands/hooks/pre-edit.md +102 -0
  39. package/src/cli/simple-commands/init/templates/commands/hooks/pre-search.md +105 -0
  40. package/src/cli/simple-commands/init/templates/commands/hooks/pre-task.md +8 -8
  41. package/src/cli/simple-commands/init/templates/commands/hooks/session-end.md +107 -0
  42. package/src/cli/simple-commands/init/templates/commands/hooks/session-restore.md +110 -0
  43. package/src/cli/simple-commands/init/templates/commands/hooks/session-start.md +106 -0
  44. package/src/cli/simple-commands/init/templates/enhanced-templates.js +170 -222
  45. package/src/cli/simple-commands/init/templates/settings.json +30 -110
  46. package/src/cli/simple-commands/swarm.js +9 -6
  47. package/src/cli/ui/compatible-ui.ts +1 -14
  48. package/src/cli/ui/fallback-handler.ts +2 -2
  49. package/src/cli/utils/environment-detector.ts +6 -6
  50. package/src/cli/utils/interactive-detector.js +126 -0
  51. package/src/communication/message-bus.ts +7 -3
  52. package/src/coordination/advanced-task-executor.ts +11 -8
  53. package/src/coordination/load-balancer.ts +19 -33
  54. package/src/coordination/work-stealing.ts +1 -1
  55. package/src/core/event-bus.ts +2 -2
  56. package/src/core/logger.ts +1 -1
  57. package/src/hive-mind/core/Agent.ts +2 -3
  58. package/src/hive-mind/core/Communication.ts +3 -16
  59. package/src/hive-mind/core/DatabaseManager.ts +3 -18
  60. package/src/hive-mind/core/HiveMind.ts +6 -8
  61. package/src/hive-mind/core/Memory.ts +35 -29
  62. package/src/hive-mind/integration/ConsensusEngine.ts +19 -4
  63. package/src/hive-mind/integration/MCPToolWrapper.ts +2 -1
  64. package/src/hive-mind/integration/SwarmOrchestrator.ts +4 -7
  65. package/src/integration/mock-components.ts +8 -8
  66. package/src/integration/system-integration.ts +20 -33
  67. package/src/mcp/index.ts +17 -20
  68. package/src/mcp/ruv-swarm-tools.ts +2 -12
  69. package/src/swarm/coordinator.ts +46 -97
  70. package/src/swarm/executor-v2.ts +18 -23
  71. package/src/swarm/executor.ts +9 -9
  72. package/src/swarm/optimizations/optimized-executor.ts +26 -79
  73. package/src/swarm/prompt-copier-enhanced.ts +9 -27
  74. package/src/swarm/prompt-copier.ts +12 -13
  75. package/src/swarm/types.ts +1 -7
  76. package/src/utils/error-handler.ts +6 -23
  77. package/src/utils/type-guards.ts +188 -0
  78. package/.claude/commands/analysis/README.md +0 -9
  79. package/.claude/commands/analysis/bottleneck-detect.md +0 -150
  80. package/.claude/commands/analysis/performance-report.md +0 -25
  81. package/.claude/commands/analysis/token-usage.md +0 -25
  82. package/.claude/commands/automation/README.md +0 -9
  83. package/.claude/commands/automation/auto-agent.md +0 -112
  84. package/.claude/commands/automation/smart-spawn.md +0 -25
  85. package/.claude/commands/automation/workflow-select.md +0 -25
  86. package/.claude/commands/coordination/README.md +0 -9
  87. package/.claude/commands/coordination/agent-spawn.md +0 -25
  88. package/.claude/commands/coordination/swarm-init.md +0 -76
  89. package/.claude/commands/coordination/task-orchestrate.md +0 -25
  90. package/.claude/commands/github/README.md +0 -11
  91. package/.claude/commands/github/code-review.md +0 -25
  92. package/.claude/commands/github/github-swarm.md +0 -108
  93. package/.claude/commands/github/issue-tracker-enhanced.md +0 -358
  94. package/.claude/commands/github/issue-triage.md +0 -25
  95. package/.claude/commands/github/pr-enhance.md +0 -26
  96. package/.claude/commands/github/repo-analyze.md +0 -25
  97. package/.claude/commands/hooks/README.md +0 -11
  98. package/.claude/commands/hooks/post-edit.md +0 -25
  99. package/.claude/commands/hooks/post-task.md +0 -25
  100. package/.claude/commands/hooks/pre-edit.md +0 -25
  101. package/.claude/commands/hooks/pre-task.md +0 -100
  102. package/.claude/commands/hooks/session-end.md +0 -25
  103. package/.claude/commands/hooks-overview.md +0 -245
  104. package/.claude/commands/memory/README.md +0 -9
  105. package/.claude/commands/memory/memory-persist.md +0 -25
  106. package/.claude/commands/memory/memory-search.md +0 -25
  107. package/.claude/commands/memory/memory-usage.md +0 -25
  108. package/.claude/commands/monitoring/README.md +0 -9
  109. package/.claude/commands/monitoring/agent-metrics.md +0 -25
  110. package/.claude/commands/monitoring/real-time-view.md +0 -25
  111. package/.claude/commands/monitoring/swarm-monitor.md +0 -25
  112. package/.claude/commands/optimization/README.md +0 -9
  113. package/.claude/commands/optimization/cache-manage.md +0 -25
  114. package/.claude/commands/optimization/parallel-execute.md +0 -25
  115. package/.claude/commands/optimization/topology-optimize.md +0 -25
  116. package/.claude/commands/training/README.md +0 -9
  117. package/.claude/commands/training/model-update.md +0 -25
  118. package/.claude/commands/training/neural-train.md +0 -25
  119. package/.claude/commands/training/pattern-learn.md +0 -25
  120. package/.claude/commands/workflows/README.md +0 -9
  121. package/.claude/commands/workflows/workflow-create.md +0 -25
  122. package/.claude/commands/workflows/workflow-execute.md +0 -25
  123. package/.claude/commands/workflows/workflow-export.md +0 -25
  124. package/.claude/helpers/github-setup.sh +0 -28
  125. package/.claude/helpers/quick-start.sh +0 -19
  126. package/.claude/helpers/setup-mcp.sh +0 -18
  127. package/dist/adapters/cliffy-node.d.ts +0 -45
  128. package/dist/adapters/cliffy-node.d.ts.map +0 -1
  129. package/dist/adapters/cliffy-node.js +0 -61
  130. package/dist/adapters/cliffy-node.js.map +0 -1
  131. package/dist/agents/agent-manager.d.ts +0 -191
  132. package/dist/agents/agent-manager.d.ts.map +0 -1
  133. package/dist/agents/agent-manager.js +0 -969
  134. package/dist/agents/agent-manager.js.map +0 -1
  135. package/dist/agents/agent-registry.d.ts +0 -112
  136. package/dist/agents/agent-registry.d.ts.map +0 -1
  137. package/dist/agents/agent-registry.js +0 -341
  138. package/dist/agents/agent-registry.js.map +0 -1
  139. package/dist/cli/agents/analyst.d.ts +0 -28
  140. package/dist/cli/agents/analyst.d.ts.map +0 -1
  141. package/dist/cli/agents/analyst.js +0 -718
  142. package/dist/cli/agents/analyst.js.map +0 -1
  143. package/dist/cli/agents/architect.d.ts +0 -27
  144. package/dist/cli/agents/architect.d.ts.map +0 -1
  145. package/dist/cli/agents/architect.js +0 -729
  146. package/dist/cli/agents/architect.js.map +0 -1
  147. package/dist/cli/agents/base-agent.d.ts +0 -80
  148. package/dist/cli/agents/base-agent.d.ts.map +0 -1
  149. package/dist/cli/agents/base-agent.js +0 -385
  150. package/dist/cli/agents/base-agent.js.map +0 -1
  151. package/dist/cli/agents/capabilities.d.ts +0 -106
  152. package/dist/cli/agents/capabilities.d.ts.map +0 -1
  153. package/dist/cli/agents/capabilities.js +0 -556
  154. package/dist/cli/agents/capabilities.js.map +0 -1
  155. package/dist/cli/agents/coder.d.ts +0 -34
  156. package/dist/cli/agents/coder.d.ts.map +0 -1
  157. package/dist/cli/agents/coder.js +0 -806
  158. package/dist/cli/agents/coder.js.map +0 -1
  159. package/dist/cli/agents/coordinator.d.ts +0 -25
  160. package/dist/cli/agents/coordinator.d.ts.map +0 -1
  161. package/dist/cli/agents/coordinator.js +0 -454
  162. package/dist/cli/agents/coordinator.js.map +0 -1
  163. package/dist/cli/agents/hive-agents.d.ts +0 -85
  164. package/dist/cli/agents/hive-agents.d.ts.map +0 -1
  165. package/dist/cli/agents/hive-agents.js +0 -549
  166. package/dist/cli/agents/hive-agents.js.map +0 -1
  167. package/dist/cli/agents/index.d.ts +0 -111
  168. package/dist/cli/agents/index.d.ts.map +0 -1
  169. package/dist/cli/agents/index.js +0 -276
  170. package/dist/cli/agents/index.js.map +0 -1
  171. package/dist/cli/agents/researcher.d.ts +0 -24
  172. package/dist/cli/agents/researcher.d.ts.map +0 -1
  173. package/dist/cli/agents/researcher.js +0 -356
  174. package/dist/cli/agents/researcher.js.map +0 -1
  175. package/dist/cli/agents/tester.d.ts +0 -27
  176. package/dist/cli/agents/tester.d.ts.map +0 -1
  177. package/dist/cli/agents/tester.js +0 -594
  178. package/dist/cli/agents/tester.js.map +0 -1
  179. package/dist/cli/cli-core.d.ts +0 -49
  180. package/dist/cli/cli-core.d.ts.map +0 -1
  181. package/dist/cli/cli-core.js +0 -263
  182. package/dist/cli/cli-core.js.map +0 -1
  183. package/dist/cli/commands/advanced-memory-commands.d.ts +0 -2
  184. package/dist/cli/commands/advanced-memory-commands.d.ts.map +0 -1
  185. package/dist/cli/commands/advanced-memory-commands.js +0 -849
  186. package/dist/cli/commands/advanced-memory-commands.js.map +0 -1
  187. package/dist/cli/commands/agent-simple.d.ts +0 -12
  188. package/dist/cli/commands/agent-simple.d.ts.map +0 -1
  189. package/dist/cli/commands/agent-simple.js +0 -353
  190. package/dist/cli/commands/agent-simple.js.map +0 -1
  191. package/dist/cli/commands/agent.d.ts +0 -7
  192. package/dist/cli/commands/agent.d.ts.map +0 -1
  193. package/dist/cli/commands/agent.js +0 -369
  194. package/dist/cli/commands/agent.js.map +0 -1
  195. package/dist/cli/commands/claude.d.ts +0 -3
  196. package/dist/cli/commands/claude.d.ts.map +0 -1
  197. package/dist/cli/commands/claude.js +0 -154
  198. package/dist/cli/commands/claude.js.map +0 -1
  199. package/dist/cli/commands/config-integration.d.ts +0 -10
  200. package/dist/cli/commands/config-integration.d.ts.map +0 -1
  201. package/dist/cli/commands/config-integration.js +0 -416
  202. package/dist/cli/commands/config-integration.js.map +0 -1
  203. package/dist/cli/commands/config.d.ts +0 -5
  204. package/dist/cli/commands/config.d.ts.map +0 -1
  205. package/dist/cli/commands/config.js +0 -89
  206. package/dist/cli/commands/config.js.map +0 -1
  207. package/dist/cli/commands/enterprise.d.ts +0 -3
  208. package/dist/cli/commands/enterprise.d.ts.map +0 -1
  209. package/dist/cli/commands/enterprise.js +0 -1486
  210. package/dist/cli/commands/enterprise.js.map +0 -1
  211. package/dist/cli/commands/help.d.ts +0 -6
  212. package/dist/cli/commands/help.d.ts.map +0 -1
  213. package/dist/cli/commands/help.js +0 -786
  214. package/dist/cli/commands/help.js.map +0 -1
  215. package/dist/cli/commands/hive-mind/index.d.ts +0 -15
  216. package/dist/cli/commands/hive-mind/index.d.ts.map +0 -1
  217. package/dist/cli/commands/hive-mind/index.js +0 -22
  218. package/dist/cli/commands/hive-mind/index.js.map +0 -1
  219. package/dist/cli/commands/hive-mind/init.d.ts +0 -10
  220. package/dist/cli/commands/hive-mind/init.d.ts.map +0 -1
  221. package/dist/cli/commands/hive-mind/init.js +0 -68
  222. package/dist/cli/commands/hive-mind/init.js.map +0 -1
  223. package/dist/cli/commands/hive-mind/optimize-memory.d.ts +0 -8
  224. package/dist/cli/commands/hive-mind/optimize-memory.d.ts.map +0 -1
  225. package/dist/cli/commands/hive-mind/optimize-memory.js +0 -391
  226. package/dist/cli/commands/hive-mind/optimize-memory.js.map +0 -1
  227. package/dist/cli/commands/hive-mind/spawn.d.ts +0 -10
  228. package/dist/cli/commands/hive-mind/spawn.d.ts.map +0 -1
  229. package/dist/cli/commands/hive-mind/spawn.js +0 -147
  230. package/dist/cli/commands/hive-mind/spawn.js.map +0 -1
  231. package/dist/cli/commands/hive-mind/status.d.ts +0 -10
  232. package/dist/cli/commands/hive-mind/status.d.ts.map +0 -1
  233. package/dist/cli/commands/hive-mind/status.js +0 -209
  234. package/dist/cli/commands/hive-mind/status.js.map +0 -1
  235. package/dist/cli/commands/hive-mind/task.d.ts +0 -10
  236. package/dist/cli/commands/hive-mind/task.d.ts.map +0 -1
  237. package/dist/cli/commands/hive-mind/task.js +0 -288
  238. package/dist/cli/commands/hive-mind/task.js.map +0 -1
  239. package/dist/cli/commands/hive-mind/wizard.d.ts +0 -10
  240. package/dist/cli/commands/hive-mind/wizard.d.ts.map +0 -1
  241. package/dist/cli/commands/hive-mind/wizard.js +0 -513
  242. package/dist/cli/commands/hive-mind/wizard.js.map +0 -1
  243. package/dist/cli/commands/hive.d.ts +0 -6
  244. package/dist/cli/commands/hive.d.ts.map +0 -1
  245. package/dist/cli/commands/hive.js +0 -374
  246. package/dist/cli/commands/hive.js.map +0 -1
  247. package/dist/cli/commands/index.d.ts +0 -3
  248. package/dist/cli/commands/index.d.ts.map +0 -1
  249. package/dist/cli/commands/index.js +0 -2416
  250. package/dist/cli/commands/index.js.map +0 -1
  251. package/dist/cli/commands/mcp.d.ts +0 -6
  252. package/dist/cli/commands/mcp.d.ts.map +0 -1
  253. package/dist/cli/commands/mcp.js +0 -177
  254. package/dist/cli/commands/mcp.js.map +0 -1
  255. package/dist/cli/commands/memory.d.ts +0 -30
  256. package/dist/cli/commands/memory.d.ts.map +0 -1
  257. package/dist/cli/commands/memory.js +0 -225
  258. package/dist/cli/commands/memory.js.map +0 -1
  259. package/dist/cli/commands/migrate.d.ts +0 -6
  260. package/dist/cli/commands/migrate.d.ts.map +0 -1
  261. package/dist/cli/commands/migrate.js +0 -139
  262. package/dist/cli/commands/migrate.js.map +0 -1
  263. package/dist/cli/commands/monitor.d.ts +0 -6
  264. package/dist/cli/commands/monitor.d.ts.map +0 -1
  265. package/dist/cli/commands/monitor.js +0 -477
  266. package/dist/cli/commands/monitor.js.map +0 -1
  267. package/dist/cli/commands/ruv-swarm.d.ts +0 -10
  268. package/dist/cli/commands/ruv-swarm.d.ts.map +0 -1
  269. package/dist/cli/commands/ruv-swarm.js +0 -563
  270. package/dist/cli/commands/ruv-swarm.js.map +0 -1
  271. package/dist/cli/commands/session.d.ts +0 -6
  272. package/dist/cli/commands/session.d.ts.map +0 -1
  273. package/dist/cli/commands/session.js +0 -543
  274. package/dist/cli/commands/session.js.map +0 -1
  275. package/dist/cli/commands/sparc.d.ts +0 -3
  276. package/dist/cli/commands/sparc.d.ts.map +0 -1
  277. package/dist/cli/commands/sparc.js +0 -452
  278. package/dist/cli/commands/sparc.js.map +0 -1
  279. package/dist/cli/commands/start/event-emitter.d.ts +0 -13
  280. package/dist/cli/commands/start/event-emitter.d.ts.map +0 -1
  281. package/dist/cli/commands/start/event-emitter.js +0 -35
  282. package/dist/cli/commands/start/event-emitter.js.map +0 -1
  283. package/dist/cli/commands/start/index.d.ts +0 -10
  284. package/dist/cli/commands/start/index.d.ts.map +0 -1
  285. package/dist/cli/commands/start/index.js +0 -9
  286. package/dist/cli/commands/start/index.js.map +0 -1
  287. package/dist/cli/commands/start/process-manager.d.ts +0 -31
  288. package/dist/cli/commands/start/process-manager.d.ts.map +0 -1
  289. package/dist/cli/commands/start/process-manager.js +0 -281
  290. package/dist/cli/commands/start/process-manager.js.map +0 -1
  291. package/dist/cli/commands/start/process-ui-simple.d.ts +0 -25
  292. package/dist/cli/commands/start/process-ui-simple.d.ts.map +0 -1
  293. package/dist/cli/commands/start/process-ui-simple.js +0 -334
  294. package/dist/cli/commands/start/process-ui-simple.js.map +0 -1
  295. package/dist/cli/commands/start/process-ui.d.ts +0 -5
  296. package/dist/cli/commands/start/process-ui.d.ts.map +0 -1
  297. package/dist/cli/commands/start/process-ui.js +0 -5
  298. package/dist/cli/commands/start/process-ui.js.map +0 -1
  299. package/dist/cli/commands/start/start-command.d.ts +0 -6
  300. package/dist/cli/commands/start/start-command.d.ts.map +0 -1
  301. package/dist/cli/commands/start/start-command.js +0 -450
  302. package/dist/cli/commands/start/start-command.js.map +0 -1
  303. package/dist/cli/commands/start/system-monitor.d.ts +0 -22
  304. package/dist/cli/commands/start/system-monitor.d.ts.map +0 -1
  305. package/dist/cli/commands/start/system-monitor.js +0 -267
  306. package/dist/cli/commands/start/system-monitor.js.map +0 -1
  307. package/dist/cli/commands/start/types.d.ts +0 -64
  308. package/dist/cli/commands/start/types.d.ts.map +0 -1
  309. package/dist/cli/commands/start/types.js +0 -22
  310. package/dist/cli/commands/start/types.js.map +0 -1
  311. package/dist/cli/commands/start.d.ts +0 -6
  312. package/dist/cli/commands/start.d.ts.map +0 -1
  313. package/dist/cli/commands/start.js +0 -6
  314. package/dist/cli/commands/start.js.map +0 -1
  315. package/dist/cli/commands/status.d.ts +0 -6
  316. package/dist/cli/commands/status.d.ts.map +0 -1
  317. package/dist/cli/commands/status.js +0 -312
  318. package/dist/cli/commands/status.js.map +0 -1
  319. package/dist/cli/commands/swarm-new.d.ts +0 -3
  320. package/dist/cli/commands/swarm-new.d.ts.map +0 -1
  321. package/dist/cli/commands/swarm-new.js +0 -989
  322. package/dist/cli/commands/swarm-new.js.map +0 -1
  323. package/dist/cli/commands/swarm-spawn.d.ts +0 -24
  324. package/dist/cli/commands/swarm-spawn.d.ts.map +0 -1
  325. package/dist/cli/commands/swarm-spawn.js +0 -61
  326. package/dist/cli/commands/swarm-spawn.js.map +0 -1
  327. package/dist/cli/commands/swarm.d.ts +0 -3
  328. package/dist/cli/commands/swarm.d.ts.map +0 -1
  329. package/dist/cli/commands/swarm.js +0 -460
  330. package/dist/cli/commands/swarm.js.map +0 -1
  331. package/dist/cli/commands/task.d.ts +0 -3
  332. package/dist/cli/commands/task.d.ts.map +0 -1
  333. package/dist/cli/commands/task.js +0 -29
  334. package/dist/cli/commands/task.js.map +0 -1
  335. package/dist/cli/commands/workflow.d.ts +0 -3
  336. package/dist/cli/commands/workflow.d.ts.map +0 -1
  337. package/dist/cli/commands/workflow.js +0 -23
  338. package/dist/cli/commands/workflow.js.map +0 -1
  339. package/dist/cli/completion.d.ts +0 -16
  340. package/dist/cli/completion.d.ts.map +0 -1
  341. package/dist/cli/completion.js +0 -535
  342. package/dist/cli/completion.js.map +0 -1
  343. package/dist/cli/formatter.d.ts +0 -66
  344. package/dist/cli/formatter.d.ts.map +0 -1
  345. package/dist/cli/formatter.js +0 -277
  346. package/dist/cli/formatter.js.map +0 -1
  347. package/dist/cli/index-remote.d.ts +0 -3
  348. package/dist/cli/index-remote.d.ts.map +0 -1
  349. package/dist/cli/index-remote.js +0 -126
  350. package/dist/cli/index-remote.js.map +0 -1
  351. package/dist/cli/index.d.ts +0 -7
  352. package/dist/cli/index.d.ts.map +0 -1
  353. package/dist/cli/index.js +0 -197
  354. package/dist/cli/index.js.map +0 -1
  355. package/dist/cli/init/batch-tools.d.ts +0 -2
  356. package/dist/cli/init/batch-tools.d.ts.map +0 -1
  357. package/dist/cli/init/batch-tools.js +0 -387
  358. package/dist/cli/init/batch-tools.js.map +0 -1
  359. package/dist/cli/init/claude-config.d.ts +0 -3
  360. package/dist/cli/init/claude-config.d.ts.map +0 -1
  361. package/dist/cli/init/claude-config.js +0 -289
  362. package/dist/cli/init/claude-config.js.map +0 -1
  363. package/dist/cli/init/directory-structure.d.ts +0 -2
  364. package/dist/cli/init/directory-structure.d.ts.map +0 -1
  365. package/dist/cli/init/directory-structure.js +0 -144
  366. package/dist/cli/init/directory-structure.js.map +0 -1
  367. package/dist/cli/init/index.d.ts +0 -6
  368. package/dist/cli/init/index.d.ts.map +0 -1
  369. package/dist/cli/init/index.js +0 -52
  370. package/dist/cli/init/index.js.map +0 -1
  371. package/dist/cli/init/sparc-environment.d.ts +0 -2
  372. package/dist/cli/init/sparc-environment.d.ts.map +0 -1
  373. package/dist/cli/init/sparc-environment.js +0 -426
  374. package/dist/cli/init/sparc-environment.js.map +0 -1
  375. package/dist/cli/init/swarm-commands.d.ts +0 -2
  376. package/dist/cli/init/swarm-commands.d.ts.map +0 -1
  377. package/dist/cli/init/swarm-commands.js +0 -795
  378. package/dist/cli/init/swarm-commands.js.map +0 -1
  379. package/dist/cli/init/utils.d.ts +0 -5
  380. package/dist/cli/init/utils.d.ts.map +0 -1
  381. package/dist/cli/init/utils.js +0 -14
  382. package/dist/cli/init/utils.js.map +0 -1
  383. package/dist/cli/main.d.ts +0 -3
  384. package/dist/cli/main.d.ts.map +0 -1
  385. package/dist/cli/main.js +0 -26
  386. package/dist/cli/main.js.map +0 -1
  387. package/dist/cli/node-repl.d.ts +0 -5
  388. package/dist/cli/node-repl.d.ts.map +0 -1
  389. package/dist/cli/node-repl.js +0 -677
  390. package/dist/cli/node-repl.js.map +0 -1
  391. package/dist/cli/repl.d.ts +0 -5
  392. package/dist/cli/repl.d.ts.map +0 -1
  393. package/dist/cli/repl.js +0 -909
  394. package/dist/cli/repl.js.map +0 -1
  395. package/dist/cli/simple-cli.d.ts +0 -3
  396. package/dist/cli/simple-cli.d.ts.map +0 -1
  397. package/dist/cli/simple-cli.js +0 -3059
  398. package/dist/cli/simple-cli.js.map +0 -1
  399. package/dist/cli/simple-mcp.d.ts +0 -6
  400. package/dist/cli/simple-mcp.d.ts.map +0 -1
  401. package/dist/cli/simple-mcp.js +0 -107
  402. package/dist/cli/simple-mcp.js.map +0 -1
  403. package/dist/cli/simple-orchestrator.d.ts +0 -16
  404. package/dist/cli/simple-orchestrator.d.ts.map +0 -1
  405. package/dist/cli/simple-orchestrator.js +0 -833
  406. package/dist/cli/simple-orchestrator.js.map +0 -1
  407. package/dist/cli/ui/compatible-ui.d.ts +0 -45
  408. package/dist/cli/ui/compatible-ui.d.ts.map +0 -1
  409. package/dist/cli/ui/compatible-ui.js +0 -318
  410. package/dist/cli/ui/compatible-ui.js.map +0 -1
  411. package/dist/cli/ui/fallback-handler.d.ts +0 -26
  412. package/dist/cli/ui/fallback-handler.d.ts.map +0 -1
  413. package/dist/cli/ui/fallback-handler.js +0 -163
  414. package/dist/cli/ui/fallback-handler.js.map +0 -1
  415. package/dist/cli/ui/index.d.ts +0 -11
  416. package/dist/cli/ui/index.d.ts.map +0 -1
  417. package/dist/cli/ui/index.js +0 -33
  418. package/dist/cli/ui/index.js.map +0 -1
  419. package/dist/cli/utils/environment-detector.d.ts +0 -52
  420. package/dist/cli/utils/environment-detector.d.ts.map +0 -1
  421. package/dist/cli/utils/environment-detector.js +0 -238
  422. package/dist/cli/utils/environment-detector.js.map +0 -1
  423. package/dist/cli/utils/prompt-defaults.d.ts +0 -82
  424. package/dist/cli/utils/prompt-defaults.d.ts.map +0 -1
  425. package/dist/cli/utils/prompt-defaults.js +0 -253
  426. package/dist/cli/utils/prompt-defaults.js.map +0 -1
  427. package/dist/communication/message-bus.d.ts +0 -283
  428. package/dist/communication/message-bus.d.ts.map +0 -1
  429. package/dist/communication/message-bus.js +0 -954
  430. package/dist/communication/message-bus.js.map +0 -1
  431. package/dist/config/config-manager.d.ts +0 -174
  432. package/dist/config/config-manager.d.ts.map +0 -1
  433. package/dist/config/config-manager.js +0 -443
  434. package/dist/config/config-manager.js.map +0 -1
  435. package/dist/config/ruv-swarm-config.d.ts +0 -167
  436. package/dist/config/ruv-swarm-config.d.ts.map +0 -1
  437. package/dist/config/ruv-swarm-config.js +0 -274
  438. package/dist/config/ruv-swarm-config.js.map +0 -1
  439. package/dist/config/ruv-swarm-integration.d.ts +0 -93
  440. package/dist/config/ruv-swarm-integration.d.ts.map +0 -1
  441. package/dist/config/ruv-swarm-integration.js +0 -292
  442. package/dist/config/ruv-swarm-integration.js.map +0 -1
  443. package/dist/constants/agent-types.d.ts +0 -46
  444. package/dist/constants/agent-types.d.ts.map +0 -1
  445. package/dist/constants/agent-types.js +0 -50
  446. package/dist/constants/agent-types.js.map +0 -1
  447. package/dist/coordination/advanced-scheduler.d.ts +0 -121
  448. package/dist/coordination/advanced-scheduler.d.ts.map +0 -1
  449. package/dist/coordination/advanced-scheduler.js +0 -386
  450. package/dist/coordination/advanced-scheduler.js.map +0 -1
  451. package/dist/coordination/advanced-task-executor.d.ts +0 -100
  452. package/dist/coordination/advanced-task-executor.d.ts.map +0 -1
  453. package/dist/coordination/advanced-task-executor.js +0 -459
  454. package/dist/coordination/advanced-task-executor.js.map +0 -1
  455. package/dist/coordination/background-executor.d.ts +0 -69
  456. package/dist/coordination/background-executor.d.ts.map +0 -1
  457. package/dist/coordination/background-executor.js +0 -362
  458. package/dist/coordination/background-executor.js.map +0 -1
  459. package/dist/coordination/circuit-breaker.d.ts +0 -124
  460. package/dist/coordination/circuit-breaker.d.ts.map +0 -1
  461. package/dist/coordination/circuit-breaker.js +0 -298
  462. package/dist/coordination/circuit-breaker.js.map +0 -1
  463. package/dist/coordination/conflict-resolution.d.ts +0 -133
  464. package/dist/coordination/conflict-resolution.d.ts.map +0 -1
  465. package/dist/coordination/conflict-resolution.js +0 -358
  466. package/dist/coordination/conflict-resolution.js.map +0 -1
  467. package/dist/coordination/dependency-graph.d.ts +0 -78
  468. package/dist/coordination/dependency-graph.d.ts.map +0 -1
  469. package/dist/coordination/dependency-graph.js +0 -386
  470. package/dist/coordination/dependency-graph.js.map +0 -1
  471. package/dist/coordination/hive-orchestrator.d.ts +0 -118
  472. package/dist/coordination/hive-orchestrator.d.ts.map +0 -1
  473. package/dist/coordination/hive-orchestrator.js +0 -321
  474. package/dist/coordination/hive-orchestrator.js.map +0 -1
  475. package/dist/coordination/hive-protocol.d.ts +0 -117
  476. package/dist/coordination/hive-protocol.d.ts.map +0 -1
  477. package/dist/coordination/hive-protocol.js +0 -373
  478. package/dist/coordination/hive-protocol.js.map +0 -1
  479. package/dist/coordination/index.d.ts +0 -14
  480. package/dist/coordination/index.d.ts.map +0 -1
  481. package/dist/coordination/index.js +0 -21
  482. package/dist/coordination/index.js.map +0 -1
  483. package/dist/coordination/load-balancer.d.ts +0 -139
  484. package/dist/coordination/load-balancer.d.ts.map +0 -1
  485. package/dist/coordination/load-balancer.js +0 -691
  486. package/dist/coordination/load-balancer.js.map +0 -1
  487. package/dist/coordination/manager.d.ts +0 -66
  488. package/dist/coordination/manager.d.ts.map +0 -1
  489. package/dist/coordination/manager.js +0 -360
  490. package/dist/coordination/manager.js.map +0 -1
  491. package/dist/coordination/messaging.d.ts +0 -37
  492. package/dist/coordination/messaging.d.ts.map +0 -1
  493. package/dist/coordination/messaging.js +0 -219
  494. package/dist/coordination/messaging.js.map +0 -1
  495. package/dist/coordination/metrics.d.ts +0 -153
  496. package/dist/coordination/metrics.d.ts.map +0 -1
  497. package/dist/coordination/metrics.js +0 -434
  498. package/dist/coordination/metrics.js.map +0 -1
  499. package/dist/coordination/resources.d.ts +0 -36
  500. package/dist/coordination/resources.d.ts.map +0 -1
  501. package/dist/coordination/resources.js +0 -250
  502. package/dist/coordination/resources.js.map +0 -1
  503. package/dist/coordination/scheduler.d.ts +0 -48
  504. package/dist/coordination/scheduler.d.ts.map +0 -1
  505. package/dist/coordination/scheduler.js +0 -308
  506. package/dist/coordination/scheduler.js.map +0 -1
  507. package/dist/coordination/swarm-coordinator.d.ts +0 -116
  508. package/dist/coordination/swarm-coordinator.d.ts.map +0 -1
  509. package/dist/coordination/swarm-coordinator.js +0 -565
  510. package/dist/coordination/swarm-coordinator.js.map +0 -1
  511. package/dist/coordination/swarm-monitor.d.ts +0 -101
  512. package/dist/coordination/swarm-monitor.d.ts.map +0 -1
  513. package/dist/coordination/swarm-monitor.js +0 -340
  514. package/dist/coordination/swarm-monitor.js.map +0 -1
  515. package/dist/coordination/work-stealing.d.ts +0 -44
  516. package/dist/coordination/work-stealing.d.ts.map +0 -1
  517. package/dist/coordination/work-stealing.js +0 -155
  518. package/dist/coordination/work-stealing.js.map +0 -1
  519. package/dist/core/config.d.ts +0 -239
  520. package/dist/core/config.d.ts.map +0 -1
  521. package/dist/core/config.js +0 -1128
  522. package/dist/core/config.js.map +0 -1
  523. package/dist/core/event-bus.d.ts +0 -60
  524. package/dist/core/event-bus.d.ts.map +0 -1
  525. package/dist/core/event-bus.js +0 -153
  526. package/dist/core/event-bus.js.map +0 -1
  527. package/dist/core/json-persistence.d.ts +0 -52
  528. package/dist/core/json-persistence.d.ts.map +0 -1
  529. package/dist/core/json-persistence.js +0 -115
  530. package/dist/core/json-persistence.js.map +0 -1
  531. package/dist/core/logger.d.ts +0 -57
  532. package/dist/core/logger.d.ts.map +0 -1
  533. package/dist/core/logger.js +0 -253
  534. package/dist/core/logger.js.map +0 -1
  535. package/dist/core/orchestrator-fixed.d.ts +0 -81
  536. package/dist/core/orchestrator-fixed.d.ts.map +0 -1
  537. package/dist/core/orchestrator-fixed.js +0 -210
  538. package/dist/core/orchestrator-fixed.js.map +0 -1
  539. package/dist/core/orchestrator.d.ts +0 -103
  540. package/dist/core/orchestrator.d.ts.map +0 -1
  541. package/dist/core/orchestrator.js +0 -965
  542. package/dist/core/orchestrator.js.map +0 -1
  543. package/dist/core/persistence.d.ts +0 -50
  544. package/dist/core/persistence.d.ts.map +0 -1
  545. package/dist/core/persistence.js +0 -186
  546. package/dist/core/persistence.js.map +0 -1
  547. package/dist/enterprise/analytics-manager.d.ts +0 -489
  548. package/dist/enterprise/analytics-manager.d.ts.map +0 -1
  549. package/dist/enterprise/analytics-manager.js +0 -949
  550. package/dist/enterprise/analytics-manager.js.map +0 -1
  551. package/dist/enterprise/audit-manager.d.ts +0 -459
  552. package/dist/enterprise/audit-manager.d.ts.map +0 -1
  553. package/dist/enterprise/audit-manager.js +0 -992
  554. package/dist/enterprise/audit-manager.js.map +0 -1
  555. package/dist/enterprise/cloud-manager.d.ts +0 -435
  556. package/dist/enterprise/cloud-manager.d.ts.map +0 -1
  557. package/dist/enterprise/cloud-manager.js +0 -784
  558. package/dist/enterprise/cloud-manager.js.map +0 -1
  559. package/dist/enterprise/deployment-manager.d.ts +0 -328
  560. package/dist/enterprise/deployment-manager.d.ts.map +0 -1
  561. package/dist/enterprise/deployment-manager.js +0 -823
  562. package/dist/enterprise/deployment-manager.js.map +0 -1
  563. package/dist/enterprise/index.d.ts +0 -13
  564. package/dist/enterprise/index.d.ts.map +0 -1
  565. package/dist/enterprise/index.js +0 -7
  566. package/dist/enterprise/index.js.map +0 -1
  567. package/dist/enterprise/project-manager.d.ts +0 -228
  568. package/dist/enterprise/project-manager.d.ts.map +0 -1
  569. package/dist/enterprise/project-manager.js +0 -529
  570. package/dist/enterprise/project-manager.js.map +0 -1
  571. package/dist/enterprise/security-manager.d.ts +0 -422
  572. package/dist/enterprise/security-manager.d.ts.map +0 -1
  573. package/dist/enterprise/security-manager.js +0 -902
  574. package/dist/enterprise/security-manager.js.map +0 -1
  575. package/dist/hive-mind/core/Agent.d.ts +0 -137
  576. package/dist/hive-mind/core/Agent.d.ts.map +0 -1
  577. package/dist/hive-mind/core/Agent.js +0 -567
  578. package/dist/hive-mind/core/Agent.js.map +0 -1
  579. package/dist/hive-mind/core/Communication.d.ts +0 -116
  580. package/dist/hive-mind/core/Communication.d.ts.map +0 -1
  581. package/dist/hive-mind/core/Communication.js +0 -407
  582. package/dist/hive-mind/core/Communication.js.map +0 -1
  583. package/dist/hive-mind/core/DatabaseManager.d.ts +0 -93
  584. package/dist/hive-mind/core/DatabaseManager.d.ts.map +0 -1
  585. package/dist/hive-mind/core/DatabaseManager.js +0 -551
  586. package/dist/hive-mind/core/DatabaseManager.js.map +0 -1
  587. package/dist/hive-mind/core/HiveMind.d.ts +0 -90
  588. package/dist/hive-mind/core/HiveMind.d.ts.map +0 -1
  589. package/dist/hive-mind/core/HiveMind.js +0 -439
  590. package/dist/hive-mind/core/HiveMind.js.map +0 -1
  591. package/dist/hive-mind/core/Memory.d.ts +0 -235
  592. package/dist/hive-mind/core/Memory.d.ts.map +0 -1
  593. package/dist/hive-mind/core/Memory.js +0 -1185
  594. package/dist/hive-mind/core/Memory.js.map +0 -1
  595. package/dist/hive-mind/core/MemoryMonitor.d.ts +0 -183
  596. package/dist/hive-mind/core/MemoryMonitor.d.ts.map +0 -1
  597. package/dist/hive-mind/core/MemoryMonitor.js +0 -547
  598. package/dist/hive-mind/core/MemoryMonitor.js.map +0 -1
  599. package/dist/hive-mind/core/Queen.d.ts +0 -115
  600. package/dist/hive-mind/core/Queen.d.ts.map +0 -1
  601. package/dist/hive-mind/core/Queen.js +0 -586
  602. package/dist/hive-mind/core/Queen.js.map +0 -1
  603. package/dist/hive-mind/index.d.ts +0 -17
  604. package/dist/hive-mind/index.d.ts.map +0 -1
  605. package/dist/hive-mind/index.js +0 -21
  606. package/dist/hive-mind/index.js.map +0 -1
  607. package/dist/hive-mind/integration/ConsensusEngine.d.ts +0 -117
  608. package/dist/hive-mind/integration/ConsensusEngine.d.ts.map +0 -1
  609. package/dist/hive-mind/integration/ConsensusEngine.js +0 -476
  610. package/dist/hive-mind/integration/ConsensusEngine.js.map +0 -1
  611. package/dist/hive-mind/integration/MCPToolWrapper.d.ts +0 -172
  612. package/dist/hive-mind/integration/MCPToolWrapper.d.ts.map +0 -1
  613. package/dist/hive-mind/integration/MCPToolWrapper.js +0 -216
  614. package/dist/hive-mind/integration/MCPToolWrapper.js.map +0 -1
  615. package/dist/hive-mind/integration/SwarmOrchestrator.d.ts +0 -172
  616. package/dist/hive-mind/integration/SwarmOrchestrator.d.ts.map +0 -1
  617. package/dist/hive-mind/integration/SwarmOrchestrator.js +0 -746
  618. package/dist/hive-mind/integration/SwarmOrchestrator.js.map +0 -1
  619. package/dist/hive-mind/types.d.ts +0 -298
  620. package/dist/hive-mind/types.d.ts.map +0 -1
  621. package/dist/hive-mind/types.js +0 -7
  622. package/dist/hive-mind/types.js.map +0 -1
  623. package/dist/integration/mock-components.d.ts +0 -107
  624. package/dist/integration/mock-components.d.ts.map +0 -1
  625. package/dist/integration/mock-components.js +0 -357
  626. package/dist/integration/mock-components.js.map +0 -1
  627. package/dist/integration/system-integration.d.ts +0 -84
  628. package/dist/integration/system-integration.d.ts.map +0 -1
  629. package/dist/integration/system-integration.js +0 -429
  630. package/dist/integration/system-integration.js.map +0 -1
  631. package/dist/integration/types.d.ts +0 -119
  632. package/dist/integration/types.d.ts.map +0 -1
  633. package/dist/integration/types.js +0 -5
  634. package/dist/integration/types.js.map +0 -1
  635. package/dist/mcp/auth.d.ts +0 -80
  636. package/dist/mcp/auth.d.ts.map +0 -1
  637. package/dist/mcp/auth.js +0 -343
  638. package/dist/mcp/auth.js.map +0 -1
  639. package/dist/mcp/claude-code-wrapper.d.ts +0 -26
  640. package/dist/mcp/claude-code-wrapper.d.ts.map +0 -1
  641. package/dist/mcp/claude-code-wrapper.js +0 -598
  642. package/dist/mcp/claude-code-wrapper.js.map +0 -1
  643. package/dist/mcp/claude-flow-tools.d.ts +0 -13
  644. package/dist/mcp/claude-flow-tools.d.ts.map +0 -1
  645. package/dist/mcp/claude-flow-tools.js +0 -1142
  646. package/dist/mcp/claude-flow-tools.js.map +0 -1
  647. package/dist/mcp/client.d.ts +0 -41
  648. package/dist/mcp/client.d.ts.map +0 -1
  649. package/dist/mcp/client.js +0 -194
  650. package/dist/mcp/client.js.map +0 -1
  651. package/dist/mcp/index.d.ts +0 -134
  652. package/dist/mcp/index.d.ts.map +0 -1
  653. package/dist/mcp/index.js +0 -212
  654. package/dist/mcp/index.js.map +0 -1
  655. package/dist/mcp/integrate-wrapper.d.ts +0 -16
  656. package/dist/mcp/integrate-wrapper.d.ts.map +0 -1
  657. package/dist/mcp/integrate-wrapper.js +0 -77
  658. package/dist/mcp/integrate-wrapper.js.map +0 -1
  659. package/dist/mcp/lifecycle-manager.d.ts +0 -121
  660. package/dist/mcp/lifecycle-manager.d.ts.map +0 -1
  661. package/dist/mcp/lifecycle-manager.js +0 -365
  662. package/dist/mcp/lifecycle-manager.js.map +0 -1
  663. package/dist/mcp/load-balancer.d.ts +0 -88
  664. package/dist/mcp/load-balancer.d.ts.map +0 -1
  665. package/dist/mcp/load-balancer.js +0 -389
  666. package/dist/mcp/load-balancer.js.map +0 -1
  667. package/dist/mcp/orchestration-integration.d.ts +0 -135
  668. package/dist/mcp/orchestration-integration.d.ts.map +0 -1
  669. package/dist/mcp/orchestration-integration.js +0 -722
  670. package/dist/mcp/orchestration-integration.js.map +0 -1
  671. package/dist/mcp/performance-monitor.d.ts +0 -164
  672. package/dist/mcp/performance-monitor.d.ts.map +0 -1
  673. package/dist/mcp/performance-monitor.js +0 -478
  674. package/dist/mcp/performance-monitor.js.map +0 -1
  675. package/dist/mcp/protocol-manager.d.ts +0 -88
  676. package/dist/mcp/protocol-manager.d.ts.map +0 -1
  677. package/dist/mcp/protocol-manager.js +0 -358
  678. package/dist/mcp/protocol-manager.js.map +0 -1
  679. package/dist/mcp/recovery/connection-health-monitor.d.ts +0 -69
  680. package/dist/mcp/recovery/connection-health-monitor.d.ts.map +0 -1
  681. package/dist/mcp/recovery/connection-health-monitor.js +0 -241
  682. package/dist/mcp/recovery/connection-health-monitor.js.map +0 -1
  683. package/dist/mcp/recovery/connection-state-manager.d.ts +0 -102
  684. package/dist/mcp/recovery/connection-state-manager.d.ts.map +0 -1
  685. package/dist/mcp/recovery/connection-state-manager.js +0 -318
  686. package/dist/mcp/recovery/connection-state-manager.js.map +0 -1
  687. package/dist/mcp/recovery/fallback-coordinator.d.ts +0 -79
  688. package/dist/mcp/recovery/fallback-coordinator.d.ts.map +0 -1
  689. package/dist/mcp/recovery/fallback-coordinator.js +0 -278
  690. package/dist/mcp/recovery/fallback-coordinator.js.map +0 -1
  691. package/dist/mcp/recovery/index.d.ts +0 -10
  692. package/dist/mcp/recovery/index.d.ts.map +0 -1
  693. package/dist/mcp/recovery/index.js +0 -10
  694. package/dist/mcp/recovery/index.js.map +0 -1
  695. package/dist/mcp/recovery/reconnection-manager.d.ts +0 -69
  696. package/dist/mcp/recovery/reconnection-manager.d.ts.map +0 -1
  697. package/dist/mcp/recovery/reconnection-manager.js +0 -226
  698. package/dist/mcp/recovery/reconnection-manager.js.map +0 -1
  699. package/dist/mcp/recovery/recovery-manager.d.ts +0 -93
  700. package/dist/mcp/recovery/recovery-manager.d.ts.map +0 -1
  701. package/dist/mcp/recovery/recovery-manager.js +0 -250
  702. package/dist/mcp/recovery/recovery-manager.js.map +0 -1
  703. package/dist/mcp/router.d.ts +0 -54
  704. package/dist/mcp/router.d.ts.map +0 -1
  705. package/dist/mcp/router.js +0 -201
  706. package/dist/mcp/router.js.map +0 -1
  707. package/dist/mcp/ruv-swarm-tools.d.ts +0 -58
  708. package/dist/mcp/ruv-swarm-tools.d.ts.map +0 -1
  709. package/dist/mcp/ruv-swarm-tools.js +0 -518
  710. package/dist/mcp/ruv-swarm-tools.js.map +0 -1
  711. package/dist/mcp/server-with-wrapper.d.ts +0 -3
  712. package/dist/mcp/server-with-wrapper.d.ts.map +0 -1
  713. package/dist/mcp/server-with-wrapper.js +0 -36
  714. package/dist/mcp/server-with-wrapper.js.map +0 -1
  715. package/dist/mcp/server-wrapper-mode.d.ts +0 -3
  716. package/dist/mcp/server-wrapper-mode.d.ts.map +0 -1
  717. package/dist/mcp/server-wrapper-mode.js +0 -28
  718. package/dist/mcp/server-wrapper-mode.js.map +0 -1
  719. package/dist/mcp/server.d.ts +0 -75
  720. package/dist/mcp/server.d.ts.map +0 -1
  721. package/dist/mcp/server.js +0 -533
  722. package/dist/mcp/server.js.map +0 -1
  723. package/dist/mcp/session-manager.d.ts +0 -60
  724. package/dist/mcp/session-manager.d.ts.map +0 -1
  725. package/dist/mcp/session-manager.js +0 -322
  726. package/dist/mcp/session-manager.js.map +0 -1
  727. package/dist/mcp/sparc-modes.d.ts +0 -12
  728. package/dist/mcp/sparc-modes.d.ts.map +0 -1
  729. package/dist/mcp/sparc-modes.js +0 -370
  730. package/dist/mcp/sparc-modes.js.map +0 -1
  731. package/dist/mcp/swarm-tools.d.ts +0 -87
  732. package/dist/mcp/swarm-tools.d.ts.map +0 -1
  733. package/dist/mcp/swarm-tools.js +0 -711
  734. package/dist/mcp/swarm-tools.js.map +0 -1
  735. package/dist/mcp/tools.d.ts +0 -145
  736. package/dist/mcp/tools.d.ts.map +0 -1
  737. package/dist/mcp/tools.js +0 -418
  738. package/dist/mcp/tools.js.map +0 -1
  739. package/dist/mcp/transports/base.d.ts +0 -22
  740. package/dist/mcp/transports/base.d.ts.map +0 -1
  741. package/dist/mcp/transports/base.js +0 -2
  742. package/dist/mcp/transports/base.js.map +0 -1
  743. package/dist/mcp/transports/http.d.ts +0 -45
  744. package/dist/mcp/transports/http.d.ts.map +0 -1
  745. package/dist/mcp/transports/http.js +0 -400
  746. package/dist/mcp/transports/http.js.map +0 -1
  747. package/dist/mcp/transports/stdio.d.ts +0 -34
  748. package/dist/mcp/transports/stdio.d.ts.map +0 -1
  749. package/dist/mcp/transports/stdio.js +0 -203
  750. package/dist/mcp/transports/stdio.js.map +0 -1
  751. package/dist/memory/advanced-memory-manager.d.ts +0 -303
  752. package/dist/memory/advanced-memory-manager.d.ts.map +0 -1
  753. package/dist/memory/advanced-memory-manager.js +0 -1458
  754. package/dist/memory/advanced-memory-manager.js.map +0 -1
  755. package/dist/memory/backends/base.d.ts +0 -21
  756. package/dist/memory/backends/base.d.ts.map +0 -1
  757. package/dist/memory/backends/base.js +0 -2
  758. package/dist/memory/backends/base.js.map +0 -1
  759. package/dist/memory/backends/markdown.d.ts +0 -32
  760. package/dist/memory/backends/markdown.d.ts.map +0 -1
  761. package/dist/memory/backends/markdown.js +0 -223
  762. package/dist/memory/backends/markdown.js.map +0 -1
  763. package/dist/memory/backends/sqlite.d.ts +0 -29
  764. package/dist/memory/backends/sqlite.d.ts.map +0 -1
  765. package/dist/memory/backends/sqlite.js +0 -272
  766. package/dist/memory/backends/sqlite.js.map +0 -1
  767. package/dist/memory/cache.d.ts +0 -65
  768. package/dist/memory/cache.d.ts.map +0 -1
  769. package/dist/memory/cache.js +0 -186
  770. package/dist/memory/cache.js.map +0 -1
  771. package/dist/memory/distributed-memory.d.ts +0 -188
  772. package/dist/memory/distributed-memory.d.ts.map +0 -1
  773. package/dist/memory/distributed-memory.js +0 -711
  774. package/dist/memory/distributed-memory.js.map +0 -1
  775. package/dist/memory/indexer.d.ts +0 -52
  776. package/dist/memory/indexer.d.ts.map +0 -1
  777. package/dist/memory/indexer.js +0 -188
  778. package/dist/memory/indexer.js.map +0 -1
  779. package/dist/memory/manager.d.ts +0 -58
  780. package/dist/memory/manager.d.ts.map +0 -1
  781. package/dist/memory/manager.js +0 -426
  782. package/dist/memory/manager.js.map +0 -1
  783. package/dist/memory/swarm-memory.d.ts +0 -91
  784. package/dist/memory/swarm-memory.d.ts.map +0 -1
  785. package/dist/memory/swarm-memory.js +0 -461
  786. package/dist/memory/swarm-memory.js.map +0 -1
  787. package/dist/migration/index.d.ts +0 -3
  788. package/dist/migration/index.d.ts.map +0 -1
  789. package/dist/migration/index.js +0 -166
  790. package/dist/migration/index.js.map +0 -1
  791. package/dist/migration/logger.d.ts +0 -26
  792. package/dist/migration/logger.d.ts.map +0 -1
  793. package/dist/migration/logger.js +0 -145
  794. package/dist/migration/logger.js.map +0 -1
  795. package/dist/migration/migration-analyzer.d.ts +0 -15
  796. package/dist/migration/migration-analyzer.d.ts.map +0 -1
  797. package/dist/migration/migration-analyzer.js +0 -279
  798. package/dist/migration/migration-analyzer.js.map +0 -1
  799. package/dist/migration/migration-runner.d.ts +0 -26
  800. package/dist/migration/migration-runner.d.ts.map +0 -1
  801. package/dist/migration/migration-runner.js +0 -499
  802. package/dist/migration/migration-runner.js.map +0 -1
  803. package/dist/migration/migration-validator.d.ts +0 -14
  804. package/dist/migration/migration-validator.d.ts.map +0 -1
  805. package/dist/migration/migration-validator.js +0 -313
  806. package/dist/migration/migration-validator.js.map +0 -1
  807. package/dist/migration/progress-reporter.d.ts +0 -25
  808. package/dist/migration/progress-reporter.d.ts.map +0 -1
  809. package/dist/migration/progress-reporter.js +0 -163
  810. package/dist/migration/progress-reporter.js.map +0 -1
  811. package/dist/migration/rollback-manager.d.ts +0 -21
  812. package/dist/migration/rollback-manager.d.ts.map +0 -1
  813. package/dist/migration/rollback-manager.js +0 -348
  814. package/dist/migration/rollback-manager.js.map +0 -1
  815. package/dist/migration/types.d.ts +0 -103
  816. package/dist/migration/types.d.ts.map +0 -1
  817. package/dist/migration/types.js +0 -6
  818. package/dist/migration/types.js.map +0 -1
  819. package/dist/monitoring/diagnostics.d.ts +0 -109
  820. package/dist/monitoring/diagnostics.d.ts.map +0 -1
  821. package/dist/monitoring/diagnostics.js +0 -545
  822. package/dist/monitoring/diagnostics.js.map +0 -1
  823. package/dist/monitoring/health-check.d.ts +0 -91
  824. package/dist/monitoring/health-check.d.ts.map +0 -1
  825. package/dist/monitoring/health-check.js +0 -371
  826. package/dist/monitoring/health-check.js.map +0 -1
  827. package/dist/monitoring/real-time-monitor.d.ts +0 -230
  828. package/dist/monitoring/real-time-monitor.d.ts.map +0 -1
  829. package/dist/monitoring/real-time-monitor.js +0 -839
  830. package/dist/monitoring/real-time-monitor.js.map +0 -1
  831. package/dist/resources/resource-manager.d.ts +0 -390
  832. package/dist/resources/resource-manager.d.ts.map +0 -1
  833. package/dist/resources/resource-manager.js +0 -1220
  834. package/dist/resources/resource-manager.js.map +0 -1
  835. package/dist/swarm/claude-flow-executor.d.ts +0 -28
  836. package/dist/swarm/claude-flow-executor.d.ts.map +0 -1
  837. package/dist/swarm/claude-flow-executor.js +0 -210
  838. package/dist/swarm/claude-flow-executor.js.map +0 -1
  839. package/dist/swarm/coordinator.d.ts +0 -134
  840. package/dist/swarm/coordinator.d.ts.map +0 -1
  841. package/dist/swarm/coordinator.js +0 -2607
  842. package/dist/swarm/coordinator.js.map +0 -1
  843. package/dist/swarm/direct-executor.d.ts +0 -48
  844. package/dist/swarm/direct-executor.d.ts.map +0 -1
  845. package/dist/swarm/direct-executor.js +0 -1113
  846. package/dist/swarm/direct-executor.js.map +0 -1
  847. package/dist/swarm/executor-v2.d.ts +0 -23
  848. package/dist/swarm/executor-v2.d.ts.map +0 -1
  849. package/dist/swarm/executor-v2.js +0 -320
  850. package/dist/swarm/executor-v2.js.map +0 -1
  851. package/dist/swarm/executor.d.ts +0 -117
  852. package/dist/swarm/executor.d.ts.map +0 -1
  853. package/dist/swarm/executor.js +0 -791
  854. package/dist/swarm/executor.js.map +0 -1
  855. package/dist/swarm/index.d.ts +0 -31
  856. package/dist/swarm/index.d.ts.map +0 -1
  857. package/dist/swarm/index.js +0 -42
  858. package/dist/swarm/index.js.map +0 -1
  859. package/dist/swarm/memory.d.ts +0 -176
  860. package/dist/swarm/memory.d.ts.map +0 -1
  861. package/dist/swarm/memory.js +0 -1068
  862. package/dist/swarm/memory.js.map +0 -1
  863. package/dist/swarm/optimizations/async-file-manager.d.ts +0 -49
  864. package/dist/swarm/optimizations/async-file-manager.d.ts.map +0 -1
  865. package/dist/swarm/optimizations/async-file-manager.js +0 -248
  866. package/dist/swarm/optimizations/async-file-manager.js.map +0 -1
  867. package/dist/swarm/optimizations/circular-buffer.d.ts +0 -46
  868. package/dist/swarm/optimizations/circular-buffer.d.ts.map +0 -1
  869. package/dist/swarm/optimizations/circular-buffer.js +0 -159
  870. package/dist/swarm/optimizations/circular-buffer.js.map +0 -1
  871. package/dist/swarm/optimizations/connection-pool.d.ts +0 -54
  872. package/dist/swarm/optimizations/connection-pool.d.ts.map +0 -1
  873. package/dist/swarm/optimizations/connection-pool.js +0 -227
  874. package/dist/swarm/optimizations/connection-pool.js.map +0 -1
  875. package/dist/swarm/optimizations/index.d.ts +0 -24
  876. package/dist/swarm/optimizations/index.d.ts.map +0 -1
  877. package/dist/swarm/optimizations/index.js +0 -30
  878. package/dist/swarm/optimizations/index.js.map +0 -1
  879. package/dist/swarm/optimizations/optimized-executor.d.ts +0 -109
  880. package/dist/swarm/optimizations/optimized-executor.d.ts.map +0 -1
  881. package/dist/swarm/optimizations/optimized-executor.js +0 -321
  882. package/dist/swarm/optimizations/optimized-executor.js.map +0 -1
  883. package/dist/swarm/optimizations/ttl-map.d.ts +0 -78
  884. package/dist/swarm/optimizations/ttl-map.d.ts.map +0 -1
  885. package/dist/swarm/optimizations/ttl-map.js +0 -229
  886. package/dist/swarm/optimizations/ttl-map.js.map +0 -1
  887. package/dist/swarm/prompt-cli.d.ts +0 -5
  888. package/dist/swarm/prompt-cli.d.ts.map +0 -1
  889. package/dist/swarm/prompt-cli.js +0 -256
  890. package/dist/swarm/prompt-cli.js.map +0 -1
  891. package/dist/swarm/prompt-copier-enhanced.d.ts +0 -17
  892. package/dist/swarm/prompt-copier-enhanced.d.ts.map +0 -1
  893. package/dist/swarm/prompt-copier-enhanced.js +0 -190
  894. package/dist/swarm/prompt-copier-enhanced.js.map +0 -1
  895. package/dist/swarm/prompt-copier.d.ts +0 -76
  896. package/dist/swarm/prompt-copier.d.ts.map +0 -1
  897. package/dist/swarm/prompt-copier.js +0 -379
  898. package/dist/swarm/prompt-copier.js.map +0 -1
  899. package/dist/swarm/prompt-manager.d.ts +0 -72
  900. package/dist/swarm/prompt-manager.d.ts.map +0 -1
  901. package/dist/swarm/prompt-manager.js +0 -270
  902. package/dist/swarm/prompt-manager.js.map +0 -1
  903. package/dist/swarm/prompt-utils.d.ts +0 -52
  904. package/dist/swarm/prompt-utils.d.ts.map +0 -1
  905. package/dist/swarm/prompt-utils.js +0 -265
  906. package/dist/swarm/prompt-utils.js.map +0 -1
  907. package/dist/swarm/sparc-executor.d.ts +0 -105
  908. package/dist/swarm/sparc-executor.d.ts.map +0 -1
  909. package/dist/swarm/sparc-executor.js +0 -1364
  910. package/dist/swarm/sparc-executor.js.map +0 -1
  911. package/dist/swarm/strategies/auto.d.ts +0 -57
  912. package/dist/swarm/strategies/auto.d.ts.map +0 -1
  913. package/dist/swarm/strategies/auto.js +0 -623
  914. package/dist/swarm/strategies/auto.js.map +0 -1
  915. package/dist/swarm/strategies/base.d.ts +0 -78
  916. package/dist/swarm/strategies/base.d.ts.map +0 -1
  917. package/dist/swarm/strategies/base.js +0 -108
  918. package/dist/swarm/strategies/base.js.map +0 -1
  919. package/dist/swarm/strategies/research.d.ts +0 -75
  920. package/dist/swarm/strategies/research.d.ts.map +0 -1
  921. package/dist/swarm/strategies/research.js +0 -841
  922. package/dist/swarm/strategies/research.js.map +0 -1
  923. package/dist/swarm/strategies/strategy-metrics-patch.d.ts +0 -11
  924. package/dist/swarm/strategies/strategy-metrics-patch.d.ts.map +0 -1
  925. package/dist/swarm/strategies/strategy-metrics-patch.js +0 -2
  926. package/dist/swarm/strategies/strategy-metrics-patch.js.map +0 -1
  927. package/dist/swarm/types.d.ts +0 -578
  928. package/dist/swarm/types.d.ts.map +0 -1
  929. package/dist/swarm/types.js +0 -51
  930. package/dist/swarm/types.js.map +0 -1
  931. package/dist/swarm/workers/copy-worker.d.ts +0 -2
  932. package/dist/swarm/workers/copy-worker.d.ts.map +0 -1
  933. package/dist/swarm/workers/copy-worker.js +0 -56
  934. package/dist/swarm/workers/copy-worker.js.map +0 -1
  935. package/dist/task/commands.d.ts +0 -60
  936. package/dist/task/commands.d.ts.map +0 -1
  937. package/dist/task/commands.js +0 -107
  938. package/dist/task/commands.js.map +0 -1
  939. package/dist/task/coordination.d.ts +0 -109
  940. package/dist/task/coordination.d.ts.map +0 -1
  941. package/dist/task/coordination.js +0 -629
  942. package/dist/task/coordination.js.map +0 -1
  943. package/dist/task/engine.d.ts +0 -198
  944. package/dist/task/engine.d.ts.map +0 -1
  945. package/dist/task/engine.js +0 -498
  946. package/dist/task/engine.js.map +0 -1
  947. package/dist/task/index.d.ts +0 -103
  948. package/dist/task/index.d.ts.map +0 -1
  949. package/dist/task/index.js +0 -276
  950. package/dist/task/index.js.map +0 -1
  951. package/dist/task/types.d.ts +0 -56
  952. package/dist/task/types.d.ts.map +0 -1
  953. package/dist/task/types.js +0 -2
  954. package/dist/task/types.js.map +0 -1
  955. package/dist/terminal/adapters/base.d.ts +0 -40
  956. package/dist/terminal/adapters/base.d.ts.map +0 -1
  957. package/dist/terminal/adapters/base.js +0 -5
  958. package/dist/terminal/adapters/base.js.map +0 -1
  959. package/dist/terminal/adapters/native.d.ts +0 -19
  960. package/dist/terminal/adapters/native.d.ts.map +0 -1
  961. package/dist/terminal/adapters/native.js +0 -414
  962. package/dist/terminal/adapters/native.js.map +0 -1
  963. package/dist/terminal/adapters/vscode.d.ts +0 -20
  964. package/dist/terminal/adapters/vscode.d.ts.map +0 -1
  965. package/dist/terminal/adapters/vscode.js +0 -265
  966. package/dist/terminal/adapters/vscode.js.map +0 -1
  967. package/dist/terminal/manager.d.ts +0 -59
  968. package/dist/terminal/manager.d.ts.map +0 -1
  969. package/dist/terminal/manager.js +0 -237
  970. package/dist/terminal/manager.js.map +0 -1
  971. package/dist/terminal/pool.d.ts +0 -32
  972. package/dist/terminal/pool.d.ts.map +0 -1
  973. package/dist/terminal/pool.js +0 -205
  974. package/dist/terminal/pool.js.map +0 -1
  975. package/dist/terminal/session.d.ts +0 -41
  976. package/dist/terminal/session.d.ts.map +0 -1
  977. package/dist/terminal/session.js +0 -206
  978. package/dist/terminal/session.js.map +0 -1
  979. package/dist/types/index.d.ts +0 -28
  980. package/dist/types/index.d.ts.map +0 -1
  981. package/dist/types/index.js +0 -15
  982. package/dist/types/index.js.map +0 -1
  983. package/dist/ui/hive-dashboard.d.ts +0 -140
  984. package/dist/ui/hive-dashboard.d.ts.map +0 -1
  985. package/dist/ui/hive-dashboard.js +0 -281
  986. package/dist/ui/hive-dashboard.js.map +0 -1
  987. package/dist/utils/error-handler.d.ts +0 -13
  988. package/dist/utils/error-handler.d.ts.map +0 -1
  989. package/dist/utils/error-handler.js +0 -45
  990. package/dist/utils/error-handler.js.map +0 -1
  991. package/dist/utils/errors.d.ts +0 -121
  992. package/dist/utils/errors.d.ts.map +0 -1
  993. package/dist/utils/errors.js +0 -194
  994. package/dist/utils/errors.js.map +0 -1
  995. package/dist/utils/formatters.d.ts +0 -15
  996. package/dist/utils/formatters.d.ts.map +0 -1
  997. package/dist/utils/formatters.js +0 -75
  998. package/dist/utils/formatters.js.map +0 -1
  999. package/dist/utils/helpers.d.ts +0 -131
  1000. package/dist/utils/helpers.d.ts.map +0 -1
  1001. package/dist/utils/helpers.js +0 -447
  1002. package/dist/utils/helpers.js.map +0 -1
  1003. package/dist/utils/paths.d.ts +0 -4
  1004. package/dist/utils/paths.d.ts.map +0 -1
  1005. package/dist/utils/paths.js +0 -39
  1006. package/dist/utils/paths.js.map +0 -1
  1007. package/dist/utils/types.d.ts +0 -512
  1008. package/dist/utils/types.d.ts.map +0 -1
  1009. package/dist/utils/types.js +0 -37
  1010. package/dist/utils/types.js.map +0 -1
  1011. package/src/cli/simple-commands/hive-mind/memory.d.ts +0 -37
  1012. package/src/cli/simple-commands/init/templates/CLAUDE-FLOW-SPECIFIC.md +0 -238
  1013. package/src/cli/simple-commands/init/templates/all-commands.js +0 -1355
  1014. package/src/cli/simple-commands/init/templates/commands/hooks/hooks-documentation.md +0 -272
  1015. package/src/cli/simple-commands/init/templates/github-enhanced.js +0 -505
  1016. package/src/cli/simple-commands/init/templates/hooks-documentation.md +0 -272
  1017. package/src/cli/simple-commands/web-server.d.ts +0 -22
  1018. package/src/cli/utils.d.ts +0 -8
@@ -1,3059 +0,0 @@
1
- #!/usr/bin/env -S deno run --allow-all
2
- /**
3
- * Simple CLI wrapper for Claude-Flow (JavaScript version)
4
- * This version avoids TypeScript issues in node_modules
5
- */
6
- import { promises as fs } from 'node:fs';
7
- import { executeCommand, hasCommand, showCommandHelp, listCommands } from './command-registry.js';
8
- import { parseFlags } from './utils.js';
9
- const VERSION = '2.0.0';
10
- function printHelp() {
11
- console.log(`
12
- 🌊 Claude-Flow v${VERSION} - Enterprise-Grade AI Agent Orchestration Platform
13
-
14
- 🎯 ENTERPRISE FEATURES: Complete ruv-swarm integration with 27 MCP tools, neural networking, and production-ready infrastructure
15
-
16
- USAGE:
17
- claude-flow <command> [options]
18
-
19
- 🚀 INSTALLATION & ENTERPRISE SETUP:
20
- npx claude-flow@2.0.0 init --sparc # Enterprise SPARC + ruv-swarm integration
21
-
22
- The --sparc flag creates:
23
- • Complete ruv-swarm integration with 27 MCP tools
24
- • Neural network processing with WASM optimization
25
- • Multi-agent coordination (hierarchical, mesh, ring, star topologies)
26
- • Cross-session memory and persistent learning
27
- • GitHub workflow automation (6 specialized modes)
28
- • Production-ready Docker infrastructure
29
- • Enterprise security and compliance features
30
-
31
- 🧠 SWARM INTELLIGENCE COMMANDS (v2.0.0):
32
- swarm "objective" [--strategy] [--mode] [--max-agents N] [--parallel] [--monitor]
33
- --strategy: research, development, analysis, testing, optimization, maintenance
34
- --mode: centralized, distributed, hierarchical, mesh, hybrid
35
- --parallel: Enable parallel execution (2.8-4.4x speed improvement)
36
- --monitor: Real-time swarm monitoring and performance tracking
37
-
38
- 🐙 GITHUB WORKFLOW AUTOMATION (v2.0.0):
39
- github gh-coordinator # GitHub workflow orchestration and coordination
40
- github pr-manager # Pull request management with multi-reviewer coordination
41
- github issue-tracker # Issue management and project coordination
42
- github release-manager # Release coordination and deployment pipelines
43
- github repo-architect # Repository structure optimization
44
- github sync-coordinator # Multi-package synchronization and version alignment
45
-
46
- 🏗️ CORE ENTERPRISE COMMANDS:
47
- init [--sparc] # Initialize with enterprise environment + ruv-swarm
48
- start [--ui] [--swarm] # Start orchestration with swarm intelligence
49
- spawn <type> [--name] # Create AI agent with swarm coordination
50
- agent <subcommand> # Advanced agent management with neural patterns
51
- sparc <subcommand> # 17 SPARC modes with neural enhancement
52
- memory <subcommand> # Cross-session persistent memory with neural learning
53
- status # Comprehensive system status with performance metrics
54
-
55
- 🤖 NEURAL AGENT TYPES (ruv-swarm Integration):
56
- researcher # Research with web access and data analysis
57
- coder # Code development with neural patterns
58
- analyst # Performance analysis and optimization
59
- architect # System design with enterprise patterns
60
- tester # Comprehensive testing with automation
61
- coordinator # Multi-agent orchestration and workflow management
62
- reviewer # Code review with security and quality checks
63
- optimizer # Performance optimization and bottleneck analysis
64
-
65
- 🎮 ENTERPRISE QUICK START:
66
- # Initialize enterprise environment
67
- npx claude-flow@2.0.0 init --sparc
68
-
69
- # Start enterprise orchestration with swarm intelligence
70
- ./claude-flow start --ui --swarm
71
-
72
- # Deploy intelligent multi-agent development workflow
73
- ./claude-flow swarm "build enterprise API" --strategy development --parallel --monitor
74
-
75
- # GitHub workflow automation
76
- ./claude-flow github pr-manager "coordinate release with automated testing"
77
-
78
- # Neural memory management
79
- ./claude-flow memory store "architecture" "microservices with API gateway pattern"
80
-
81
- # Real-time system monitoring
82
- ./claude-flow status --verbose
83
-
84
- 🏢 ENTERPRISE COMMAND CATEGORIES:
85
- Core Intelligence: swarm, agent, sparc, memory, neural
86
- GitHub Automation: github (6 specialized modes)
87
- Development: init, start, status, config, workflow
88
- Infrastructure: mcp, terminal, session, docker
89
- Enterprise: project, deploy, cloud, security, analytics, audit
90
-
91
- 🧠 NEURAL NETWORK FEATURES (v2.0.0):
92
- • WASM-powered cognitive patterns with SIMD optimization
93
- • 27 MCP tools for comprehensive workflow automation
94
- • Cross-session learning and adaptation
95
- • Real-time performance monitoring (sub-10ms response times)
96
- • 32.3% token usage reduction through intelligent coordination
97
- • Self-healing workflows with automatic error recovery
98
-
99
- 📊 ENTERPRISE PERFORMANCE METRICS:
100
- • 84.8% SWE-Bench solve rate through coordinated intelligence
101
- • 2.8-4.4x speed improvement with parallel execution
102
- • 60% Docker build performance improvement
103
- • 100% test success rate with comprehensive validation
104
- • Sub-10ms MCP response times
105
-
106
- 🔗 INTEGRATION & COMPATIBILITY:
107
- • Node.js 20+ optimization for enterprise environments
108
- • Complete Claude Code integration with enhanced capabilities
109
- • Multi-platform support (Windows, macOS, Linux)
110
- • Enterprise security with access control and audit logging
111
- • Cross-package synchronization and dependency management
112
-
113
- GET DETAILED HELP:
114
- claude-flow help <command> # Command-specific enterprise documentation
115
- claude-flow <command> --help # Alternative help syntax
116
-
117
- Examples:
118
- claude-flow help swarm # Swarm intelligence coordination
119
- claude-flow help github # GitHub workflow automation
120
- claude-flow help neural # Neural network processing
121
- claude-flow help enterprise # Enterprise features and compliance
122
-
123
- COMMON OPTIONS:
124
- --verbose, -v Enable detailed output with performance metrics
125
- --help Show command help with enterprise features
126
- --config <path> Use custom enterprise configuration
127
- --parallel Enable parallel execution (default for swarms)
128
- --monitor Real-time monitoring and performance tracking
129
-
130
- 📚 Documentation: https://github.com/ruvnet/claude-code-flow
131
- 🐝 ruv-swarm: https://github.com/ruvnet/ruv-FANN/tree/main/ruv-swarm
132
-
133
- 🚀 Enterprise-Grade AI Agent Orchestration - Built with ❤️ by rUv for the Claude community
134
- `);
135
- }
136
- function printVersion() {
137
- console.log(`Claude-Flow v${VERSION}`);
138
- }
139
- function printError(message) {
140
- console.error(`❌ Error: ${message}`);
141
- }
142
- function printSuccess(message) {
143
- console.log(`✅ ${message}`);
144
- }
145
- function printWarning(message) {
146
- console.warn(`⚠️ Warning: ${message}`);
147
- }
148
- function showHelpWithCommands() {
149
- printHelp();
150
- console.log('\nRegistered Commands:');
151
- const commands = listCommands();
152
- for (const command of commands) {
153
- console.log(` ${command.name.padEnd(12)} ${command.description}`);
154
- }
155
- console.log('\nUse "claude-flow help <command>" for detailed usage information');
156
- }
157
- async function main() {
158
- const args = Deno.args;
159
- if (args.length === 0) {
160
- printHelp();
161
- return;
162
- }
163
- const command = args[0];
164
- const { flags, args: parsedArgs } = parseFlags(args.slice(1));
165
- // Handle special commands first
166
- switch (command) {
167
- case 'version':
168
- case '--version':
169
- case '-v':
170
- printVersion();
171
- return;
172
- case 'help':
173
- case '--help':
174
- case '-h':
175
- if (parsedArgs.length > 0) {
176
- showCommandHelp(parsedArgs[0]);
177
- }
178
- else {
179
- showHelpWithCommands();
180
- }
181
- return;
182
- }
183
- // Check if this is a registered modular command
184
- if (hasCommand(command)) {
185
- try {
186
- await executeCommand(command, parsedArgs, flags);
187
- return;
188
- }
189
- catch (err) {
190
- printError(err.message);
191
- return;
192
- }
193
- }
194
- // Legacy command handling (to be refactored)
195
- const subArgs = parsedArgs; // Use parsed args for legacy commands
196
- switch (command) {
197
- case 'status':
198
- printSuccess('Claude-Flow System Status:');
199
- console.log('🟡 Status: Not Running (orchestrator not started)');
200
- console.log('🤖 Agents: 0 active');
201
- console.log('📋 Tasks: 0 in queue');
202
- console.log('💾 Memory: Ready');
203
- console.log('🖥️ Terminal Pool: Ready');
204
- console.log('🌐 MCP Server: Stopped');
205
- break;
206
- case 'monitor':
207
- printSuccess('Starting system monitor...');
208
- console.log('📊 Real-time monitoring would display here');
209
- break;
210
- case 'spawn':
211
- // Convenience alias for agent spawn
212
- const spawnType = subArgs[0] || 'general';
213
- const spawnName = flags.name || `agent-${Date.now()}`;
214
- printSuccess(`Spawning ${spawnType} agent: ${spawnName}`);
215
- console.log('🤖 Agent would be created with the following configuration:');
216
- console.log(` Type: ${spawnType}`);
217
- console.log(` Name: ${spawnName}`);
218
- console.log(' Capabilities: Research, Analysis, Code Generation');
219
- console.log(' Status: Ready');
220
- console.log('\n📋 Note: Full agent spawning requires orchestrator to be running');
221
- break;
222
- case 'terminal':
223
- const terminalCmd = subArgs[0];
224
- switch (terminalCmd) {
225
- case 'pool':
226
- const poolCmd = subArgs[1];
227
- const detailed = subArgs.includes('--detailed') || subArgs.includes('-d');
228
- if (poolCmd === 'status') {
229
- printSuccess('Terminal Pool Status:');
230
- console.log('🖥️ Status: Ready');
231
- console.log('📊 Pool Size: 10 (default)');
232
- console.log('🟢 Active Terminals: 0');
233
- console.log('⏸️ Idle Terminals: 0');
234
- console.log('📈 Total Created: 0');
235
- if (detailed) {
236
- console.log('\n📋 Detailed Information:');
237
- console.log(' Configuration:');
238
- console.log(' • Max Pool Size: 10');
239
- console.log(' • Idle Timeout: 5 minutes');
240
- console.log(' • Shell: /bin/bash');
241
- console.log(' • Working Directory: ' + process.cwd());
242
- console.log(' Performance:');
243
- console.log(' • Average Response Time: N/A');
244
- console.log(' • Terminal Creation Time: N/A');
245
- console.log(' • Memory Usage: N/A');
246
- console.log(' Health:');
247
- console.log(' • Pool Health: Healthy');
248
- console.log(' • Last Health Check: Just now');
249
- }
250
- }
251
- else if (poolCmd === 'list') {
252
- printSuccess('Terminal Pool Sessions:');
253
- console.log('📋 No active terminal sessions');
254
- }
255
- else if (poolCmd === 'create') {
256
- printSuccess('Creating new terminal session...');
257
- console.log('🆔 Terminal ID: term-' + Date.now());
258
- console.log('🖥️ Status: Created');
259
- console.log('🐚 Shell: /bin/bash');
260
- }
261
- else if (poolCmd === 'terminate') {
262
- const termId = subArgs[2];
263
- if (termId) {
264
- printSuccess(`Terminating terminal: ${termId}`);
265
- console.log('✅ Terminal terminated successfully');
266
- }
267
- else {
268
- printError('Usage: terminal pool terminate <terminal-id>');
269
- }
270
- }
271
- else if (poolCmd === 'stats') {
272
- // Pool statistics command
273
- printSuccess('Terminal Pool Statistics:');
274
- console.log('📊 Utilization: 0%');
275
- console.log('⚡ Performance Metrics:');
276
- console.log(' • Average Command Time: N/A');
277
- console.log(' • Total Commands: 0');
278
- console.log(' • Failed Commands: 0');
279
- console.log('♻️ Recycling Stats:');
280
- console.log(' • Terminals Recycled: 0');
281
- console.log(' • Average Lifetime: N/A');
282
- }
283
- else {
284
- console.log('Terminal pool commands: status, list, create, terminate, stats');
285
- console.log('Options: --detailed, -d');
286
- }
287
- break;
288
- case 'create':
289
- // Advanced terminal creation
290
- const nameIndex = subArgs.indexOf('--name');
291
- const shellIndex = subArgs.indexOf('--shell');
292
- const wdIndex = subArgs.indexOf('--working-directory');
293
- const envIndex = subArgs.indexOf('--env');
294
- const persistentIndex = subArgs.indexOf('--persistent');
295
- const terminalConfig = {
296
- name: nameIndex >= 0 ? subArgs[nameIndex + 1] : 'terminal-' + Date.now(),
297
- shell: shellIndex >= 0 ? subArgs[shellIndex + 1] : 'bash',
298
- workingDirectory: wdIndex >= 0 ? subArgs[wdIndex + 1] : process.cwd(),
299
- env: envIndex >= 0 ? subArgs[envIndex + 1] : '',
300
- persistent: persistentIndex >= 0
301
- };
302
- printSuccess('Creating terminal session...');
303
- console.log(`🆔 Terminal ID: ${terminalConfig.name}`);
304
- console.log(`🐚 Shell: ${terminalConfig.shell}`);
305
- console.log(`📁 Working Directory: ${terminalConfig.workingDirectory}`);
306
- if (terminalConfig.env) {
307
- console.log(`🔧 Environment: ${terminalConfig.env}`);
308
- }
309
- if (terminalConfig.persistent) {
310
- console.log('💾 Persistent: Yes');
311
- }
312
- break;
313
- case 'execute':
314
- case 'exec':
315
- const execCmd = subArgs.slice(1).join(' ');
316
- const sessionFlag = subArgs.indexOf('--session');
317
- const timeoutFlag = subArgs.indexOf('--timeout');
318
- const backgroundFlag = subArgs.includes('--background');
319
- if (execCmd && sessionFlag < 0) {
320
- printSuccess(`Executing command: ${execCmd}`);
321
- console.log('🖥️ Command would execute in terminal pool');
322
- console.log('📝 Output would appear here');
323
- if (backgroundFlag) {
324
- console.log('🔄 Running in background');
325
- }
326
- }
327
- else if (sessionFlag >= 0) {
328
- const sessionId = subArgs[sessionFlag + 1];
329
- const cmdStart = subArgs.indexOf('"');
330
- const cmdEnd = subArgs.lastIndexOf('"');
331
- const command = cmdStart >= 0 && cmdEnd > cmdStart ?
332
- subArgs.slice(cmdStart, cmdEnd + 1).join(' ').slice(1, -1) :
333
- 'echo "No command"';
334
- printSuccess(`Executing in session ${sessionId}: ${command}`);
335
- if (timeoutFlag >= 0) {
336
- console.log(`⏱️ Timeout: ${subArgs[timeoutFlag + 1]}`);
337
- }
338
- }
339
- else {
340
- printError('Usage: terminal execute <command> [--session <id>] [--timeout <duration>]');
341
- }
342
- break;
343
- case 'batch-exec':
344
- // Batch command execution
345
- const batchSession = subArgs.find(arg => !arg.startsWith('--'));
346
- const commandsFlag = subArgs.indexOf('--commands');
347
- const fileFlag = subArgs.indexOf('--file');
348
- if (commandsFlag >= 0) {
349
- const commands = subArgs[commandsFlag + 1].split(',');
350
- printSuccess(`Executing ${commands.length} commands in sequence`);
351
- commands.forEach((cmd, i) => {
352
- console.log(` ${i + 1}. ${cmd}`);
353
- });
354
- }
355
- else if (fileFlag >= 0) {
356
- printSuccess(`Executing commands from file: ${subArgs[fileFlag + 1]}`);
357
- }
358
- else {
359
- console.log('Usage: terminal batch-exec --commands "cmd1,cmd2,cmd3" [--session <id>]');
360
- }
361
- break;
362
- case 'list':
363
- // List all terminal sessions
364
- const listDetailed = subArgs.includes('--detailed');
365
- printSuccess('Active Terminal Sessions:');
366
- console.log('📋 No active terminal sessions');
367
- if (listDetailed) {
368
- console.log('\nSystem Information:');
369
- console.log(' • Total Sessions Created: 0');
370
- console.log(' • Sessions Recycled: 0');
371
- console.log(' • Average Session Lifetime: N/A');
372
- }
373
- break;
374
- case 'info':
375
- // Get terminal info
376
- const infoSessionId = subArgs[1];
377
- if (infoSessionId) {
378
- printSuccess(`Terminal Information: ${infoSessionId}`);
379
- console.log('🆔 Session ID: ' + infoSessionId);
380
- console.log('📍 Status: Not found');
381
- console.log('🐚 Shell: N/A');
382
- console.log('📁 Working Directory: N/A');
383
- console.log('⏱️ Created: N/A');
384
- console.log('📊 Commands Executed: 0');
385
- }
386
- else {
387
- printError('Usage: terminal info <session-id>');
388
- }
389
- break;
390
- case 'attach':
391
- // Attach to terminal
392
- const attachId = subArgs[1];
393
- if (attachId) {
394
- printSuccess(`Attaching to terminal: ${attachId}`);
395
- console.log('🔗 Would enter interactive mode');
396
- console.log('💡 Press Ctrl+D to detach');
397
- }
398
- else {
399
- printError('Usage: terminal attach <session-id>');
400
- }
401
- break;
402
- case 'detach':
403
- // Detach from terminal
404
- const detachId = subArgs[1];
405
- if (detachId) {
406
- printSuccess(`Detaching from terminal: ${detachId}`);
407
- console.log('✅ Session continues running in background');
408
- }
409
- else {
410
- printError('Usage: terminal detach <session-id>');
411
- }
412
- break;
413
- case 'terminate':
414
- // Terminate terminal
415
- const terminateId = subArgs[1];
416
- const graceful = subArgs.includes('--graceful');
417
- if (terminateId) {
418
- printSuccess(`Terminating terminal: ${terminateId}`);
419
- if (graceful) {
420
- console.log('🕐 Graceful shutdown initiated');
421
- }
422
- console.log('✅ Terminal terminated');
423
- }
424
- else {
425
- printError('Usage: terminal terminate <session-id> [--graceful]');
426
- }
427
- break;
428
- case 'cleanup':
429
- // Cleanup idle terminals
430
- const idleTime = subArgs.find(arg => arg.includes('--idle-longer-than'));
431
- printSuccess('Cleaning up idle terminals...');
432
- console.log('🧹 Scanning for idle sessions');
433
- if (idleTime) {
434
- console.log(`⏱️ Idle threshold: ${idleTime.split('=')[1] || '30m'}`);
435
- }
436
- console.log('✅ Cleanup complete: 0 terminals removed');
437
- break;
438
- case 'monitor':
439
- // Monitor terminal
440
- const monitorId = subArgs[1];
441
- if (monitorId) {
442
- printSuccess(`Monitoring terminal: ${monitorId}`);
443
- console.log('📊 Real-time metrics would display here');
444
- console.log(' • CPU: 0%');
445
- console.log(' • Memory: 0MB');
446
- console.log(' • I/O: 0 ops/s');
447
- }
448
- else {
449
- printError('Usage: terminal monitor <session-id>');
450
- }
451
- break;
452
- case 'record':
453
- // Record terminal session
454
- const recordId = subArgs[1];
455
- const outputFlag = subArgs.indexOf('--output');
456
- if (recordId && outputFlag >= 0) {
457
- printSuccess(`Recording terminal session: ${recordId}`);
458
- console.log(`📹 Output file: ${subArgs[outputFlag + 1]}`);
459
- console.log('🔴 Recording started');
460
- }
461
- else {
462
- printError('Usage: terminal record <session-id> --output <file>');
463
- }
464
- break;
465
- case 'replay':
466
- // Replay terminal session
467
- const replayFile = subArgs[1];
468
- if (replayFile) {
469
- printSuccess(`Replaying session from: ${replayFile}`);
470
- console.log('▶️ Playback would start here');
471
- console.log('⏸️ Controls: space=pause, arrows=seek, q=quit');
472
- }
473
- else {
474
- printError('Usage: terminal replay <recording-file>');
475
- }
476
- break;
477
- case 'share':
478
- // Share terminal session
479
- const shareId = subArgs[1];
480
- const accessLevel = subArgs.find(arg => arg.includes('--access-level'));
481
- if (shareId) {
482
- printSuccess(`Sharing terminal session: ${shareId}`);
483
- console.log(`🔗 Share URL: https://claude-flow.local/terminal/${shareId}/view`);
484
- console.log(`🔐 Access: ${accessLevel ? accessLevel.split('=')[1] : 'read-only'}`);
485
- console.log('⏱️ Expires in: 2 hours');
486
- }
487
- else {
488
- printError('Usage: terminal share <session-id> [--access-level read|write]');
489
- }
490
- break;
491
- case 'multi-config':
492
- // Multi-terminal configuration
493
- const multiCmd = subArgs[1];
494
- if (multiCmd === 'create') {
495
- const configName = subArgs.find(arg => !arg.startsWith('--'));
496
- printSuccess(`Creating multi-terminal configuration: ${configName || 'default'}`);
497
- console.log('📋 Configuration template created');
498
- }
499
- else {
500
- console.log('Usage: terminal multi-config create --name <name> --config <file>');
501
- }
502
- break;
503
- case 'multi-launch':
504
- // Launch multi-terminal environment
505
- const envName = subArgs[1];
506
- if (envName) {
507
- printSuccess(`Launching multi-terminal environment: ${envName}`);
508
- console.log('🚀 Starting terminals in dependency order...');
509
- console.log(' 1. database - Starting...');
510
- console.log(' 2. backend-api - Waiting for database...');
511
- console.log(' 3. frontend-app - Waiting for backend...');
512
- console.log('✅ All terminals launched successfully');
513
- }
514
- else {
515
- printError('Usage: terminal multi-launch <environment-name>');
516
- }
517
- break;
518
- case 'batch-create':
519
- // Batch create terminals
520
- const configFile = subArgs.find(arg => arg.includes('--config'));
521
- printSuccess('Creating multiple terminal sessions...');
522
- if (configFile) {
523
- console.log(`📄 Loading config from: ${configFile.split('=')[1]}`);
524
- }
525
- console.log('✅ Created 3 terminal sessions');
526
- break;
527
- case 'session':
528
- // Legacy session command handling
529
- const sessionCmd = subArgs[1];
530
- if (sessionCmd === 'list') {
531
- printSuccess('Terminal Sessions:');
532
- console.log('📋 No active sessions');
533
- }
534
- else if (sessionCmd === 'info') {
535
- const sessionId = subArgs[2];
536
- if (sessionId) {
537
- printSuccess(`Session Info: ${sessionId}`);
538
- console.log('🆔 Session ID: ' + sessionId);
539
- console.log('📍 Status: Not found');
540
- }
541
- else {
542
- printError('Usage: terminal session info <session-id>');
543
- }
544
- }
545
- else {
546
- console.log('Terminal session commands: list, info');
547
- }
548
- break;
549
- default:
550
- console.log('Terminal commands:');
551
- console.log(' Basic:');
552
- console.log(' pool - Manage terminal pool (status, list, create, terminate)');
553
- console.log(' create - Create new terminal with options');
554
- console.log(' execute - Execute command in terminal');
555
- console.log(' list - List all active terminals');
556
- console.log(' info - Get terminal information');
557
- console.log(' Session Control:');
558
- console.log(' attach - Attach to terminal session');
559
- console.log(' detach - Detach from terminal');
560
- console.log(' terminate - Terminate terminal session');
561
- console.log(' cleanup - Clean up idle terminals');
562
- console.log(' Advanced:');
563
- console.log(' batch-exec - Execute multiple commands');
564
- console.log(' monitor - Monitor terminal metrics');
565
- console.log(' record - Record terminal session');
566
- console.log(' replay - Replay recorded session');
567
- console.log(' share - Share terminal session');
568
- console.log(' Multi-Terminal:');
569
- console.log(' multi-config - Create multi-terminal config');
570
- console.log(' multi-launch - Launch terminal environment');
571
- console.log(' batch-create - Create multiple terminals');
572
- console.log('\nExamples:');
573
- console.log(' terminal pool status --detailed');
574
- console.log(' terminal create --name "dev" --shell bash --persistent');
575
- console.log(' terminal execute "npm test" --session dev --timeout 5m');
576
- console.log(' terminal batch-exec --commands "cd /app,npm install,npm start"');
577
- console.log(' terminal monitor dev --metrics cpu,memory');
578
- }
579
- break;
580
- case 'session':
581
- printSuccess('Terminal session manager ready');
582
- console.log('🖥️ Session operations would be handled here');
583
- break;
584
- case 'workflow':
585
- const workflowFile = subArgs[0];
586
- if (workflowFile) {
587
- printSuccess(`Executing workflow: ${workflowFile}`);
588
- console.log('🔄 Workflow execution would start here');
589
- }
590
- else {
591
- printError('Please specify a workflow file');
592
- }
593
- break;
594
- case 'repl':
595
- printSuccess('Starting interactive REPL mode...');
596
- await startRepl();
597
- break;
598
- case 'project':
599
- const projectCmd = subArgs[0];
600
- switch (projectCmd) {
601
- case 'create':
602
- const projectName = subArgs[1];
603
- if (!projectName) {
604
- printError('Usage: project create <name> [options]');
605
- break;
606
- }
607
- const isolationFlag = subArgs.indexOf('--isolation');
608
- const resourceQuotaFlag = subArgs.indexOf('--resource-quota');
609
- const securityProfileFlag = subArgs.indexOf('--security-profile');
610
- const templateFlag = subArgs.indexOf('--template');
611
- printSuccess(`Creating project: ${projectName}`);
612
- console.log('🏗️ Project Configuration:');
613
- console.log(` Name: ${projectName}`);
614
- console.log(` Isolation: ${isolationFlag >= 0 ? subArgs[isolationFlag + 1] : 'standard'}`);
615
- if (resourceQuotaFlag >= 0) {
616
- console.log(` Resource Quota: ${subArgs[resourceQuotaFlag + 1]}`);
617
- }
618
- console.log(` Security Profile: ${securityProfileFlag >= 0 ? subArgs[securityProfileFlag + 1] : 'default'}`);
619
- if (templateFlag >= 0) {
620
- console.log(` Template: ${subArgs[templateFlag + 1]}`);
621
- }
622
- // Create project directory structure
623
- console.log('\n📁 Creating project structure:');
624
- console.log(` ✓ Created /projects/${projectName}/`);
625
- console.log(` ✓ Created /projects/${projectName}/agents/`);
626
- console.log(` ✓ Created /projects/${projectName}/workflows/`);
627
- console.log(` ✓ Created /projects/${projectName}/config/`);
628
- console.log(` ✓ Created /projects/${projectName}/data/`);
629
- console.log(` ✓ Created project-config.json`);
630
- console.log('\n✅ Project created successfully!');
631
- break;
632
- case 'switch':
633
- const switchProject = subArgs[1];
634
- if (!switchProject) {
635
- printError('Usage: project switch <name>');
636
- break;
637
- }
638
- printSuccess(`Switching to project: ${switchProject}`);
639
- console.log('🔄 Loading project context...');
640
- console.log(' ✓ Project configuration loaded');
641
- console.log(' ✓ Agent states restored');
642
- console.log(' ✓ Workflow history loaded');
643
- console.log(`\n📍 Active project: ${switchProject}`);
644
- break;
645
- case 'list':
646
- const showActive = subArgs.includes('--active');
647
- const withStats = subArgs.includes('--with-stats');
648
- printSuccess('Available projects:');
649
- const projects = [
650
- { name: 'microservices-platform', status: 'active', agents: 12, tasks: 45 },
651
- { name: 'ai-research', status: 'idle', agents: 3, tasks: 8 },
652
- { name: 'frontend-apps', status: 'archived', agents: 0, tasks: 0 }
653
- ];
654
- projects.forEach(project => {
655
- if (showActive && project.status !== 'active')
656
- return;
657
- console.log(`\n📦 ${project.name}`);
658
- console.log(` Status: ${project.status}`);
659
- if (withStats) {
660
- console.log(` Active Agents: ${project.agents}`);
661
- console.log(` Pending Tasks: ${project.tasks}`);
662
- }
663
- });
664
- break;
665
- case 'config':
666
- const configAction = subArgs[1];
667
- const configProject = subArgs[2];
668
- if (configAction === 'set' && configProject) {
669
- const configKey = subArgs[3];
670
- const configValue = subArgs.slice(4).join(' ');
671
- printSuccess(`Updating project configuration: ${configProject}`);
672
- console.log(` Setting: ${configKey} = ${configValue}`);
673
- console.log('✅ Configuration updated');
674
- }
675
- else if (configAction === 'get' && configProject) {
676
- const configKey = subArgs[3];
677
- console.log(`Project: ${configProject}`);
678
- console.log(`${configKey}: (configuration value)`);
679
- }
680
- else {
681
- console.log('Usage: project config set <project> <key> <value>');
682
- console.log(' project config get <project> <key>');
683
- }
684
- break;
685
- case 'monitor':
686
- const monitorProject = subArgs[1];
687
- if (!monitorProject) {
688
- printError('Usage: project monitor <name> [options]');
689
- break;
690
- }
691
- printSuccess(`Monitoring project: ${monitorProject}`);
692
- console.log('\n📊 Real-time Metrics:');
693
- console.log(' Resource Usage:');
694
- console.log(' • CPU: 45%');
695
- console.log(' • Memory: 2.3GB / 4GB');
696
- console.log(' • Storage: 8.5GB / 20GB');
697
- console.log(' • Network: 23Mbps / 100Mbps');
698
- console.log(' Agent Performance:');
699
- console.log(' • Active Agents: 8');
700
- console.log(' • Average Response Time: 234ms');
701
- console.log(' • Task Success Rate: 94%');
702
- console.log(' Costs:');
703
- console.log(' • Today: $124.50');
704
- console.log(' • This Month: $2,845.00');
705
- break;
706
- case 'backup':
707
- const backupProject = subArgs[1];
708
- if (!backupProject) {
709
- printError('Usage: project backup <name> [options]');
710
- break;
711
- }
712
- const includeData = subArgs.includes('--include-data');
713
- const includeConfig = subArgs.includes('--include-config');
714
- const includeHistory = subArgs.includes('--include-history');
715
- const outputFlag = subArgs.indexOf('--output');
716
- printSuccess(`Creating backup for project: ${backupProject}`);
717
- console.log('🗄️ Backup Configuration:');
718
- console.log(` Include Data: ${includeData ? 'Yes' : 'No'}`);
719
- console.log(` Include Config: ${includeConfig ? 'Yes' : 'No'}`);
720
- console.log(` Include History: ${includeHistory ? 'Yes' : 'No'}`);
721
- console.log('\n📦 Creating backup...');
722
- console.log(' ✓ Collecting project data');
723
- console.log(' ✓ Compressing files');
724
- console.log(' ✓ Encrypting backup');
725
- const outputFile = outputFlag >= 0 ? subArgs[outputFlag + 1] : `${backupProject}-backup-${Date.now()}.tar.gz`;
726
- console.log(`\n✅ Backup created: ${outputFile}`);
727
- console.log(' Size: 145MB');
728
- console.log(' Checksum: sha256:abcd1234...');
729
- break;
730
- case 'share':
731
- const shareFrom = subArgs[1];
732
- const shareTo = subArgs[2];
733
- if (!shareFrom || !shareTo) {
734
- printError('Usage: project share <from-project> <to-project> [options]');
735
- break;
736
- }
737
- const agentsFlag = subArgs.indexOf('--agents');
738
- const permissionsFlag = subArgs.indexOf('--permissions');
739
- const durationFlag = subArgs.indexOf('--duration');
740
- printSuccess(`Sharing resources from ${shareFrom} to ${shareTo}`);
741
- if (agentsFlag >= 0) {
742
- console.log(` Agents: ${subArgs[agentsFlag + 1]}`);
743
- }
744
- if (permissionsFlag >= 0) {
745
- console.log(` Permissions: ${subArgs[permissionsFlag + 1]}`);
746
- }
747
- if (durationFlag >= 0) {
748
- console.log(` Duration: ${subArgs[durationFlag + 1]}`);
749
- }
750
- console.log('\n✅ Resource sharing configured');
751
- break;
752
- case 'federation':
753
- const fedCmd = subArgs[1];
754
- if (fedCmd === 'create') {
755
- const fedName = subArgs[2];
756
- const projectsFlag = subArgs.indexOf('--projects');
757
- if (!fedName) {
758
- printError('Usage: project federation create <name> --projects <project-list>');
759
- break;
760
- }
761
- printSuccess(`Creating federation: ${fedName}`);
762
- if (projectsFlag >= 0) {
763
- console.log(` Projects: ${subArgs[projectsFlag + 1]}`);
764
- }
765
- console.log(' Coordination Model: hierarchical');
766
- console.log(' Shared Resources: knowledge-base, artifact-registry');
767
- console.log('\n✅ Federation created successfully');
768
- }
769
- else if (fedCmd === 'list') {
770
- printSuccess('Active federations:');
771
- console.log('\n🏢 development-ecosystem');
772
- console.log(' Projects: backend-services, frontend-apps, infrastructure');
773
- console.log(' Coordinator: infrastructure');
774
- console.log(' Status: Active');
775
- }
776
- else {
777
- console.log('Federation commands: create, list, workflow');
778
- }
779
- break;
780
- default:
781
- console.log('Project commands:');
782
- console.log(' create - Create new project with isolation');
783
- console.log(' switch - Switch active project context');
784
- console.log(' list - List all projects');
785
- console.log(' config - Get/set project configuration');
786
- console.log(' monitor - Monitor project resources and performance');
787
- console.log(' backup - Create project backup');
788
- console.log(' share - Share resources between projects');
789
- console.log(' federation - Manage project federations');
790
- console.log('\nExamples:');
791
- console.log(' project create "microservices" --isolation strict --resource-quota "agents:15,memory:4GB"');
792
- console.log(' project switch "microservices"');
793
- console.log(' project monitor "microservices" --real-time');
794
- }
795
- break;
796
- case 'cloud':
797
- const cloudCmd = subArgs[0];
798
- const cloudProvider = subArgs[1];
799
- switch (cloudCmd) {
800
- case 'aws':
801
- switch (cloudProvider) {
802
- case 'deploy':
803
- const awsServices = subArgs.indexOf('--services');
804
- const awsRegions = subArgs.indexOf('--regions');
805
- const awsHA = subArgs.includes('--ha-configuration');
806
- const awsCostOpt = subArgs.includes('--cost-optimization');
807
- printSuccess('Deploying Claude-Flow to AWS');
808
- console.log('☁️ AWS Deployment Configuration:');
809
- if (awsServices >= 0) {
810
- console.log(` Services: ${subArgs[awsServices + 1]}`);
811
- }
812
- if (awsRegions >= 0) {
813
- console.log(` Regions: ${subArgs[awsRegions + 1]}`);
814
- }
815
- console.log(` High Availability: ${awsHA ? 'Enabled' : 'Disabled'}`);
816
- console.log(` Cost Optimization: ${awsCostOpt ? 'Enabled' : 'Disabled'}`);
817
- console.log('\n🚀 Deployment Progress:');
818
- console.log(' ✓ Creating ECS cluster');
819
- console.log(' ✓ Setting up Lambda functions');
820
- console.log(' ✓ Configuring RDS database');
821
- console.log(' ✓ Setting up S3 buckets');
822
- console.log(' ✓ Configuring CloudWatch monitoring');
823
- console.log(' ✓ Setting up load balancers');
824
- console.log('\n✅ AWS deployment completed successfully');
825
- console.log(' Cluster ARN: arn:aws:ecs:us-east-1:123456789012:cluster/claude-flow');
826
- console.log(' API Gateway: https://api.aws.claude-flow.com');
827
- console.log(' Monitoring: https://console.aws.amazon.com/cloudwatch');
828
- break;
829
- case 'configure':
830
- printSuccess('Configuring AWS integration');
831
- console.log('🔧 AWS Configuration:');
832
- console.log(' ✓ IAM roles and policies');
833
- console.log(' ✓ VPC and security groups');
834
- console.log(' ✓ Auto-scaling policies');
835
- console.log(' ✓ Backup and disaster recovery');
836
- console.log(' ✓ Cost monitoring and alerts');
837
- break;
838
- case 'status':
839
- printSuccess('AWS Infrastructure Status');
840
- console.log('\n🏗️ Infrastructure Health:');
841
- console.log(' ECS Cluster: 3/3 instances healthy');
842
- console.log(' Lambda Functions: 12/12 active');
843
- console.log(' RDS Database: Available (Multi-AZ)');
844
- console.log(' S3 Buckets: 5 buckets, 2.3TB stored');
845
- console.log(' CloudWatch: 47 metrics, 0 alarms');
846
- console.log('\n💰 Cost Summary (This Month):');
847
- console.log(' Compute (ECS/Lambda): $1,245.50');
848
- console.log(' Storage (S3/EBS): $342.25');
849
- console.log(' Network: $87.30');
850
- console.log(' Total: $1,675.05');
851
- break;
852
- default:
853
- console.log('AWS commands: deploy, configure, status');
854
- }
855
- break;
856
- case 'azure':
857
- switch (cloudProvider) {
858
- case 'deploy':
859
- const azureServices = subArgs.indexOf('--services');
860
- const azureRegions = subArgs.indexOf('--regions');
861
- const azureIntegration = subArgs.includes('--integration-with-aws');
862
- printSuccess('Deploying Claude-Flow to Azure');
863
- console.log('☁️ Azure Deployment Configuration:');
864
- if (azureServices >= 0) {
865
- console.log(` Services: ${subArgs[azureServices + 1]}`);
866
- }
867
- if (azureRegions >= 0) {
868
- console.log(` Regions: ${subArgs[azureRegions + 1]}`);
869
- }
870
- console.log(` AWS Integration: ${azureIntegration ? 'Enabled' : 'Disabled'}`);
871
- console.log('\n🚀 Deployment Progress:');
872
- console.log(' ✓ Creating AKS cluster');
873
- console.log(' ✓ Setting up Azure Functions');
874
- console.log(' ✓ Configuring Cosmos DB');
875
- console.log(' ✓ Setting up Blob Storage');
876
- console.log(' ✓ Configuring Azure Monitor');
877
- console.log(' ✓ Setting up Application Gateway');
878
- console.log('\n✅ Azure deployment completed successfully');
879
- console.log(' Resource Group: claude-flow-production');
880
- console.log(' API Gateway: https://api.azure.claude-flow.com');
881
- console.log(' Monitoring: https://portal.azure.com');
882
- break;
883
- case 'configure':
884
- printSuccess('Configuring Azure integration');
885
- console.log('🔧 Azure Configuration:');
886
- console.log(' ✓ Service principals and RBAC');
887
- console.log(' ✓ Virtual networks and NSGs');
888
- console.log(' ✓ Auto-scaling rules');
889
- console.log(' ✓ Backup and site recovery');
890
- console.log(' ✓ Cost management and budgets');
891
- break;
892
- case 'status':
893
- printSuccess('Azure Infrastructure Status');
894
- console.log('\n🏗️ Infrastructure Health:');
895
- console.log(' AKS Cluster: 3/3 nodes ready');
896
- console.log(' Azure Functions: 8/8 active');
897
- console.log(' Cosmos DB: Available (Global)');
898
- console.log(' Blob Storage: 3 containers, 1.8TB stored');
899
- console.log(' Azure Monitor: 35 metrics, 0 alerts');
900
- console.log('\n💰 Cost Summary (This Month):');
901
- console.log(' Compute (AKS/Functions): $985.40');
902
- console.log(' Storage (Blob/Cosmos): $267.85');
903
- console.log(' Network: $63.20');
904
- console.log(' Total: $1,316.45');
905
- break;
906
- default:
907
- console.log('Azure commands: deploy, configure, status');
908
- }
909
- break;
910
- case 'gcp':
911
- switch (cloudProvider) {
912
- case 'deploy':
913
- const gcpServices = subArgs.indexOf('--services');
914
- const gcpRegions = subArgs.indexOf('--regions');
915
- const multiCloud = subArgs.includes('--multi-cloud-networking');
916
- printSuccess('Deploying Claude-Flow to Google Cloud');
917
- console.log('☁️ GCP Deployment Configuration:');
918
- if (gcpServices >= 0) {
919
- console.log(` Services: ${subArgs[gcpServices + 1]}`);
920
- }
921
- if (gcpRegions >= 0) {
922
- console.log(` Regions: ${subArgs[gcpRegions + 1]}`);
923
- }
924
- console.log(` Multi-Cloud Networking: ${multiCloud ? 'Enabled' : 'Disabled'}`);
925
- console.log('\n🚀 Deployment Progress:');
926
- console.log(' ✓ Creating GKE cluster');
927
- console.log(' ✓ Setting up Cloud Functions');
928
- console.log(' ✓ Configuring Cloud SQL');
929
- console.log(' ✓ Setting up Cloud Storage');
930
- console.log(' ✓ Configuring Cloud Monitoring');
931
- console.log(' ✓ Setting up Cloud Load Balancing');
932
- console.log('\n✅ GCP deployment completed successfully');
933
- console.log(' Project ID: claude-flow-production');
934
- console.log(' API Gateway: https://api.gcp.claude-flow.com');
935
- console.log(' Monitoring: https://console.cloud.google.com');
936
- break;
937
- case 'configure':
938
- printSuccess('Configuring GCP integration');
939
- console.log('🔧 GCP Configuration:');
940
- console.log(' ✓ Service accounts and IAM');
941
- console.log(' ✓ VPC networks and firewall rules');
942
- console.log(' ✓ Auto-scaling policies');
943
- console.log(' ✓ Backup and disaster recovery');
944
- console.log(' ✓ Budget alerts and cost optimization');
945
- break;
946
- case 'status':
947
- printSuccess('GCP Infrastructure Status');
948
- console.log('\n🏗️ Infrastructure Health:');
949
- console.log(' GKE Cluster: 3/3 nodes ready');
950
- console.log(' Cloud Functions: 10/10 active');
951
- console.log(' Cloud SQL: Available (HA)');
952
- console.log(' Cloud Storage: 4 buckets, 2.1TB stored');
953
- console.log(' Cloud Monitoring: 42 metrics, 0 incidents');
954
- console.log('\n💰 Cost Summary (This Month):');
955
- console.log(' Compute (GKE/Functions): $1,125.30');
956
- console.log(' Storage (Cloud Storage/SQL): $298.75');
957
- console.log(' Network: $71.45');
958
- console.log(' Total: $1,495.50');
959
- break;
960
- default:
961
- console.log('GCP commands: deploy, configure, status');
962
- }
963
- break;
964
- case 'multi-cloud':
965
- const multiCloudCmd = subArgs[1];
966
- switch (multiCloudCmd) {
967
- case 'deploy':
968
- printSuccess('Deploying multi-cloud Claude-Flow architecture');
969
- console.log('🌐 Multi-Cloud Deployment:');
970
- console.log(' Primary: AWS (us-east-1)');
971
- console.log(' Secondary: Azure (eastus)');
972
- console.log(' Tertiary: GCP (us-central1)');
973
- console.log('\n🔗 Cross-Cloud Networking:');
974
- console.log(' ✓ VPN connections established');
975
- console.log(' ✓ DNS and load balancing configured');
976
- console.log(' ✓ Data replication setup');
977
- console.log(' ✓ Unified monitoring deployed');
978
- console.log('\n✅ Multi-cloud deployment completed');
979
- console.log(' Global endpoint: https://global.claude-flow.com');
980
- console.log(' Failover time: < 30 seconds');
981
- console.log(' Data consistency: Eventually consistent');
982
- break;
983
- case 'status':
984
- printSuccess('Multi-Cloud Infrastructure Status');
985
- console.log('\n🌐 Global Infrastructure:');
986
- console.log(' AWS (Primary): 🟢 Healthy');
987
- console.log(' Azure (Secondary): 🟢 Healthy');
988
- console.log(' GCP (Tertiary): 🟢 Healthy');
989
- console.log('\n📊 Traffic Distribution:');
990
- console.log(' AWS: 45% (2,341 req/min)');
991
- console.log(' Azure: 35% (1,823 req/min)');
992
- console.log(' GCP: 20% (1,042 req/min)');
993
- console.log('\n💰 Total Cost (This Month): $4,487.00');
994
- break;
995
- case 'failover':
996
- const failoverTarget = subArgs[2];
997
- if (!failoverTarget) {
998
- printError('Usage: cloud multi-cloud failover <target-cloud>');
999
- break;
1000
- }
1001
- printWarning(`Initiating failover to ${failoverTarget}`);
1002
- console.log('🔄 Failover Process:');
1003
- console.log(' ✓ Health check failed on primary');
1004
- console.log(' ✓ Traffic routing to secondary');
1005
- console.log(' ✓ Database replication verified');
1006
- console.log(' ✓ DNS updates propagated');
1007
- console.log(`\n✅ Failover to ${failoverTarget} completed in 23 seconds`);
1008
- break;
1009
- default:
1010
- console.log('Multi-cloud commands: deploy, status, failover');
1011
- }
1012
- break;
1013
- case 'kubernetes':
1014
- const k8sCmd = subArgs[1];
1015
- switch (k8sCmd) {
1016
- case 'deploy':
1017
- printSuccess('Deploying Claude-Flow to Kubernetes');
1018
- console.log('⚙️ Kubernetes Deployment:');
1019
- console.log(' Namespace: claude-flow');
1020
- console.log(' Replicas: 3');
1021
- console.log(' Resources: 1Gi memory, 500m CPU per pod');
1022
- console.log('\n📦 Deploying Components:');
1023
- console.log(' ✓ Orchestrator deployment');
1024
- console.log(' ✓ MCP server deployment');
1025
- console.log(' ✓ Memory bank deployment');
1026
- console.log(' ✓ Load balancer service');
1027
- console.log(' ✓ Ingress controller');
1028
- console.log(' ✓ ConfigMaps and Secrets');
1029
- console.log('\n✅ Kubernetes deployment completed');
1030
- console.log(' Pods: 3/3 running');
1031
- console.log(' Service: claude-flow-orchestrator-service');
1032
- console.log(' Ingress: https://k8s.claude-flow.com');
1033
- break;
1034
- case 'scale':
1035
- const replicas = subArgs[2] || '5';
1036
- printSuccess(`Scaling Claude-Flow to ${replicas} replicas`);
1037
- console.log('📈 Scaling Progress:');
1038
- console.log(` Current replicas: 3`);
1039
- console.log(` Target replicas: ${replicas}`);
1040
- console.log(' ✓ Updating deployment');
1041
- console.log(' ✓ Rolling update in progress');
1042
- console.log(` ✓ Scaled to ${replicas} replicas successfully`);
1043
- break;
1044
- case 'status':
1045
- printSuccess('Kubernetes Cluster Status');
1046
- console.log('\n⚙️ Cluster Information:');
1047
- console.log(' Namespace: claude-flow');
1048
- console.log(' Deployments: 3/3 ready');
1049
- console.log(' Pods: 3/3 running');
1050
- console.log(' Services: 2 active');
1051
- console.log(' ConfigMaps: 2');
1052
- console.log(' Secrets: 1');
1053
- console.log('\n📊 Resource Usage:');
1054
- console.log(' CPU: 1.2/3.0 cores (40%)');
1055
- console.log(' Memory: 2.1/3.0 GB (70%)');
1056
- console.log(' Storage: 8.5/50 GB (17%)');
1057
- break;
1058
- default:
1059
- console.log('Kubernetes commands: deploy, scale, status');
1060
- }
1061
- break;
1062
- default:
1063
- console.log('Cloud commands:');
1064
- console.log(' aws - Amazon Web Services integration');
1065
- console.log(' azure - Microsoft Azure integration');
1066
- console.log(' gcp - Google Cloud Platform integration');
1067
- console.log(' multi-cloud - Multi-cloud deployment and management');
1068
- console.log(' kubernetes - Kubernetes deployment and management');
1069
- console.log('\nExamples:');
1070
- console.log(' cloud aws deploy --services "ecs,lambda,rds" --regions "us-east-1,us-west-2"');
1071
- console.log(' cloud azure deploy --services "aks,functions,cosmos-db"');
1072
- console.log(' cloud gcp deploy --services "gke,cloud-functions,cloud-sql"');
1073
- console.log(' cloud multi-cloud deploy');
1074
- console.log(' cloud kubernetes deploy');
1075
- }
1076
- break;
1077
- case 'claude':
1078
- const claudeCmd = subArgs[0];
1079
- switch (claudeCmd) {
1080
- case 'spawn':
1081
- // Extract task description and flags
1082
- let taskEndIndex = subArgs.length;
1083
- for (let i = 1; i < subArgs.length; i++) {
1084
- if (subArgs[i].startsWith('-')) {
1085
- taskEndIndex = i;
1086
- break;
1087
- }
1088
- }
1089
- const task = subArgs.slice(1, taskEndIndex).join(' ');
1090
- if (!task) {
1091
- printError('Usage: claude spawn <task description> [options]');
1092
- break;
1093
- }
1094
- // Parse flags
1095
- const flags = {};
1096
- for (let i = taskEndIndex; i < subArgs.length; i++) {
1097
- const arg = subArgs[i];
1098
- if (arg === '--tools' || arg === '-t') {
1099
- flags.tools = subArgs[++i];
1100
- }
1101
- else if (arg === '--no-permissions') {
1102
- flags.noPermissions = true;
1103
- }
1104
- else if (arg === '--config' || arg === '-c') {
1105
- flags.config = subArgs[++i];
1106
- }
1107
- else if (arg === '--mode' || arg === '-m') {
1108
- flags.mode = subArgs[++i];
1109
- }
1110
- else if (arg === '--parallel') {
1111
- flags.parallel = true;
1112
- }
1113
- else if (arg === '--research') {
1114
- flags.research = true;
1115
- }
1116
- else if (arg === '--coverage') {
1117
- flags.coverage = parseInt(subArgs[++i]);
1118
- }
1119
- else if (arg === '--commit') {
1120
- flags.commit = subArgs[++i];
1121
- }
1122
- else if (arg === '--verbose' || arg === '-v') {
1123
- flags.verbose = true;
1124
- }
1125
- else if (arg === '--dry-run' || arg === '-d') {
1126
- flags.dryRun = true;
1127
- }
1128
- }
1129
- // Build tools list
1130
- let tools = flags.tools || 'View,Edit,Replace,GlobTool,GrepTool,LS,Bash';
1131
- if (flags.parallel) {
1132
- tools += ',BatchTool,dispatch_agent';
1133
- }
1134
- if (flags.research) {
1135
- tools += ',WebFetchTool';
1136
- }
1137
- const instanceId = `claude-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
1138
- if (flags.dryRun) {
1139
- printWarning('DRY RUN - Would execute:');
1140
- console.log(`Command: claude "<enhanced task with guidance>" --allowedTools ${tools}`);
1141
- console.log(`Instance ID: ${instanceId}`);
1142
- console.log(`Task: ${task}`);
1143
- console.log(`Tools: ${tools}`);
1144
- console.log(`Mode: ${flags.mode || 'full'}`);
1145
- console.log(`Coverage: ${flags.coverage || 80}%`);
1146
- console.log(`Commit: ${flags.commit || 'phase'}`);
1147
- console.log(`\nEnhanced Features:`);
1148
- console.log(` - Memory Bank enabled via: npx claude-flow memory commands`);
1149
- console.log(` - Coordination ${flags.parallel ? 'enabled' : 'disabled'}`);
1150
- console.log(` - Access Claude-Flow features through Bash tool`);
1151
- }
1152
- else {
1153
- printSuccess(`Spawning Claude instance: ${instanceId}`);
1154
- console.log(`📝 Original Task: ${task}`);
1155
- console.log(`🔧 Tools: ${tools}`);
1156
- console.log(`⚙️ Mode: ${flags.mode || 'full'}`);
1157
- console.log(`📊 Coverage: ${flags.coverage || 80}%`);
1158
- console.log(`💾 Commit: ${flags.commit || 'phase'}`);
1159
- console.log(`✨ Enhanced with Claude-Flow guidance for memory and coordination`);
1160
- console.log('');
1161
- console.log('📋 Task will be enhanced with:');
1162
- console.log(' - Memory Bank instructions (store/retrieve)');
1163
- console.log(' - Coordination capabilities (swarm management)');
1164
- console.log(' - Best practices for multi-agent workflows');
1165
- console.log('');
1166
- // Build the actual claude command with enhanced guidance
1167
- let enhancedTask = `# Task Assignment
1168
-
1169
- ## Your Primary Task
1170
- ${task}
1171
-
1172
- ## Development Environment
1173
-
1174
- You are working in a development environment with advanced orchestration capabilities available if needed.
1175
-
1176
- ### Project Context
1177
- - Working Directory: ${process.cwd()}
1178
- - Instance ID: ${instanceId}
1179
- - Development Mode: ${flags.mode || 'full'}
1180
- ${flags.coverage ? `- Test Coverage Target: ${flags.coverage}%` : ''}
1181
- ${flags.commit ? `- Git Commit Strategy: ${flags.commit}` : ''}
1182
- ${flags.config ? `- MCP Config: ${flags.config}` : ''}
1183
-
1184
- ### Available Tools
1185
- - You have access to these tools: ${tools}
1186
- ${flags.tools ? `- Custom tools specified: ${flags.tools}` : ''}
1187
-
1188
- ### Optional Orchestration Features
1189
-
1190
- If this task requires complex coordination, memory persistence, or multi-agent collaboration, you can use the claude-flow system:
1191
-
1192
- 1. **Persistent Memory** (if needed for your task)
1193
- - Store project data: \`npx claude-flow memory store <key> "<value>"\`
1194
- - Retrieve stored data: \`npx claude-flow memory query <key>\`
1195
- - Export/Import memory: \`npx claude-flow memory export/import <file>\`
1196
-
1197
- 2. **Task Coordination** (if working on complex multi-part tasks)
1198
- - Check task status: \`npx claude-flow status\`
1199
- - Monitor progress: \`npx claude-flow monitor\`
1200
- - List active tasks: \`npx claude-flow task list\`
1201
-
1202
- 3. **Multi-Agent Collaboration** (if task benefits from parallelization)
1203
- - Spawn specialized agents: \`npx claude-flow agent spawn <type> --name <name>\`
1204
- - Create subtasks: \`npx claude-flow task create <type> "<description>"\`
1205
- - Coordinate work: \`npx claude-flow task assign <task-id> <agent-id>\``;
1206
- if (flags.parallel) {
1207
- enhancedTask += `
1208
-
1209
- **Parallel Execution Enabled**: The orchestration system can help coordinate parallel work if needed.`;
1210
- }
1211
- if (flags.research) {
1212
- enhancedTask += `
1213
-
1214
- **Research Mode**: Web research tools are available for information gathering.`;
1215
- }
1216
- enhancedTask += `
1217
-
1218
- ### Task Execution Guidelines
1219
-
1220
- 1. **Focus on Your Primary Objective**:
1221
- - Understand the specific requirements of the task
1222
- - Plan your approach based on the project's needs
1223
- - Use appropriate tools and practices for the technology stack
1224
- ${flags.mode === 'backend-only' ? ' - Focus on backend implementation' : ''}
1225
- ${flags.mode === 'frontend-only' ? ' - Focus on frontend implementation' : ''}
1226
- ${flags.mode === 'api-only' ? ' - Focus on API design and implementation' : ''}
1227
-
1228
- 2. **Development Best Practices**:
1229
- - Write clean, maintainable code following project conventions
1230
- - Include appropriate tests and documentation
1231
- - Use version control effectively
1232
- ${flags.coverage ? ` - Ensure test coverage meets ${flags.coverage}% target` : ''}
1233
- ${flags.commit === 'phase' ? ' - Commit changes after completing major phases' : ''}
1234
- ${flags.commit === 'feature' ? ' - Commit changes after each feature is complete' : ''}
1235
- ${flags.commit === 'manual' ? ' - Only commit when explicitly requested' : ''}
1236
-
1237
- 3. **Leverage Orchestration When Beneficial**:
1238
- - For complex tasks requiring persistent state, use the memory bank
1239
- - For multi-part projects, use task coordination features
1240
- - For parallelizable work, consider multi-agent approaches
1241
- ${flags.parallel ? ' - Parallel capabilities are enabled for this task' : ''}
1242
- ${flags.research ? ' - Research tools are available if needed' : ''}
1243
- ${flags.noPermissions ? ' - Running with --no-permissions mode' : ''}
1244
- ${flags.verbose ? ' - Verbose mode enabled for detailed output' : ''}
1245
-
1246
- ## Getting Started
1247
-
1248
- Begin working on your task. The orchestration features are available as tools to help you be more effective, but your primary focus should be on delivering the requested functionality.
1249
-
1250
- ### Quick Reference (if using orchestration features)
1251
-
1252
- \`\`\`bash
1253
- # Example: Storing project-specific data
1254
- Bash("npx claude-flow memory store project_config '{\\"name\\": \\"my-app\\", \\"version\\": \\"1.0.0\\"}'")
1255
-
1256
- # Example: Checking for previous work
1257
- Bash("npx claude-flow memory query previous_implementation")
1258
-
1259
- # Example: Creating subtasks for complex projects
1260
- Bash("npx claude-flow task create frontend 'Build React components'")
1261
- Bash("npx claude-flow task create backend 'Implement API endpoints'")
1262
- \`\`\`
1263
-
1264
- Remember: These are optional tools. Use them when they add value to your development process.
1265
-
1266
- ## Development Mode: ${flags.mode || 'full'}
1267
- ${flags.mode === 'backend-only' ? `Focus on server-side implementation, APIs, and business logic.` : ''}
1268
- ${flags.mode === 'frontend-only' ? `Focus on client-side implementation, UI/UX, and user interactions.` : ''}
1269
- ${flags.mode === 'api-only' ? `Focus on API design, documentation, and endpoint implementation.` : ''}
1270
- ${flags.mode === 'full' || !flags.mode ? `Full-stack development covering all aspects of the application.` : ''}
1271
-
1272
- `;
1273
- const claudeArgs = [enhancedTask];
1274
- claudeArgs.push('--allowedTools', tools);
1275
- // DEBUG: Log what we're about to pass
1276
- console.log('\n🔍 DEBUG - Command Construction:');
1277
- console.log(`First arg length: ${claudeArgs[0].length} chars`);
1278
- console.log(`First 100 chars: ${claudeArgs[0].substring(0, 100)}...`);
1279
- console.log(`Args count: ${claudeArgs.length}`);
1280
- if (flags.noPermissions) {
1281
- claudeArgs.push('--dangerously-skip-permissions');
1282
- }
1283
- if (flags.config) {
1284
- claudeArgs.push('--mcp-config', flags.config);
1285
- }
1286
- if (flags.verbose) {
1287
- claudeArgs.push('--verbose');
1288
- }
1289
- // Execute the actual claude command
1290
- try {
1291
- // Debug: Log the actual command being executed
1292
- if (flags.verbose) {
1293
- console.log('Debug - Executing command:');
1294
- console.log(`claude ${claudeArgs.map(arg => arg.includes(' ') || arg.includes('\n') ? `"${arg}"` : arg).join(' ')}`);
1295
- }
1296
- const command = new Deno.Command('claude', {
1297
- args: claudeArgs,
1298
- env: {
1299
- ...Deno.env.toObject(),
1300
- CLAUDE_INSTANCE_ID: instanceId,
1301
- CLAUDE_FLOW_MODE: flags.mode || 'full',
1302
- CLAUDE_FLOW_COVERAGE: (flags.coverage || 80).toString(),
1303
- CLAUDE_FLOW_COMMIT: flags.commit || 'phase',
1304
- // Add claude-flow specific features
1305
- CLAUDE_FLOW_MEMORY_ENABLED: 'true',
1306
- CLAUDE_FLOW_MEMORY_NAMESPACE: 'default',
1307
- CLAUDE_FLOW_COORDINATION_ENABLED: flags.parallel ? 'true' : 'false',
1308
- CLAUDE_FLOW_FEATURES: 'memory,coordination,swarm',
1309
- },
1310
- stdin: 'inherit',
1311
- stdout: 'inherit',
1312
- stderr: 'inherit',
1313
- });
1314
- const child = command.spawn();
1315
- const status = await child.status;
1316
- if (status.success) {
1317
- printSuccess(`Claude instance ${instanceId} completed successfully`);
1318
- }
1319
- else {
1320
- printError(`Claude instance ${instanceId} exited with code ${status.code}`);
1321
- }
1322
- }
1323
- catch (err) {
1324
- printError(`Failed to spawn Claude: ${err.message}`);
1325
- console.log('Make sure you have the Claude CLI installed.');
1326
- }
1327
- }
1328
- break;
1329
- case 'batch':
1330
- const workflowFile = subArgs[1];
1331
- if (!workflowFile) {
1332
- printError('Usage: claude batch <workflow-file>');
1333
- break;
1334
- }
1335
- printSuccess(`Loading workflow: ${workflowFile}`);
1336
- console.log('📋 Batch execution would process workflow file');
1337
- break;
1338
- default:
1339
- console.log('Claude commands: spawn, batch');
1340
- console.log('\nExamples:');
1341
- console.log(' claude-flow claude spawn "implement user authentication" --research --parallel');
1342
- console.log(' claude-flow claude spawn "fix bug in payment system" --no-permissions');
1343
- console.log(' claude-flow claude batch workflow.json --dry-run');
1344
- }
1345
- break;
1346
- case 'deploy':
1347
- const deployCmd = subArgs[0];
1348
- switch (deployCmd) {
1349
- case 'ha-cluster':
1350
- const nodes = subArgs.find(arg => arg.includes('--nodes'));
1351
- const regions = subArgs.find(arg => arg.includes('--regions'));
1352
- const replicationFactor = subArgs.find(arg => arg.includes('--replication-factor'));
1353
- printSuccess('Deploying High Availability Cluster...');
1354
- console.log('🏗️ HA Configuration:');
1355
- console.log(` Nodes: ${nodes ? nodes.split('=')[1] : '3'}`);
1356
- console.log(` Regions: ${regions ? regions.split('=')[1] : 'us-east-1,us-west-2,eu-west-1'}`);
1357
- console.log(` Replication Factor: ${replicationFactor ? replicationFactor.split('=')[1] : '2'}`);
1358
- console.log(' Load Balancer: nginx');
1359
- console.log(' Health Checks: comprehensive');
1360
- console.log('\n🚀 Deployment Progress:');
1361
- console.log(' ✓ Provisioning nodes in us-east-1');
1362
- console.log(' ✓ Provisioning nodes in us-west-2');
1363
- console.log(' ✓ Provisioning nodes in eu-west-1');
1364
- console.log(' ✓ Configuring load balancer');
1365
- console.log(' ✓ Setting up health checks');
1366
- console.log(' ✓ Establishing replication');
1367
- console.log('\n✅ HA cluster deployed successfully!');
1368
- console.log(' Cluster endpoint: https://claude-flow-ha.example.com');
1369
- break;
1370
- case 'scaling':
1371
- const scalingAction = subArgs[1];
1372
- if (scalingAction === 'configure') {
1373
- printSuccess('Configuring Auto-Scaling...');
1374
- console.log('📈 Scaling Configuration:');
1375
- console.log(' Min Instances: 2');
1376
- console.log(' Max Instances: 50');
1377
- console.log(' Scale Up Threshold: CPU:70%, Memory:80%');
1378
- console.log(' Scale Down Threshold: CPU:30%, Memory:40%');
1379
- console.log(' Cool-down Periods: Up:300s, Down:600s');
1380
- console.log('\n✅ Auto-scaling configured');
1381
- }
1382
- else if (scalingAction === 'predictive') {
1383
- printSuccess('Enabling Predictive Scaling...');
1384
- console.log('🔮 Predictive Configuration:');
1385
- console.log(' Forecast Horizon: 1 hour');
1386
- console.log(' Learning Period: 7 days');
1387
- console.log(' Confidence Threshold: 0.8');
1388
- console.log(' ML Model: LSTM-based forecasting');
1389
- console.log('\n✅ Predictive scaling enabled');
1390
- }
1391
- else {
1392
- console.log('Scaling commands: configure, predictive, status');
1393
- }
1394
- break;
1395
- case 'security':
1396
- const securityAction = subArgs[1];
1397
- if (securityAction === 'harden') {
1398
- printSuccess('Applying Security Hardening...');
1399
- console.log('🔒 Security Configuration:');
1400
- console.log(' Profile: enterprise');
1401
- console.log(' Encryption: all-traffic, at-rest');
1402
- console.log(' Authentication: multi-factor');
1403
- console.log(' Authorization: RBAC');
1404
- console.log(' Audit Logging: comprehensive');
1405
- console.log(' Compliance: SOC2, GDPR, HIPAA');
1406
- console.log('\n🛡️ Applying security measures:');
1407
- console.log(' ✓ Enabling encryption at rest');
1408
- console.log(' ✓ Configuring TLS 1.3 minimum');
1409
- console.log(' ✓ Setting up MFA requirements');
1410
- console.log(' ✓ Implementing RBAC policies');
1411
- console.log(' ✓ Enabling audit logging');
1412
- console.log(' ✓ Applying compliance controls');
1413
- console.log('\n✅ Security hardening complete');
1414
- }
1415
- else if (securityAction === 'monitor') {
1416
- printSuccess('Security Monitoring Active');
1417
- console.log('🔍 Real-time Security Status:');
1418
- console.log(' Threat Level: Low');
1419
- console.log(' Active Sessions: 42');
1420
- console.log(' Failed Auth Attempts: 3 (last 24h)');
1421
- console.log(' Anomalies Detected: 0');
1422
- console.log(' Compliance Status: ✅ Compliant');
1423
- }
1424
- else {
1425
- console.log('Security commands: harden, policy, rbac, monitor');
1426
- }
1427
- break;
1428
- case 'kubernetes':
1429
- case 'k8s':
1430
- printSuccess('Deploying to Kubernetes...');
1431
- console.log('☸️ Kubernetes Deployment:');
1432
- console.log(' Namespace: claude-flow');
1433
- console.log(' Replicas: 3');
1434
- console.log(' Image: claude-flow/orchestrator:latest');
1435
- console.log(' Service Type: LoadBalancer');
1436
- console.log('\n📦 Creating resources:');
1437
- console.log(' ✓ Created namespace/claude-flow');
1438
- console.log(' ✓ Created deployment/claude-flow-orchestrator');
1439
- console.log(' ✓ Created service/claude-flow-orchestrator-service');
1440
- console.log(' ✓ Created configmap/claude-flow-config');
1441
- console.log(' ✓ Created secret/claude-flow-secrets');
1442
- console.log('\n✅ Kubernetes deployment complete');
1443
- console.log(' Service endpoint: http://a1b2c3d4.elb.amazonaws.com');
1444
- break;
1445
- default:
1446
- console.log('Deploy commands:');
1447
- console.log(' ha-cluster - Deploy high availability cluster');
1448
- console.log(' scaling - Configure auto-scaling');
1449
- console.log(' security - Security hardening and monitoring');
1450
- console.log(' kubernetes - Deploy to Kubernetes cluster');
1451
- console.log('\nExamples:');
1452
- console.log(' deploy ha-cluster --nodes=3 --regions="us-east-1,us-west-2"');
1453
- console.log(' deploy scaling configure --min=2 --max=50');
1454
- console.log(' deploy security harden --profile enterprise');
1455
- }
1456
- break;
1457
- case 'analytics':
1458
- const analyticsCmd = subArgs[0];
1459
- switch (analyticsCmd) {
1460
- case 'performance':
1461
- printSuccess('Performance Analytics Report');
1462
- console.log('\n📊 System Performance (Last 30 Days):');
1463
- console.log(' Agent Productivity:');
1464
- console.log(' • Tasks Completed: 12,847');
1465
- console.log(' • Average Task Time: 3.4 minutes');
1466
- console.log(' • Success Rate: 94.2%');
1467
- console.log(' Resource Efficiency:');
1468
- console.log(' • CPU Utilization: 67% average');
1469
- console.log(' • Memory Usage: 2.8GB average');
1470
- console.log(' • Cost per Task: $0.024');
1471
- console.log(' Trends:');
1472
- console.log(' • Performance: ↑ 12% improvement');
1473
- console.log(' • Efficiency: ↑ 8% improvement');
1474
- console.log(' • Costs: ↓ 15% reduction');
1475
- break;
1476
- case 'business-impact':
1477
- printSuccess('Business Impact Analysis');
1478
- console.log('\n💼 Business Metrics:');
1479
- console.log(' Productivity Gains:');
1480
- console.log(' • Development Velocity: +45%');
1481
- console.log(' • Time to Market: -30%');
1482
- console.log(' • Defect Rate: -62%');
1483
- console.log(' Cost Savings:');
1484
- console.log(' • Monthly Savings: $24,500');
1485
- console.log(' • ROI: 312%');
1486
- console.log(' • Payback Period: 3.2 months');
1487
- console.log(' Quality Improvements:');
1488
- console.log(' • Code Coverage: 92%');
1489
- console.log(' • Customer Satisfaction: +18%');
1490
- break;
1491
- case 'cost':
1492
- const costCmd = subArgs[1];
1493
- if (costCmd === 'analyze') {
1494
- printSuccess('Cost Analysis Report');
1495
- console.log('\n💰 Cost Breakdown:');
1496
- console.log(' By Project:');
1497
- console.log(' • microservices-platform: $8,234 (41%)');
1498
- console.log(' • ai-research: $5,123 (26%)');
1499
- console.log(' • frontend-apps: $3,456 (17%)');
1500
- console.log(' • other: $3,187 (16%)');
1501
- console.log(' By Resource:');
1502
- console.log(' • Compute: $12,450 (62%)');
1503
- console.log(' • Storage: $4,230 (21%)');
1504
- console.log(' • Network: $2,120 (11%)');
1505
- console.log(' • Other: $1,200 (6%)');
1506
- console.log(' Optimization Opportunities:');
1507
- console.log(' • Use spot instances: Save $3,200/month');
1508
- console.log(' • Optimize storage: Save $800/month');
1509
- console.log(' • Schedule off-peak: Save $1,500/month');
1510
- }
1511
- else {
1512
- console.log('Cost commands: analyze, optimize, budget');
1513
- }
1514
- break;
1515
- default:
1516
- console.log('Analytics commands:');
1517
- console.log(' performance - System performance analytics');
1518
- console.log(' business-impact - Business impact analysis');
1519
- console.log(' cost - Cost analysis and optimization');
1520
- console.log(' capacity - Capacity planning');
1521
- console.log('\nExamples:');
1522
- console.log(' analytics performance --time-range 30d');
1523
- console.log(' analytics cost analyze --granularity project');
1524
- }
1525
- break;
1526
- case 'security':
1527
- const securityCmd = subArgs[0];
1528
- switch (securityCmd) {
1529
- case 'status':
1530
- printSuccess('Enterprise Security Status');
1531
- console.log('\n🔐 Authentication:');
1532
- console.log(' Method: Token-based (JWT)');
1533
- console.log(' MFA: Enabled (TOTP, SMS, Hardware Keys)');
1534
- console.log(' Sessions: 42 active');
1535
- console.log(' Session Timeout: 4 hours');
1536
- console.log('\n🛡️ Authorization:');
1537
- console.log(' Model: Role-Based Access Control (RBAC)');
1538
- console.log(' Roles: 5 defined (admin, developer, operator, auditor, viewer)');
1539
- console.log(' Permissions: 47 granular permissions');
1540
- console.log(' Policy Engine: Active');
1541
- console.log('\n🚦 Rate Limiting:');
1542
- console.log(' Global Limit: 1000 req/min');
1543
- console.log(' Per-User Limit: 100 req/min');
1544
- console.log(' Burst Capacity: 200 requests');
1545
- console.log(' Current Usage: 245 req/min (24.5%)');
1546
- console.log('\n⚡ Circuit Breakers:');
1547
- console.log(' Total Breakers: 12');
1548
- console.log(' Status: 10 closed, 1 half-open, 1 open');
1549
- console.log(' Last Triggered: api-gateway (2 minutes ago)');
1550
- console.log('\n📝 Audit Logging:');
1551
- console.log(' Status: Active');
1552
- console.log(' Storage: Encrypted S3 bucket');
1553
- console.log(' Retention: 7 years');
1554
- console.log(' Events Today: 48,234');
1555
- console.log(' Compliance: SOC2, GDPR, HIPAA compliant');
1556
- break;
1557
- case 'auth':
1558
- const authAction = subArgs[1];
1559
- if (authAction === 'configure') {
1560
- printSuccess('Configuring Authentication...');
1561
- console.log('🔐 Authentication Configuration:');
1562
- console.log(' Method: JWT with RS256');
1563
- console.log(' Token Expiry: 4 hours');
1564
- console.log(' Refresh Token: 30 days');
1565
- console.log(' MFA Required: Yes');
1566
- console.log(' Password Policy:');
1567
- console.log(' • Minimum length: 12 characters');
1568
- console.log(' • Complexity: Upper, lower, numbers, symbols');
1569
- console.log(' • History: Last 12 passwords');
1570
- console.log(' • Expiry: 90 days');
1571
- console.log('\n✅ Authentication configured');
1572
- }
1573
- else if (authAction === 'sessions') {
1574
- printSuccess('Active Sessions:');
1575
- console.log('\n🔑 Current Sessions:');
1576
- console.log('┌─────────────────┬──────────┬──────────────┬─────────────┬───────────┐');
1577
- console.log('│ User │ Role │ IP Address │ Login Time │ MFA │');
1578
- console.log('├─────────────────┼──────────┼──────────────┼─────────────┼───────────┤');
1579
- console.log('│ alice@corp.com │ admin │ 10.0.1.45 │ 2h ago │ Hardware │');
1580
- console.log('│ bob@corp.com │ developer│ 10.0.2.123 │ 45m ago │ TOTP │');
1581
- console.log('│ charlie@corp.com│ operator │ 10.0.1.200 │ 1h ago │ SMS │');
1582
- console.log('└─────────────────┴──────────┴──────────────┴─────────────┴───────────┘');
1583
- }
1584
- else if (authAction === 'mfa') {
1585
- printSuccess('Multi-Factor Authentication Status:');
1586
- console.log(' Enforcement: Required for all users');
1587
- console.log(' Methods Available:');
1588
- console.log(' • TOTP (Time-based One-Time Password)');
1589
- console.log(' • SMS (Text message)');
1590
- console.log(' • Hardware Keys (FIDO2/WebAuthn)');
1591
- console.log(' • Backup Codes');
1592
- console.log(' Users with MFA: 98% (147/150)');
1593
- }
1594
- else {
1595
- console.log('Auth commands: configure, sessions, mfa, tokens');
1596
- }
1597
- break;
1598
- case 'rbac':
1599
- const rbacAction = subArgs[1];
1600
- if (rbacAction === 'roles') {
1601
- printSuccess('RBAC Roles:');
1602
- console.log('\n👥 Defined Roles:');
1603
- console.log('\n📛 admin (3 users)');
1604
- console.log(' Permissions: * (all permissions)');
1605
- console.log(' Conditions: MFA required, IP restriction');
1606
- console.log('\n📛 developer (45 users)');
1607
- console.log(' Permissions:');
1608
- console.log(' • projects:read,write');
1609
- console.log(' • agents:spawn,monitor');
1610
- console.log(' • tasks:create,monitor');
1611
- console.log(' Conditions: Time window 06:00-22:00');
1612
- console.log('\n📛 operator (12 users)');
1613
- console.log(' Permissions:');
1614
- console.log(' • system:monitor');
1615
- console.log(' • agents:list,info');
1616
- console.log(' • tasks:list,status');
1617
- console.log('\n📛 auditor (5 users)');
1618
- console.log(' Permissions:');
1619
- console.log(' • audit:read');
1620
- console.log(' • system:logs');
1621
- console.log(' • reports:generate');
1622
- console.log('\n📛 viewer (85 users)');
1623
- console.log(' Permissions:');
1624
- console.log(' • *:read (read-only access)');
1625
- }
1626
- else if (rbacAction === 'assign') {
1627
- const user = subArgs[2];
1628
- const role = subArgs[3];
1629
- if (user && role) {
1630
- printSuccess(`Assigning role ${role} to user ${user}`);
1631
- console.log('✅ Role assignment complete');
1632
- console.log(' Effective immediately');
1633
- console.log(' Audit log entry created');
1634
- }
1635
- else {
1636
- printError('Usage: security rbac assign <user> <role>');
1637
- }
1638
- }
1639
- else {
1640
- console.log('RBAC commands: roles, permissions, assign, revoke');
1641
- }
1642
- break;
1643
- case 'rate-limit':
1644
- const rateLimitAction = subArgs[1];
1645
- if (rateLimitAction === 'status') {
1646
- printSuccess('Rate Limiting Status:');
1647
- console.log('\n📊 Current Limits:');
1648
- console.log(' Global:');
1649
- console.log(' • Limit: 1000 requests/minute');
1650
- console.log(' • Current: 245 requests/minute (24.5%)');
1651
- console.log(' • Available: 755 requests');
1652
- console.log(' Per-User:');
1653
- console.log(' • Default: 100 requests/minute');
1654
- console.log(' • Premium: 500 requests/minute');
1655
- console.log(' Per-Endpoint:');
1656
- console.log(' • /api/agents/spawn: 10/minute');
1657
- console.log(' • /api/tasks/create: 50/minute');
1658
- console.log(' • /api/memory/query: 200/minute');
1659
- console.log('\n🚨 Recent Violations:');
1660
- console.log(' • user123: 2 violations (15 min ago)');
1661
- console.log(' • api-client-7: 1 violation (1 hour ago)');
1662
- }
1663
- else if (rateLimitAction === 'configure') {
1664
- printSuccess('Configuring Rate Limits...');
1665
- console.log(' Global limit: 1000 req/min');
1666
- console.log(' Burst capacity: 200 requests');
1667
- console.log(' Cooldown period: 60 seconds');
1668
- console.log(' Headers: X-RateLimit-* enabled');
1669
- console.log('\n✅ Rate limiting configured');
1670
- }
1671
- else {
1672
- console.log('Rate limit commands: status, configure, reset');
1673
- }
1674
- break;
1675
- case 'circuit-breaker':
1676
- const cbAction = subArgs[1];
1677
- if (cbAction === 'status') {
1678
- printSuccess('Circuit Breaker Status:');
1679
- console.log('\n⚡ Active Circuit Breakers:');
1680
- console.log('┌──────────────────┬─────────┬──────────┬───────────┬─────────────┐');
1681
- console.log('│ Service │ State │ Failures │ Successes │ Last Change │');
1682
- console.log('├──────────────────┼─────────┼──────────┼───────────┼─────────────┤');
1683
- console.log('│ api-gateway │ OPEN │ 15 │ 0 │ 2m ago │');
1684
- console.log('│ auth-service │ CLOSED │ 0 │ 1,234 │ 1h ago │');
1685
- console.log('│ memory-service │ CLOSED │ 1 │ 5,678 │ 3h ago │');
1686
- console.log('│ agent-manager │ HALF │ 3 │ 45 │ 5m ago │');
1687
- console.log('└──────────────────┴─────────┴──────────┴───────────┴─────────────┘');
1688
- console.log('\n📈 Configuration:');
1689
- console.log(' Failure Threshold: 10 failures');
1690
- console.log(' Success Threshold: 5 successes');
1691
- console.log(' Timeout: 60 seconds');
1692
- console.log(' Half-Open Requests: 3 max');
1693
- }
1694
- else if (cbAction === 'reset') {
1695
- const service = subArgs[2];
1696
- if (service) {
1697
- printSuccess(`Resetting circuit breaker: ${service}`);
1698
- console.log('✅ Circuit breaker reset to CLOSED state');
1699
- }
1700
- else {
1701
- console.log('All circuit breakers reset');
1702
- }
1703
- }
1704
- else {
1705
- console.log('Circuit breaker commands: status, reset, configure');
1706
- }
1707
- break;
1708
- case 'audit':
1709
- const auditAction = subArgs[1];
1710
- if (auditAction === 'status') {
1711
- printSuccess('Audit Logging Status:');
1712
- console.log(' Status: Active');
1713
- console.log(' Storage Backend: AWS S3 (encrypted)');
1714
- console.log(' Retention Period: 7 years');
1715
- console.log(' Compliance: SOC2, GDPR, HIPAA');
1716
- console.log('\n📊 Statistics (Last 24h):');
1717
- console.log(' Total Events: 48,234');
1718
- console.log(' Authentication: 1,234');
1719
- console.log(' Authorization: 15,678');
1720
- console.log(' Data Access: 23,456');
1721
- console.log(' Configuration Changes: 89');
1722
- console.log(' Security Events: 12');
1723
- }
1724
- else if (auditAction === 'search') {
1725
- const query = subArgs.slice(2).join(' ');
1726
- printSuccess(`Searching audit logs: "${query || 'recent'}"`);
1727
- console.log('\n📋 Recent Audit Events:');
1728
- console.log('2024-01-10 14:23:45 | AUTH_SUCCESS | alice@corp.com | Login from 10.0.1.45');
1729
- console.log('2024-01-10 14:24:12 | PERMISSION_GRANTED | alice@corp.com | agents.spawn');
1730
- console.log('2024-01-10 14:24:13 | AGENT_CREATED | alice@corp.com | agent-12345');
1731
- console.log('2024-01-10 14:25:01 | CONFIG_CHANGED | bob@corp.com | terminal.poolSize: 10->20');
1732
- console.log('2024-01-10 14:26:30 | PERMISSION_DENIED | charlie@corp.com | admin.users.delete');
1733
- }
1734
- else if (auditAction === 'export') {
1735
- printSuccess('Exporting audit logs...');
1736
- console.log(' Time range: Last 30 days');
1737
- console.log(' Format: JSON (encrypted)');
1738
- console.log(' Destination: audit-export-20240110.json.enc');
1739
- console.log('\n✅ Export complete: 145,234 events');
1740
- }
1741
- else {
1742
- console.log('Audit commands: status, search, export, configure');
1743
- }
1744
- break;
1745
- case 'compliance':
1746
- printSuccess('Compliance Status:');
1747
- console.log('\n🏛️ Active Compliance Frameworks:');
1748
- console.log('\n✅ SOC2 Type II');
1749
- console.log(' Last Audit: 2023-10-15');
1750
- console.log(' Next Audit: 2024-04-15');
1751
- console.log(' Status: Compliant');
1752
- console.log(' Controls: 89/89 passing');
1753
- console.log('\n✅ GDPR (General Data Protection Regulation)');
1754
- console.log(' Data Protection Officer: Jane Smith');
1755
- console.log(' Privacy Impact Assessments: 12 completed');
1756
- console.log(' Data Subject Requests: 3 pending, 45 completed');
1757
- console.log(' Status: Compliant');
1758
- console.log('\n✅ HIPAA (Health Insurance Portability Act)');
1759
- console.log(' BAA Agreements: 5 active');
1760
- console.log(' PHI Encryption: AES-256 at rest, TLS 1.3 in transit');
1761
- console.log(' Access Controls: Implemented');
1762
- console.log(' Status: Compliant');
1763
- console.log('\n📋 Required Actions:');
1764
- console.log(' • Complete Q1 security training (Due: Jan 31)');
1765
- console.log(' • Update data retention policies (Due: Feb 15)');
1766
- break;
1767
- case 'test':
1768
- printSuccess('Running Security Test Suite...');
1769
- console.log('\n🧪 Security Tests:');
1770
- console.log(' ✅ Authentication: Token validation working');
1771
- console.log(' ✅ Authorization: RBAC policies enforced');
1772
- console.log(' ✅ Rate Limiting: Limits properly enforced');
1773
- console.log(' ✅ Circuit Breakers: Failing services isolated');
1774
- console.log(' ✅ Audit Logging: All events captured');
1775
- console.log(' ✅ Encryption: TLS 1.3 verified');
1776
- console.log(' ✅ Session Management: Timeouts working');
1777
- console.log(' ⚠️ MFA Bypass: 3 users without MFA');
1778
- console.log('\n📊 Security Score: 94/100');
1779
- console.log(' Recommendations:');
1780
- console.log(' • Enforce MFA for all users');
1781
- console.log(' • Update TLS certificates (expire in 45 days)');
1782
- console.log(' • Review inactive user accounts');
1783
- break;
1784
- default:
1785
- console.log('Security commands:');
1786
- console.log(' status - Show security status overview');
1787
- console.log(' auth - Authentication management');
1788
- console.log(' rbac - Role-based access control');
1789
- console.log(' rate-limit - Rate limiting configuration');
1790
- console.log(' circuit-breaker - Circuit breaker management');
1791
- console.log(' audit - Audit log management');
1792
- console.log(' compliance - Compliance status');
1793
- console.log(' test - Run security tests');
1794
- console.log('\nExamples:');
1795
- console.log(' security auth configure');
1796
- console.log(' security rbac assign user@example.com developer');
1797
- console.log(' security audit search "failed login"');
1798
- console.log(' security circuit-breaker reset api-gateway');
1799
- }
1800
- break;
1801
- case 'backup':
1802
- const backupCmd = subArgs[0];
1803
- switch (backupCmd) {
1804
- case 'configure':
1805
- printSuccess('Configuring Backup Strategy...');
1806
- console.log('🗄️ Backup Configuration:');
1807
- console.log(' Strategy: 3-2-1 (3 copies, 2 media, 1 offsite)');
1808
- console.log(' Locations:');
1809
- console.log(' • Primary: AWS S3 (us-east-1)');
1810
- console.log(' • Secondary: Azure Blob (eastus)');
1811
- console.log(' • Tertiary: Local NAS');
1812
- console.log(' Schedule:');
1813
- console.log(' • Full: Weekly (Sunday 2 AM)');
1814
- console.log(' • Incremental: Every 6 hours');
1815
- console.log(' • Differential: Daily (2 AM)');
1816
- console.log(' Encryption: AES-256');
1817
- console.log(' Compression: LZ4');
1818
- console.log(' Verification: Automatic');
1819
- console.log('\n✅ Backup strategy configured');
1820
- break;
1821
- case 'dr':
1822
- const drAction = subArgs[1];
1823
- if (drAction === 'configure') {
1824
- printSuccess('Configuring Disaster Recovery...');
1825
- console.log('🚨 DR Configuration:');
1826
- console.log(' RPO (Recovery Point Objective): 1 hour');
1827
- console.log(' RTO (Recovery Time Objective): 15 minutes');
1828
- console.log(' Replication: Real-time to secondary region');
1829
- console.log(' Failover: Automatic with manual override');
1830
- console.log(' Testing: Monthly DR drills');
1831
- console.log('\n✅ Disaster recovery configured');
1832
- }
1833
- else if (drAction === 'test') {
1834
- printSuccess('Running DR Test...');
1835
- console.log('🧪 DR Test Progress:');
1836
- console.log(' ✓ Initiating failover simulation');
1837
- console.log(' ✓ Switching to DR site');
1838
- console.log(' ✓ Verifying data integrity');
1839
- console.log(' ✓ Testing application functionality');
1840
- console.log(' ✓ Measuring RTO: 12 minutes');
1841
- console.log(' ✓ Failing back to primary');
1842
- console.log('\n✅ DR test completed successfully');
1843
- }
1844
- else {
1845
- console.log('DR commands: configure, test, status');
1846
- }
1847
- break;
1848
- case 'restore':
1849
- const restorePoint = subArgs[1];
1850
- if (!restorePoint) {
1851
- printError('Usage: backup restore <backup-id|timestamp>');
1852
- break;
1853
- }
1854
- printSuccess(`Restoring from backup: ${restorePoint}`);
1855
- console.log('🔄 Restore Progress:');
1856
- console.log(' ✓ Located backup in S3');
1857
- console.log(' ✓ Verifying backup integrity');
1858
- console.log(' ✓ Downloading backup data');
1859
- console.log(' ✓ Decrypting backup');
1860
- console.log(' ✓ Restoring application data');
1861
- console.log(' ✓ Restoring configuration');
1862
- console.log(' ✓ Verifying restored data');
1863
- console.log('\n✅ Restore completed successfully');
1864
- break;
1865
- default:
1866
- console.log('Backup commands:');
1867
- console.log(' configure - Configure backup strategy');
1868
- console.log(' dr - Disaster recovery management');
1869
- console.log(' restore - Restore from backup');
1870
- console.log(' list - List available backups');
1871
- console.log('\nExamples:');
1872
- console.log(' backup configure --strategy 3-2-1');
1873
- console.log(' backup dr test');
1874
- console.log(' backup restore "backup-20240110-023000"');
1875
- }
1876
- break;
1877
- default:
1878
- printError(`Unknown command: ${command}`);
1879
- console.log('Run "claude-flow help" for available commands');
1880
- // Suggest similar commands
1881
- const commonCommands = ['agent', 'task', 'spawn', 'init', 'start', 'status', 'memory', 'sparc', 'help'];
1882
- const suggestions = commonCommands.filter(cmd => cmd.startsWith(command.toLowerCase()) ||
1883
- cmd.includes(command.toLowerCase()));
1884
- if (suggestions.length > 0) {
1885
- console.log('\nDid you mean:');
1886
- suggestions.forEach(cmd => console.log(` claude-flow ${cmd}`));
1887
- }
1888
- process.exit(1);
1889
- }
1890
- }
1891
- // REPL Implementation
1892
- async function startRepl() {
1893
- console.log('🧠 Claude-Flow Interactive Shell v' + VERSION);
1894
- console.log('Type "help" for available commands, "exit" to quit\n');
1895
- const replState = {
1896
- history: [],
1897
- historyIndex: -1,
1898
- currentSession: null,
1899
- context: {
1900
- agents: [],
1901
- tasks: [],
1902
- terminals: [],
1903
- memory: {}
1904
- }
1905
- };
1906
- // REPL command handlers
1907
- const replCommands = {
1908
- help: () => {
1909
- console.log(`
1910
- 📚 Available REPL Commands:
1911
-
1912
- System:
1913
- status - Show system status
1914
- config [key] - Show configuration (or specific key)
1915
- clear - Clear the screen
1916
- history - Show command history
1917
- exit/quit - Exit REPL mode
1918
-
1919
- Agents:
1920
- agent spawn <type> [name] - Spawn new agent
1921
- agent list - List active agents
1922
- agent info <id> - Show agent details
1923
- agent terminate <id> - Terminate agent
1924
-
1925
- Tasks:
1926
- task create <type> <desc> - Create new task
1927
- task list - List active tasks
1928
- task assign <task> <agent> - Assign task to agent
1929
- task status <id> - Show task status
1930
-
1931
- Memory:
1932
- memory store <key> <value> - Store data in memory
1933
- memory get <key> - Retrieve data from memory
1934
- memory list - List all memory keys
1935
- memory clear - Clear all memory
1936
-
1937
- Terminal:
1938
- terminal create [name] - Create terminal session
1939
- terminal list - List terminals
1940
- terminal exec <cmd> - Execute command
1941
- terminal attach <id> - Attach to terminal
1942
-
1943
- Shortcuts:
1944
- !<command> - Execute shell command
1945
- /<search> - Search command history
1946
- ↑/↓ - Navigate command history
1947
- `);
1948
- },
1949
- status: () => {
1950
- console.log('🟢 Claude-Flow Status:');
1951
- console.log(` Agents: ${replState.context.agents.length} active`);
1952
- console.log(` Tasks: ${replState.context.tasks.length} in queue`);
1953
- console.log(` Terminals: ${replState.context.terminals.length} active`);
1954
- console.log(` Memory Keys: ${Object.keys(replState.context.memory).length}`);
1955
- },
1956
- clear: () => {
1957
- console.clear();
1958
- console.log('🧠 Claude-Flow Interactive Shell v' + VERSION);
1959
- },
1960
- history: () => {
1961
- console.log('📜 Command History:');
1962
- replState.history.forEach((cmd, i) => {
1963
- console.log(` ${i + 1}: ${cmd}`);
1964
- });
1965
- },
1966
- config: async (key) => {
1967
- try {
1968
- const config = JSON.parse(await fs.readFile('claude-flow.config.json'));
1969
- if (key) {
1970
- const keys = key.split('.');
1971
- let value = config;
1972
- for (const k of keys) {
1973
- value = value[k];
1974
- }
1975
- console.log(`${key}: ${JSON.stringify(value, null, 2)}`);
1976
- }
1977
- else {
1978
- console.log(JSON.stringify(config, null, 2));
1979
- }
1980
- }
1981
- catch {
1982
- console.log('No configuration file found. Using defaults.');
1983
- }
1984
- }
1985
- };
1986
- // Process REPL commands
1987
- async function processReplCommand(input) {
1988
- const trimmed = input.trim();
1989
- if (!trimmed)
1990
- return true;
1991
- // Add to history
1992
- replState.history.push(trimmed);
1993
- replState.historyIndex = replState.history.length;
1994
- // Handle special commands
1995
- if (trimmed === 'exit' || trimmed === 'quit') {
1996
- console.log('👋 Exiting Claude-Flow REPL...');
1997
- return false;
1998
- }
1999
- // Handle shell commands
2000
- if (trimmed.startsWith('!')) {
2001
- const shellCmd = trimmed.substring(1);
2002
- try {
2003
- const command = new Deno.Command('sh', {
2004
- args: ['-c', shellCmd],
2005
- stdout: 'piped',
2006
- stderr: 'piped'
2007
- });
2008
- const { stdout, stderr } = await command.output();
2009
- if (stdout.length > 0) {
2010
- console.log(new TextDecoder().decode(stdout));
2011
- }
2012
- if (stderr.length > 0) {
2013
- console.error(new TextDecoder().decode(stderr));
2014
- }
2015
- }
2016
- catch (err) {
2017
- console.error(`Shell error: ${err.message}`);
2018
- }
2019
- return true;
2020
- }
2021
- // Handle search
2022
- if (trimmed.startsWith('/')) {
2023
- const search = trimmed.substring(1);
2024
- const matches = replState.history.filter(cmd => cmd.includes(search));
2025
- if (matches.length > 0) {
2026
- console.log('🔍 Search results:');
2027
- matches.forEach(cmd => console.log(` ${cmd}`));
2028
- }
2029
- else {
2030
- console.log('No matches found');
2031
- }
2032
- return true;
2033
- }
2034
- // Parse command and arguments
2035
- const parts = trimmed.split(' ');
2036
- const command = parts[0];
2037
- const args = parts.slice(1);
2038
- // Handle built-in REPL commands
2039
- if (replCommands[command]) {
2040
- await replCommands[command](...args);
2041
- return true;
2042
- }
2043
- // Handle multi-word commands
2044
- if (command === 'agent') {
2045
- await handleAgentCommand(args, replState);
2046
- }
2047
- else if (command === 'task') {
2048
- await handleTaskCommand(args, replState);
2049
- }
2050
- else if (command === 'memory') {
2051
- await handleMemoryCommand(args, replState);
2052
- }
2053
- else if (command === 'terminal') {
2054
- await handleTerminalCommand(args, replState);
2055
- }
2056
- else {
2057
- console.log(`Unknown command: ${command}. Type "help" for available commands.`);
2058
- }
2059
- return true;
2060
- }
2061
- // Agent command handler
2062
- async function handleAgentCommand(args, state) {
2063
- const subCmd = args[0];
2064
- switch (subCmd) {
2065
- case 'spawn':
2066
- const type = args[1] || 'researcher';
2067
- const name = args[2] || `agent-${Date.now()}`;
2068
- const agent = {
2069
- id: `agent-${Date.now()}`,
2070
- type,
2071
- name,
2072
- status: 'active',
2073
- created: new Date().toISOString()
2074
- };
2075
- state.context.agents.push(agent);
2076
- printSuccess(`Spawned ${type} agent: ${name} (${agent.id})`);
2077
- break;
2078
- case 'list':
2079
- if (state.context.agents.length === 0) {
2080
- console.log('No active agents');
2081
- }
2082
- else {
2083
- console.log('Active agents:');
2084
- state.context.agents.forEach((agent) => {
2085
- console.log(` ${agent.id} - ${agent.name} (${agent.type}) - ${agent.status}`);
2086
- });
2087
- }
2088
- break;
2089
- case 'info':
2090
- const agentId = args[1];
2091
- const foundAgent = state.context.agents.find((a) => a.id === agentId || a.name === agentId);
2092
- if (foundAgent) {
2093
- console.log(`Agent: ${foundAgent.name}`);
2094
- console.log(` ID: ${foundAgent.id}`);
2095
- console.log(` Type: ${foundAgent.type}`);
2096
- console.log(` Status: ${foundAgent.status}`);
2097
- console.log(` Created: ${foundAgent.created}`);
2098
- }
2099
- else {
2100
- printError(`Agent not found: ${agentId}`);
2101
- }
2102
- break;
2103
- case 'terminate':
2104
- const termId = args[1];
2105
- const index = state.context.agents.findIndex((a) => a.id === termId || a.name === termId);
2106
- if (index >= 0) {
2107
- const removed = state.context.agents.splice(index, 1)[0];
2108
- printSuccess(`Terminated agent: ${removed.name}`);
2109
- }
2110
- else {
2111
- printError(`Agent not found: ${termId}`);
2112
- }
2113
- break;
2114
- default:
2115
- console.log('Agent commands: spawn, list, info, terminate');
2116
- }
2117
- }
2118
- // Task command handler
2119
- async function handleTaskCommand(args, state) {
2120
- const subCmd = args[0];
2121
- switch (subCmd) {
2122
- case 'create':
2123
- const type = args[1] || 'general';
2124
- const description = args.slice(2).join(' ') || 'No description';
2125
- const task = {
2126
- id: `task-${Date.now()}`,
2127
- type,
2128
- description,
2129
- status: 'pending',
2130
- created: new Date().toISOString()
2131
- };
2132
- state.context.tasks.push(task);
2133
- printSuccess(`Created task: ${task.id}`);
2134
- console.log(` Type: ${type}`);
2135
- console.log(` Description: ${description}`);
2136
- break;
2137
- case 'list':
2138
- if (state.context.tasks.length === 0) {
2139
- console.log('No active tasks');
2140
- }
2141
- else {
2142
- console.log('Active tasks:');
2143
- state.context.tasks.forEach((task) => {
2144
- console.log(` ${task.id} - ${task.type} - ${task.status}`);
2145
- console.log(` ${task.description}`);
2146
- });
2147
- }
2148
- break;
2149
- case 'assign':
2150
- const taskId = args[1];
2151
- const assignAgentId = args[2];
2152
- const foundTask = state.context.tasks.find((t) => t.id === taskId);
2153
- const assignAgent = state.context.agents.find((a) => a.id === assignAgentId || a.name === assignAgentId);
2154
- if (foundTask && assignAgent) {
2155
- foundTask.assignedTo = assignAgent.id;
2156
- foundTask.status = 'assigned';
2157
- printSuccess(`Assigned task ${taskId} to agent ${assignAgent.name}`);
2158
- }
2159
- else {
2160
- printError('Task or agent not found');
2161
- }
2162
- break;
2163
- case 'status':
2164
- const statusId = args[1];
2165
- const statusTask = state.context.tasks.find((t) => t.id === statusId);
2166
- if (statusTask) {
2167
- console.log(`Task: ${statusTask.id}`);
2168
- console.log(` Type: ${statusTask.type}`);
2169
- console.log(` Status: ${statusTask.status}`);
2170
- console.log(` Description: ${statusTask.description}`);
2171
- if (statusTask.assignedTo) {
2172
- console.log(` Assigned to: ${statusTask.assignedTo}`);
2173
- }
2174
- console.log(` Created: ${statusTask.created}`);
2175
- }
2176
- else {
2177
- printError(`Task not found: ${statusId}`);
2178
- }
2179
- break;
2180
- default:
2181
- console.log('Task commands: create, list, assign, status');
2182
- }
2183
- }
2184
- // Memory command handler
2185
- async function handleMemoryCommand(args, state) {
2186
- const subCmd = args[0];
2187
- switch (subCmd) {
2188
- case 'store':
2189
- const key = args[1];
2190
- const value = args.slice(2).join(' ');
2191
- if (key && value) {
2192
- state.context.memory[key] = value;
2193
- printSuccess(`Stored: ${key} = ${value}`);
2194
- }
2195
- else {
2196
- printError('Usage: memory store <key> <value>');
2197
- }
2198
- break;
2199
- case 'get':
2200
- const getKey = args[1];
2201
- if (getKey && state.context.memory[getKey]) {
2202
- console.log(`${getKey}: ${state.context.memory[getKey]}`);
2203
- }
2204
- else {
2205
- console.log(`Key not found: ${getKey}`);
2206
- }
2207
- break;
2208
- case 'list':
2209
- const keys = Object.keys(state.context.memory);
2210
- if (keys.length === 0) {
2211
- console.log('No data in memory');
2212
- }
2213
- else {
2214
- console.log('Memory keys:');
2215
- keys.forEach(key => {
2216
- console.log(` ${key}: ${state.context.memory[key]}`);
2217
- });
2218
- }
2219
- break;
2220
- case 'clear':
2221
- state.context.memory = {};
2222
- printSuccess('Memory cleared');
2223
- break;
2224
- default:
2225
- console.log('Memory commands: store, get, list, clear');
2226
- }
2227
- }
2228
- // Terminal command handler
2229
- async function handleTerminalCommand(args, state) {
2230
- const subCmd = args[0];
2231
- switch (subCmd) {
2232
- case 'create':
2233
- const name = args[1] || `term-${Date.now()}`;
2234
- const terminal = {
2235
- id: name,
2236
- status: 'active',
2237
- created: new Date().toISOString()
2238
- };
2239
- state.context.terminals.push(terminal);
2240
- printSuccess(`Created terminal: ${name}`);
2241
- break;
2242
- case 'list':
2243
- if (state.context.terminals.length === 0) {
2244
- console.log('No active terminals');
2245
- }
2246
- else {
2247
- console.log('Active terminals:');
2248
- state.context.terminals.forEach((term) => {
2249
- console.log(` ${term.id} - ${term.status}`);
2250
- });
2251
- }
2252
- break;
2253
- case 'exec':
2254
- const cmd = args.slice(1).join(' ');
2255
- if (cmd) {
2256
- console.log(`Executing: ${cmd}`);
2257
- console.log('(Command execution simulated in REPL)');
2258
- }
2259
- else {
2260
- printError('Usage: terminal exec <command>');
2261
- }
2262
- break;
2263
- case 'attach':
2264
- const attachId = args[1];
2265
- if (attachId) {
2266
- state.currentSession = attachId;
2267
- console.log(`Attached to terminal: ${attachId}`);
2268
- console.log('(Type "terminal detach" to detach)');
2269
- }
2270
- else {
2271
- printError('Usage: terminal attach <id>');
2272
- }
2273
- break;
2274
- case 'detach':
2275
- if (state.currentSession) {
2276
- console.log(`Detached from terminal: ${state.currentSession}`);
2277
- state.currentSession = null;
2278
- }
2279
- else {
2280
- console.log('Not attached to any terminal');
2281
- }
2282
- break;
2283
- default:
2284
- console.log('Terminal commands: create, list, exec, attach, detach');
2285
- }
2286
- }
2287
- // Main REPL loop
2288
- const decoder = new TextDecoder();
2289
- const encoder = new TextEncoder();
2290
- while (true) {
2291
- // Show prompt
2292
- const prompt = replState.currentSession ?
2293
- `claude-flow:${replState.currentSession}> ` :
2294
- 'claude-flow> ';
2295
- await Deno.stdout.write(encoder.encode(prompt));
2296
- // Read input
2297
- const buf = new Uint8Array(1024);
2298
- const n = await Deno.stdin.read(buf);
2299
- if (n === null)
2300
- break;
2301
- const input = decoder.decode(buf.subarray(0, n)).trim();
2302
- // Process command
2303
- const shouldContinue = await processReplCommand(input);
2304
- if (!shouldContinue)
2305
- break;
2306
- }
2307
- }
2308
- // Helper functions for init command
2309
- function createMinimalClaudeMd() {
2310
- return `# Claude Code Integration
2311
-
2312
- This file provides guidance to Claude when working with this codebase.
2313
-
2314
- ## Project Overview
2315
- [Describe your project here]
2316
-
2317
- ## Key Conventions
2318
- - Code style guidelines
2319
- - Naming conventions
2320
- - Architecture patterns
2321
-
2322
- ## Important Notes
2323
- - Special considerations
2324
- - Areas to be careful with
2325
- `;
2326
- }
2327
- function createFullClaudeMd() {
2328
- return `# Claude Code Integration Guide
2329
-
2330
- This document provides comprehensive guidance to Claude when working with this codebase.
2331
-
2332
- ## Project Overview
2333
- [Provide a detailed description of your project, its purpose, and main features]
2334
-
2335
- ## Architecture
2336
- [Describe the overall architecture, main components, and how they interact]
2337
-
2338
- ## Code Conventions
2339
- - **Naming**: [Describe naming conventions for files, functions, variables, etc.]
2340
- - **Style**: [Code formatting preferences, linting rules]
2341
- - **Patterns**: [Design patterns used in the project]
2342
- - **Testing**: [Testing approach and requirements]
2343
-
2344
- ## Directory Structure
2345
- \`\`\`
2346
- project/
2347
- ├── src/ # Source code
2348
- ├── tests/ # Test files
2349
- ├── docs/ # Documentation
2350
- └── ... # Other directories
2351
- \`\`\`
2352
-
2353
- ## Development Workflow
2354
- 1. [Step-by-step development process]
2355
- 2. [How to run tests]
2356
- 3. [How to build/deploy]
2357
-
2358
- ## Important Considerations
2359
- - [Security considerations]
2360
- - [Performance requirements]
2361
- - [Compatibility requirements]
2362
-
2363
- ## Common Tasks
2364
- - **Add a new feature**: [Instructions]
2365
- - **Fix a bug**: [Process]
2366
- - **Update documentation**: [Guidelines]
2367
-
2368
- ## Dependencies
2369
- [List key dependencies and their purposes]
2370
-
2371
- ## Troubleshooting
2372
- [Common issues and solutions]
2373
- `;
2374
- }
2375
- function createMinimalMemoryBankMd() {
2376
- return `# Memory Bank
2377
-
2378
- Session memory and context storage.
2379
-
2380
- ## Current Session
2381
- - Started: ${new Date().toISOString()}
2382
- - Context: [Current work context]
2383
-
2384
- ## Key Information
2385
- - [Important facts to remember]
2386
-
2387
- ## Progress Log
2388
- - [Track progress here]
2389
- `;
2390
- }
2391
- function createFullMemoryBankMd() {
2392
- return `# Memory Bank
2393
-
2394
- This file serves as persistent memory storage for Claude across sessions.
2395
-
2396
- ## Session Information
2397
- - **Current Session**: Started ${new Date().toISOString()}
2398
- - **Project Phase**: [Development/Testing/Production]
2399
- - **Active Tasks**: [List current tasks]
2400
-
2401
- ## Project Context
2402
- ### Technical Stack
2403
- - Languages: [List languages used]
2404
- - Frameworks: [List frameworks]
2405
- - Tools: [Development tools]
2406
-
2407
- ### Architecture Decisions
2408
- - [Record key architectural decisions]
2409
- - [Rationale for technology choices]
2410
-
2411
- ## Important Information
2412
- ### API Keys and Secrets
2413
- - [Never store actual secrets here, just references]
2414
-
2415
- ### External Services
2416
- - [List integrated services]
2417
- - [Configuration requirements]
2418
-
2419
- ### Database Schema
2420
- - [Current schema version]
2421
- - [Recent migrations]
2422
-
2423
- ## Progress Tracking
2424
- ### Completed Tasks
2425
- - [x] [Completed task 1]
2426
- - [x] [Completed task 2]
2427
-
2428
- ### In Progress
2429
- - [ ] [Current task 1]
2430
- - [ ] [Current task 2]
2431
-
2432
- ### Upcoming
2433
- - [ ] [Future task 1]
2434
- - [ ] [Future task 2]
2435
-
2436
- ## Code Patterns
2437
- ### Established Patterns
2438
- \`\`\`javascript
2439
- // Example pattern
2440
- \`\`\`
2441
-
2442
- ### Anti-patterns to Avoid
2443
- - [List anti-patterns]
2444
-
2445
- ## Meeting Notes
2446
- ### [Date]
2447
- - Participants: [Names]
2448
- - Decisions: [Key decisions]
2449
- - Action items: [Tasks assigned]
2450
-
2451
- ## Debugging History
2452
- ### Issue: [Issue name]
2453
- - **Date**: [Date]
2454
- - **Symptoms**: [What was observed]
2455
- - **Root Cause**: [What caused it]
2456
- - **Solution**: [How it was fixed]
2457
-
2458
- ## Performance Metrics
2459
- - [Baseline metrics]
2460
- - [Optimization goals]
2461
-
2462
- ## Documentation Links
2463
- - [API Documentation]: [URL]
2464
- - [Design Documents]: [URL]
2465
- - [Issue Tracker]: [URL]
2466
- `;
2467
- }
2468
- function createMinimalCoordinationMd() {
2469
- return `# Coordination
2470
-
2471
- Task and workflow coordination.
2472
-
2473
- ## Active Tasks
2474
- 1. [Current task]
2475
-
2476
- ## Workflow
2477
- - [ ] Step 1
2478
- - [ ] Step 2
2479
-
2480
- ## Resources
2481
- - [Available resources]
2482
- `;
2483
- }
2484
- function createFullCoordinationMd() {
2485
- return `# Coordination Center
2486
-
2487
- Central coordination for multi-agent collaboration and task management.
2488
-
2489
- ## Active Agents
2490
- | Agent ID | Type | Status | Assigned Tasks | Last Active |
2491
- |----------|------|--------|----------------|-------------|
2492
- | [ID] | [Type] | [Status] | [Tasks] | [Timestamp] |
2493
-
2494
- ## Task Queue
2495
- ### High Priority
2496
- 1. **[Task Name]**
2497
- - Description: [What needs to be done]
2498
- - Assigned to: [Agent ID]
2499
- - Dependencies: [Other tasks]
2500
- - Deadline: [Date/Time]
2501
-
2502
- ### Medium Priority
2503
- 1. [Task details]
2504
-
2505
- ### Low Priority
2506
- 1. [Task details]
2507
-
2508
- ## Workflow Definitions
2509
- ### [Workflow Name]
2510
- \`\`\`yaml
2511
- name: [Workflow Name]
2512
- description: [What this workflow does]
2513
- steps:
2514
- - name: [Step 1]
2515
- agent: [Agent type]
2516
- action: [What to do]
2517
- - name: [Step 2]
2518
- agent: [Agent type]
2519
- action: [What to do]
2520
- depends_on: [Step 1]
2521
- \`\`\`
2522
-
2523
- ## Resource Allocation
2524
- ### Computational Resources
2525
- - CPU: [Usage/Limits]
2526
- - Memory: [Usage/Limits]
2527
- - Storage: [Usage/Limits]
2528
-
2529
- ### External Resources
2530
- - API Rate Limits: [Service: limit]
2531
- - Database Connections: [Current/Max]
2532
-
2533
- ## Communication Channels
2534
- ### Inter-Agent Messages
2535
- - [Agent A → Agent B]: [Message type]
2536
-
2537
- ### External Communications
2538
- - Webhooks: [Configured webhooks]
2539
- - Notifications: [Notification settings]
2540
-
2541
- ## Synchronization Points
2542
- - [Sync Point 1]: [Description]
2543
- - [Sync Point 2]: [Description]
2544
-
2545
- ## Conflict Resolution
2546
- ### Strategy
2547
- - [How conflicts are resolved]
2548
-
2549
- ### Recent Conflicts
2550
- - [Date]: [Conflict description] → [Resolution]
2551
-
2552
- ## Performance Metrics
2553
- ### Task Completion
2554
- - Average time: [Time]
2555
- - Success rate: [Percentage]
2556
-
2557
- ### Agent Efficiency
2558
- - [Agent Type]: [Metrics]
2559
-
2560
- ## Scheduled Maintenance
2561
- - [Date/Time]: [What will be done]
2562
-
2563
- ## Emergency Procedures
2564
- ### System Overload
2565
- 1. [Step 1]
2566
- 2. [Step 2]
2567
-
2568
- ### Agent Failure
2569
- 1. [Recovery procedure]
2570
- `;
2571
- }
2572
- function createAgentsReadme() {
2573
- return `# Agents Directory
2574
-
2575
- This directory stores agent-specific memory and state information.
2576
-
2577
- ## Structure
2578
- Each agent gets its own subdirectory named by agent ID:
2579
- - \`agent-001/\`: First agent's memory
2580
- - \`agent-002/\`: Second agent's memory
2581
- - etc.
2582
-
2583
- ## Files per Agent
2584
- - \`profile.json\`: Agent configuration and capabilities
2585
- - \`memory.md\`: Agent's working memory
2586
- - \`tasks.json\`: Assigned tasks and their status
2587
- - \`metrics.json\`: Performance metrics
2588
-
2589
- ## Usage
2590
- Files in this directory are automatically managed by the Claude-Flow system.
2591
- `;
2592
- }
2593
- function createSessionsReadme() {
2594
- return `# Sessions Directory
2595
-
2596
- This directory stores session-specific information and terminal states.
2597
-
2598
- ## Structure
2599
- Each session gets a unique directory:
2600
- - \`session-[timestamp]/\`: Session data
2601
- - \`metadata.json\`: Session metadata
2602
- - \`terminal.log\`: Terminal output
2603
- - \`commands.history\`: Command history
2604
- - \`state.json\`: Session state snapshot
2605
-
2606
- ## Retention Policy
2607
- Sessions are retained for 30 days by default, then archived or deleted based on configuration.
2608
-
2609
- ## Usage
2610
- The Claude-Flow system automatically manages session files. Do not modify these files manually.
2611
- `;
2612
- }
2613
- // Helper function to create SPARC structure manually
2614
- async function createSparcStructureManually() {
2615
- try {
2616
- // Create .roo directory structure
2617
- const rooDirectories = [
2618
- '.roo',
2619
- '.roo/templates',
2620
- '.roo/workflows',
2621
- '.roo/modes',
2622
- '.roo/configs'
2623
- ];
2624
- for (const dir of rooDirectories) {
2625
- try {
2626
- await Deno.mkdir(dir, { recursive: true });
2627
- console.log(` ✓ Created ${dir}/`);
2628
- }
2629
- catch (err) {
2630
- if (!(err instanceof Deno.errors.AlreadyExists)) {
2631
- throw err;
2632
- }
2633
- }
2634
- }
2635
- // Create .roomodes file (copy from existing if available, or create basic version)
2636
- let roomodesContent;
2637
- try {
2638
- // Check if .roomodes already exists and read it
2639
- roomodesContent = await fs.readFile('.roomodes');
2640
- console.log(' ✓ Using existing .roomodes configuration');
2641
- }
2642
- catch {
2643
- // Create basic .roomodes configuration
2644
- roomodesContent = createBasicRoomodesConfig();
2645
- await fs.writeFile('.roomodes', roomodesContent);
2646
- console.log(' ✓ Created .roomodes configuration');
2647
- }
2648
- // Create basic workflow templates
2649
- const basicWorkflow = createBasicSparcWorkflow();
2650
- await fs.writeFile('.roo/workflows/basic-tdd.json', basicWorkflow);
2651
- console.log(' ✓ Created .roo/workflows/basic-tdd.json');
2652
- // Create README for .roo directory
2653
- const rooReadme = createRooReadme();
2654
- await fs.writeFile('.roo/README.md', rooReadme);
2655
- console.log(' ✓ Created .roo/README.md');
2656
- console.log(' ✅ Basic SPARC structure created successfully');
2657
- }
2658
- catch (err) {
2659
- console.log(` ❌ Failed to create SPARC structure: ${err.message}`);
2660
- }
2661
- }
2662
- function createBasicRoomodesConfig() {
2663
- return JSON.stringify({
2664
- "customModes": [
2665
- {
2666
- "slug": "architect",
2667
- "name": "🏗️ Architect",
2668
- "roleDefinition": "You design scalable, secure, and modular architectures based on functional specs and user needs. You define responsibilities across services, APIs, and components.",
2669
- "customInstructions": "Create architecture mermaid diagrams, data flows, and integration points. Ensure no part of the design includes secrets or hardcoded env values. Emphasize modular boundaries and maintain extensibility.",
2670
- "groups": ["read", "edit"],
2671
- "source": "project"
2672
- },
2673
- {
2674
- "slug": "code",
2675
- "name": "🧠 Auto-Coder",
2676
- "roleDefinition": "You write clean, efficient, modular code based on pseudocode and architecture. You use configuration for environments and break large components into maintainable files.",
2677
- "customInstructions": "Write modular code using clean architecture principles. Never hardcode secrets or environment values. Split code into files < 500 lines. Use config files or environment abstractions. Use \\`new_task\\` for subtasks and finish with \\`attempt_completion\\`.",
2678
- "groups": ["read", "edit", "browser", "mcp", "command"],
2679
- "source": "project"
2680
- },
2681
- {
2682
- "slug": "tdd",
2683
- "name": "🧪 Tester (TDD)",
2684
- "roleDefinition": "You implement Test-Driven Development (TDD, London School), writing tests first and refactoring after minimal implementation passes.",
2685
- "customInstructions": "Write failing tests first. Implement only enough code to pass. Refactor after green. Ensure tests do not hardcode secrets. Keep files < 500 lines.",
2686
- "groups": ["read", "edit", "browser", "mcp", "command"],
2687
- "source": "project"
2688
- },
2689
- {
2690
- "slug": "spec-pseudocode",
2691
- "name": "📋 Specification Writer",
2692
- "roleDefinition": "You capture full project context—functional requirements, edge cases, constraints—and translate that into modular pseudocode with TDD anchors.",
2693
- "customInstructions": "Write pseudocode as a series of md files with phase_number_name.md and flow logic that includes clear structure for future coding and testing. Split complex logic across modules.",
2694
- "groups": ["read", "edit"],
2695
- "source": "project"
2696
- },
2697
- {
2698
- "slug": "integration",
2699
- "name": "🔗 System Integrator",
2700
- "roleDefinition": "You merge the outputs of all modes into a working, tested, production-ready system. You ensure consistency, cohesion, and modularity.",
2701
- "customInstructions": "Verify interface compatibility, shared modules, and env config standards. Split integration logic across domains as needed. Use \\`new_task\\` for preflight testing.",
2702
- "groups": ["read", "edit", "browser", "mcp", "command"],
2703
- "source": "project"
2704
- },
2705
- {
2706
- "slug": "debug",
2707
- "name": "🪲 Debugger",
2708
- "roleDefinition": "You troubleshoot runtime bugs, logic errors, or integration failures by tracing, inspecting, and analyzing behavior.",
2709
- "customInstructions": "Use logs, traces, and stack analysis to isolate bugs. Avoid changing env configuration directly. Keep fixes modular.",
2710
- "groups": ["read", "edit", "browser", "mcp", "command"],
2711
- "source": "project"
2712
- }
2713
- ]
2714
- }, null, 2);
2715
- }
2716
- function createBasicSparcWorkflow() {
2717
- return JSON.stringify({
2718
- "name": "Basic TDD Workflow",
2719
- "description": "A simple SPARC-based TDD workflow for development",
2720
- "sequential": true,
2721
- "steps": [
2722
- {
2723
- "mode": "spec-pseudocode",
2724
- "description": "Create detailed specifications and pseudocode",
2725
- "phase": "specification"
2726
- },
2727
- {
2728
- "mode": "tdd",
2729
- "description": "Write failing tests (Red phase)",
2730
- "phase": "red"
2731
- },
2732
- {
2733
- "mode": "code",
2734
- "description": "Implement minimal code to pass tests (Green phase)",
2735
- "phase": "green"
2736
- },
2737
- {
2738
- "mode": "tdd",
2739
- "description": "Refactor and optimize (Refactor phase)",
2740
- "phase": "refactor"
2741
- },
2742
- {
2743
- "mode": "integration",
2744
- "description": "Integrate and verify complete solution",
2745
- "phase": "integration"
2746
- }
2747
- ]
2748
- }, null, 2);
2749
- }
2750
- function createRooReadme() {
2751
- return `# .roo Directory - SPARC Development Environment
2752
-
2753
- This directory contains the SPARC (Specification, Pseudocode, Architecture, Refinement, Completion) development environment configuration and templates.
2754
-
2755
- ## Directory Structure
2756
-
2757
- \`\`\`
2758
- .roo/
2759
- ├── README.md # This file
2760
- ├── templates/ # Template files for common patterns
2761
- ├── workflows/ # Predefined SPARC workflows
2762
- │ └── basic-tdd.json # Basic TDD workflow
2763
- ├── modes/ # Custom mode definitions (optional)
2764
- └── configs/ # Configuration files
2765
- \`\`\`
2766
-
2767
- ## SPARC Methodology
2768
-
2769
- SPARC is a systematic approach to software development:
2770
-
2771
- 1. **Specification**: Define clear requirements and constraints
2772
- 2. **Pseudocode**: Create detailed logic flows and algorithms
2773
- 3. **Architecture**: Design system structure and components
2774
- 4. **Refinement**: Implement, test, and optimize using TDD
2775
- 5. **Completion**: Integrate, document, and validate
2776
-
2777
- ## Usage with Claude-Flow
2778
-
2779
- Use the claude-flow SPARC commands to leverage this environment:
2780
-
2781
- \`\`\`bash
2782
- # List available modes
2783
- claude-flow sparc modes
2784
-
2785
- # Run specific mode
2786
- claude-flow sparc run code "implement user authentication"
2787
-
2788
- # Execute full TDD workflow
2789
- claude-flow sparc tdd "payment processing system"
2790
-
2791
- # Use custom workflow
2792
- claude-flow sparc workflow .roo/workflows/basic-tdd.json
2793
- \`\`\`
2794
-
2795
- ## Configuration
2796
-
2797
- The main configuration is in \`.roomodes\` at the project root. This directory provides additional templates and workflows to support the SPARC development process.
2798
-
2799
- ## Customization
2800
-
2801
- You can customize this environment by:
2802
- - Adding new workflow templates to \`workflows/\`
2803
- - Creating mode-specific templates in \`templates/\`
2804
- - Adding project-specific configurations in \`configs/\`
2805
-
2806
- For more information, see: https://github.com/ruvnet/claude-code-flow/docs/sparc.md
2807
- `;
2808
- }
2809
- function createSparcClaudeMd() {
2810
- return `# Claude Code Configuration - SPARC Development Environment
2811
-
2812
- ## Project Overview
2813
- This project uses the SPARC (Specification, Pseudocode, Architecture, Refinement, Completion) methodology for systematic Test-Driven Development with AI assistance through Claude-Flow orchestration.
2814
-
2815
- ## SPARC Development Commands
2816
-
2817
- ### Core SPARC Commands
2818
- - \`npx claude-flow sparc modes\`: List all available SPARC development modes
2819
- - \`npx claude-flow sparc run <mode> "<task>"\`: Execute specific SPARC mode for a task
2820
- - \`npx claude-flow sparc tdd "<feature>"\`: Run complete TDD workflow using SPARC methodology
2821
- - \`npx claude-flow sparc info <mode>\`: Get detailed information about a specific mode
2822
-
2823
- ### Standard Build Commands
2824
- - \`npm run build\`: Build the project
2825
- - \`npm run test\`: Run the test suite
2826
- - \`npm run lint\`: Run linter and format checks
2827
- - \`npm run typecheck\`: Run TypeScript type checking
2828
-
2829
- ## SPARC Methodology Workflow
2830
-
2831
- ### 1. Specification Phase
2832
- \`\`\`bash
2833
- # Create detailed specifications and requirements
2834
- npx claude-flow sparc run spec-pseudocode "Define user authentication requirements"
2835
- \`\`\`
2836
- - Define clear functional requirements
2837
- - Document edge cases and constraints
2838
- - Create user stories and acceptance criteria
2839
- - Establish non-functional requirements
2840
-
2841
- ### 2. Pseudocode Phase
2842
- \`\`\`bash
2843
- # Develop algorithmic logic and data flows
2844
- npx claude-flow sparc run spec-pseudocode "Create authentication flow pseudocode"
2845
- \`\`\`
2846
- - Break down complex logic into steps
2847
- - Define data structures and interfaces
2848
- - Plan error handling and edge cases
2849
- - Create modular, testable components
2850
-
2851
- ### 3. Architecture Phase
2852
- \`\`\`bash
2853
- # Design system architecture and component structure
2854
- npx claude-flow sparc run architect "Design authentication service architecture"
2855
- \`\`\`
2856
- - Create system diagrams and component relationships
2857
- - Define API contracts and interfaces
2858
- - Plan database schemas and data flows
2859
- - Establish security and scalability patterns
2860
-
2861
- ### 4. Refinement Phase (TDD Implementation)
2862
- \`\`\`bash
2863
- # Execute Test-Driven Development cycle
2864
- npx claude-flow sparc tdd "implement user authentication system"
2865
- \`\`\`
2866
-
2867
- **TDD Cycle:**
2868
- 1. **Red**: Write failing tests first
2869
- 2. **Green**: Implement minimal code to pass tests
2870
- 3. **Refactor**: Optimize and clean up code
2871
- 4. **Repeat**: Continue until feature is complete
2872
-
2873
- ### 5. Completion Phase
2874
- \`\`\`bash
2875
- # Integration, documentation, and validation
2876
- npx claude-flow sparc run integration "integrate authentication with user management"
2877
- \`\`\`
2878
- - Integrate all components
2879
- - Perform end-to-end testing
2880
- - Create comprehensive documentation
2881
- - Validate against original requirements
2882
-
2883
- ## SPARC Mode Reference
2884
-
2885
- ### Development Modes
2886
- - **\`architect\`**: System design and architecture planning
2887
- - **\`code\`**: Clean, modular code implementation
2888
- - **\`tdd\`**: Test-driven development and testing
2889
- - **\`spec-pseudocode\`**: Requirements and algorithmic planning
2890
- - **\`integration\`**: System integration and coordination
2891
-
2892
- ### Quality Assurance Modes
2893
- - **\`debug\`**: Troubleshooting and bug resolution
2894
- - **\`security-review\`**: Security analysis and vulnerability assessment
2895
- - **\`refinement-optimization-mode\`**: Performance optimization and refactoring
2896
-
2897
- ### Support Modes
2898
- - **\`docs-writer\`**: Documentation creation and maintenance
2899
- - **\`devops\`**: Deployment and infrastructure management
2900
- - **\`mcp\`**: External service integration
2901
-
2902
- ## Code Style and Best Practices
2903
-
2904
- ### SPARC Development Principles
2905
- - **Modular Design**: Keep files under 500 lines, break into logical components
2906
- - **Environment Safety**: Never hardcode secrets or environment-specific values
2907
- - **Test-First**: Always write tests before implementation (Red-Green-Refactor)
2908
- - **Clean Architecture**: Separate concerns, use dependency injection
2909
- - **Documentation**: Maintain clear, up-to-date documentation
2910
-
2911
- ### Coding Standards
2912
- - Use TypeScript for type safety and better tooling
2913
- - Follow consistent naming conventions (camelCase for variables, PascalCase for classes)
2914
- - Implement proper error handling and logging
2915
- - Use async/await for asynchronous operations
2916
- - Prefer composition over inheritance
2917
-
2918
- ### Memory and State Management
2919
- - Use claude-flow memory system for persistent state across sessions
2920
- - Store progress and findings using namespaced keys
2921
- - Query previous work before starting new tasks
2922
- - Export/import memory for backup and sharing
2923
-
2924
- ## SPARC Memory Integration
2925
-
2926
- ### Memory Commands for SPARC Development
2927
- \`\`\`bash
2928
- # Store project specifications
2929
- npx claude-flow memory store spec_auth "User authentication requirements and constraints"
2930
-
2931
- # Store architectural decisions
2932
- npx claude-flow memory store arch_decisions "Database schema and API design choices"
2933
-
2934
- # Store test results and coverage
2935
- npx claude-flow memory store test_coverage "Authentication module: 95% coverage, all tests passing"
2936
-
2937
- # Query previous work
2938
- npx claude-flow memory query auth_implementation
2939
-
2940
- # Export project memory
2941
- npx claude-flow memory export project_backup.json
2942
- \`\`\`
2943
-
2944
- ### Memory Namespaces
2945
- - **\`spec\`**: Requirements and specifications
2946
- - **\`arch\`**: Architecture and design decisions
2947
- - **\`impl\`**: Implementation notes and code patterns
2948
- - **\`test\`**: Test results and coverage reports
2949
- - **\`debug\`**: Bug reports and resolution notes
2950
-
2951
- ## Workflow Examples
2952
-
2953
- ### Feature Development Workflow
2954
- \`\`\`bash
2955
- # 1. Start with specification
2956
- npx claude-flow sparc run spec-pseudocode "User profile management feature"
2957
-
2958
- # 2. Design architecture
2959
- npx claude-flow sparc run architect "Profile service architecture with data validation"
2960
-
2961
- # 3. Implement with TDD
2962
- npx claude-flow sparc tdd "user profile CRUD operations"
2963
-
2964
- # 4. Security review
2965
- npx claude-flow sparc run security-review "profile data access and validation"
2966
-
2967
- # 5. Integration testing
2968
- npx claude-flow sparc run integration "profile service with authentication system"
2969
-
2970
- # 6. Documentation
2971
- npx claude-flow sparc run docs-writer "profile service API documentation"
2972
- \`\`\`
2973
-
2974
- ### Bug Fix Workflow
2975
- \`\`\`bash
2976
- # 1. Debug and analyze
2977
- npx claude-flow sparc run debug "authentication token expiration issue"
2978
-
2979
- # 2. Write regression tests
2980
- npx claude-flow sparc run tdd "token refresh mechanism tests"
2981
-
2982
- # 3. Implement fix
2983
- npx claude-flow sparc run code "fix token refresh in authentication service"
2984
-
2985
- # 4. Security review
2986
- npx claude-flow sparc run security-review "token handling security implications"
2987
- \`\`\`
2988
-
2989
- ## Configuration Files
2990
-
2991
- ### SPARC Configuration
2992
- - **\`.roomodes\`**: SPARC mode definitions and configurations
2993
- - **\`.roo/\`**: Templates, workflows, and mode-specific rules
2994
-
2995
- ### Claude-Flow Configuration
2996
- - **\`memory/\`**: Persistent memory and session data
2997
- - **\`coordination/\`**: Multi-agent coordination settings
2998
-
2999
- ## Git Workflow Integration
3000
-
3001
- ### Commit Strategy with SPARC
3002
- - **Specification commits**: After completing requirements analysis
3003
- - **Architecture commits**: After design phase completion
3004
- - **TDD commits**: After each Red-Green-Refactor cycle
3005
- - **Integration commits**: After successful component integration
3006
- - **Documentation commits**: After completing documentation updates
3007
-
3008
- ### Branch Strategy
3009
- - **\`feature/sparc-<feature-name>\`**: Feature development with SPARC methodology
3010
- - **\`hotfix/sparc-<issue>\`**: Bug fixes using SPARC debugging workflow
3011
- - **\`refactor/sparc-<component>\`**: Refactoring using optimization mode
3012
-
3013
- ## Troubleshooting
3014
-
3015
- ### Common SPARC Issues
3016
- - **Mode not found**: Check \`.roomodes\` file exists and is valid JSON
3017
- - **Memory persistence**: Ensure \`memory/\` directory has write permissions
3018
- - **Tool access**: Verify required tools are available for the selected mode
3019
- - **Namespace conflicts**: Use unique memory namespaces for different features
3020
-
3021
- ### Debug Commands
3022
- \`\`\`bash
3023
- # Check SPARC configuration
3024
- npx claude-flow sparc modes
3025
-
3026
- # Verify memory system
3027
- npx claude-flow memory stats
3028
-
3029
- # Check system status
3030
- npx claude-flow status
3031
-
3032
- # View detailed mode information
3033
- npx claude-flow sparc info <mode-name>
3034
- \`\`\`
3035
-
3036
- ## Project Architecture
3037
-
3038
- This SPARC-enabled project follows a systematic development approach:
3039
- - **Clear separation of concerns** through modular design
3040
- - **Test-driven development** ensuring reliability and maintainability
3041
- - **Iterative refinement** for continuous improvement
3042
- - **Comprehensive documentation** for team collaboration
3043
- - **AI-assisted development** through specialized SPARC modes
3044
-
3045
- ## Important Notes
3046
-
3047
- - Always run tests before committing (\`npm run test\`)
3048
- - Use SPARC memory system to maintain context across sessions
3049
- - Follow the Red-Green-Refactor cycle during TDD phases
3050
- - Document architectural decisions in memory for future reference
3051
- - Regular security reviews for any authentication or data handling code
3052
-
3053
- For more information about SPARC methodology, see: https://github.com/ruvnet/claude-code-flow/docs/sparc.md
3054
- `;
3055
- }
3056
- if (import.meta.main) {
3057
- await main();
3058
- }
3059
- //# sourceMappingURL=simple-cli.js.map