claude-flow-novice 2.0.3 → 2.0.4

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 (272) hide show
  1. package/dist/src/cli/commands/guidance.js +487 -668
  2. package/dist/src/cli/commands/index-validate.js +18 -29
  3. package/dist/src/cli/commands/mcp-troubleshoot.js +230 -282
  4. package/dist/src/cli/commands/neural-goal-init.js +92 -125
  5. package/dist/src/cli/commands/swarm-exec.js +317 -393
  6. package/dist/src/cli/commands/swarm.js +1 -1
  7. package/dist/src/cli/commands/validate-framework.js +983 -1100
  8. package/dist/src/cli/commands/validate.js +144 -223
  9. package/dist/src/cli/simple-commands/__tests__/agent.test.js +265 -277
  10. package/dist/src/cli/simple-commands/__tests__/memory.test.js +6 -7
  11. package/dist/src/cli/simple-commands/__tests__/swarm.test.js +373 -356
  12. package/dist/src/cli/simple-commands/__tests__/task.test.js +6 -7
  13. package/dist/src/cli/simple-commands/agent.js +157 -193
  14. package/dist/src/cli/simple-commands/analysis.js +336 -446
  15. package/dist/src/cli/simple-commands/automation-executor.js +1095 -1339
  16. package/dist/src/cli/simple-commands/automation.js +481 -469
  17. package/dist/src/cli/simple-commands/batch-manager.js +261 -313
  18. package/dist/src/cli/simple-commands/claude-telemetry.js +241 -267
  19. package/dist/src/cli/simple-commands/claude-track.js +68 -90
  20. package/dist/src/cli/simple-commands/concurrent-display.js +266 -320
  21. package/dist/src/cli/simple-commands/config.js +245 -290
  22. package/dist/src/cli/simple-commands/coordination.js +182 -234
  23. package/dist/src/cli/simple-commands/enhanced-ui-views.js +812 -615
  24. package/dist/src/cli/simple-commands/enhanced-webui-complete.js +922 -981
  25. package/dist/src/cli/simple-commands/fix-hook-variables.js +274 -294
  26. package/dist/src/cli/simple-commands/github/gh-coordinator.js +378 -457
  27. package/dist/src/cli/simple-commands/github/github-api.js +535 -574
  28. package/dist/src/cli/simple-commands/github/init.js +276 -303
  29. package/dist/src/cli/simple-commands/github.js +222 -247
  30. package/dist/src/cli/simple-commands/goal.js +51 -63
  31. package/dist/src/cli/simple-commands/hive-mind/auto-save-middleware.js +208 -278
  32. package/dist/src/cli/simple-commands/hive-mind/communication.js +601 -696
  33. package/dist/src/cli/simple-commands/hive-mind/core.js +907 -979
  34. package/dist/src/cli/simple-commands/hive-mind/db-optimizer.js +406 -655
  35. package/dist/src/cli/simple-commands/hive-mind/mcp-wrapper.js +1125 -1245
  36. package/dist/src/cli/simple-commands/hive-mind/memory.js +854 -1090
  37. package/dist/src/cli/simple-commands/hive-mind/performance-optimizer.js +459 -574
  38. package/dist/src/cli/simple-commands/hive-mind/performance-test.js +263 -347
  39. package/dist/src/cli/simple-commands/hive-mind/queen.js +727 -768
  40. package/dist/src/cli/simple-commands/hive-mind/session-manager.js +745 -1049
  41. package/dist/src/cli/simple-commands/hive-mind-optimize.js +227 -283
  42. package/dist/src/cli/simple-commands/hive-mind-wizard.js +174 -217
  43. package/dist/src/cli/simple-commands/hive-mind.js +1842 -2283
  44. package/dist/src/cli/simple-commands/hive.js +90 -79
  45. package/dist/src/cli/simple-commands/hook-safety.js +431 -521
  46. package/dist/src/cli/simple-commands/hooks/session-start-soul.js +203 -254
  47. package/dist/src/cli/simple-commands/hooks.js +1064 -1204
  48. package/dist/src/cli/simple-commands/init/agent-copier.js +294 -319
  49. package/dist/src/cli/simple-commands/init/batch-init.js +496 -562
  50. package/dist/src/cli/simple-commands/init/claude-commands/claude-flow-commands.js +13 -19
  51. package/dist/src/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.js +13 -19
  52. package/dist/src/cli/simple-commands/init/claude-commands/optimized-slash-commands.js +61 -88
  53. package/dist/src/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js +125 -150
  54. package/dist/src/cli/simple-commands/init/claude-commands/slash-commands.js +42 -49
  55. package/dist/src/cli/simple-commands/init/claude-commands/sparc-commands.js +43 -61
  56. package/dist/src/cli/simple-commands/init/copy-revised-templates.js +141 -147
  57. package/dist/src/cli/simple-commands/init/executable-wrapper.js +31 -44
  58. package/dist/src/cli/simple-commands/init/gitignore-updater.js +64 -90
  59. package/dist/src/cli/simple-commands/init/help.js +104 -107
  60. package/dist/src/cli/simple-commands/init/hive-mind-init.js +509 -528
  61. package/dist/src/cli/simple-commands/init/index.js +1510 -1759
  62. package/dist/src/cli/simple-commands/init/performance-monitor.js +234 -317
  63. package/dist/src/cli/simple-commands/init/rollback/backup-manager.js +441 -504
  64. package/dist/src/cli/simple-commands/init/rollback/index.js +289 -364
  65. package/dist/src/cli/simple-commands/init/rollback/recovery-manager.js +652 -728
  66. package/dist/src/cli/simple-commands/init/rollback/rollback-executor.js +416 -481
  67. package/dist/src/cli/simple-commands/init/rollback/state-tracker.js +369 -448
  68. package/dist/src/cli/simple-commands/init/sparc/roo-readme.js +1 -2
  69. package/dist/src/cli/simple-commands/init/sparc/roomodes-config.js +122 -99
  70. package/dist/src/cli/simple-commands/init/sparc/workflows.js +32 -37
  71. package/dist/src/cli/simple-commands/init/sparc-structure.js +55 -62
  72. package/dist/src/cli/simple-commands/init/template-copier.js +421 -533
  73. package/dist/src/cli/simple-commands/init/templates/coordination-md.js +3 -6
  74. package/dist/src/cli/simple-commands/init/templates/enhanced-templates.js +344 -318
  75. package/dist/src/cli/simple-commands/init/templates/github-safe-enhanced.js +173 -218
  76. package/dist/src/cli/simple-commands/init/templates/github-safe.js +65 -75
  77. package/dist/src/cli/simple-commands/init/templates/memory-bank-md.js +3 -6
  78. package/dist/src/cli/simple-commands/init/templates/readme-files.js +2 -4
  79. package/dist/src/cli/simple-commands/init/templates/safe-hook-patterns.js +187 -230
  80. package/dist/src/cli/simple-commands/init/templates/sparc-modes.js +53 -80
  81. package/dist/src/cli/simple-commands/init/templates/verification-claude-md.js +101 -85
  82. package/dist/src/cli/simple-commands/init/validation/config-validator.js +283 -330
  83. package/dist/src/cli/simple-commands/init/validation/health-checker.js +495 -561
  84. package/dist/src/cli/simple-commands/init/validation/index.js +302 -358
  85. package/dist/src/cli/simple-commands/init/validation/mode-validator.js +308 -359
  86. package/dist/src/cli/simple-commands/init/validation/post-init-validator.js +389 -366
  87. package/dist/src/cli/simple-commands/init/validation/pre-init-validator.js +270 -268
  88. package/dist/src/cli/simple-commands/init/validation/test-runner.js +427 -447
  89. package/dist/src/cli/simple-commands/init.js +1 -2
  90. package/dist/src/cli/simple-commands/mcp-health.js +131 -158
  91. package/dist/src/cli/simple-commands/mcp-integration-layer.js +533 -634
  92. package/dist/src/cli/simple-commands/mcp.js +345 -400
  93. package/dist/src/cli/simple-commands/memory-consolidation.js +426 -537
  94. package/dist/src/cli/simple-commands/memory.js +247 -311
  95. package/dist/src/cli/simple-commands/migrate-hooks.js +39 -46
  96. package/dist/src/cli/simple-commands/monitor.js +294 -363
  97. package/dist/src/cli/simple-commands/neural.js +51 -65
  98. package/dist/src/cli/simple-commands/pair-autofix-only.js +538 -662
  99. package/dist/src/cli/simple-commands/pair-basic.js +528 -656
  100. package/dist/src/cli/simple-commands/pair-old.js +430 -543
  101. package/dist/src/cli/simple-commands/pair-working.js +615 -751
  102. package/dist/src/cli/simple-commands/pair.js +615 -751
  103. package/dist/src/cli/simple-commands/performance-hooks.js +83 -111
  104. package/dist/src/cli/simple-commands/performance-metrics.js +348 -433
  105. package/dist/src/cli/simple-commands/process-ui-enhanced.js +708 -787
  106. package/dist/src/cli/simple-commands/process-ui.js +230 -254
  107. package/dist/src/cli/simple-commands/realtime-update-system.js +525 -611
  108. package/dist/src/cli/simple-commands/sparc/architecture.js +1704 -1530
  109. package/dist/src/cli/simple-commands/sparc/commands.js +438 -516
  110. package/dist/src/cli/simple-commands/sparc/completion.js +1224 -1481
  111. package/dist/src/cli/simple-commands/sparc/coordinator.js +913 -978
  112. package/dist/src/cli/simple-commands/sparc/index.js +241 -298
  113. package/dist/src/cli/simple-commands/sparc/phase-base.js +314 -390
  114. package/dist/src/cli/simple-commands/sparc/pseudocode.js +965 -869
  115. package/dist/src/cli/simple-commands/sparc/refinement.js +980 -1273
  116. package/dist/src/cli/simple-commands/sparc/specification.js +559 -645
  117. package/dist/src/cli/simple-commands/sparc-modes/architect.js +1 -1
  118. package/dist/src/cli/simple-commands/sparc-modes/ask.js +1 -1
  119. package/dist/src/cli/simple-commands/sparc-modes/code.js +1 -1
  120. package/dist/src/cli/simple-commands/sparc-modes/debug.js +1 -1
  121. package/dist/src/cli/simple-commands/sparc-modes/devops.js +1 -1
  122. package/dist/src/cli/simple-commands/sparc-modes/docs-writer.js +1 -1
  123. package/dist/src/cli/simple-commands/sparc-modes/generic.js +1 -1
  124. package/dist/src/cli/simple-commands/sparc-modes/index.js +47 -55
  125. package/dist/src/cli/simple-commands/sparc-modes/integration.js +1 -1
  126. package/dist/src/cli/simple-commands/sparc-modes/mcp.js +1 -1
  127. package/dist/src/cli/simple-commands/sparc-modes/monitoring.js +1 -1
  128. package/dist/src/cli/simple-commands/sparc-modes/optimization.js +1 -1
  129. package/dist/src/cli/simple-commands/sparc-modes/security-review.js +1 -1
  130. package/dist/src/cli/simple-commands/sparc-modes/sparc-orchestrator.js +1 -1
  131. package/dist/src/cli/simple-commands/sparc-modes/spec-pseudocode.js +1 -1
  132. package/dist/src/cli/simple-commands/sparc-modes/supabase-admin.js +1 -1
  133. package/dist/src/cli/simple-commands/sparc-modes/swarm.js +101 -87
  134. package/dist/src/cli/simple-commands/sparc-modes/tdd.js +1 -1
  135. package/dist/src/cli/simple-commands/sparc-modes/tutorial.js +1 -1
  136. package/dist/src/cli/simple-commands/sparc.js +465 -493
  137. package/dist/src/cli/simple-commands/start-ui.js +108 -132
  138. package/dist/src/cli/simple-commands/start-wrapper.js +240 -268
  139. package/dist/src/cli/simple-commands/start.js +1 -1
  140. package/dist/src/cli/simple-commands/status.js +254 -275
  141. package/dist/src/cli/simple-commands/stream-chain-clean.js +128 -171
  142. package/dist/src/cli/simple-commands/stream-chain-fixed.js +61 -82
  143. package/dist/src/cli/simple-commands/stream-chain-real.js +267 -331
  144. package/dist/src/cli/simple-commands/stream-chain-working.js +211 -263
  145. package/dist/src/cli/simple-commands/stream-chain.js +260 -318
  146. package/dist/src/cli/simple-commands/stream-processor.js +290 -315
  147. package/dist/src/cli/simple-commands/swarm-executor.js +189 -222
  148. package/dist/src/cli/simple-commands/swarm-metrics-integration.js +208 -300
  149. package/dist/src/cli/simple-commands/swarm-ui.js +623 -703
  150. package/dist/src/cli/simple-commands/swarm-webui-integration.js +258 -286
  151. package/dist/src/cli/simple-commands/swarm.js +887 -1082
  152. package/dist/src/cli/simple-commands/task.js +161 -206
  153. package/dist/src/cli/simple-commands/timestamp-fix.js +59 -89
  154. package/dist/src/cli/simple-commands/token-tracker.js +258 -316
  155. package/dist/src/cli/simple-commands/tool-execution-framework.js +433 -519
  156. package/dist/src/cli/simple-commands/train-and-stream.js +275 -331
  157. package/dist/src/cli/simple-commands/training-pipeline.js +619 -725
  158. package/dist/src/cli/simple-commands/training.js +170 -227
  159. package/dist/src/cli/simple-commands/verification-hooks.js +261 -284
  160. package/dist/src/cli/simple-commands/verification-integration.js +389 -417
  161. package/dist/src/cli/simple-commands/verification-training-integration.js +486 -606
  162. package/dist/src/cli/simple-commands/verification.js +493 -513
  163. package/dist/src/cli/simple-commands/web-server.js +766 -836
  164. package/dist/src/cli/simple-commands/webui-validator.js +106 -124
  165. package/dist/src/coordination/event-bus/demo-wasm-integration.js +212 -251
  166. package/dist/src/coordination/event-bus/qe-event-bus.js +608 -748
  167. package/dist/src/coordination/event-bus/qe-event-bus.test.js +379 -454
  168. package/dist/src/coordination/iteration-tracker.js +363 -454
  169. package/dist/src/enterprise/analytics-manager.js +1135 -0
  170. package/dist/src/enterprise/audit-manager.js +1115 -0
  171. package/dist/src/enterprise/cloud-manager.js +891 -0
  172. package/dist/src/enterprise/deployment-manager.js +966 -0
  173. package/dist/src/enterprise/index.js +6 -0
  174. package/dist/src/enterprise/project-manager.js +584 -0
  175. package/dist/src/enterprise/security-manager.js +991 -0
  176. package/dist/src/index.js +1 -1
  177. package/dist/src/mcp/DEPRECATED.js +46 -60
  178. package/dist/src/mcp/fixes/mcp-error-fixes.js +115 -134
  179. package/dist/src/mcp/implementations/agent-tracker.js +114 -128
  180. package/dist/src/mcp/implementations/daa-tools.js +292 -350
  181. package/dist/src/mcp/implementations/workflow-tools.js +329 -361
  182. package/dist/src/mcp/mcp-config-manager.js +1183 -1331
  183. package/dist/src/mcp/mcp-server-novice-simplified.js +11 -17
  184. package/dist/src/mcp/mcp-server-novice.js +11 -17
  185. package/dist/src/mcp/mcp-server-sdk.js +11 -17
  186. package/dist/src/mcp/mcp-server.js +1620 -1484
  187. package/dist/src/mcp/ruv-swarm-wrapper.js +209 -239
  188. package/dist/src/memory/advanced-serializer.js +609 -589
  189. package/dist/src/memory/enhanced-examples.js +220 -305
  190. package/dist/src/memory/enhanced-memory.js +295 -336
  191. package/dist/src/memory/enhanced-session-serializer.js +408 -492
  192. package/dist/src/memory/fallback-memory-system.js +900 -1021
  193. package/dist/src/memory/fallback-store.js +93 -131
  194. package/dist/src/memory/high-performance-serialization.js +592 -730
  195. package/dist/src/memory/in-memory-store.js +161 -213
  196. package/dist/src/memory/index.js +123 -157
  197. package/dist/src/memory/lock-free-structures.js +578 -764
  198. package/dist/src/memory/memory-mapped-persistence.js +585 -766
  199. package/dist/src/memory/memory-pressure-manager.js +569 -707
  200. package/dist/src/memory/migration.js +358 -445
  201. package/dist/src/memory/shared-memory.js +641 -768
  202. package/dist/src/memory/sqlite-store.js +245 -325
  203. package/dist/src/memory/sqlite-wrapper.js +122 -151
  204. package/dist/src/memory/swarm-memory.js +470 -603
  205. package/dist/src/memory/test-example.js +126 -134
  206. package/dist/src/memory/ultra-fast-memory-store.js +622 -821
  207. package/dist/src/memory/unified-memory-manager.js +356 -437
  208. package/dist/src/migration/index.js +92 -0
  209. package/dist/src/migration/logger.js +121 -0
  210. package/dist/src/migration/migration-analyzer.js +268 -0
  211. package/dist/src/migration/migration-runner.js +522 -0
  212. package/dist/src/migration/migration-validator.js +285 -0
  213. package/dist/src/migration/progress-reporter.js +150 -0
  214. package/dist/src/migration/rollback-manager.js +321 -0
  215. package/dist/src/migration/tests/migration-system.test.js +7 -0
  216. package/dist/src/migration/types.js +3 -0
  217. package/dist/src/swarm/CodeRefactoringSwarm.js +777 -952
  218. package/dist/src/swarm/__tests__/integration.test.js +227 -0
  219. package/dist/src/swarm/__tests__/prompt-copier.test.js +344 -0
  220. package/dist/src/swarm/advanced-orchestrator.js +1095 -0
  221. package/dist/src/swarm/claude-code-interface.js +961 -0
  222. package/dist/src/swarm/claude-flow-executor.js +229 -0
  223. package/dist/src/swarm/consensus-coordinator.js +475 -0
  224. package/dist/src/swarm/coordinator.js +2993 -0
  225. package/dist/src/swarm/direct-executor.js +1180 -0
  226. package/dist/src/swarm/error-recovery/advanced-error-detection.js +691 -0
  227. package/dist/src/swarm/error-recovery/automated-recovery-workflows.js +998 -0
  228. package/dist/src/swarm/error-recovery/error-recovery-coordinator.js +1197 -0
  229. package/dist/src/swarm/error-recovery/recovery-monitoring.js +772 -0
  230. package/dist/src/swarm/error-recovery/resilience-architecture.js +714 -0
  231. package/dist/src/swarm/error-recovery/self-healing-mechanisms.js +1319 -0
  232. package/dist/src/swarm/error-recovery/test-error-recovery-effectiveness.js +808 -0
  233. package/dist/src/swarm/executor-v2.js +322 -0
  234. package/dist/src/swarm/executor.js +815 -0
  235. package/dist/src/swarm/hive-mind-integration.js +703 -0
  236. package/dist/src/swarm/index.js +41 -0
  237. package/dist/src/swarm/json-output-aggregator.js +267 -0
  238. package/dist/src/swarm/large-scale-coordinator.js +542 -0
  239. package/dist/src/swarm/mcp-integration-wrapper.js +628 -0
  240. package/dist/src/swarm/memory.js +1117 -0
  241. package/dist/src/swarm/optimizations/__tests__/optimization.test.js +348 -0
  242. package/dist/src/swarm/optimizations/async-file-manager.js +285 -0
  243. package/dist/src/swarm/optimizations/circular-buffer.js +162 -0
  244. package/dist/src/swarm/optimizations/connection-pool.js +244 -0
  245. package/dist/src/swarm/optimizations/index.js +28 -0
  246. package/dist/src/swarm/optimizations/optimized-executor.js +320 -0
  247. package/dist/src/swarm/optimizations/ttl-map.js +234 -0
  248. package/dist/src/swarm/prompt-cli.js +200 -0
  249. package/dist/src/swarm/prompt-copier-enhanced.js +202 -0
  250. package/dist/src/swarm/prompt-copier.js +381 -0
  251. package/dist/src/swarm/prompt-manager.js +295 -0
  252. package/dist/src/swarm/prompt-utils.js +310 -0
  253. package/dist/src/swarm/result-aggregator.js +718 -0
  254. package/dist/src/swarm/sparc-executor.js +1568 -0
  255. package/dist/src/swarm/strategies/auto.js +758 -0
  256. package/dist/src/swarm/strategies/base.js +128 -0
  257. package/dist/src/swarm/strategies/research.js +914 -0
  258. package/dist/src/swarm/strategies/strategy-metrics-patch.js +2 -0
  259. package/dist/src/swarm/types.js +52 -0
  260. package/dist/src/swarm/workers/copy-worker.js +56 -0
  261. package/dist/src/utils/__tests__/github-cli-safety-wrapper.test.js +332 -400
  262. package/dist/src/utils/github-cli-safe.js +56 -64
  263. package/dist/src/utils/github-cli-safety-wrapper.js +451 -546
  264. package/dist/src/utils/npx-isolated-cache.js +104 -119
  265. package/dist/src/utils/preference-manager.js +622 -652
  266. package/dist/src/utils/timezone-utils.js +86 -105
  267. package/dist/src/validators/epic-config-schema.js +214 -0
  268. package/dist/src/validators/index.js +10 -0
  269. package/dist/src/validators/swarm-init-validator.js +259 -0
  270. package/dist/src/validators/todowrite-batching-validator.js +215 -0
  271. package/dist/src/validators/todowrite-integration.js +187 -0
  272. package/package.json +2 -2
@@ -1,70 +1,60 @@
1
1
  // enhanced-templates.js - Generate Claude Flow v2.0.0 enhanced templates
2
- import { readFileSync } from 'fs';
3
- import { dirname, join } from 'path';
4
- import { fileURLToPath } from 'url';
5
-
2
+ import { readFileSync } from "fs";
3
+ import { dirname, join } from "path";
4
+ import { fileURLToPath } from "url";
6
5
  const __dirname = dirname(fileURLToPath(import.meta.url));
7
-
8
6
  // Load template files
9
- const loadTemplate = (filename) => {
10
- try {
11
- return readFileSync(join(__dirname, filename), 'utf8');
12
- } catch (error) {
13
- // Silently fall back to hardcoded templates if files not found
14
- // This handles npm packaging scenarios where template files may not be included
15
- return null;
16
- }
7
+ const loadTemplate = (filename)=>{
8
+ try {
9
+ return readFileSync(join(__dirname, filename), 'utf8');
10
+ } catch (error) {
11
+ // Silently fall back to hardcoded templates if files not found
12
+ // This handles npm packaging scenarios where template files may not be included
13
+ return null;
14
+ }
17
15
  };
18
-
19
16
  export function createEnhancedClaudeMd() {
20
- const template = loadTemplate('CLAUDE.md');
21
- if (!template) {
22
- throw new Error('CLAUDE.md template file not found! Templates must be included in build.');
23
- }
24
- return template;
17
+ const template = loadTemplate('CLAUDE.md');
18
+ if (!template) {
19
+ throw new Error('CLAUDE.md template file not found! Templates must be included in build.');
20
+ }
21
+ return template;
25
22
  }
26
-
27
23
  export function createEnhancedSettingsJson() {
28
- const template = loadTemplate('settings.json');
29
- if (!template) {
30
- return createEnhancedSettingsJsonFallback();
31
- }
32
- return template;
24
+ const template = loadTemplate('settings.json');
25
+ if (!template) {
26
+ return createEnhancedSettingsJsonFallback();
27
+ }
28
+ return template;
33
29
  }
34
-
35
30
  export function createWrapperScript(type = 'unix') {
36
- // For unix, use the universal wrapper that works in both CommonJS and ES modules
37
- if (type === 'unix') {
38
- const universalTemplate = loadTemplate('claude-flow-universal');
39
- if (universalTemplate) {
40
- return universalTemplate;
31
+ // For unix, use the universal wrapper that works in both CommonJS and ES modules
32
+ if (type === 'unix') {
33
+ const universalTemplate = loadTemplate('claude-flow-universal');
34
+ if (universalTemplate) {
35
+ return universalTemplate;
36
+ }
41
37
  }
42
- }
43
-
44
- const filename =
45
- type === 'unix' ? 'claude-flow' : type === 'windows' ? 'claude-flow.bat' : 'claude-flow.ps1';
46
-
47
- const template = loadTemplate(filename);
48
- if (!template) {
49
- return createWrapperScriptFallback(type);
50
- }
51
- return template;
38
+ const filename = type === 'unix' ? 'claude-flow' : type === 'windows' ? 'claude-flow.bat' : 'claude-flow.ps1';
39
+ const template = loadTemplate(filename);
40
+ if (!template) {
41
+ return createWrapperScriptFallback(type);
42
+ }
43
+ return template;
52
44
  }
53
-
54
45
  export function createCommandDoc(category, command) {
55
- const template = loadTemplate(`commands/${category}/${command}.md`);
56
- if (!template) {
57
- // Silently fall back to generated documentation
58
- return createCommandDocFallback(category, command);
59
- }
60
- return template;
46
+ const template = loadTemplate(`commands/${category}/${command}.md`);
47
+ if (!template) {
48
+ // Silently fall back to generated documentation
49
+ return createCommandDocFallback(category, command);
50
+ }
51
+ return template;
61
52
  }
62
-
63
53
  // Generate command documentation fallbacks
64
54
  function createCommandDocFallback(category, command) {
65
- const docs = {
66
- analysis: {
67
- 'bottleneck-detect': `# bottleneck-detect
55
+ const docs = {
56
+ analysis: {
57
+ 'bottleneck-detect': `# bottleneck-detect
68
58
 
69
59
  Automatically detect performance bottlenecks in your swarm operations.
70
60
 
@@ -90,7 +80,7 @@ npx claude-flow-novice analysis bottleneck-detect --threshold 500
90
80
  npx claude-flow-novice analysis bottleneck-detect --export bottlenecks.json
91
81
  \`\`\`
92
82
  `,
93
- 'token-usage': `# token-usage
83
+ 'token-usage': `# token-usage
94
84
 
95
85
  Analyze token usage patterns and optimize for efficiency.
96
86
 
@@ -116,7 +106,7 @@ npx claude-flow-novice analysis token-usage --by-agent
116
106
  npx claude-flow-novice analysis token-usage --period 7d --export tokens.csv
117
107
  \`\`\`
118
108
  `,
119
- 'performance-report': `# performance-report
109
+ 'performance-report': `# performance-report
120
110
 
121
111
  Generate comprehensive performance reports for swarm operations.
122
112
 
@@ -141,10 +131,10 @@ npx claude-flow-novice analysis performance-report --compare swarm-123
141
131
  # Full metrics report
142
132
  npx claude-flow-novice analysis performance-report --include-metrics --format markdown
143
133
  \`\`\`
144
- `,
145
- },
146
- automation: {
147
- 'auto-agent': `# auto-agent
134
+ `
135
+ },
136
+ automation: {
137
+ 'auto-agent': `# auto-agent
148
138
 
149
139
  Automatically assign agents based on task analysis.
150
140
 
@@ -170,7 +160,7 @@ npx claude-flow-novice automation auto-agent --task "Fix bugs" --max-agents 3
170
160
  npx claude-flow-novice automation auto-agent --strategy specialized
171
161
  \`\`\`
172
162
  `,
173
- 'smart-spawn': `# smart-spawn
163
+ 'smart-spawn': `# smart-spawn
174
164
 
175
165
  Intelligently spawn agents based on workload analysis.
176
166
 
@@ -196,7 +186,7 @@ npx claude-flow-novice automation smart-spawn --threshold 5
196
186
  npx claude-flow-novice automation smart-spawn --topology hierarchical
197
187
  \`\`\`
198
188
  `,
199
- 'workflow-select': `# workflow-select
189
+ 'workflow-select': `# workflow-select
200
190
 
201
191
  Automatically select optimal workflow based on task type.
202
192
 
@@ -221,10 +211,10 @@ npx claude-flow-novice automation workflow-select --constraints "no-downtime,rol
221
211
  # Preview mode
222
212
  npx claude-flow-novice automation workflow-select --task "Database migration" --preview
223
213
  \`\`\`
224
- `,
225
- },
226
- coordination: {
227
- 'swarm-init': `# swarm-init
214
+ `
215
+ },
216
+ coordination: {
217
+ 'swarm-init': `# swarm-init
228
218
 
229
219
  Initialize a new agent swarm with specified topology.
230
220
 
@@ -250,7 +240,7 @@ npx claude-flow-novice swarm init --topology mesh --max-agents 8
250
240
  npx claude-flow-novice swarm init --strategy parallel
251
241
  \`\`\`
252
242
  `,
253
- 'agent-spawn': `# agent-spawn
243
+ 'agent-spawn': `# agent-spawn
254
244
 
255
245
  Spawn a new agent in the current swarm.
256
246
 
@@ -276,7 +266,7 @@ npx claude-flow-novice agent spawn --type researcher --name "API Expert"
276
266
  npx claude-flow-novice agent spawn --type coder --skills "python,fastapi,testing"
277
267
  \`\`\`
278
268
  `,
279
- 'task-orchestrate': `# task-orchestrate
269
+ 'task-orchestrate': `# task-orchestrate
280
270
 
281
271
  Orchestrate complex tasks across the swarm.
282
272
 
@@ -301,10 +291,10 @@ npx claude-flow-novice task orchestrate --task "Fix production bug" --priority c
301
291
  # With specific strategy
302
292
  npx claude-flow-novice task orchestrate --task "Refactor codebase" --strategy parallel
303
293
  \`\`\`
304
- `,
305
- },
306
- github: {
307
- 'github-swarm': `# github-swarm
294
+ `
295
+ },
296
+ github: {
297
+ 'github-swarm': `# github-swarm
308
298
 
309
299
  Create a specialized swarm for GitHub repository management.
310
300
 
@@ -330,7 +320,7 @@ npx claude-flow-novice github swarm --repository myorg/myrepo --focus security
330
320
  npx claude-flow-novice github swarm --repository myorg/myrepo --agents 6
331
321
  \`\`\`
332
322
  `,
333
- 'repo-analyze': `# repo-analyze
323
+ 'repo-analyze': `# repo-analyze
334
324
 
335
325
  Deep analysis of GitHub repository with AI insights.
336
326
 
@@ -356,7 +346,7 @@ npx claude-flow-novice github repo-analyze --repository myorg/myrepo --deep
356
346
  npx claude-flow-novice github repo-analyze --repository myorg/myrepo --include issues,prs
357
347
  \`\`\`
358
348
  `,
359
- 'pr-enhance': `# pr-enhance
349
+ 'pr-enhance': `# pr-enhance
360
350
 
361
351
  AI-powered pull request enhancements.
362
352
 
@@ -383,7 +373,7 @@ npx claude-flow-novice github pr-enhance --pr-number 123 --add-tests
383
373
  npx claude-flow-novice github pr-enhance --pr-number 123 --add-tests --improve-docs
384
374
  \`\`\`
385
375
  `,
386
- 'issue-triage': `# issue-triage
376
+ 'issue-triage': `# issue-triage
387
377
 
388
378
  Intelligent issue classification and triage.
389
379
 
@@ -409,7 +399,7 @@ npx claude-flow-novice github issue-triage --repository myorg/myrepo --auto-labe
409
399
  npx claude-flow-novice github issue-triage --repository myorg/myrepo --auto-label --assign
410
400
  \`\`\`
411
401
  `,
412
- 'code-review': `# code-review
402
+ 'code-review': `# code-review
413
403
 
414
404
  Automated code review with swarm intelligence.
415
405
 
@@ -434,10 +424,10 @@ npx claude-flow-novice github code-review --pr-number 456 --focus security
434
424
  # With fix suggestions
435
425
  npx claude-flow-novice github code-review --pr-number 456 --suggest-fixes
436
426
  \`\`\`
437
- `,
438
- },
439
- hooks: {
440
- 'pre-task': `# pre-task
427
+ `
428
+ },
429
+ hooks: {
430
+ 'pre-task': `# pre-task
441
431
 
442
432
  Hook executed before task execution.
443
433
 
@@ -463,7 +453,7 @@ npx claude-flow-novice hook pre-task --description "Complex refactoring" --auto-
463
453
  npx claude-flow-novice hook pre-task --description "Continue feature" --load-context
464
454
  \`\`\`
465
455
  `,
466
- 'post-task': `# post-task
456
+ 'post-task': `# post-task
467
457
 
468
458
  Hook executed after task completion.
469
459
 
@@ -489,7 +479,7 @@ npx claude-flow-novice hook post-task --task-id task-123 --analyze-performance
489
479
  npx claude-flow-novice hook post-task --task-id task-123 --update-memory
490
480
  \`\`\`
491
481
  `,
492
- 'pre-edit': `# pre-edit
482
+ 'pre-edit': `# pre-edit
493
483
 
494
484
  Hook executed before file edits.
495
485
 
@@ -515,7 +505,7 @@ npx claude-flow-novice hook pre-edit --file src/api.js --validate-syntax
515
505
  npx claude-flow-novice hook pre-edit --file src/api.js --backup
516
506
  \`\`\`
517
507
  `,
518
- 'post-edit': `# post-edit
508
+ 'post-edit': `# post-edit
519
509
 
520
510
  Hook executed after file edits.
521
511
 
@@ -541,7 +531,7 @@ npx claude-flow-novice hook post-edit --file src/api.js --memory-key "api-change
541
531
  npx claude-flow-novice hook post-edit --file src/api.js --format
542
532
  \`\`\`
543
533
  `,
544
- 'session-end': `# session-end
534
+ 'session-end': `# session-end
545
535
 
546
536
  Hook executed at session end.
547
537
 
@@ -566,10 +556,10 @@ npx claude-flow-novice hook session-end --export-metrics
566
556
  # Full closure
567
557
  npx claude-flow-novice hook session-end --export-metrics --generate-summary --persist-state
568
558
  \`\`\`
569
- `,
570
- },
571
- memory: {
572
- 'memory-usage': `# memory-usage
559
+ `
560
+ },
561
+ memory: {
562
+ 'memory-usage': `# memory-usage
573
563
 
574
564
  Manage persistent memory storage.
575
565
 
@@ -595,7 +585,7 @@ npx claude-flow-novice memory usage --action retrieve --key "project-config"
595
585
  npx claude-flow-novice memory usage --action list
596
586
  \`\`\`
597
587
  `,
598
- 'memory-persist': `# memory-persist
588
+ 'memory-persist': `# memory-persist
599
589
 
600
590
  Persist memory across sessions.
601
591
 
@@ -621,7 +611,7 @@ npx claude-flow-novice memory persist --import memory-backup.json
621
611
  npx claude-flow-novice memory persist --export memory.gz --compress
622
612
  \`\`\`
623
613
  `,
624
- 'memory-search': `# memory-search
614
+ 'memory-search': `# memory-search
625
615
 
626
616
  Search through stored memory.
627
617
 
@@ -646,10 +636,10 @@ npx claude-flow-novice memory search --pattern "api-.*"
646
636
  # Limited results
647
637
  npx claude-flow-novice memory search --query "config" --limit 10
648
638
  \`\`\`
649
- `,
650
- },
651
- monitoring: {
652
- 'swarm-monitor': `# swarm-monitor
639
+ `
640
+ },
641
+ monitoring: {
642
+ 'swarm-monitor': `# swarm-monitor
653
643
 
654
644
  Real-time swarm monitoring.
655
645
 
@@ -675,7 +665,7 @@ npx claude-flow-novice swarm monitor --interval 5000
675
665
  npx claude-flow-novice swarm monitor --metrics
676
666
  \`\`\`
677
667
  `,
678
- 'agent-metrics': `# agent-metrics
668
+ 'agent-metrics': `# agent-metrics
679
669
 
680
670
  View agent performance metrics.
681
671
 
@@ -701,7 +691,7 @@ npx claude-flow-novice agent metrics --agent-id agent-001
701
691
  npx claude-flow-novice agent metrics --period 1h
702
692
  \`\`\`
703
693
  `,
704
- 'real-time-view': `# real-time-view
694
+ 'real-time-view': `# real-time-view
705
695
 
706
696
  Real-time view of swarm activity.
707
697
 
@@ -726,10 +716,10 @@ npx claude-flow-novice monitoring real-time-view --filter errors
726
716
  # Highlight pattern
727
717
  npx claude-flow-novice monitoring real-time-view --highlight "API"
728
718
  \`\`\`
729
- `,
730
- },
731
- optimization: {
732
- 'topology-optimize': `# topology-optimize
719
+ `
720
+ },
721
+ optimization: {
722
+ 'topology-optimize': `# topology-optimize
733
723
 
734
724
  Optimize swarm topology for current workload.
735
725
 
@@ -755,7 +745,7 @@ npx claude-flow-novice optimization topology-optimize --target speed
755
745
  npx claude-flow-novice optimization topology-optimize --target efficiency --apply
756
746
  \`\`\`
757
747
  `,
758
- 'parallel-execute': `# parallel-execute
748
+ 'parallel-execute': `# parallel-execute
759
749
 
760
750
  Execute tasks in parallel for maximum efficiency.
761
751
 
@@ -781,7 +771,7 @@ npx claude-flow-novice optimization parallel-execute --tasks tasks.json --max-pa
781
771
  npx claude-flow-novice optimization parallel-execute --strategy adaptive
782
772
  \`\`\`
783
773
  `,
784
- 'cache-manage': `# cache-manage
774
+ 'cache-manage': `# cache-manage
785
775
 
786
776
  Manage operation cache for performance.
787
777
 
@@ -806,10 +796,10 @@ npx claude-flow-novice optimization cache-manage --action clear
806
796
  # Set limits
807
797
  npx claude-flow-novice optimization cache-manage --max-size 100 --ttl 3600
808
798
  \`\`\`
809
- `,
810
- },
811
- training: {
812
- 'neural-train': `# neural-train
799
+ `
800
+ },
801
+ training: {
802
+ 'neural-train': `# neural-train
813
803
 
814
804
  Train neural patterns from operations.
815
805
 
@@ -835,7 +825,7 @@ npx claude-flow-novice training neural-train --model task-predictor
835
825
  npx claude-flow-novice training neural-train --epochs 100
836
826
  \`\`\`
837
827
  `,
838
- 'pattern-learn': `# pattern-learn
828
+ 'pattern-learn': `# pattern-learn
839
829
 
840
830
  Learn patterns from successful operations.
841
831
 
@@ -861,7 +851,7 @@ npx claude-flow-novice training pattern-learn --threshold 0.9
861
851
  npx claude-flow-novice training pattern-learn --save optimal-patterns
862
852
  \`\`\`
863
853
  `,
864
- 'model-update': `# model-update
854
+ 'model-update': `# model-update
865
855
 
866
856
  Update neural models with new data.
867
857
 
@@ -886,10 +876,10 @@ npx claude-flow-novice training model-update --model agent-selector
886
876
  # Incremental with validation
887
877
  npx claude-flow-novice training model-update --incremental --validate
888
878
  \`\`\`
889
- `,
890
- },
891
- workflows: {
892
- 'workflow-create': `# workflow-create
879
+ `
880
+ },
881
+ workflows: {
882
+ 'workflow-create': `# workflow-create
893
883
 
894
884
  Create reusable workflow templates.
895
885
 
@@ -915,7 +905,7 @@ npx claude-flow-novice workflow create --name "test-suite" --from-history
915
905
  npx claude-flow-novice workflow create --interactive
916
906
  \`\`\`
917
907
  `,
918
- 'workflow-execute': `# workflow-execute
908
+ 'workflow-execute': `# workflow-execute
919
909
 
920
910
  Execute saved workflows.
921
911
 
@@ -941,7 +931,7 @@ npx claude-flow-novice workflow execute --name "test-suite" --params '{"env": "s
941
931
  npx claude-flow-novice workflow execute --name "deploy-api" --dry-run
942
932
  \`\`\`
943
933
  `,
944
- 'workflow-export': `# workflow-export
934
+ 'workflow-export': `# workflow-export
945
935
 
946
936
  Export workflows for sharing.
947
937
 
@@ -966,10 +956,10 @@ npx claude-flow-novice workflow export --name "test-suite" --format yaml
966
956
  # With history
967
957
  npx claude-flow-novice workflow export --name "deploy-api" --include-history
968
958
  \`\`\`
969
- `,
970
- },
971
- swarm: {
972
- swarm: `# swarm
959
+ `
960
+ },
961
+ swarm: {
962
+ swarm: `# swarm
973
963
 
974
964
  Main swarm orchestration command for Claude Flow.
975
965
 
@@ -997,7 +987,7 @@ npx claude-flow-novice swarm "Research AI patterns" --strategy research
997
987
  npx claude-flow-novice swarm "Build API" --claude
998
988
  \`\`\`
999
989
  `,
1000
- 'swarm-init': `# swarm-init
990
+ 'swarm-init': `# swarm-init
1001
991
 
1002
992
  Initialize a new swarm with specified topology.
1003
993
 
@@ -1017,7 +1007,7 @@ npx claude-flow-novice swarm init --topology mesh
1017
1007
  npx claude-flow-novice swarm init --topology hierarchical --max-agents 8
1018
1008
  \`\`\`
1019
1009
  `,
1020
- 'swarm-spawn': `# swarm-spawn
1010
+ 'swarm-spawn': `# swarm-spawn
1021
1011
 
1022
1012
  Spawn agents in the swarm.
1023
1013
 
@@ -1036,10 +1026,10 @@ npx claude-flow-novice swarm spawn [options]
1036
1026
  npx claude-flow-novice swarm spawn --type coder --count 3
1037
1027
  npx claude-flow-novice swarm spawn --type researcher --capabilities "web-search,analysis"
1038
1028
  \`\`\`
1039
- `,
1040
- },
1041
- 'hive-mind': {
1042
- 'hive-mind': `# hive-mind
1029
+ `
1030
+ },
1031
+ 'hive-mind': {
1032
+ 'hive-mind': `# hive-mind
1043
1033
 
1044
1034
  Hive Mind collective intelligence system for advanced swarm coordination.
1045
1035
 
@@ -1067,7 +1057,7 @@ npx claude-flow-novice hive-mind spawn "Build microservices"
1067
1057
  npx claude-flow-novice hive-mind status
1068
1058
  \`\`\`
1069
1059
  `,
1070
- 'hive-mind-init': `# hive-mind-init
1060
+ 'hive-mind-init': `# hive-mind-init
1071
1061
 
1072
1062
  Initialize the Hive Mind collective intelligence system.
1073
1063
 
@@ -1086,7 +1076,7 @@ npx claude-flow-novice hive-mind init
1086
1076
  npx claude-flow-novice hive-mind init --force
1087
1077
  \`\`\`
1088
1078
  `,
1089
- 'hive-mind-spawn': `# hive-mind-spawn
1079
+ 'hive-mind-spawn': `# hive-mind-spawn
1090
1080
 
1091
1081
  Spawn a Hive Mind swarm with queen-led coordination.
1092
1082
 
@@ -1107,10 +1097,10 @@ npx claude-flow-novice hive-mind spawn "Build API"
1107
1097
  npx claude-flow-novice hive-mind spawn "Research patterns" --queen-type adaptive
1108
1098
  npx claude-flow-novice hive-mind spawn "Build service" --claude
1109
1099
  \`\`\`
1110
- `,
1111
- },
1112
- agents: {
1113
- 'agent-types': `# agent-types
1100
+ `
1101
+ },
1102
+ agents: {
1103
+ 'agent-types': `# agent-types
1114
1104
 
1115
1105
  Complete guide to all 54 available agent types in Claude Flow.
1116
1106
 
@@ -1137,7 +1127,7 @@ For full list and details:
1137
1127
  npx claude-flow-novice agents list
1138
1128
  \`\`\`
1139
1129
  `,
1140
- 'agent-capabilities': `# agent-capabilities
1130
+ 'agent-capabilities': `# agent-capabilities
1141
1131
 
1142
1132
  Matrix of agent capabilities and their specializations.
1143
1133
 
@@ -1159,7 +1149,7 @@ npx claude-flow-novice agents capabilities
1159
1149
  npx claude-flow-novice agents capabilities --type coder
1160
1150
  \`\`\`
1161
1151
  `,
1162
- 'agent-coordination': `# agent-coordination
1152
+ 'agent-coordination': `# agent-coordination
1163
1153
 
1164
1154
  Coordination patterns for multi-agent collaboration.
1165
1155
 
@@ -1188,7 +1178,7 @@ npx claude-flow-novice swarm init --topology adaptive
1188
1178
  - Use mesh for research tasks
1189
1179
  - Use adaptive for unknown workloads
1190
1180
  `,
1191
- 'agent-spawning': `# agent-spawning
1181
+ 'agent-spawning': `# agent-spawning
1192
1182
 
1193
1183
  Guide to spawning agents with Claude Code's Task tool.
1194
1184
 
@@ -1216,59 +1206,102 @@ mcp__claude-flow__agent_spawn { type: "researcher" }
1216
1206
  2. Use Task tool for execution
1217
1207
  3. MCP only for coordination
1218
1208
  4. Batch all operations
1219
- `,
1220
- },
1221
- };
1222
-
1223
- return (
1224
- docs[category]?.[command] ||
1225
- `# ${command}\n\nCommand documentation for ${command} in category ${category}.\n\nUsage:\n\`\`\`bash\nnpx claude-flow-novice ${category} ${command} [options]\n\`\`\`\n`
1226
- );
1209
+ `
1210
+ }
1211
+ };
1212
+ return docs[category]?.[command] || `# ${command}\n\nCommand documentation for ${command} in category ${category}.\n\nUsage:\n\`\`\`bash\nnpx claude-flow-novice ${category} ${command} [options]\n\`\`\`\n`;
1227
1213
  }
1228
-
1229
1214
  // Command categories and their commands
1230
1215
  export const COMMAND_STRUCTURE = {
1231
- analysis: ['bottleneck-detect', 'token-usage', 'performance-report'],
1232
- automation: ['auto-agent', 'smart-spawn', 'workflow-select'],
1233
- coordination: ['swarm-init', 'agent-spawn', 'task-orchestrate'],
1234
- github: ['github-swarm', 'repo-analyze', 'pr-enhance', 'issue-triage', 'code-review'],
1235
- hooks: ['pre-task', 'post-task', 'pre-edit', 'post-edit', 'session-end'],
1236
- memory: ['memory-usage', 'memory-persist', 'memory-search'],
1237
- monitoring: ['swarm-monitor', 'agent-metrics', 'real-time-view'],
1238
- optimization: ['topology-optimize', 'parallel-execute', 'cache-manage'],
1239
- training: ['neural-train', 'pattern-learn', 'model-update'],
1240
- workflows: ['workflow-create', 'workflow-execute', 'workflow-export'],
1241
- swarm: [
1242
- 'swarm',
1243
- 'swarm-init',
1244
- 'swarm-spawn',
1245
- 'swarm-status',
1246
- 'swarm-monitor',
1247
- 'swarm-strategies',
1248
- 'swarm-modes',
1249
- 'swarm-background',
1250
- 'swarm-analysis',
1251
- ],
1252
- 'hive-mind': [
1253
- 'hive-mind',
1254
- 'hive-mind-init',
1255
- 'hive-mind-spawn',
1256
- 'hive-mind-status',
1257
- 'hive-mind-resume',
1258
- 'hive-mind-stop',
1259
- 'hive-mind-sessions',
1260
- 'hive-mind-consensus',
1261
- 'hive-mind-memory',
1262
- 'hive-mind-metrics',
1263
- 'hive-mind-wizard',
1264
- ],
1265
- agents: ['agent-types', 'agent-capabilities', 'agent-coordination', 'agent-spawning'],
1216
+ analysis: [
1217
+ 'bottleneck-detect',
1218
+ 'token-usage',
1219
+ 'performance-report'
1220
+ ],
1221
+ automation: [
1222
+ 'auto-agent',
1223
+ 'smart-spawn',
1224
+ 'workflow-select'
1225
+ ],
1226
+ coordination: [
1227
+ 'swarm-init',
1228
+ 'agent-spawn',
1229
+ 'task-orchestrate'
1230
+ ],
1231
+ github: [
1232
+ 'github-swarm',
1233
+ 'repo-analyze',
1234
+ 'pr-enhance',
1235
+ 'issue-triage',
1236
+ 'code-review'
1237
+ ],
1238
+ hooks: [
1239
+ 'pre-task',
1240
+ 'post-task',
1241
+ 'pre-edit',
1242
+ 'post-edit',
1243
+ 'session-end'
1244
+ ],
1245
+ memory: [
1246
+ 'memory-usage',
1247
+ 'memory-persist',
1248
+ 'memory-search'
1249
+ ],
1250
+ monitoring: [
1251
+ 'swarm-monitor',
1252
+ 'agent-metrics',
1253
+ 'real-time-view'
1254
+ ],
1255
+ optimization: [
1256
+ 'topology-optimize',
1257
+ 'parallel-execute',
1258
+ 'cache-manage'
1259
+ ],
1260
+ training: [
1261
+ 'neural-train',
1262
+ 'pattern-learn',
1263
+ 'model-update'
1264
+ ],
1265
+ workflows: [
1266
+ 'workflow-create',
1267
+ 'workflow-execute',
1268
+ 'workflow-export'
1269
+ ],
1270
+ swarm: [
1271
+ 'swarm',
1272
+ 'swarm-init',
1273
+ 'swarm-spawn',
1274
+ 'swarm-status',
1275
+ 'swarm-monitor',
1276
+ 'swarm-strategies',
1277
+ 'swarm-modes',
1278
+ 'swarm-background',
1279
+ 'swarm-analysis'
1280
+ ],
1281
+ 'hive-mind': [
1282
+ 'hive-mind',
1283
+ 'hive-mind-init',
1284
+ 'hive-mind-spawn',
1285
+ 'hive-mind-status',
1286
+ 'hive-mind-resume',
1287
+ 'hive-mind-stop',
1288
+ 'hive-mind-sessions',
1289
+ 'hive-mind-consensus',
1290
+ 'hive-mind-memory',
1291
+ 'hive-mind-metrics',
1292
+ 'hive-mind-wizard'
1293
+ ],
1294
+ agents: [
1295
+ 'agent-types',
1296
+ 'agent-capabilities',
1297
+ 'agent-coordination',
1298
+ 'agent-spawning'
1299
+ ]
1266
1300
  };
1267
-
1268
1301
  // Helper script content
1269
1302
  export function createHelperScript(name) {
1270
- const scripts = {
1271
- 'setup-mcp.sh': `#!/bin/bash
1303
+ const scripts = {
1304
+ 'setup-mcp.sh': `#!/bin/bash
1272
1305
  # Setup MCP server for Claude Flow
1273
1306
 
1274
1307
  echo "🚀 Setting up Claude Flow MCP server..."
@@ -1287,7 +1320,7 @@ claude mcp add claude-flow-novice npx claude-flow-novice mcp start
1287
1320
  echo "✅ MCP server setup complete!"
1288
1321
  echo "🎯 You can now use mcp__claude-flow__ tools in Claude Code"
1289
1322
  `,
1290
- 'quick-start.sh': `#!/bin/bash
1323
+ 'quick-start.sh': `#!/bin/bash
1291
1324
  # Quick start guide for Claude Flow
1292
1325
 
1293
1326
  echo "🚀 Claude Flow Quick Start"
@@ -1307,7 +1340,7 @@ echo " npx claude-flow-novice swarm monitor"
1307
1340
  echo ""
1308
1341
  echo "📚 For more examples, see .claude/commands/"
1309
1342
  `,
1310
- 'github-setup.sh': `#!/bin/bash
1343
+ 'github-setup.sh': `#!/bin/bash
1311
1344
  # Setup GitHub integration for Claude Flow
1312
1345
 
1313
1346
  echo "🔗 Setting up GitHub integration..."
@@ -1336,7 +1369,7 @@ echo " - npx claude-flow-novice repo analyze"
1336
1369
  echo " - npx claude-flow-novice pr enhance"
1337
1370
  echo " - npx claude-flow-novice issue triage"
1338
1371
  `,
1339
- 'github-safe.js': `#!/usr/bin/env node
1372
+ 'github-safe.js': `#!/usr/bin/env node
1340
1373
 
1341
1374
  /**
1342
1375
  * Safe GitHub CLI Helper
@@ -1443,7 +1476,7 @@ if ((command === 'issue' || command === 'pr') &&
1443
1476
  execSync(\`gh \${args.join(' ')}\`, { stdio: 'inherit' });
1444
1477
  }
1445
1478
  `,
1446
- 'checkpoint-hooks.sh': `#!/bin/bash
1479
+ 'checkpoint-hooks.sh': `#!/bin/bash
1447
1480
  # Checkpoint hook functions for Claude settings.json
1448
1481
 
1449
1482
  # Function to handle pre-edit checkpoints
@@ -1625,7 +1658,7 @@ case "$1" in
1625
1658
  ;;
1626
1659
  esac
1627
1660
  `,
1628
- 'checkpoint-manager.sh': `#!/bin/bash
1661
+ 'checkpoint-manager.sh': `#!/bin/bash
1629
1662
  # Claude Checkpoint Manager
1630
1663
  # Provides easy rollback and management of Claude Code checkpoints
1631
1664
 
@@ -1877,7 +1910,7 @@ case "$1" in
1877
1910
  ;;
1878
1911
  esac
1879
1912
  `,
1880
- 'standard-checkpoint-hooks.sh': `#!/bin/bash
1913
+ 'standard-checkpoint-hooks.sh': `#!/bin/bash
1881
1914
  # Standard checkpoint hook functions for Claude settings.json (without GitHub features)
1882
1915
 
1883
1916
  # Function to handle pre-edit checkpoints
@@ -2056,17 +2089,15 @@ case "$1" in
2056
2089
  exit 1
2057
2090
  ;;
2058
2091
  esac
2059
- `,
2060
- };
2061
-
2062
- return scripts[name] || '';
2092
+ `
2093
+ };
2094
+ return scripts[name] || '';
2063
2095
  }
2064
-
2065
2096
  // Wrapper script fallbacks
2066
2097
  function createWrapperScriptFallback(type) {
2067
- if (type === 'unix') {
2068
- // Return the universal ES module compatible wrapper
2069
- return `#!/usr/bin/env node
2098
+ if (type === 'unix') {
2099
+ // Return the universal ES module compatible wrapper
2100
+ return `#!/usr/bin/env node
2070
2101
 
2071
2102
  /**
2072
2103
  * Claude Flow CLI - Universal Wrapper
@@ -2137,8 +2168,8 @@ function createWrapperScriptFallback(type) {
2137
2168
  console.error('Could not find claude-flow. Please install it with: npm install claude-flow');
2138
2169
  process.exit(1);
2139
2170
  })();`;
2140
- } else if (type === 'windows') {
2141
- return `@echo off
2171
+ } else if (type === 'windows') {
2172
+ return `@echo off
2142
2173
  rem Claude Flow wrapper script for Windows
2143
2174
 
2144
2175
  rem Check if package.json exists in current directory
@@ -2156,8 +2187,8 @@ if exist "%~dp0package.json" (
2156
2187
  rem Production mode - use npx alpha
2157
2188
  npx claude-flow@alpha %*
2158
2189
  )`;
2159
- } else if (type === 'powershell') {
2160
- return `# Claude Flow wrapper script for PowerShell
2190
+ } else if (type === 'powershell') {
2191
+ return `# Claude Flow wrapper script for PowerShell
2161
2192
 
2162
2193
  $scriptPath = Split-Path -Parent $MyInvocation.MyCommand.Path
2163
2194
 
@@ -2175,136 +2206,131 @@ if (Test-Path "$scriptPath\\package.json") {
2175
2206
  # Production mode - use npx alpha
2176
2207
  & npx claude-flow@alpha $args
2177
2208
  }`;
2178
- }
2179
- return '';
2209
+ }
2210
+ return '';
2180
2211
  }
2181
-
2182
2212
  // DEPRECATED: Fallback functions removed - use template files only
2183
2213
  function createEnhancedClaudeMdFallback() {
2184
- throw new Error('Template-only approach: createEnhancedClaudeMdFallback() is deprecated and removed.');
2214
+ throw new Error('Template-only approach: createEnhancedClaudeMdFallback() is deprecated and removed.');
2185
2215
  }
2186
-
2187
2216
  function createEnhancedSettingsJsonFallback() {
2188
- return JSON.stringify(
2189
- {
2190
- env: {
2191
- CLAUDE_FLOW_AUTO_COMMIT: 'false',
2192
- CLAUDE_FLOW_AUTO_PUSH: 'false',
2193
- CLAUDE_FLOW_HOOKS_ENABLED: 'true',
2194
- CLAUDE_FLOW_TELEMETRY_ENABLED: 'true',
2195
- CLAUDE_FLOW_REMOTE_EXECUTION: 'true',
2196
- CLAUDE_FLOW_CHECKPOINTS_ENABLED: 'true',
2197
- },
2198
- permissions: {
2199
- allow: [
2200
- 'Bash(npx claude-flow-novice *)',
2201
- 'Bash(npm run lint)',
2202
- 'Bash(npm run test:*)',
2203
- 'Bash(npm test *)',
2204
- 'Bash(git status)',
2205
- 'Bash(git diff *)',
2206
- 'Bash(git log *)',
2207
- 'Bash(git add *)',
2208
- 'Bash(git commit *)',
2209
- 'Bash(git push)',
2210
- 'Bash(git config *)',
2211
- 'Bash(git tag *)',
2212
- 'Bash(git branch *)',
2213
- 'Bash(git checkout *)',
2214
- 'Bash(git stash *)',
2215
- 'Bash(node *)',
2216
- 'Bash(which *)',
2217
- 'Bash(pwd)',
2218
- 'Bash(ls *)',
2219
- 'Bash(jq *)',
2220
- ],
2221
- deny: ['Bash(rm -rf /)', 'Bash(curl * | bash)', 'Bash(wget * | sh)', 'Bash(eval *)'],
2222
- },
2223
- enabledMcpjsonServers: ['claude-flow', 'ruv-swarm'],
2224
- hooks: {
2225
- PreToolUse: [
2226
- {
2227
- matcher: 'Bash',
2228
- hooks: [
2229
- {
2230
- type: 'command',
2231
- command:
2232
- 'cat | jq -r \'.tool_input.command // ""\' | xargs -I {} npx claude-flow@alpha hooks pre-command --command "{}" --validate-safety true --prepare-resources true',
2233
- },
2217
+ return JSON.stringify({
2218
+ env: {
2219
+ CLAUDE_FLOW_AUTO_COMMIT: 'false',
2220
+ CLAUDE_FLOW_AUTO_PUSH: 'false',
2221
+ CLAUDE_FLOW_HOOKS_ENABLED: 'true',
2222
+ CLAUDE_FLOW_TELEMETRY_ENABLED: 'true',
2223
+ CLAUDE_FLOW_REMOTE_EXECUTION: 'true',
2224
+ CLAUDE_FLOW_CHECKPOINTS_ENABLED: 'true'
2225
+ },
2226
+ permissions: {
2227
+ allow: [
2228
+ 'Bash(npx claude-flow-novice *)',
2229
+ 'Bash(npm run lint)',
2230
+ 'Bash(npm run test:*)',
2231
+ 'Bash(npm test *)',
2232
+ 'Bash(git status)',
2233
+ 'Bash(git diff *)',
2234
+ 'Bash(git log *)',
2235
+ 'Bash(git add *)',
2236
+ 'Bash(git commit *)',
2237
+ 'Bash(git push)',
2238
+ 'Bash(git config *)',
2239
+ 'Bash(git tag *)',
2240
+ 'Bash(git branch *)',
2241
+ 'Bash(git checkout *)',
2242
+ 'Bash(git stash *)',
2243
+ 'Bash(node *)',
2244
+ 'Bash(which *)',
2245
+ 'Bash(pwd)',
2246
+ 'Bash(ls *)',
2247
+ 'Bash(jq *)'
2234
2248
  ],
2235
- },
2236
- {
2237
- matcher: 'Write|Edit|MultiEdit',
2238
- hooks: [
2239
- {
2240
- type: 'command',
2241
- command:
2242
- 'cat | jq -r \'.tool_input.file_path // .tool_input.path // ""\' | xargs -I {} npx claude-flow@alpha hooks pre-edit --file "{}" --auto-assign-agents true --load-context true',
2243
- },
2244
- {
2245
- type: 'command',
2246
- command: './.claude/helpers/standard-checkpoint-hooks.sh pre-edit "{{tool_input}}"',
2247
- },
2248
- ],
2249
- },
2249
+ deny: [
2250
+ 'Bash(rm -rf /)',
2251
+ 'Bash(curl * | bash)',
2252
+ 'Bash(wget * | sh)',
2253
+ 'Bash(eval *)'
2254
+ ]
2255
+ },
2256
+ enabledMcpjsonServers: [
2257
+ 'claude-flow',
2258
+ 'ruv-swarm'
2250
2259
  ],
2251
- PostToolUse: [
2252
- {
2253
- matcher: 'Bash',
2254
- hooks: [
2255
- {
2256
- type: 'command',
2257
- command:
2258
- 'cat | jq -r \'.tool_input.command // ""\' | xargs -I {} npx claude-flow@alpha hooks post-command --command "{}" --track-metrics true --store-results true',
2259
- },
2260
- ],
2261
- },
2262
- {
2263
- matcher: 'Write|Edit|MultiEdit',
2264
- hooks: [
2265
- {
2266
- type: 'command',
2267
- command:
2268
- 'cat | jq -r \'.tool_input.file_path // .tool_input.path // ""\' | xargs -I {} npx claude-flow@alpha hooks post-edit --file "{}" --format true --update-memory true --train-neural true',
2269
- },
2270
- {
2271
- type: 'command',
2272
- command:
2273
- './.claude/helpers/standard-checkpoint-hooks.sh post-edit "{{tool_input}}"',
2274
- },
2260
+ hooks: {
2261
+ PreToolUse: [
2262
+ {
2263
+ matcher: 'Bash',
2264
+ hooks: [
2265
+ {
2266
+ type: 'command',
2267
+ command: 'cat | jq -r \'.tool_input.command // ""\' | xargs -I {} npx claude-flow@alpha hooks pre-command --command "{}" --validate-safety true --prepare-resources true'
2268
+ }
2269
+ ]
2270
+ },
2271
+ {
2272
+ matcher: 'Write|Edit|MultiEdit',
2273
+ hooks: [
2274
+ {
2275
+ type: 'command',
2276
+ command: 'cat | jq -r \'.tool_input.file_path // .tool_input.path // ""\' | xargs -I {} npx claude-flow@alpha hooks pre-edit --file "{}" --auto-assign-agents true --load-context true'
2277
+ },
2278
+ {
2279
+ type: 'command',
2280
+ command: './.claude/helpers/standard-checkpoint-hooks.sh pre-edit "{{tool_input}}"'
2281
+ }
2282
+ ]
2283
+ }
2275
2284
  ],
2276
- },
2277
- ],
2278
- UserPromptSubmit: [
2279
- {
2280
- hooks: [
2281
- {
2282
- type: 'command',
2283
- command: './.claude/helpers/standard-checkpoint-hooks.sh task "{{user_prompt}}"',
2284
- },
2285
+ PostToolUse: [
2286
+ {
2287
+ matcher: 'Bash',
2288
+ hooks: [
2289
+ {
2290
+ type: 'command',
2291
+ command: 'cat | jq -r \'.tool_input.command // ""\' | xargs -I {} npx claude-flow@alpha hooks post-command --command "{}" --track-metrics true --store-results true'
2292
+ }
2293
+ ]
2294
+ },
2295
+ {
2296
+ matcher: 'Write|Edit|MultiEdit',
2297
+ hooks: [
2298
+ {
2299
+ type: 'command',
2300
+ command: 'cat | jq -r \'.tool_input.file_path // .tool_input.path // ""\' | xargs -I {} npx claude-flow@alpha hooks post-edit --file "{}" --format true --update-memory true --train-neural true'
2301
+ },
2302
+ {
2303
+ type: 'command',
2304
+ command: './.claude/helpers/standard-checkpoint-hooks.sh post-edit "{{tool_input}}"'
2305
+ }
2306
+ ]
2307
+ }
2285
2308
  ],
2286
- },
2287
- ],
2288
- Stop: [
2289
- {
2290
- hooks: [
2291
- {
2292
- type: 'command',
2293
- command:
2294
- '/usr/bin/env bash -c \'if command -v npx >/dev/null 2>&1; then npx claude-flow@alpha hooks session-end --generate-summary true --persist-state true --export-metrics true; else echo "⚠️ npx not available, skipping Claude Flow session-end hook"; fi\'',
2295
- },
2296
- {
2297
- type: 'command',
2298
- command:
2299
- '/usr/bin/env bash -c \'if [ -f ./.claude/helpers/standard-checkpoint-hooks.sh ]; then ./.claude/helpers/standard-checkpoint-hooks.sh session-end; else echo "⚠️ Checkpoint hooks not found"; fi\'',
2300
- },
2309
+ UserPromptSubmit: [
2310
+ {
2311
+ hooks: [
2312
+ {
2313
+ type: 'command',
2314
+ command: './.claude/helpers/standard-checkpoint-hooks.sh task "{{user_prompt}}"'
2315
+ }
2316
+ ]
2317
+ }
2301
2318
  ],
2302
- },
2303
- ],
2304
- },
2305
- includeCoAuthoredBy: true,
2306
- },
2307
- null,
2308
- 2,
2309
- );
2319
+ Stop: [
2320
+ {
2321
+ hooks: [
2322
+ {
2323
+ type: 'command',
2324
+ command: '/usr/bin/env bash -c \'if command -v npx >/dev/null 2>&1; then npx claude-flow@alpha hooks session-end --generate-summary true --persist-state true --export-metrics true; else echo "⚠️ npx not available, skipping Claude Flow session-end hook"; fi\''
2325
+ },
2326
+ {
2327
+ type: 'command',
2328
+ command: '/usr/bin/env bash -c \'if [ -f ./.claude/helpers/standard-checkpoint-hooks.sh ]; then ./.claude/helpers/standard-checkpoint-hooks.sh session-end; else echo "⚠️ Checkpoint hooks not found"; fi\''
2329
+ }
2330
+ ]
2331
+ }
2332
+ ]
2333
+ },
2334
+ includeCoAuthoredBy: true
2335
+ }, null, 2);
2310
2336
  }