claude-flow-novice 1.5.10 → 1.5.11

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.
@@ -1,18 +1,19 @@
1
- import chalk from 'chalk';
2
- import { getErrorMessage } from '../../utils/error-handler.js';
3
- import { success, error, warning, info } from '../cli-core.js';
4
- import colors from 'chalk';
1
+ import chalk from "chalk";
2
+ import { getErrorMessage } from "../../utils/error-handler.js";
3
+ import { success, error, warning, info } from "../cli-core.js";
4
+ import colors from "chalk";
5
5
  const { bold, blue, yellow } = colors;
6
- import { Orchestrator } from '../../core/orchestrator-fixed.js';
7
- import { ConfigManager } from '../../core/config.js';
8
- import { EventBus } from '../../core/event-bus.js';
9
- import { Logger } from '../../core/logger.js';
10
- import { JsonPersistenceManager } from '../../core/json-persistence.js';
11
- import { swarmAction } from './swarm.js';
12
- import { SimpleMemoryManager } from './memory.js';
13
- import { sparcAction } from './sparc.js';
14
- import { createMigrateCommand } from './migrate.js';
15
- import { enterpriseCommands } from './enterprise.js';
6
+ import { Orchestrator } from "../../core/orchestrator-fixed.js";
7
+ import { ConfigManager } from "../../core/config.js";
8
+ import { EventBus } from "../../core/event-bus.js";
9
+ import { Logger } from "../../core/logger.js";
10
+ import { JsonPersistenceManager } from "../../core/json-persistence.js";
11
+ import { swarmAction } from "./swarm.js";
12
+ import { SimpleMemoryManager } from "./memory.js";
13
+ import { sparcAction } from "./sparc.js";
14
+ import { createMigrateCommand } from "./migrate.js";
15
+ import { enterpriseCommands } from "./enterprise.js";
16
+ import { createEnhancedClaudeMd } from "../simple-commands/init/templates/enhanced-templates.js";
16
17
  let orchestrator = null;
17
18
  let configManager = null;
18
19
  let persistence = null;
@@ -28,9 +29,9 @@ async function getOrchestrator() {
28
29
  const config = await getConfigManager();
29
30
  const eventBus = EventBus.getInstance();
30
31
  const logger = new Logger({
31
- level: 'info',
32
- format: 'text',
33
- destination: 'console'
32
+ level: "info",
33
+ format: "text",
34
+ destination: "console"
34
35
  });
35
36
  orchestrator = new Orchestrator(config, eventBus, logger);
36
37
  }
@@ -46,29 +47,29 @@ async function getConfigManager() {
46
47
  export function setupCommands(cli) {
47
48
  // Neural init command
48
49
  cli.command({
49
- name: 'neural',
50
- description: 'Neural module management',
50
+ name: "neural",
51
+ description: "Neural module management",
51
52
  subcommands: [
52
53
  {
53
- name: 'init',
54
- description: 'Initialize SAFLA neural module',
54
+ name: "init",
55
+ description: "Initialize SAFLA neural module",
55
56
  options: [
56
57
  {
57
- name: 'force',
58
- short: 'f',
59
- description: 'Overwrite existing module',
60
- type: 'boolean'
58
+ name: "force",
59
+ short: "f",
60
+ description: "Overwrite existing module",
61
+ type: "boolean"
61
62
  },
62
63
  {
63
- name: 'target',
64
- short: 't',
65
- description: 'Target directory',
66
- type: 'string',
67
- defaultValue: '.claude/agents/neural'
64
+ name: "target",
65
+ short: "t",
66
+ description: "Target directory",
67
+ type: "string",
68
+ defaultValue: ".claude/agents/neural"
68
69
  }
69
70
  ],
70
71
  action: async (ctx)=>{
71
- const { initNeuralModule } = await import('../../scripts/init-neural.js');
72
+ const { initNeuralModule } = await import("../../scripts/init-neural.js");
72
73
  await initNeuralModule({
73
74
  force: ctx.flags.force,
74
75
  targetDir: ctx.flags.target
@@ -79,29 +80,29 @@ export function setupCommands(cli) {
79
80
  });
80
81
  // Goal init command
81
82
  cli.command({
82
- name: 'goal',
83
- description: 'Goal module management',
83
+ name: "goal",
84
+ description: "Goal module management",
84
85
  subcommands: [
85
86
  {
86
- name: 'init',
87
- description: 'Initialize GOAP goal module',
87
+ name: "init",
88
+ description: "Initialize GOAP goal module",
88
89
  options: [
89
90
  {
90
- name: 'force',
91
- short: 'f',
92
- description: 'Overwrite existing module',
93
- type: 'boolean'
91
+ name: "force",
92
+ short: "f",
93
+ description: "Overwrite existing module",
94
+ type: "boolean"
94
95
  },
95
96
  {
96
- name: 'target',
97
- short: 't',
98
- description: 'Target directory',
99
- type: 'string',
100
- defaultValue: '.claude/agents/goal'
97
+ name: "target",
98
+ short: "t",
99
+ description: "Target directory",
100
+ type: "string",
101
+ defaultValue: ".claude/agents/goal"
101
102
  }
102
103
  ],
103
104
  action: async (ctx)=>{
104
- const { initGoalModule } = await import('../../scripts/init-goal.js');
105
+ const { initGoalModule } = await import("../../scripts/init-goal.js");
105
106
  await initGoalModule({
106
107
  force: ctx.flags.force,
107
108
  targetDir: ctx.flags.target
@@ -112,75 +113,75 @@ export function setupCommands(cli) {
112
113
  });
113
114
  // Init command
114
115
  cli.command({
115
- name: 'init',
116
- description: 'Initialize Claude Code integration files',
116
+ name: "init",
117
+ description: "Initialize Claude Code integration files",
117
118
  options: [
118
119
  {
119
- name: 'force',
120
- short: 'f',
121
- description: 'Overwrite existing files',
122
- type: 'boolean'
120
+ name: "force",
121
+ short: "f",
122
+ description: "Overwrite existing files",
123
+ type: "boolean"
123
124
  },
124
125
  {
125
- name: 'minimal',
126
- short: 'm',
127
- description: 'Create minimal configuration files',
128
- type: 'boolean'
126
+ name: "minimal",
127
+ short: "m",
128
+ description: "Create minimal configuration files",
129
+ type: "boolean"
129
130
  }
130
131
  ],
131
132
  action: async (ctx)=>{
132
133
  try {
133
- success('Initializing Claude Code integration files...');
134
+ success("Initializing Claude Code integration files...");
134
135
  const force = ctx.flags.force || ctx.flags.f;
135
136
  const minimal = ctx.flags.minimal || ctx.flags.m;
136
137
  // Flow-nexus mode removed
137
138
  // Check if files already exist for full init
138
139
  const files = [
139
- 'CLAUDE.md',
140
- 'memory-bank.md',
141
- 'coordination.md'
140
+ "CLAUDE.md",
141
+ "memory-bank.md",
142
+ "coordination.md"
142
143
  ];
143
144
  const existingFiles = [];
144
145
  for (const file of files){
145
- const { access } = await import('fs/promises');
146
+ const { access } = await import("fs/promises");
146
147
  const exists = await access(file).then(()=>true).catch(()=>false);
147
148
  if (exists) {
148
149
  existingFiles.push(file);
149
150
  }
150
151
  }
151
152
  if (existingFiles.length > 0 && !force) {
152
- warning(`The following files already exist: ${existingFiles.join(', ')}`);
153
- console.log('Use --force to overwrite existing files');
153
+ warning(`The following files already exist: ${existingFiles.join(", ")}`);
154
+ console.log("Use --force to overwrite existing files");
154
155
  return;
155
156
  }
156
157
  // Create CLAUDE.md
157
158
  const claudeMd = minimal ? createMinimalClaudeMd() : createFullClaudeMd();
158
- const { writeFile } = await import('fs/promises');
159
- await writeFile('CLAUDE.md', claudeMd);
160
- console.log(' ✓ Created CLAUDE.md');
159
+ const { writeFile } = await import("fs/promises");
160
+ await writeFile("CLAUDE.md", claudeMd);
161
+ console.log(" ✓ Created CLAUDE.md");
161
162
  // Create memory-bank.md
162
163
  const memoryBankMd = minimal ? createMinimalMemoryBankMd() : createFullMemoryBankMd();
163
- await writeFile('memory-bank.md', memoryBankMd);
164
- console.log(' ✓ Created memory-bank.md');
164
+ await writeFile("memory-bank.md", memoryBankMd);
165
+ console.log(" ✓ Created memory-bank.md");
165
166
  // Create coordination.md
166
167
  const coordinationMd = minimal ? createMinimalCoordinationMd() : createFullCoordinationMd();
167
- await writeFile('coordination.md', coordinationMd);
168
- console.log(' ✓ Created coordination.md');
168
+ await writeFile("coordination.md", coordinationMd);
169
+ console.log(" ✓ Created coordination.md");
169
170
  // Create directory structure
170
171
  const directories = [
171
- 'memory',
172
- 'memory/agents',
173
- 'memory/sessions',
174
- 'coordination',
175
- 'coordination/memory_bank',
176
- 'coordination/subtasks',
177
- 'coordination/orchestration'
172
+ "memory",
173
+ "memory/agents",
174
+ "memory/sessions",
175
+ "coordination",
176
+ "coordination/memory_bank",
177
+ "coordination/subtasks",
178
+ "coordination/orchestration"
178
179
  ];
179
180
  // Ensure memory directory exists for SQLite database
180
- if (!directories.includes('memory')) {
181
- directories.unshift('memory');
181
+ if (!directories.includes("memory")) {
182
+ directories.unshift("memory");
182
183
  }
183
- const { mkdir } = await import('fs/promises');
184
+ const { mkdir } = await import("fs/promises");
184
185
  for (const dir of directories){
185
186
  try {
186
187
  await mkdir(dir, {
@@ -188,34 +189,34 @@ export function setupCommands(cli) {
188
189
  });
189
190
  console.log(` ✓ Created ${dir}/ directory`);
190
191
  } catch (err) {
191
- if (err.code !== 'EEXIST') {
192
+ if (err.code !== "EEXIST") {
192
193
  throw err;
193
194
  }
194
195
  }
195
196
  }
196
197
  // Create placeholder files for memory directories
197
198
  const agentsReadme = createAgentsReadme();
198
- await writeFile('memory/agents/README.md', agentsReadme);
199
- console.log(' ✓ Created memory/agents/README.md');
199
+ await writeFile("memory/agents/README.md", agentsReadme);
200
+ console.log(" ✓ Created memory/agents/README.md");
200
201
  const sessionsReadme = createSessionsReadme();
201
- await writeFile('memory/sessions/README.md', sessionsReadme);
202
- console.log(' ✓ Created memory/sessions/README.md');
202
+ await writeFile("memory/sessions/README.md", sessionsReadme);
203
+ console.log(" ✓ Created memory/sessions/README.md");
203
204
  // Initialize the persistence database
204
205
  const initialData = {
205
206
  agents: [],
206
207
  tasks: [],
207
208
  lastUpdated: Date.now()
208
209
  };
209
- await writeFile('memory/claude-flow-data.json', JSON.stringify(initialData, null, 2));
210
- console.log(' ✓ Created memory/claude-flow-data.json (persistence database)');
210
+ await writeFile("memory/claude-flow-data.json", JSON.stringify(initialData, null, 2));
211
+ console.log(" ✓ Created memory/claude-flow-data.json (persistence database)");
211
212
  // Enhanced features for novice package: Agent system, MCP config, and hooks
212
- console.log('\n🤖 Setting up enhanced agent system...');
213
+ console.log("\n🤖 Setting up enhanced agent system...");
213
214
  // Create .claude directory structure for agents
214
215
  const claudeDirectories = [
215
- '.claude',
216
- '.claude/agents',
217
- '.claude/commands',
218
- '.claude/hooks'
216
+ ".claude",
217
+ ".claude/agents",
218
+ ".claude/commands",
219
+ ".claude/hooks"
219
220
  ];
220
221
  for (const dir of claudeDirectories){
221
222
  await mkdir(dir, {
@@ -224,69 +225,69 @@ export function setupCommands(cli) {
224
225
  console.log(` ✓ Created ${dir}/ directory`);
225
226
  }
226
227
  // Create MCP configuration file
227
- console.log('\n🔌 Setting up MCP configuration...');
228
+ console.log("\n🔌 Setting up MCP configuration...");
228
229
  const mcpConfig = {
229
230
  mcpServers: {
230
- 'claude-flow-novice': {
231
- command: 'npx',
231
+ "claude-flow-novice": {
232
+ command: "npx",
232
233
  args: [
233
- 'claude-flow-novice@latest',
234
- 'mcp',
235
- 'start'
234
+ "claude-flow-novice@latest",
235
+ "mcp",
236
+ "start"
236
237
  ],
237
- type: 'stdio'
238
+ type: "stdio"
238
239
  },
239
- 'ruv-swarm': {
240
- command: 'npx',
240
+ "ruv-swarm": {
241
+ command: "npx",
241
242
  args: [
242
- 'ruv-swarm@latest',
243
- 'mcp',
244
- 'start'
243
+ "ruv-swarm@latest",
244
+ "mcp",
245
+ "start"
245
246
  ],
246
- type: 'stdio'
247
+ type: "stdio"
247
248
  }
248
249
  }
249
250
  };
250
- await writeFile('.mcp.json', JSON.stringify(mcpConfig, null, 2));
251
- console.log(' ✓ Created .mcp.json with claude-flow-novice and ruv-swarm servers');
251
+ await writeFile(".mcp.json", JSON.stringify(mcpConfig, null, 2));
252
+ console.log(" ✓ Created .mcp.json with claude-flow-novice and ruv-swarm servers");
252
253
  // Create hooks configuration
253
- console.log('\n🪝 Setting up hooks system...');
254
+ console.log("\n🪝 Setting up hooks system...");
254
255
  const hooksConfig = {
255
256
  hooks: {
256
257
  pre_task: {
257
258
  enabled: true,
258
259
  command: 'npx claude-flow-novice@latest hooks pre-task --description "$TASK_DESCRIPTION"',
259
- description: 'Pre-task coordination hook'
260
+ description: "Pre-task coordination hook"
260
261
  },
261
262
  post_edit: {
262
263
  enabled: true,
263
264
  command: 'npx claude-flow-novice@latest hooks post-edit --file "$FILE_PATH" --memory-key "swarm/$AGENT_ID/$STEP"',
264
- description: 'Post-edit memory storage hook'
265
+ description: "Post-edit memory storage hook"
265
266
  },
266
267
  post_task: {
267
268
  enabled: true,
268
269
  command: 'npx claude-flow-novice@latest hooks post-task --task-id "$TASK_ID"',
269
- description: 'Post-task completion hook'
270
+ description: "Post-task completion hook"
270
271
  }
271
272
  },
272
273
  memory: {
273
274
  enabled: true,
274
- persistence: 'local',
275
- namespace: 'claude-flow-novice'
275
+ persistence: "local",
276
+ namespace: "claude-flow-novice"
276
277
  }
277
278
  };
278
- await writeFile('.claude/hooks.json', JSON.stringify(hooksConfig, null, 2));
279
- console.log(' ✓ Created .claude/hooks.json with automated coordination');
279
+ await writeFile(".claude/hooks.json", JSON.stringify(hooksConfig, null, 2));
280
+ console.log(" ✓ Created .claude/hooks.json with automated coordination");
280
281
  // Create basic agent definitions (simplified for novice package)
281
282
  const basicAgents = [
282
- 'coder',
283
- 'reviewer',
284
- 'tester',
285
- 'planner',
286
- 'researcher',
287
- 'backend-dev',
288
- 'system-architect',
289
- 'code-analyzer'
283
+ "coder",
284
+ "reviewer",
285
+ "tester",
286
+ "planner",
287
+ "researcher",
288
+ "backend-dev",
289
+ "system-architect",
290
+ "code-analyzer"
290
291
  ];
291
292
  for (const agent of basicAgents){
292
293
  const agentConfig = {
@@ -296,17 +297,17 @@ export function setupCommands(cli) {
296
297
  capabilities: [
297
298
  agent
298
299
  ],
299
- version: '1.0.0'
300
+ version: "1.0.0"
300
301
  };
301
302
  await writeFile(`.claude/agents/${agent}.json`, JSON.stringify(agentConfig, null, 2));
302
303
  }
303
304
  console.log(` ✓ Created ${basicAgents.length} essential agent definitions`);
304
- success('Claude Code integration files initialized successfully!');
305
- console.log('\nNext steps:');
306
- console.log('1. Review and customize the generated files for your project');
305
+ success("Claude Code integration files initialized successfully!");
306
+ console.log("\nNext steps:");
307
+ console.log("1. Review and customize the generated files for your project");
307
308
  console.log("2. Run 'npx claude-flow-novice start' to begin the orchestration system");
308
309
  console.log("3. Use 'claude --dangerously-skip-permissions' for unattended operation");
309
- console.log('\nNote: Persistence database initialized at memory/claude-flow-data.json');
310
+ console.log("\nNote: Persistence database initialized at memory/claude-flow-data.json");
310
311
  } catch (err) {
311
312
  error(`Failed to initialize files: ${err.message}`);
312
313
  }
@@ -314,53 +315,53 @@ export function setupCommands(cli) {
314
315
  });
315
316
  // Start command
316
317
  cli.command({
317
- name: 'start',
318
- description: 'Start the orchestration system',
318
+ name: "start",
319
+ description: "Start the orchestration system",
319
320
  options: [
320
321
  {
321
- name: 'daemon',
322
- short: 'd',
323
- description: 'Run as daemon in background',
324
- type: 'boolean'
322
+ name: "daemon",
323
+ short: "d",
324
+ description: "Run as daemon in background",
325
+ type: "boolean"
325
326
  },
326
327
  {
327
- name: 'port',
328
- short: 'p',
329
- description: 'MCP server port',
330
- type: 'number',
328
+ name: "port",
329
+ short: "p",
330
+ description: "MCP server port",
331
+ type: "number",
331
332
  default: 3000
332
333
  }
333
334
  ],
334
335
  action: async (ctx)=>{
335
- success('Starting Claude-Flow orchestration system...');
336
+ success("Starting Claude-Flow orchestration system...");
336
337
  try {
337
338
  const orch = await getOrchestrator();
338
339
  await orch.start();
339
- success('System started successfully!');
340
- info('Components initialized:');
341
- console.log(' ✓ Event Bus');
342
- console.log(' ✓ Orchestrator Engine');
343
- console.log(' ✓ Memory Manager');
344
- console.log(' ✓ Terminal Pool');
345
- console.log(' ✓ MCP Server');
346
- console.log(' ✓ Coordination Manager');
340
+ success("System started successfully!");
341
+ info("Components initialized:");
342
+ console.log(" ✓ Event Bus");
343
+ console.log(" ✓ Orchestrator Engine");
344
+ console.log(" ✓ Memory Manager");
345
+ console.log(" ✓ Terminal Pool");
346
+ console.log(" ✓ MCP Server");
347
+ console.log(" ✓ Coordination Manager");
347
348
  if (!ctx.flags.daemon) {
348
- info('Press Ctrl+C to stop the system');
349
+ info("Press Ctrl+C to stop the system");
349
350
  // Keep the process running until interrupted
350
351
  const controller = new AbortController();
351
352
  const shutdown = ()=>{
352
- console.log('\nShutting down...');
353
+ console.log("\nShutting down...");
353
354
  controller.abort();
354
355
  };
355
- process.on('SIGINT', shutdown);
356
- process.on('SIGTERM', shutdown);
356
+ process.on("SIGINT", shutdown);
357
+ process.on("SIGTERM", shutdown);
357
358
  try {
358
359
  await new Promise((resolve)=>{
359
- controller.signal.addEventListener('abort', ()=>resolve());
360
+ controller.signal.addEventListener("abort", ()=>resolve());
360
361
  });
361
362
  } finally{
362
- process.off('SIGINT', shutdown);
363
- process.off('SIGTERM', shutdown);
363
+ process.off("SIGINT", shutdown);
364
+ process.off("SIGTERM", shutdown);
364
365
  }
365
366
  }
366
367
  } catch (err) {
@@ -371,18 +372,18 @@ export function setupCommands(cli) {
371
372
  });
372
373
  // Task command
373
374
  cli.command({
374
- name: 'task',
375
- description: 'Manage tasks',
375
+ name: "task",
376
+ description: "Manage tasks",
376
377
  aliases: [
377
- 'tasks'
378
+ "tasks"
378
379
  ],
379
380
  action: async (ctx)=>{
380
381
  const subcommand = ctx.args[0];
381
382
  switch(subcommand){
382
- case 'create':
383
+ case "create":
383
384
  {
384
- const type = ctx.args[1] || 'general';
385
- const description = ctx.args.slice(2).join(' ') || 'No description';
385
+ const type = ctx.args[1] || "general";
386
+ const description = ctx.args.slice(2).join(" ") || "No description";
386
387
  try {
387
388
  const persist = await getPersistence();
388
389
  const taskId = `task-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
@@ -391,9 +392,9 @@ export function setupCommands(cli) {
391
392
  id: taskId,
392
393
  type,
393
394
  description,
394
- status: 'pending',
395
+ status: "pending",
395
396
  priority: ctx.flags.priority || 1,
396
- dependencies: ctx.flags.deps ? ctx.flags.deps.split(',') : [],
397
+ dependencies: ctx.flags.deps ? ctx.flags.deps.split(",") : [],
397
398
  metadata: {},
398
399
  progress: 0,
399
400
  createdAt: Date.now()
@@ -407,13 +408,13 @@ export function setupCommands(cli) {
407
408
  }
408
409
  break;
409
410
  }
410
- case 'list':
411
+ case "list":
411
412
  {
412
413
  try {
413
414
  const persist = await getPersistence();
414
415
  const tasks = await persist.getActiveTasks();
415
416
  if (tasks.length === 0) {
416
- info('No active tasks');
417
+ info("No active tasks");
417
418
  } else {
418
419
  success(`Active tasks (${tasks.length}):`);
419
420
  for (const task of tasks){
@@ -428,12 +429,12 @@ export function setupCommands(cli) {
428
429
  }
429
430
  break;
430
431
  }
431
- case 'assign':
432
+ case "assign":
432
433
  {
433
434
  const taskId = ctx.args[1];
434
435
  const agentId = ctx.args[2];
435
436
  if (!taskId || !agentId) {
436
- error('Usage: task assign <task-id> <agent-id>');
437
+ error("Usage: task assign <task-id> <agent-id>");
437
438
  break;
438
439
  }
439
440
  try {
@@ -452,7 +453,7 @@ export function setupCommands(cli) {
452
453
  }
453
454
  // Update task with assigned agent
454
455
  task.assignedAgent = agentId;
455
- task.status = 'assigned';
456
+ task.status = "assigned";
456
457
  await persist.saveTask(task);
457
458
  success(`Task ${taskId} assigned to agent ${agentId}`);
458
459
  console.log(`📝 Task: ${task.description}`);
@@ -462,27 +463,27 @@ export function setupCommands(cli) {
462
463
  }
463
464
  break;
464
465
  }
465
- case 'workflow':
466
+ case "workflow":
466
467
  {
467
468
  const workflowFile = ctx.args[1];
468
469
  if (!workflowFile) {
469
- error('Usage: task workflow <workflow-file>');
470
+ error("Usage: task workflow <workflow-file>");
470
471
  break;
471
472
  }
472
473
  try {
473
- const { readFile } = await import('fs/promises');
474
- const content = await readFile(workflowFile, 'utf-8');
474
+ const { readFile } = await import("fs/promises");
475
+ const content = await readFile(workflowFile, "utf-8");
475
476
  const workflow = JSON.parse(content);
476
- success('Workflow loaded:');
477
- console.log(`📋 Name: ${workflow.name || 'Unnamed'}`);
478
- console.log(`📝 Description: ${workflow.description || 'No description'}`);
477
+ success("Workflow loaded:");
478
+ console.log(`📋 Name: ${workflow.name || "Unnamed"}`);
479
+ console.log(`📝 Description: ${workflow.description || "No description"}`);
479
480
  console.log(`🤖 Agents: ${workflow.agents?.length || 0}`);
480
481
  console.log(`📌 Tasks: ${workflow.tasks?.length || 0}`);
481
482
  if (ctx.flags.execute) {
482
- warning('Workflow execution would start here (not yet implemented)');
483
+ warning("Workflow execution would start here (not yet implemented)");
483
484
  // TODO: Implement workflow execution
484
485
  } else {
485
- info('To execute this workflow, ensure Claude-Flow is running');
486
+ info("To execute this workflow, ensure Claude-Flow is running");
486
487
  }
487
488
  } catch (err) {
488
489
  error(`Failed to load workflow: ${err.message}`);
@@ -491,7 +492,7 @@ export function setupCommands(cli) {
491
492
  }
492
493
  default:
493
494
  {
494
- console.log('Available subcommands: create, list, assign, workflow');
495
+ console.log("Available subcommands: create, list, assign, workflow");
495
496
  break;
496
497
  }
497
498
  }
@@ -499,15 +500,15 @@ export function setupCommands(cli) {
499
500
  });
500
501
  // Enhanced Agent command with comprehensive management
501
502
  cli.command({
502
- name: 'agent',
503
- description: 'Comprehensive agent management with advanced features',
503
+ name: "agent",
504
+ description: "Comprehensive agent management with advanced features",
504
505
  aliases: [
505
- 'agents'
506
+ "agents"
506
507
  ],
507
508
  action: async (ctx)=>{
508
509
  const subcommand = ctx.args[0];
509
510
  // Import enhanced agent command dynamically
510
- const { agentCommand } = await import('./agent.js');
511
+ const { agentCommand } = await import("./agent.js");
511
512
  // Create a mock context for the enhanced command
512
513
  const enhancedCtx = {
513
514
  args: ctx.args.slice(1),
@@ -517,49 +518,49 @@ export function setupCommands(cli) {
517
518
  try {
518
519
  // Map simple commands to enhanced command structure
519
520
  switch(subcommand){
520
- case 'spawn':
521
- case 'list':
522
- case 'info':
523
- case 'terminate':
524
- case 'start':
525
- case 'restart':
526
- case 'pool':
527
- case 'health':
521
+ case "spawn":
522
+ case "list":
523
+ case "info":
524
+ case "terminate":
525
+ case "start":
526
+ case "restart":
527
+ case "pool":
528
+ case "health":
528
529
  // Use the enhanced agent command system
529
- console.log(chalk.cyan('🚀 Using enhanced agent management system...'));
530
+ console.log(chalk.cyan("🚀 Using enhanced agent management system..."));
530
531
  // Create a simplified wrapper around the enhanced command
531
- const agentManager = await import('../../agents/agent-manager.js');
532
- const { MemoryManager } = await import('../../memory/manager.js');
533
- const { EventBus } = await import('../../core/event-bus.js');
534
- const { Logger } = await import('../../core/logger.js');
535
- const { DistributedMemorySystem } = await import('../../memory/distributed-memory.js');
536
- warning('Enhanced agent management is available!');
537
- console.log('For full functionality, use the comprehensive agent commands:');
538
- console.log(` - claude-flow-novice agent ${subcommand} ${ctx.args.slice(1).join(' ')}`);
539
- console.log(' - Enhanced features: pools, health monitoring, resource management');
540
- console.log(' - Interactive configuration and detailed metrics');
532
+ const agentManager = await import("../../agents/agent-manager.js");
533
+ const { MemoryManager } = await import("../../memory/manager.js");
534
+ const { EventBus } = await import("../../core/event-bus.js");
535
+ const { Logger } = await import("../../core/logger.js");
536
+ const { DistributedMemorySystem } = await import("../../memory/distributed-memory.js");
537
+ warning("Enhanced agent management is available!");
538
+ console.log("For full functionality, use the comprehensive agent commands:");
539
+ console.log(` - claude-flow-novice agent ${subcommand} ${ctx.args.slice(1).join(" ")}`);
540
+ console.log(" - Enhanced features: pools, health monitoring, resource management");
541
+ console.log(" - Interactive configuration and detailed metrics");
541
542
  break;
542
543
  default:
543
544
  {
544
- console.log(chalk.cyan('📋 Agent Management Commands:'));
545
- console.log('Available subcommands:');
546
- console.log(' spawn - Create and start new agents');
547
- console.log(' list - Display all agents with status');
548
- console.log(' info - Get detailed agent information');
549
- console.log(' terminate - Safely terminate agents');
550
- console.log(' start - Start a created agent');
551
- console.log(' restart - Restart an agent');
552
- console.log(' pool - Manage agent pools');
553
- console.log(' health - Monitor agent health');
554
- console.log('');
555
- console.log('Enhanced Features:');
556
- console.log(' ✨ Resource allocation and monitoring');
557
- console.log(' ✨ Agent pools for scaling');
558
- console.log(' ✨ Health diagnostics and auto-recovery');
559
- console.log(' ✨ Interactive configuration');
560
- console.log(' ✨ Memory integration for coordination');
561
- console.log('');
562
- console.log('For detailed help, use: claude-flow-novice agent <command> --help');
545
+ console.log(chalk.cyan("📋 Agent Management Commands:"));
546
+ console.log("Available subcommands:");
547
+ console.log(" spawn - Create and start new agents");
548
+ console.log(" list - Display all agents with status");
549
+ console.log(" info - Get detailed agent information");
550
+ console.log(" terminate - Safely terminate agents");
551
+ console.log(" start - Start a created agent");
552
+ console.log(" restart - Restart an agent");
553
+ console.log(" pool - Manage agent pools");
554
+ console.log(" health - Monitor agent health");
555
+ console.log("");
556
+ console.log("Enhanced Features:");
557
+ console.log(" ✨ Resource allocation and monitoring");
558
+ console.log(" ✨ Agent pools for scaling");
559
+ console.log(" ✨ Health diagnostics and auto-recovery");
560
+ console.log(" ✨ Interactive configuration");
561
+ console.log(" ✨ Memory integration for coordination");
562
+ console.log("");
563
+ console.log("For detailed help, use: claude-flow-novice agent <command> --help");
563
564
  break;
564
565
  }
565
566
  }
@@ -567,9 +568,9 @@ export function setupCommands(cli) {
567
568
  error(`Enhanced agent management unavailable: ${err.message}`);
568
569
  // Fallback to basic implementation
569
570
  switch(subcommand){
570
- case 'spawn':
571
+ case "spawn":
571
572
  {
572
- const type = ctx.args[1] || 'researcher';
573
+ const type = ctx.args[1] || "researcher";
573
574
  const name = ctx.flags.name || `${type}-${Date.now()}`;
574
575
  try {
575
576
  const persist = await getPersistence();
@@ -578,7 +579,7 @@ export function setupCommands(cli) {
578
579
  id: agentId,
579
580
  type,
580
581
  name,
581
- status: 'active',
582
+ status: "active",
582
583
  capabilities: getCapabilitiesForType(type),
583
584
  systemPrompt: ctx.flags.prompt || getDefaultPromptForType(type),
584
585
  maxConcurrentTasks: ctx.flags.maxTasks || 5,
@@ -595,13 +596,13 @@ export function setupCommands(cli) {
595
596
  }
596
597
  break;
597
598
  }
598
- case 'list':
599
+ case "list":
599
600
  {
600
601
  try {
601
602
  const persist = await getPersistence();
602
603
  const agents = await persist.getActiveAgents();
603
604
  if (agents.length === 0) {
604
- info('No active agents');
605
+ info("No active agents");
605
606
  } else {
606
607
  success(`Active agents (${agents.length}):`);
607
608
  for (const agent of agents){
@@ -615,8 +616,8 @@ export function setupCommands(cli) {
615
616
  }
616
617
  default:
617
618
  {
618
- console.log('Available subcommands (basic): spawn, list');
619
- console.log('For enhanced features, ensure all dependencies are installed.');
619
+ console.log("Available subcommands (basic): spawn, list");
620
+ console.log("For enhanced features, ensure all dependencies are installed.");
620
621
  break;
621
622
  }
622
623
  }
@@ -634,29 +635,29 @@ export function setupCommands(cli) {
634
635
  component: ctx.flags.component || ctx.flags.c,
635
636
  json: ctx.flags.json,
636
637
  detailed: ctx.flags.detailed,
637
- healthCheck: ctx.flags.healthCheck || ctx.flags['health-check'],
638
+ healthCheck: ctx.flags.healthCheck || ctx.flags["health-check"],
638
639
  history: ctx.flags.history
639
640
  };
640
641
  // Mock the enhanced status command action
641
- console.log(chalk.cyan('🔍 Enhanced Status Command'));
642
- console.log('For full enhanced functionality, use: claude-flow-novice status [options]');
643
- console.log('Available options: --watch, --interval, --component, --json, --detailed, --health-check, --history');
642
+ console.log(chalk.cyan("🔍 Enhanced Status Command"));
643
+ console.log("For full enhanced functionality, use: claude-flow-novice status [options]");
644
+ console.log("Available options: --watch, --interval, --component, --json, --detailed, --health-check, --history");
644
645
  // Fallback to basic status
645
646
  try {
646
647
  const persist = await getPersistence();
647
648
  const stats = await persist.getStats();
648
649
  // Check if orchestrator is running by looking for the log file
649
- const { access } = await import('fs/promises');
650
- const isRunning = await access('orchestrator.log').then(()=>true).catch(()=>false);
651
- success('Claude-Flow System Status:');
652
- console.log(`🟢 Status: ${isRunning ? 'Running' : 'Stopped'}`);
650
+ const { access } = await import("fs/promises");
651
+ const isRunning = await access("orchestrator.log").then(()=>true).catch(()=>false);
652
+ success("Claude-Flow System Status:");
653
+ console.log(`🟢 Status: ${isRunning ? "Running" : "Stopped"}`);
653
654
  console.log(`🤖 Agents: ${stats.activeAgents} active (${stats.totalAgents} total)`);
654
655
  console.log(`📋 Tasks: ${stats.pendingTasks} in queue (${stats.totalTasks} total)`);
655
656
  console.log(`💾 Memory: Ready`);
656
657
  console.log(`🖥️ Terminal Pool: Ready`);
657
- console.log(`🌐 MCP Server: ${isRunning ? 'Running' : 'Stopped'}`);
658
+ console.log(`🌐 MCP Server: ${isRunning ? "Running" : "Stopped"}`);
658
659
  if (ctx.flags.verbose || options.detailed) {
659
- console.log('\nDetailed Statistics:');
660
+ console.log("\nDetailed Statistics:");
660
661
  console.log(` Total Agents: ${stats.totalAgents}`);
661
662
  console.log(` Active Agents: ${stats.activeAgents}`);
662
663
  console.log(` Total Tasks: ${stats.totalTasks}`);
@@ -664,86 +665,86 @@ export function setupCommands(cli) {
664
665
  console.log(` Completed Tasks: ${stats.completedTasks}`);
665
666
  }
666
667
  if (options.watch) {
667
- warning('Watch mode available in enhanced status command');
668
- console.log('Use: claude-flow-novice status --watch');
668
+ warning("Watch mode available in enhanced status command");
669
+ console.log("Use: claude-flow-novice status --watch");
669
670
  }
670
671
  } catch (err) {
671
672
  error(`Failed to get status: ${err.message}`);
672
673
  }
673
674
  };
674
675
  cli.command({
675
- name: 'status',
676
- description: 'Show enhanced system status with comprehensive reporting',
676
+ name: "status",
677
+ description: "Show enhanced system status with comprehensive reporting",
677
678
  options: [
678
679
  {
679
- name: 'watch',
680
- short: 'w',
681
- description: 'Watch mode - continuously update status',
682
- type: 'boolean'
680
+ name: "watch",
681
+ short: "w",
682
+ description: "Watch mode - continuously update status",
683
+ type: "boolean"
683
684
  },
684
685
  {
685
- name: 'interval',
686
- short: 'i',
687
- description: 'Update interval in seconds',
688
- type: 'number',
686
+ name: "interval",
687
+ short: "i",
688
+ description: "Update interval in seconds",
689
+ type: "number",
689
690
  default: 5
690
691
  },
691
692
  {
692
- name: 'component',
693
- short: 'c',
694
- description: 'Show status for specific component',
695
- type: 'string'
693
+ name: "component",
694
+ short: "c",
695
+ description: "Show status for specific component",
696
+ type: "string"
696
697
  },
697
698
  {
698
- name: 'json',
699
- description: 'Output in JSON format',
700
- type: 'boolean'
699
+ name: "json",
700
+ description: "Output in JSON format",
701
+ type: "boolean"
701
702
  },
702
703
  {
703
- name: 'detailed',
704
- description: 'Show detailed component information',
705
- type: 'boolean'
704
+ name: "detailed",
705
+ description: "Show detailed component information",
706
+ type: "boolean"
706
707
  },
707
708
  {
708
- name: 'health-check',
709
- description: 'Perform comprehensive health checks',
710
- type: 'boolean'
709
+ name: "health-check",
710
+ description: "Perform comprehensive health checks",
711
+ type: "boolean"
711
712
  },
712
713
  {
713
- name: 'history',
714
- description: 'Show status history from logs',
715
- type: 'boolean'
714
+ name: "history",
715
+ description: "Show status history from logs",
716
+ type: "boolean"
716
717
  },
717
718
  {
718
- name: 'verbose',
719
- short: 'v',
720
- description: 'Enable verbose output',
721
- type: 'boolean'
719
+ name: "verbose",
720
+ short: "v",
721
+ description: "Enable verbose output",
722
+ type: "boolean"
722
723
  }
723
724
  ],
724
725
  action: enhancedStatusAction
725
726
  });
726
727
  } catch (err) {
727
- warning('Enhanced status command not available, using basic version');
728
+ warning("Enhanced status command not available, using basic version");
728
729
  // Fallback basic status command
729
730
  cli.command({
730
- name: 'status',
731
- description: 'Show system status',
731
+ name: "status",
732
+ description: "Show system status",
732
733
  action: async (ctx)=>{
733
734
  try {
734
735
  const persist = await getPersistence();
735
736
  const stats = await persist.getStats();
736
- const { access } = await import('fs/promises');
737
- const isRunning = await access('orchestrator.log').then(()=>true).catch(()=>false);
738
- success('Claude-Flow System Status:');
739
- console.log(`🟢 Status: ${isRunning ? 'Running' : 'Stopped'}`);
737
+ const { access } = await import("fs/promises");
738
+ const isRunning = await access("orchestrator.log").then(()=>true).catch(()=>false);
739
+ success("Claude-Flow System Status:");
740
+ console.log(`🟢 Status: ${isRunning ? "Running" : "Stopped"}`);
740
741
  console.log(`🤖 Agents: ${stats.activeAgents} active (${stats.totalAgents} total)`);
741
742
  console.log(`📋 Tasks: ${stats.pendingTasks} in queue (${stats.totalTasks} total)`);
742
743
  console.log(`💾 Memory: Ready`);
743
744
  console.log(`🖥️ Terminal Pool: Ready`);
744
- console.log(`🌐 MCP Server: ${isRunning ? 'Running' : 'Stopped'}`);
745
+ console.log(`🌐 MCP Server: ${isRunning ? "Running" : "Stopped"}`);
745
746
  if (ctx.flags.verbose) {
746
- console.log('\nDetailed Statistics:');
747
+ console.log("\nDetailed Statistics:");
747
748
  console.log(` Total Agents: ${stats.totalAgents}`);
748
749
  console.log(` Active Agents: ${stats.activeAgents}`);
749
750
  console.log(` Total Tasks: ${stats.totalTasks}`);
@@ -758,15 +759,15 @@ export function setupCommands(cli) {
758
759
  }
759
760
  // MCP command
760
761
  cli.command({
761
- name: 'mcp',
762
- description: 'Manage MCP server and tools',
762
+ name: "mcp",
763
+ description: "Manage MCP server and tools",
763
764
  action: async (ctx)=>{
764
765
  const subcommand = ctx.args[0];
765
766
  switch(subcommand){
766
- case 'start':
767
+ case "start":
767
768
  {
768
769
  const port = ctx.flags.port || 3000;
769
- const host = ctx.flags.host || 'localhost';
770
+ const host = ctx.flags.host || "localhost";
770
771
  try {
771
772
  // MCP server is part of the orchestrator start process
772
773
  const orch = await getOrchestrator();
@@ -784,13 +785,13 @@ export function setupCommands(cli) {
784
785
  }
785
786
  break;
786
787
  }
787
- case 'stop':
788
+ case "stop":
788
789
  {
789
790
  try {
790
791
  const orch = await getOrchestrator();
791
792
  const health = await orch.healthCheck();
792
793
  if (!health.healthy) {
793
- info('MCP server is not running');
794
+ info("MCP server is not running");
794
795
  } else {
795
796
  warning("MCP server runs as part of the orchestrator. Use 'claude-flow-novice stop' to stop the entire system");
796
797
  }
@@ -799,18 +800,18 @@ export function setupCommands(cli) {
799
800
  }
800
801
  break;
801
802
  }
802
- case 'status':
803
+ case "status":
803
804
  {
804
805
  try {
805
806
  const orch = await getOrchestrator();
806
807
  const health = await orch.healthCheck();
807
- success('MCP Server Status:');
808
- console.log(`🌐 Status: ${health.mcp ? 'Running' : 'Stopped'}`);
808
+ success("MCP Server Status:");
809
+ console.log(`🌐 Status: ${health.mcp ? "Running" : "Stopped"}`);
809
810
  if (health.mcp) {
810
811
  const config = await getConfigManager();
811
812
  const mcpConfig = config.get().mcp;
812
813
  console.log(`📍 Address: ${mcpConfig.host}:${mcpConfig.port}`);
813
- console.log(`🔐 Authentication: ${mcpConfig.auth ? 'Enabled' : 'Disabled'}`);
814
+ console.log(`🔐 Authentication: ${mcpConfig.auth ? "Enabled" : "Disabled"}`);
814
815
  console.log(`🔧 Tools: Available`);
815
816
  console.log(`📊 Metrics: Collecting`);
816
817
  }
@@ -819,44 +820,44 @@ export function setupCommands(cli) {
819
820
  }
820
821
  break;
821
822
  }
822
- case 'tools':
823
+ case "tools":
823
824
  {
824
825
  try {
825
- success('Available MCP Tools:');
826
- console.log(' 📊 Research Tools:');
827
- console.log(' • web_search - Search the web for information');
828
- console.log(' • web_fetch - Fetch content from URLs');
829
- console.log(' • knowledge_query - Query knowledge base');
830
- console.log(' 💻 Code Tools:');
831
- console.log(' • code_edit - Edit code files');
832
- console.log(' • code_search - Search through codebase');
833
- console.log(' • code_analyze - Analyze code quality');
834
- console.log(' 🖥️ Terminal Tools:');
835
- console.log(' • terminal_execute - Execute shell commands');
836
- console.log(' • terminal_session - Manage terminal sessions');
837
- console.log(' • file_operations - File system operations');
838
- console.log(' 💾 Memory Tools:');
839
- console.log(' • memory_store - Store information');
840
- console.log(' • memory_query - Query stored information');
841
- console.log(' • memory_index - Index and search content');
826
+ success("Available MCP Tools:");
827
+ console.log(" 📊 Research Tools:");
828
+ console.log(" • web_search - Search the web for information");
829
+ console.log(" • web_fetch - Fetch content from URLs");
830
+ console.log(" • knowledge_query - Query knowledge base");
831
+ console.log(" 💻 Code Tools:");
832
+ console.log(" • code_edit - Edit code files");
833
+ console.log(" • code_search - Search through codebase");
834
+ console.log(" • code_analyze - Analyze code quality");
835
+ console.log(" 🖥️ Terminal Tools:");
836
+ console.log(" • terminal_execute - Execute shell commands");
837
+ console.log(" • terminal_session - Manage terminal sessions");
838
+ console.log(" • file_operations - File system operations");
839
+ console.log(" 💾 Memory Tools:");
840
+ console.log(" • memory_store - Store information");
841
+ console.log(" • memory_query - Query stored information");
842
+ console.log(" • memory_index - Index and search content");
842
843
  } catch (err) {
843
844
  error(`Failed to list tools: ${err.message}`);
844
845
  }
845
846
  break;
846
847
  }
847
- case 'config':
848
+ case "config":
848
849
  {
849
850
  try {
850
851
  const config = await getConfigManager();
851
852
  const mcpConfig = config.get().mcp;
852
- success('MCP Configuration:');
853
+ success("MCP Configuration:");
853
854
  console.log(JSON.stringify(mcpConfig, null, 2));
854
855
  } catch (err) {
855
856
  error(`Failed to show MCP config: ${err.message}`);
856
857
  }
857
858
  break;
858
859
  }
859
- case 'restart':
860
+ case "restart":
860
861
  {
861
862
  try {
862
863
  warning("MCP server runs as part of the orchestrator. Use 'claude-flow-novice stop' then 'claude-flow-novice start' to restart the entire system");
@@ -865,18 +866,18 @@ export function setupCommands(cli) {
865
866
  }
866
867
  break;
867
868
  }
868
- case 'logs':
869
+ case "logs":
869
870
  {
870
871
  const lines = ctx.flags.lines || 50;
871
872
  try {
872
873
  // Mock logs since logging system might not be fully implemented
873
874
  success(`MCP Server Logs (last ${lines} lines):`);
874
- console.log('2024-01-10 10:00:00 [INFO] MCP server started on localhost:3000');
875
- console.log('2024-01-10 10:00:01 [INFO] Tools registered: 12');
876
- console.log('2024-01-10 10:00:02 [INFO] Authentication disabled');
877
- console.log('2024-01-10 10:01:00 [INFO] Client connected: claude-desktop');
878
- console.log('2024-01-10 10:01:05 [INFO] Tool called: web_search');
879
- console.log('2024-01-10 10:01:10 [INFO] Tool response sent successfully');
875
+ console.log("2024-01-10 10:00:00 [INFO] MCP server started on localhost:3000");
876
+ console.log("2024-01-10 10:00:01 [INFO] Tools registered: 12");
877
+ console.log("2024-01-10 10:00:02 [INFO] Authentication disabled");
878
+ console.log("2024-01-10 10:01:00 [INFO] Client connected: claude-desktop");
879
+ console.log("2024-01-10 10:01:05 [INFO] Tool called: web_search");
880
+ console.log("2024-01-10 10:01:10 [INFO] Tool response sent successfully");
880
881
  } catch (err) {
881
882
  error(`Failed to get logs: ${err.message}`);
882
883
  }
@@ -885,7 +886,7 @@ export function setupCommands(cli) {
885
886
  default:
886
887
  {
887
888
  error(`Unknown mcp subcommand: ${subcommand}`);
888
- console.log('Available subcommands: start, stop, status, tools, config, restart, logs');
889
+ console.log("Available subcommands: start, stop, status, tools, config, restart, logs");
889
890
  break;
890
891
  }
891
892
  }
@@ -893,27 +894,27 @@ export function setupCommands(cli) {
893
894
  });
894
895
  // Memory command
895
896
  cli.command({
896
- name: 'memory',
897
- description: 'Manage memory bank',
897
+ name: "memory",
898
+ description: "Manage memory bank",
898
899
  aliases: [
899
- 'mem'
900
+ "mem"
900
901
  ],
901
902
  action: async (ctx)=>{
902
903
  const subcommand = ctx.args[0];
903
904
  const memory = new SimpleMemoryManager();
904
905
  switch(subcommand){
905
- case 'store':
906
+ case "store":
906
907
  {
907
908
  const key = ctx.args[1];
908
- const value = ctx.args.slice(2).join(' '); // Join all remaining args as value
909
+ const value = ctx.args.slice(2).join(" "); // Join all remaining args as value
909
910
  if (!key || !value) {
910
- error('Usage: memory store <key> <value>');
911
+ error("Usage: memory store <key> <value>");
911
912
  break;
912
913
  }
913
914
  try {
914
- const namespace = ctx.flags.namespace || ctx.flags.n || 'default';
915
+ const namespace = ctx.flags.namespace || ctx.flags.n || "default";
915
916
  await memory.store(key, value, namespace);
916
- success('Stored successfully');
917
+ success("Stored successfully");
917
918
  console.log(`📝 Key: ${key}`);
918
919
  console.log(`📦 Namespace: ${namespace}`);
919
920
  console.log(`💾 Size: ${new TextEncoder().encode(value).length} bytes`);
@@ -922,11 +923,11 @@ export function setupCommands(cli) {
922
923
  }
923
924
  break;
924
925
  }
925
- case 'query':
926
+ case "query":
926
927
  {
927
- const search = ctx.args.slice(1).join(' '); // Join all remaining args as search
928
+ const search = ctx.args.slice(1).join(" "); // Join all remaining args as search
928
929
  if (!search) {
929
- error('Usage: memory query <search>');
930
+ error("Usage: memory query <search>");
930
931
  break;
931
932
  }
932
933
  try {
@@ -934,7 +935,7 @@ export function setupCommands(cli) {
934
935
  const limit = ctx.flags.limit || ctx.flags.l || 10;
935
936
  const results = await memory.query(search, namespace);
936
937
  if (results.length === 0) {
937
- warning('No results found');
938
+ warning("No results found");
938
939
  return;
939
940
  }
940
941
  success(`Found ${results.length} results:`);
@@ -942,7 +943,7 @@ export function setupCommands(cli) {
942
943
  for (const entry of limited){
943
944
  console.log(blue(`\n📌 ${entry.key}`));
944
945
  console.log(` Namespace: ${entry.namespace}`);
945
- console.log(` Value: ${entry.value.substring(0, 100)}${entry.value.length > 100 ? '...' : ''}`);
946
+ console.log(` Value: ${entry.value.substring(0, 100)}${entry.value.length > 100 ? "..." : ""}`);
946
947
  console.log(` Stored: ${new Date(entry.timestamp).toLocaleString()}`);
947
948
  }
948
949
  if (results.length > limit) {
@@ -953,17 +954,17 @@ export function setupCommands(cli) {
953
954
  }
954
955
  break;
955
956
  }
956
- case 'export':
957
+ case "export":
957
958
  {
958
959
  const file = ctx.args[1];
959
960
  if (!file) {
960
- error('Usage: memory export <file>');
961
+ error("Usage: memory export <file>");
961
962
  break;
962
963
  }
963
964
  try {
964
965
  await memory.exportData(file);
965
966
  const stats = await memory.getStats();
966
- success('Memory exported successfully');
967
+ success("Memory exported successfully");
967
968
  console.log(`📁 File: ${file}`);
968
969
  console.log(`📊 Entries: ${stats.totalEntries}`);
969
970
  console.log(`💾 Size: ${(stats.sizeBytes / 1024).toFixed(2)} KB`);
@@ -972,17 +973,17 @@ export function setupCommands(cli) {
972
973
  }
973
974
  break;
974
975
  }
975
- case 'import':
976
+ case "import":
976
977
  {
977
978
  const file = ctx.args[1];
978
979
  if (!file) {
979
- error('Usage: memory import <file>');
980
+ error("Usage: memory import <file>");
980
981
  break;
981
982
  }
982
983
  try {
983
984
  await memory.importData(file);
984
985
  const stats = await memory.getStats();
985
- success('Memory imported successfully');
986
+ success("Memory imported successfully");
986
987
  console.log(`📁 File: ${file}`);
987
988
  console.log(`📊 Entries: ${stats.totalEntries}`);
988
989
  console.log(`🗂️ Namespaces: ${stats.namespaces}`);
@@ -991,16 +992,16 @@ export function setupCommands(cli) {
991
992
  }
992
993
  break;
993
994
  }
994
- case 'stats':
995
+ case "stats":
995
996
  {
996
997
  try {
997
998
  const stats = await memory.getStats();
998
- success('Memory Bank Statistics:');
999
+ success("Memory Bank Statistics:");
999
1000
  console.log(` Total Entries: ${stats.totalEntries}`);
1000
1001
  console.log(` Namespaces: ${stats.namespaces}`);
1001
1002
  console.log(` Size: ${(stats.sizeBytes / 1024).toFixed(2)} KB`);
1002
1003
  if (stats.namespaces > 0) {
1003
- console.log(blue('\n📁 Namespace Breakdown:'));
1004
+ console.log(blue("\n📁 Namespace Breakdown:"));
1004
1005
  for (const [namespace, count] of Object.entries(stats.namespaceStats)){
1005
1006
  console.log(` ${namespace}: ${count} entries`);
1006
1007
  }
@@ -1010,12 +1011,12 @@ export function setupCommands(cli) {
1010
1011
  }
1011
1012
  break;
1012
1013
  }
1013
- case 'cleanup':
1014
+ case "cleanup":
1014
1015
  {
1015
1016
  try {
1016
1017
  const days = ctx.flags.days || ctx.flags.d || 30;
1017
1018
  const removed = await memory.cleanup(days);
1018
- success('Cleanup completed');
1019
+ success("Cleanup completed");
1019
1020
  console.log(`🗑️ Removed: ${removed} entries older than ${days} days`);
1020
1021
  } catch (err) {
1021
1022
  error(`Failed to cleanup: ${err.message}`);
@@ -1024,12 +1025,12 @@ export function setupCommands(cli) {
1024
1025
  }
1025
1026
  default:
1026
1027
  {
1027
- console.log('Available subcommands: store, query, export, import, stats, cleanup');
1028
- console.log('\nExamples:');
1029
- console.log(` ${blue('memory store')} previous_work "Research findings from yesterday"`);
1030
- console.log(` ${blue('memory query')} research`);
1031
- console.log(` ${blue('memory export')} backup.json`);
1032
- console.log(` ${blue('memory stats')}`);
1028
+ console.log("Available subcommands: store, query, export, import, stats, cleanup");
1029
+ console.log("\nExamples:");
1030
+ console.log(` ${blue("memory store")} previous_work "Research findings from yesterday"`);
1031
+ console.log(` ${blue("memory query")} research`);
1032
+ console.log(` ${blue("memory export")} backup.json`);
1033
+ console.log(` ${blue("memory stats")}`);
1033
1034
  break;
1034
1035
  }
1035
1036
  }
@@ -1037,98 +1038,98 @@ export function setupCommands(cli) {
1037
1038
  });
1038
1039
  // Claude command
1039
1040
  cli.command({
1040
- name: 'claude',
1041
- description: 'Spawn Claude instances with specific configurations',
1041
+ name: "claude",
1042
+ description: "Spawn Claude instances with specific configurations",
1042
1043
  aliases: [
1043
- 'cl'
1044
+ "cl"
1044
1045
  ],
1045
1046
  options: [
1046
1047
  {
1047
- name: 'tools',
1048
- short: 't',
1049
- description: 'Allowed tools (comma-separated)',
1050
- type: 'string',
1051
- default: 'View,Edit,Replace,GlobTool,GrepTool,LS,Bash'
1048
+ name: "tools",
1049
+ short: "t",
1050
+ description: "Allowed tools (comma-separated)",
1051
+ type: "string",
1052
+ default: "View,Edit,Replace,GlobTool,GrepTool,LS,Bash"
1052
1053
  },
1053
1054
  {
1054
- name: 'no-permissions',
1055
- description: 'Use --dangerously-skip-permissions flag',
1056
- type: 'boolean'
1055
+ name: "no-permissions",
1056
+ description: "Use --dangerously-skip-permissions flag",
1057
+ type: "boolean"
1057
1058
  },
1058
1059
  {
1059
- name: 'config',
1060
- short: 'c',
1061
- description: 'MCP config file path',
1062
- type: 'string'
1060
+ name: "config",
1061
+ short: "c",
1062
+ description: "MCP config file path",
1063
+ type: "string"
1063
1064
  },
1064
1065
  {
1065
- name: 'mode',
1066
- short: 'm',
1067
- description: 'Development mode (full, backend-only, frontend-only, api-only)',
1068
- type: 'string',
1069
- default: 'full'
1066
+ name: "mode",
1067
+ short: "m",
1068
+ description: "Development mode (full, backend-only, frontend-only, api-only)",
1069
+ type: "string",
1070
+ default: "full"
1070
1071
  },
1071
1072
  {
1072
- name: 'parallel',
1073
- description: 'Enable parallel execution with BatchTool',
1074
- type: 'boolean'
1073
+ name: "parallel",
1074
+ description: "Enable parallel execution with BatchTool",
1075
+ type: "boolean"
1075
1076
  },
1076
1077
  {
1077
- name: 'research',
1078
- description: 'Enable web research with WebFetchTool',
1079
- type: 'boolean'
1078
+ name: "research",
1079
+ description: "Enable web research with WebFetchTool",
1080
+ type: "boolean"
1080
1081
  },
1081
1082
  {
1082
- name: 'coverage',
1083
- description: 'Test coverage target percentage',
1084
- type: 'number',
1083
+ name: "coverage",
1084
+ description: "Test coverage target percentage",
1085
+ type: "number",
1085
1086
  default: 80
1086
1087
  },
1087
1088
  {
1088
- name: 'commit',
1089
- description: 'Commit frequency (phase, feature, manual)',
1090
- type: 'string',
1091
- default: 'phase'
1089
+ name: "commit",
1090
+ description: "Commit frequency (phase, feature, manual)",
1091
+ type: "string",
1092
+ default: "phase"
1092
1093
  },
1093
1094
  {
1094
- name: 'verbose',
1095
- short: 'v',
1096
- description: 'Enable verbose output',
1097
- type: 'boolean'
1095
+ name: "verbose",
1096
+ short: "v",
1097
+ description: "Enable verbose output",
1098
+ type: "boolean"
1098
1099
  },
1099
1100
  {
1100
- name: 'dry-run',
1101
- short: 'd',
1102
- description: 'Show what would be executed without running',
1103
- type: 'boolean'
1101
+ name: "dry-run",
1102
+ short: "d",
1103
+ description: "Show what would be executed without running",
1104
+ type: "boolean"
1104
1105
  }
1105
1106
  ],
1106
1107
  action: async (ctx)=>{
1107
1108
  const subcommand = ctx.args[0];
1108
1109
  switch(subcommand){
1109
- case 'spawn':
1110
+ case "spawn":
1110
1111
  {
1111
1112
  // Find where flags start (arguments starting with -)
1112
1113
  let taskEndIndex = ctx.args.length;
1113
1114
  for(let i = 1; i < ctx.args.length; i++){
1114
- if (ctx.args[i].startsWith('-')) {
1115
+ if (ctx.args[i].startsWith("-")) {
1115
1116
  taskEndIndex = i;
1116
1117
  break;
1117
1118
  }
1118
1119
  }
1119
- const task = ctx.args.slice(1, taskEndIndex).join(' ');
1120
+ const task = ctx.args.slice(1, taskEndIndex).join(" ");
1120
1121
  if (!task) {
1121
- error('Usage: claude spawn <task description>');
1122
+ error("Usage: claude spawn <task description>");
1122
1123
  break;
1123
1124
  }
1124
1125
  try {
1125
1126
  // Build allowed tools list
1126
- let tools = ctx.flags.tools || 'View,Edit,Replace,GlobTool,GrepTool,LS,Bash';
1127
+ let tools = ctx.flags.tools || "View,Edit,Replace,GlobTool,GrepTool,LS,Bash";
1127
1128
  if (ctx.flags.parallel) {
1128
- tools += ',BatchTool,dispatch_agent';
1129
+ tools += ",BatchTool,dispatch_agent";
1129
1130
  }
1130
1131
  if (ctx.flags.research) {
1131
- tools += ',WebFetchTool';
1132
+ tools += ",WebFetchTool";
1132
1133
  }
1133
1134
  const instanceId = `claude-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
1134
1135
  // Build enhanced task with Claude-Flow guidance
@@ -1175,23 +1176,23 @@ You are running within the Claude-Flow orchestration system, which provides powe
1175
1176
 
1176
1177
  2. **During Execution**:
1177
1178
  - Store findings: \`npx claude-flow-novice memory store findings "your data here"\`
1178
- - Save checkpoints: \`npx claude-flow-novice memory store progress_${task.replace(/\s+/g, '_')} "current status"\`
1179
- ${ctx.flags.parallel ? '- Spawn agents: `npx claude-flow-novice agent spawn researcher --name "research-agent"`' : ''}
1180
- ${ctx.flags.parallel ? '- Create tasks: `npx claude-flow-novice task create implementation "implement feature X"`' : ''}
1179
+ - Save checkpoints: \`npx claude-flow-novice memory store progress_${task.replace(/\s+/g, "_")} "current status"\`
1180
+ ${ctx.flags.parallel ? '- Spawn agents: `npx claude-flow-novice agent spawn researcher --name "research-agent"`' : ""}
1181
+ ${ctx.flags.parallel ? '- Create tasks: `npx claude-flow-novice task create implementation "implement feature X"`' : ""}
1181
1182
 
1182
1183
  3. **Best Practices**:
1183
1184
  - Use the Bash tool to run \`npx claude-flow\` commands
1184
1185
  - Store data as JSON strings for complex structures
1185
1186
  - Query memory before starting to check for existing work
1186
1187
  - Use descriptive keys for memory storage
1187
- ${ctx.flags.parallel ? '- Coordinate with other agents through shared memory' : ''}
1188
- ${ctx.flags.research ? '- Store research findings: `npx claude-flow-novice memory store research_findings "data"`' : ''}
1188
+ ${ctx.flags.parallel ? "- Coordinate with other agents through shared memory" : ""}
1189
+ ${ctx.flags.research ? '- Store research findings: `npx claude-flow-novice memory store research_findings "data"`' : ""}
1189
1190
 
1190
1191
  ## Configuration
1191
1192
  - Instance ID: ${instanceId}
1192
- - Mode: ${ctx.flags.mode || 'full'}
1193
+ - Mode: ${ctx.flags.mode || "full"}
1193
1194
  - Coverage Target: ${ctx.flags.coverage || 80}%
1194
- - Commit Strategy: ${ctx.flags.commit || 'phase'}
1195
+ - Commit Strategy: ${ctx.flags.commit || "phase"}
1195
1196
 
1196
1197
  ## Example Commands
1197
1198
 
@@ -1215,66 +1216,66 @@ Bash("npx claude-flow-novice agent spawn researcher --name auth-researcher")
1215
1216
  Now, please proceed with the task: ${task}`;
1216
1217
  // Build Claude command with enhanced task
1217
1218
  const claudeCmd = [
1218
- 'claude',
1219
+ "claude",
1219
1220
  enhancedTask
1220
1221
  ];
1221
- claudeCmd.push('--allowedTools', tools);
1222
- if (ctx.flags.noPermissions || ctx.flags['skip-permissions']) {
1223
- claudeCmd.push('--dangerously-skip-permissions');
1222
+ claudeCmd.push("--allowedTools", tools);
1223
+ if (ctx.flags.noPermissions || ctx.flags["skip-permissions"]) {
1224
+ claudeCmd.push("--dangerously-skip-permissions");
1224
1225
  }
1225
1226
  if (ctx.flags.config) {
1226
- claudeCmd.push('--mcp-config', ctx.flags.config);
1227
+ claudeCmd.push("--mcp-config", ctx.flags.config);
1227
1228
  }
1228
1229
  if (ctx.flags.verbose) {
1229
- claudeCmd.push('--verbose');
1230
+ claudeCmd.push("--verbose");
1230
1231
  }
1231
- if (ctx.flags.dryRun || ctx.flags['dry-run'] || ctx.flags.d) {
1232
- warning('DRY RUN - Would execute:');
1232
+ if (ctx.flags.dryRun || ctx.flags["dry-run"] || ctx.flags.d) {
1233
+ warning("DRY RUN - Would execute:");
1233
1234
  console.log(`Command: claude "<enhanced task with guidance>" --allowedTools ${tools}`);
1234
1235
  console.log(`Instance ID: ${instanceId}`);
1235
1236
  console.log(`Original Task: ${task}`);
1236
1237
  console.log(`Tools: ${tools}`);
1237
- console.log(`Mode: ${ctx.flags.mode || 'full'}`);
1238
+ console.log(`Mode: ${ctx.flags.mode || "full"}`);
1238
1239
  console.log(`Coverage: ${ctx.flags.coverage || 80}%`);
1239
- console.log(`Commit: ${ctx.flags.commit || 'phase'}`);
1240
+ console.log(`Commit: ${ctx.flags.commit || "phase"}`);
1240
1241
  console.log(`\nEnhanced Features:`);
1241
1242
  console.log(` - Memory Bank enabled via: npx claude-flow-novice memory commands`);
1242
- console.log(` - Coordination ${ctx.flags.parallel ? 'enabled' : 'disabled'}`);
1243
+ console.log(` - Coordination ${ctx.flags.parallel ? "enabled" : "disabled"}`);
1243
1244
  console.log(` - Access Claude-Flow features through Bash tool`);
1244
1245
  return;
1245
1246
  }
1246
1247
  success(`Spawning Claude instance: ${instanceId}`);
1247
1248
  console.log(`📝 Original Task: ${task}`);
1248
1249
  console.log(`🔧 Tools: ${tools}`);
1249
- console.log(`⚙️ Mode: ${ctx.flags.mode || 'full'}`);
1250
+ console.log(`⚙️ Mode: ${ctx.flags.mode || "full"}`);
1250
1251
  console.log(`📊 Coverage: ${ctx.flags.coverage || 80}%`);
1251
- console.log(`💾 Commit: ${ctx.flags.commit || 'phase'}`);
1252
+ console.log(`💾 Commit: ${ctx.flags.commit || "phase"}`);
1252
1253
  console.log(`✨ Enhanced with Claude-Flow guidance for memory and coordination`);
1253
- console.log('');
1254
- console.log('📋 Task will be enhanced with:');
1255
- console.log(' - Memory Bank instructions (store/retrieve)');
1256
- console.log(' - Coordination capabilities (swarm management)');
1257
- console.log(' - Best practices for multi-agent workflows');
1258
- console.log('');
1254
+ console.log("");
1255
+ console.log("📋 Task will be enhanced with:");
1256
+ console.log(" - Memory Bank instructions (store/retrieve)");
1257
+ console.log(" - Coordination capabilities (swarm management)");
1258
+ console.log(" - Best practices for multi-agent workflows");
1259
+ console.log("");
1259
1260
  // Execute Claude command
1260
- const { spawn } = await import('child_process');
1261
- const child = spawn('claude', claudeCmd.slice(1).map((arg)=>arg.replace(/^"|"$/g, '')), {
1261
+ const { spawn } = await import("child_process");
1262
+ const child = spawn("claude", claudeCmd.slice(1).map((arg)=>arg.replace(/^"|"$/g, "")), {
1262
1263
  env: {
1263
1264
  ...process.env,
1264
1265
  CLAUDE_INSTANCE_ID: instanceId,
1265
- CLAUDE_FLOW_MODE: ctx.flags.mode || 'full',
1266
+ CLAUDE_FLOW_MODE: ctx.flags.mode || "full",
1266
1267
  CLAUDE_FLOW_COVERAGE: (ctx.flags.coverage || 80).toString(),
1267
- CLAUDE_FLOW_COMMIT: ctx.flags.commit || 'phase',
1268
+ CLAUDE_FLOW_COMMIT: ctx.flags.commit || "phase",
1268
1269
  // Add Claude-Flow specific features
1269
- CLAUDE_FLOW_MEMORY_ENABLED: 'true',
1270
- CLAUDE_FLOW_MEMORY_NAMESPACE: 'default',
1271
- CLAUDE_FLOW_COORDINATION_ENABLED: ctx.flags.parallel ? 'true' : 'false',
1272
- CLAUDE_FLOW_FEATURES: 'memory,coordination,swarm'
1270
+ CLAUDE_FLOW_MEMORY_ENABLED: "true",
1271
+ CLAUDE_FLOW_MEMORY_NAMESPACE: "default",
1272
+ CLAUDE_FLOW_COORDINATION_ENABLED: ctx.flags.parallel ? "true" : "false",
1273
+ CLAUDE_FLOW_FEATURES: "memory,coordination,swarm"
1273
1274
  },
1274
- stdio: 'inherit'
1275
+ stdio: "inherit"
1275
1276
  });
1276
1277
  const status = await new Promise((resolve)=>{
1277
- child.on('close', (code)=>{
1278
+ child.on("close", (code)=>{
1278
1279
  resolve({
1279
1280
  success: code === 0,
1280
1281
  code
@@ -1291,60 +1292,60 @@ Now, please proceed with the task: ${task}`;
1291
1292
  }
1292
1293
  break;
1293
1294
  }
1294
- case 'batch':
1295
+ case "batch":
1295
1296
  {
1296
1297
  const workflowFile = ctx.args[1];
1297
1298
  if (!workflowFile) {
1298
- error('Usage: claude batch <workflow-file>');
1299
+ error("Usage: claude batch <workflow-file>");
1299
1300
  break;
1300
1301
  }
1301
1302
  try {
1302
- const { readFile } = await import('fs/promises');
1303
- const content = await readFile(workflowFile, 'utf-8');
1303
+ const { readFile } = await import("fs/promises");
1304
+ const content = await readFile(workflowFile, "utf-8");
1304
1305
  const workflow = JSON.parse(content);
1305
- success(`Loading workflow: ${workflow.name || 'Unnamed'}`);
1306
+ success(`Loading workflow: ${workflow.name || "Unnamed"}`);
1306
1307
  console.log(`📋 Tasks: ${workflow.tasks?.length || 0}`);
1307
1308
  if (!workflow.tasks || workflow.tasks.length === 0) {
1308
- warning('No tasks found in workflow');
1309
+ warning("No tasks found in workflow");
1309
1310
  return;
1310
1311
  }
1311
1312
  const promises = [];
1312
1313
  for (const task of workflow.tasks){
1313
1314
  const claudeCmd = [
1314
- 'claude',
1315
+ "claude",
1315
1316
  `"${task.description || task.name}"`
1316
1317
  ];
1317
1318
  // Add tools
1318
1319
  if (task.tools) {
1319
- const toolsList = Array.isArray(task.tools) ? task.tools.join(',') : task.tools;
1320
- claudeCmd.push('--allowedTools', toolsList);
1320
+ const toolsList = Array.isArray(task.tools) ? task.tools.join(",") : task.tools;
1321
+ claudeCmd.push("--allowedTools", toolsList);
1321
1322
  }
1322
1323
  // Add flags
1323
1324
  if (task.skipPermissions || task.dangerouslySkipPermissions) {
1324
- claudeCmd.push('--dangerously-skip-permissions');
1325
+ claudeCmd.push("--dangerously-skip-permissions");
1325
1326
  }
1326
1327
  if (task.config) {
1327
- claudeCmd.push('--mcp-config', task.config);
1328
+ claudeCmd.push("--mcp-config", task.config);
1328
1329
  }
1329
1330
  const taskId = task.id || `task-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
1330
- if (ctx.flags.dryRun || ctx.flags['dry-run']) {
1331
- console.log(`\n${yellow('DRY RUN')} - Task: ${task.name || taskId}`);
1332
- console.log(`Command: ${claudeCmd.join(' ')}`);
1331
+ if (ctx.flags.dryRun || ctx.flags["dry-run"]) {
1332
+ console.log(`\n${yellow("DRY RUN")} - Task: ${task.name || taskId}`);
1333
+ console.log(`Command: ${claudeCmd.join(" ")}`);
1333
1334
  continue;
1334
1335
  }
1335
1336
  console.log(`\n🚀 Spawning Claude for task: ${task.name || taskId}`);
1336
- const { spawn } = await import('child_process');
1337
- const child = spawn('claude', claudeCmd.slice(1).map((arg)=>arg.replace(/^"|"$/g, '')), {
1337
+ const { spawn } = await import("child_process");
1338
+ const child = spawn("claude", claudeCmd.slice(1).map((arg)=>arg.replace(/^"|"$/g, "")), {
1338
1339
  env: {
1339
1340
  ...process.env,
1340
1341
  CLAUDE_TASK_ID: taskId,
1341
- CLAUDE_TASK_TYPE: task.type || 'general'
1342
+ CLAUDE_TASK_TYPE: task.type || "general"
1342
1343
  },
1343
- stdio: 'inherit'
1344
+ stdio: "inherit"
1344
1345
  });
1345
1346
  if (workflow.parallel) {
1346
1347
  promises.push(new Promise((resolve)=>{
1347
- child.on('close', (code)=>{
1348
+ child.on("close", (code)=>{
1348
1349
  resolve({
1349
1350
  success: code === 0,
1350
1351
  code
@@ -1354,7 +1355,7 @@ Now, please proceed with the task: ${task}`;
1354
1355
  } else {
1355
1356
  // Wait for completion if sequential
1356
1357
  const status = await new Promise((resolve)=>{
1357
- child.on('close', (code)=>{
1358
+ child.on("close", (code)=>{
1358
1359
  resolve({
1359
1360
  success: code === 0,
1360
1361
  code
@@ -1367,13 +1368,13 @@ Now, please proceed with the task: ${task}`;
1367
1368
  }
1368
1369
  }
1369
1370
  if (workflow.parallel && promises.length > 0) {
1370
- success('All Claude instances spawned in parallel mode');
1371
+ success("All Claude instances spawned in parallel mode");
1371
1372
  const results = await Promise.all(promises);
1372
1373
  const failed = results.filter((s)=>!s.success).length;
1373
1374
  if (failed > 0) {
1374
1375
  warning(`${failed} tasks failed`);
1375
1376
  } else {
1376
- success('All tasks completed successfully');
1377
+ success("All tasks completed successfully");
1377
1378
  }
1378
1379
  }
1379
1380
  } catch (err) {
@@ -1383,11 +1384,11 @@ Now, please proceed with the task: ${task}`;
1383
1384
  }
1384
1385
  default:
1385
1386
  {
1386
- console.log('Available subcommands: spawn, batch');
1387
- console.log('\nExamples:');
1387
+ console.log("Available subcommands: spawn, batch");
1388
+ console.log("\nExamples:");
1388
1389
  console.log(' claude-flow-novice claude spawn "implement user authentication" --research --parallel');
1389
1390
  console.log(' claude-flow-novice claude spawn "fix bug in payment system" --no-permissions');
1390
- console.log(' claude-flow-novice claude batch workflow.json --dry-run');
1391
+ console.log(" claude-flow-novice claude batch workflow.json --dry-run");
1391
1392
  break;
1392
1393
  }
1393
1394
  }
@@ -1404,34 +1405,34 @@ Now, please proceed with the task: ${task}`;
1404
1405
  alerts: ctx.flags.alerts,
1405
1406
  export: ctx.flags.export,
1406
1407
  threshold: ctx.flags.threshold || 80,
1407
- logLevel: ctx.flags.logLevel || ctx.flags['log-level'] || 'info',
1408
- noGraphs: ctx.flags.noGraphs || ctx.flags['no-graphs']
1408
+ logLevel: ctx.flags.logLevel || ctx.flags["log-level"] || "info",
1409
+ noGraphs: ctx.flags.noGraphs || ctx.flags["no-graphs"]
1409
1410
  };
1410
- console.log(chalk.cyan('📊 Enhanced Monitor Command'));
1411
- console.log('For full enhanced functionality, use: claude-flow-novice monitor [options]');
1412
- console.log('Available options: --interval, --compact, --focus, --alerts, --export, --threshold, --log-level, --no-graphs');
1411
+ console.log(chalk.cyan("📊 Enhanced Monitor Command"));
1412
+ console.log("For full enhanced functionality, use: claude-flow-novice monitor [options]");
1413
+ console.log("Available options: --interval, --compact, --focus, --alerts, --export, --threshold, --log-level, --no-graphs");
1413
1414
  // Fallback to basic monitoring
1414
1415
  try {
1415
1416
  const persist = await getPersistence();
1416
1417
  const stats = await persist.getStats();
1417
- const { access } = await import('fs/promises');
1418
- const isRunning = await access('orchestrator.log').then(()=>true).catch(()=>false);
1418
+ const { access } = await import("fs/promises");
1419
+ const isRunning = await access("orchestrator.log").then(()=>true).catch(()=>false);
1419
1420
  if (!isRunning) {
1420
1421
  warning("Orchestrator is not running. Start it first with 'claude-flow-novice start'");
1421
1422
  return;
1422
1423
  }
1423
- info('Starting enhanced monitoring dashboard...');
1424
- console.log('Press Ctrl+C to exit');
1424
+ info("Starting enhanced monitoring dashboard...");
1425
+ console.log("Press Ctrl+C to exit");
1425
1426
  const interval = Number(options.interval) * 1000;
1426
1427
  let running = true;
1427
1428
  const cleanup = ()=>{
1428
1429
  running = false;
1429
- console.log('\nMonitor stopped');
1430
+ console.log("\nMonitor stopped");
1430
1431
  process.exit(0);
1431
1432
  };
1432
- process.on('SIGINT', cleanup);
1433
- process.on('SIGTERM', cleanup);
1434
- process.stdout.write('\x1b[?25l');
1433
+ process.on("SIGINT", cleanup);
1434
+ process.on("SIGTERM", cleanup);
1435
+ process.stdout.write("\x1b[?25l");
1435
1436
  let cycles = 0;
1436
1437
  while(running){
1437
1438
  try {
@@ -1440,8 +1441,8 @@ Now, please proceed with the task: ${task}`;
1440
1441
  const agents = await persist.getActiveAgents();
1441
1442
  const tasks = await persist.getActiveTasks();
1442
1443
  // Enhanced header
1443
- success('Claude-Flow Enhanced Live Monitor');
1444
- console.log(''.repeat(60));
1444
+ success("Claude-Flow Enhanced Live Monitor");
1445
+ console.log("".repeat(60));
1445
1446
  console.log(`Update #${++cycles} • ${new Date().toLocaleTimeString()} • Interval: ${options.interval}s`);
1446
1447
  if (options.focus) {
1447
1448
  console.log(`🎯 Focus: ${options.focus}`);
@@ -1450,12 +1451,12 @@ Now, please proceed with the task: ${task}`;
1450
1451
  console.log(`🚨 Alerts: Enabled (threshold: ${options.threshold}%)`);
1451
1452
  }
1452
1453
  // System overview with thresholds
1453
- console.log('\n📊 System Overview:');
1454
+ console.log("\n📊 System Overview:");
1454
1455
  const cpuUsage = Math.random() * 100;
1455
1456
  const memoryUsage = Math.random() * 1000;
1456
1457
  const threshold = Number(options.threshold || 80);
1457
- const cpuColor = cpuUsage > threshold ? '🔴' : cpuUsage > threshold * 0.8 ? '🟡' : '🟢';
1458
- const memoryColor = memoryUsage > 800 ? '🔴' : memoryUsage > 600 ? '🟡' : '🟢';
1458
+ const cpuColor = cpuUsage > threshold ? "🔴" : cpuUsage > threshold * 0.8 ? "🟡" : "🟢";
1459
+ const memoryColor = memoryUsage > 800 ? "🔴" : memoryUsage > 600 ? "🟡" : "🟢";
1459
1460
  console.log(` ${cpuColor} CPU: ${cpuUsage.toFixed(1)}%`);
1460
1461
  console.log(` ${memoryColor} Memory: ${memoryUsage.toFixed(0)}MB`);
1461
1462
  console.log(` 🤖 Agents: ${currentStats.activeAgents} active (${currentStats.totalAgents} total)`);
@@ -1463,27 +1464,27 @@ Now, please proceed with the task: ${task}`;
1463
1464
  console.log(` ✅ Completed: ${currentStats.completedTasks} tasks`);
1464
1465
  // Performance metrics
1465
1466
  if (!options.compact) {
1466
- console.log('\n📈 Performance Metrics:');
1467
+ console.log("\n📈 Performance Metrics:");
1467
1468
  console.log(` Response Time: ${(800 + Math.random() * 400).toFixed(0)}ms`);
1468
1469
  console.log(` Throughput: ${(40 + Math.random() * 20).toFixed(1)} req/min`);
1469
1470
  console.log(` Error Rate: ${(Math.random() * 2).toFixed(2)}%`);
1470
1471
  // Simple ASCII graph simulation
1471
1472
  if (!options.noGraphs) {
1472
- console.log('\n📊 CPU Trend (last 10 updates):');
1473
+ console.log("\n📊 CPU Trend (last 10 updates):");
1473
1474
  const trend = Array.from({
1474
1475
  length: 10
1475
1476
  }, ()=>Math.floor(Math.random() * 8));
1476
1477
  const chars = [
1477
- '',
1478
- '',
1479
- '',
1480
- '',
1481
- '',
1482
- '',
1483
- '',
1484
- ''
1478
+ "",
1479
+ "",
1480
+ "",
1481
+ "",
1482
+ "",
1483
+ "",
1484
+ "",
1485
+ ""
1485
1486
  ];
1486
- console.log(` ${trend.map((i)=>chars[i]).join('')}`);
1487
+ console.log(` ${trend.map((i)=>chars[i]).join("")}`);
1487
1488
  }
1488
1489
  }
1489
1490
  // Active components (if focused)
@@ -1496,18 +1497,18 @@ Now, please proceed with the task: ${task}`;
1496
1497
  }
1497
1498
  // Alerts simulation
1498
1499
  if (options.alerts && Math.random() > 0.8) {
1499
- console.log('\n🚨 Active Alerts:');
1500
+ console.log("\n🚨 Active Alerts:");
1500
1501
  console.log(` ⚠️ High CPU usage detected`);
1501
1502
  console.log(` 📊 Memory usage approaching threshold`);
1502
1503
  }
1503
1504
  // Export status
1504
1505
  if (options.export) {
1505
- console.log('\n💾 Export Status:');
1506
+ console.log("\n💾 Export Status:");
1506
1507
  console.log(` Exporting to: ${options.export}`);
1507
1508
  console.log(` Data points: ${cycles}`);
1508
1509
  }
1509
1510
  // Footer
1510
- console.log('\n' + ''.repeat(60));
1511
+ console.log("\n" + "".repeat(60));
1511
1512
  console.log(`Log Level: ${options.logLevel} • Threshold: ${options.threshold}% • Press Ctrl+C to exit`);
1512
1513
  await new Promise((resolve)=>setTimeout(resolve, interval));
1513
1514
  } catch (err) {
@@ -1515,115 +1516,115 @@ Now, please proceed with the task: ${task}`;
1515
1516
  await new Promise((resolve)=>setTimeout(resolve, interval));
1516
1517
  }
1517
1518
  }
1518
- process.stdout.write('\x1b[?25h');
1519
+ process.stdout.write("\x1b[?25h");
1519
1520
  } catch (err) {
1520
1521
  error(`Failed to start enhanced monitor: ${err.message}`);
1521
1522
  }
1522
1523
  };
1523
1524
  cli.command({
1524
- name: 'monitor',
1525
- description: 'Enhanced live monitoring dashboard with comprehensive metrics',
1525
+ name: "monitor",
1526
+ description: "Enhanced live monitoring dashboard with comprehensive metrics",
1526
1527
  options: [
1527
1528
  {
1528
- name: 'interval',
1529
- short: 'i',
1530
- description: 'Update interval in seconds',
1531
- type: 'number',
1529
+ name: "interval",
1530
+ short: "i",
1531
+ description: "Update interval in seconds",
1532
+ type: "number",
1532
1533
  default: 2
1533
1534
  },
1534
1535
  {
1535
- name: 'compact',
1536
- short: 'c',
1537
- description: 'Compact view mode',
1538
- type: 'boolean'
1536
+ name: "compact",
1537
+ short: "c",
1538
+ description: "Compact view mode",
1539
+ type: "boolean"
1539
1540
  },
1540
1541
  {
1541
- name: 'focus',
1542
- short: 'f',
1543
- description: 'Focus on specific component',
1544
- type: 'string'
1542
+ name: "focus",
1543
+ short: "f",
1544
+ description: "Focus on specific component",
1545
+ type: "string"
1545
1546
  },
1546
1547
  {
1547
- name: 'alerts',
1548
- description: 'Enable alert notifications',
1549
- type: 'boolean'
1548
+ name: "alerts",
1549
+ description: "Enable alert notifications",
1550
+ type: "boolean"
1550
1551
  },
1551
1552
  {
1552
- name: 'export',
1553
- description: 'Export monitoring data to file',
1554
- type: 'string'
1553
+ name: "export",
1554
+ description: "Export monitoring data to file",
1555
+ type: "string"
1555
1556
  },
1556
1557
  {
1557
- name: 'threshold',
1558
- description: 'Alert threshold percentage',
1559
- type: 'number',
1558
+ name: "threshold",
1559
+ description: "Alert threshold percentage",
1560
+ type: "number",
1560
1561
  default: 80
1561
1562
  },
1562
1563
  {
1563
- name: 'log-level',
1564
- description: 'Log level filter (error, warn, info, debug)',
1565
- type: 'string',
1566
- default: 'info'
1564
+ name: "log-level",
1565
+ description: "Log level filter (error, warn, info, debug)",
1566
+ type: "string",
1567
+ default: "info"
1567
1568
  },
1568
1569
  {
1569
- name: 'no-graphs',
1570
- description: 'Disable ASCII graphs',
1571
- type: 'boolean'
1570
+ name: "no-graphs",
1571
+ description: "Disable ASCII graphs",
1572
+ type: "boolean"
1572
1573
  }
1573
1574
  ],
1574
1575
  action: enhancedMonitorAction
1575
1576
  });
1576
1577
  } catch (err) {
1577
- warning('Enhanced monitor command not available, using basic version');
1578
+ warning("Enhanced monitor command not available, using basic version");
1578
1579
  // Fallback basic monitor command (original implementation)
1579
1580
  cli.command({
1580
- name: 'monitor',
1581
- description: 'Live monitoring dashboard',
1581
+ name: "monitor",
1582
+ description: "Live monitoring dashboard",
1582
1583
  options: [
1583
1584
  {
1584
- name: 'interval',
1585
- short: 'i',
1586
- description: 'Update interval in seconds',
1587
- type: 'number',
1585
+ name: "interval",
1586
+ short: "i",
1587
+ description: "Update interval in seconds",
1588
+ type: "number",
1588
1589
  default: 2
1589
1590
  },
1590
1591
  {
1591
- name: 'compact',
1592
- short: 'c',
1593
- description: 'Compact view mode',
1594
- type: 'boolean'
1592
+ name: "compact",
1593
+ short: "c",
1594
+ description: "Compact view mode",
1595
+ type: "boolean"
1595
1596
  },
1596
1597
  {
1597
- name: 'focus',
1598
- short: 'f',
1599
- description: 'Focus on specific component',
1600
- type: 'string'
1598
+ name: "focus",
1599
+ short: "f",
1600
+ description: "Focus on specific component",
1601
+ type: "string"
1601
1602
  }
1602
1603
  ],
1603
1604
  action: async (ctx)=>{
1604
1605
  // Original basic monitor implementation
1605
1606
  try {
1606
1607
  const persist = await getPersistence();
1607
- const { access } = await import('fs/promises');
1608
- const isRunning = await access('orchestrator.log').then(()=>true).catch(()=>false);
1608
+ const { access } = await import("fs/promises");
1609
+ const isRunning = await access("orchestrator.log").then(()=>true).catch(()=>false);
1609
1610
  if (!isRunning) {
1610
1611
  warning("Orchestrator is not running. Start it first with 'claude-flow-novice start'");
1611
1612
  return;
1612
1613
  }
1613
- info('Starting basic monitoring dashboard...');
1614
- console.log('Press Ctrl+C to exit');
1614
+ info("Starting basic monitoring dashboard...");
1615
+ console.log("Press Ctrl+C to exit");
1615
1616
  const interval = (ctx.flags.interval || 2) * 1000;
1616
1617
  let running = true;
1617
1618
  const cleanup = ()=>{
1618
1619
  running = false;
1619
- console.log('\nMonitor stopped');
1620
+ console.log("\nMonitor stopped");
1620
1621
  process.exit(0);
1621
1622
  };
1622
- process.on('SIGINT', cleanup);
1623
+ process.on("SIGINT", cleanup);
1623
1624
  while(running){
1624
1625
  console.clear();
1625
1626
  const stats = await persist.getStats();
1626
- success('Claude-Flow Live Monitor');
1627
+ success("Claude-Flow Live Monitor");
1627
1628
  console.log(`🟢 Status: Running`);
1628
1629
  console.log(`🤖 Agents: ${stats.activeAgents} active`);
1629
1630
  console.log(`📋 Tasks: ${stats.pendingTasks} pending`);
@@ -1638,183 +1639,183 @@ Now, please proceed with the task: ${task}`;
1638
1639
  }
1639
1640
  // Swarm command
1640
1641
  cli.command({
1641
- name: 'swarm',
1642
- description: 'Create self-orchestrating Claude agent swarms',
1642
+ name: "swarm",
1643
+ description: "Create self-orchestrating Claude agent swarms",
1643
1644
  options: [
1644
1645
  {
1645
- name: 'strategy',
1646
- short: 's',
1647
- description: 'Orchestration strategy (auto, research, development, analysis, testing, optimization, maintenance)',
1648
- type: 'string',
1649
- default: 'auto'
1646
+ name: "strategy",
1647
+ short: "s",
1648
+ description: "Orchestration strategy (auto, research, development, analysis, testing, optimization, maintenance)",
1649
+ type: "string",
1650
+ default: "auto"
1650
1651
  },
1651
1652
  {
1652
- name: 'mode',
1653
- short: 'm',
1654
- description: 'Coordination mode (centralized, distributed, hierarchical, mesh, hybrid)',
1655
- type: 'string',
1656
- default: 'centralized'
1653
+ name: "mode",
1654
+ short: "m",
1655
+ description: "Coordination mode (centralized, distributed, hierarchical, mesh, hybrid)",
1656
+ type: "string",
1657
+ default: "centralized"
1657
1658
  },
1658
1659
  {
1659
- name: 'max-agents',
1660
- description: 'Maximum number of agents to spawn',
1661
- type: 'number',
1660
+ name: "max-agents",
1661
+ description: "Maximum number of agents to spawn",
1662
+ type: "number",
1662
1663
  default: 5
1663
1664
  },
1664
1665
  {
1665
- name: 'max-depth',
1666
- description: 'Maximum delegation depth',
1667
- type: 'number',
1666
+ name: "max-depth",
1667
+ description: "Maximum delegation depth",
1668
+ type: "number",
1668
1669
  default: 3
1669
1670
  },
1670
1671
  {
1671
- name: 'research',
1672
- description: 'Enable research capabilities for all agents',
1673
- type: 'boolean'
1672
+ name: "research",
1673
+ description: "Enable research capabilities for all agents",
1674
+ type: "boolean"
1674
1675
  },
1675
1676
  {
1676
- name: 'parallel',
1677
- description: 'Enable parallel execution',
1678
- type: 'boolean'
1677
+ name: "parallel",
1678
+ description: "Enable parallel execution",
1679
+ type: "boolean"
1679
1680
  },
1680
1681
  {
1681
- name: 'memory-namespace',
1682
- description: 'Shared memory namespace',
1683
- type: 'string',
1684
- default: 'swarm'
1682
+ name: "memory-namespace",
1683
+ description: "Shared memory namespace",
1684
+ type: "string",
1685
+ default: "swarm"
1685
1686
  },
1686
1687
  {
1687
- name: 'timeout',
1688
- description: 'Swarm timeout in minutes',
1689
- type: 'number',
1688
+ name: "timeout",
1689
+ description: "Swarm timeout in minutes",
1690
+ type: "number",
1690
1691
  default: 60
1691
1692
  },
1692
1693
  {
1693
- name: 'review',
1694
- description: 'Enable peer review between agents',
1695
- type: 'boolean'
1694
+ name: "review",
1695
+ description: "Enable peer review between agents",
1696
+ type: "boolean"
1696
1697
  },
1697
1698
  {
1698
- name: 'coordinator',
1699
- description: 'Spawn dedicated coordinator agent',
1700
- type: 'boolean'
1699
+ name: "coordinator",
1700
+ description: "Spawn dedicated coordinator agent",
1701
+ type: "boolean"
1701
1702
  },
1702
1703
  {
1703
- name: 'config',
1704
- short: 'c',
1705
- description: 'MCP config file',
1706
- type: 'string'
1704
+ name: "config",
1705
+ short: "c",
1706
+ description: "MCP config file",
1707
+ type: "string"
1707
1708
  },
1708
1709
  {
1709
- name: 'verbose',
1710
- short: 'v',
1711
- description: 'Enable verbose output',
1712
- type: 'boolean'
1710
+ name: "verbose",
1711
+ short: "v",
1712
+ description: "Enable verbose output",
1713
+ type: "boolean"
1713
1714
  },
1714
1715
  {
1715
- name: 'dry-run',
1716
- short: 'd',
1717
- description: 'Preview swarm configuration',
1718
- type: 'boolean'
1716
+ name: "dry-run",
1717
+ short: "d",
1718
+ description: "Preview swarm configuration",
1719
+ type: "boolean"
1719
1720
  },
1720
1721
  {
1721
- name: 'vscode',
1722
- description: 'Use VS Code terminal integration',
1723
- type: 'boolean'
1722
+ name: "vscode",
1723
+ description: "Use VS Code terminal integration",
1724
+ type: "boolean"
1724
1725
  },
1725
1726
  {
1726
- name: 'monitor',
1727
- description: 'Enable real-time monitoring',
1728
- type: 'boolean'
1727
+ name: "monitor",
1728
+ description: "Enable real-time monitoring",
1729
+ type: "boolean"
1729
1730
  },
1730
1731
  {
1731
- name: 'ui',
1732
- description: 'Use blessed terminal UI (avoids TTY issues)',
1733
- type: 'boolean'
1732
+ name: "ui",
1733
+ description: "Use blessed terminal UI (avoids TTY issues)",
1734
+ type: "boolean"
1734
1735
  },
1735
1736
  {
1736
- name: 'claude',
1737
- description: 'Launch Claude Code with swarm coordination prompt',
1738
- type: 'boolean'
1737
+ name: "claude",
1738
+ description: "Launch Claude Code with swarm coordination prompt",
1739
+ type: "boolean"
1739
1740
  },
1740
1741
  {
1741
- name: 'executor',
1742
- description: 'Use built-in executor instead of Claude Code',
1743
- type: 'boolean'
1742
+ name: "executor",
1743
+ description: "Use built-in executor instead of Claude Code",
1744
+ type: "boolean"
1744
1745
  }
1745
1746
  ],
1746
1747
  action: swarmAction
1747
1748
  });
1748
1749
  // Enhanced SPARC command
1749
1750
  cli.command({
1750
- name: 'sparc',
1751
- description: 'Enhanced SPARC-based TDD development with specialized modes and orchestration',
1751
+ name: "sparc",
1752
+ description: "Enhanced SPARC-based TDD development with specialized modes and orchestration",
1752
1753
  options: [
1753
1754
  {
1754
- name: 'namespace',
1755
- short: 'n',
1756
- description: 'Memory namespace for this session',
1757
- type: 'string',
1758
- default: 'sparc'
1755
+ name: "namespace",
1756
+ short: "n",
1757
+ description: "Memory namespace for this session",
1758
+ type: "string",
1759
+ default: "sparc"
1759
1760
  },
1760
1761
  {
1761
- name: 'no-permissions',
1762
- description: 'Skip permission prompts',
1763
- type: 'boolean'
1762
+ name: "no-permissions",
1763
+ description: "Skip permission prompts",
1764
+ type: "boolean"
1764
1765
  },
1765
1766
  {
1766
- name: 'config',
1767
- short: 'c',
1768
- description: 'MCP configuration file',
1769
- type: 'string'
1767
+ name: "config",
1768
+ short: "c",
1769
+ description: "MCP configuration file",
1770
+ type: "string"
1770
1771
  },
1771
1772
  {
1772
- name: 'verbose',
1773
- short: 'v',
1774
- description: 'Enable verbose output',
1775
- type: 'boolean'
1773
+ name: "verbose",
1774
+ short: "v",
1775
+ description: "Enable verbose output",
1776
+ type: "boolean"
1776
1777
  },
1777
1778
  {
1778
- name: 'dry-run',
1779
- short: 'd',
1780
- description: 'Preview what would be executed',
1781
- type: 'boolean'
1779
+ name: "dry-run",
1780
+ short: "d",
1781
+ description: "Preview what would be executed",
1782
+ type: "boolean"
1782
1783
  },
1783
1784
  {
1784
- name: 'sequential',
1785
- description: 'Wait between workflow steps',
1786
- type: 'boolean',
1785
+ name: "sequential",
1786
+ description: "Wait between workflow steps",
1787
+ type: "boolean",
1787
1788
  default: true
1788
1789
  },
1789
1790
  {
1790
- name: 'batch',
1791
- description: 'Enable batch operations for efficiency',
1792
- type: 'boolean'
1791
+ name: "batch",
1792
+ description: "Enable batch operations for efficiency",
1793
+ type: "boolean"
1793
1794
  },
1794
1795
  {
1795
- name: 'parallel',
1796
- description: 'Enable parallel agent execution',
1797
- type: 'boolean'
1796
+ name: "parallel",
1797
+ description: "Enable parallel agent execution",
1798
+ type: "boolean"
1798
1799
  },
1799
1800
  {
1800
- name: 'orchestration',
1801
- description: 'Enable orchestration features',
1802
- type: 'boolean',
1801
+ name: "orchestration",
1802
+ description: "Enable orchestration features",
1803
+ type: "boolean",
1803
1804
  default: true
1804
1805
  }
1805
1806
  ],
1806
1807
  action: async (ctx)=>{
1807
1808
  try {
1808
- console.log(chalk.cyan('🚀 Enhanced SPARC Development Mode'));
1809
- console.log('Features: TDD + Orchestration + Batch Operations + Memory Management');
1809
+ console.log(chalk.cyan("🚀 Enhanced SPARC Development Mode"));
1810
+ console.log("Features: TDD + Orchestration + Batch Operations + Memory Management");
1810
1811
  if (ctx.flags.batch) {
1811
- console.log('✨ Batch operations enabled for efficient file handling');
1812
+ console.log("✨ Batch operations enabled for efficient file handling");
1812
1813
  }
1813
1814
  if (ctx.flags.parallel) {
1814
- console.log('⚡ Parallel agent execution enabled');
1815
+ console.log("⚡ Parallel agent execution enabled");
1815
1816
  }
1816
1817
  if (ctx.flags.orchestration) {
1817
- console.log('🎼 Orchestration features enabled');
1818
+ console.log("🎼 Orchestration features enabled");
1818
1819
  }
1819
1820
  // Call the original SPARC action with enhanced features
1820
1821
  await sparcAction(ctx);
@@ -1828,77 +1829,77 @@ Now, please proceed with the task: ${task}`;
1828
1829
  cli.command(migrateCmd);
1829
1830
  // Swarm UI command (convenience wrapper)
1830
1831
  cli.command({
1831
- name: 'swarm-ui',
1832
- description: 'Create self-orchestrating Claude agent swarms with blessed UI',
1832
+ name: "swarm-ui",
1833
+ description: "Create self-orchestrating Claude agent swarms with blessed UI",
1833
1834
  options: [
1834
1835
  {
1835
- name: 'strategy',
1836
- short: 's',
1837
- description: 'Orchestration strategy (auto, research, development, analysis)',
1838
- type: 'string',
1839
- default: 'auto'
1836
+ name: "strategy",
1837
+ short: "s",
1838
+ description: "Orchestration strategy (auto, research, development, analysis)",
1839
+ type: "string",
1840
+ default: "auto"
1840
1841
  },
1841
1842
  {
1842
- name: 'max-agents',
1843
- description: 'Maximum number of agents to spawn',
1844
- type: 'number',
1843
+ name: "max-agents",
1844
+ description: "Maximum number of agents to spawn",
1845
+ type: "number",
1845
1846
  default: 5
1846
1847
  },
1847
1848
  {
1848
- name: 'max-depth',
1849
- description: 'Maximum delegation depth',
1850
- type: 'number',
1849
+ name: "max-depth",
1850
+ description: "Maximum delegation depth",
1851
+ type: "number",
1851
1852
  default: 3
1852
1853
  },
1853
1854
  {
1854
- name: 'research',
1855
- description: 'Enable research capabilities for all agents',
1856
- type: 'boolean'
1855
+ name: "research",
1856
+ description: "Enable research capabilities for all agents",
1857
+ type: "boolean"
1857
1858
  },
1858
1859
  {
1859
- name: 'parallel',
1860
- description: 'Enable parallel execution',
1861
- type: 'boolean'
1860
+ name: "parallel",
1861
+ description: "Enable parallel execution",
1862
+ type: "boolean"
1862
1863
  },
1863
1864
  {
1864
- name: 'memory-namespace',
1865
- description: 'Shared memory namespace',
1866
- type: 'string',
1867
- default: 'swarm'
1865
+ name: "memory-namespace",
1866
+ description: "Shared memory namespace",
1867
+ type: "string",
1868
+ default: "swarm"
1868
1869
  },
1869
1870
  {
1870
- name: 'timeout',
1871
- description: 'Swarm timeout in minutes',
1872
- type: 'number',
1871
+ name: "timeout",
1872
+ description: "Swarm timeout in minutes",
1873
+ type: "number",
1873
1874
  default: 60
1874
1875
  },
1875
1876
  {
1876
- name: 'review',
1877
- description: 'Enable peer review between agents',
1878
- type: 'boolean'
1877
+ name: "review",
1878
+ description: "Enable peer review between agents",
1879
+ type: "boolean"
1879
1880
  },
1880
1881
  {
1881
- name: 'coordinator',
1882
- description: 'Spawn dedicated coordinator agent',
1883
- type: 'boolean'
1882
+ name: "coordinator",
1883
+ description: "Spawn dedicated coordinator agent",
1884
+ type: "boolean"
1884
1885
  },
1885
1886
  {
1886
- name: 'config',
1887
- short: 'c',
1888
- description: 'MCP config file',
1889
- type: 'string'
1887
+ name: "config",
1888
+ short: "c",
1889
+ description: "MCP config file",
1890
+ type: "string"
1890
1891
  },
1891
1892
  {
1892
- name: 'verbose',
1893
- short: 'v',
1894
- description: 'Enable verbose output',
1895
- type: 'boolean'
1893
+ name: "verbose",
1894
+ short: "v",
1895
+ description: "Enable verbose output",
1896
+ type: "boolean"
1896
1897
  },
1897
1898
  {
1898
- name: 'dry-run',
1899
- short: 'd',
1900
- description: 'Preview swarm configuration',
1901
- type: 'boolean'
1899
+ name: "dry-run",
1900
+ short: "d",
1901
+ description: "Preview swarm configuration",
1902
+ type: "boolean"
1902
1903
  }
1903
1904
  ],
1904
1905
  action: async (ctx)=>{
@@ -1910,30 +1911,30 @@ Now, please proceed with the task: ${task}`;
1910
1911
  // Enhanced session command integration
1911
1912
  try {
1912
1913
  const enhancedSessionAction = async (ctx)=>{
1913
- console.log(chalk.cyan('💾 Enhanced Session Management'));
1914
- console.log('For full enhanced functionality, use: claude-flow-novice session <command> [options]');
1914
+ console.log(chalk.cyan("💾 Enhanced Session Management"));
1915
+ console.log("For full enhanced functionality, use: claude-flow-novice session <command> [options]");
1915
1916
  console.log();
1916
- console.log('Available commands:');
1917
- console.log(' list - List all saved sessions with status');
1918
- console.log(' save - Save current session state');
1919
- console.log(' restore - Restore a saved session');
1920
- console.log(' delete - Delete a saved session');
1921
- console.log(' export - Export session to file');
1922
- console.log(' import - Import session from file');
1923
- console.log(' info - Show detailed session information');
1924
- console.log(' clean - Clean up old or orphaned sessions');
1925
- console.log(' backup - Backup sessions to archive');
1926
- console.log(' restore-backup - Restore sessions from backup');
1927
- console.log(' validate - Validate session integrity');
1928
- console.log(' monitor - Monitor active sessions in real-time');
1917
+ console.log("Available commands:");
1918
+ console.log(" list - List all saved sessions with status");
1919
+ console.log(" save - Save current session state");
1920
+ console.log(" restore - Restore a saved session");
1921
+ console.log(" delete - Delete a saved session");
1922
+ console.log(" export - Export session to file");
1923
+ console.log(" import - Import session from file");
1924
+ console.log(" info - Show detailed session information");
1925
+ console.log(" clean - Clean up old or orphaned sessions");
1926
+ console.log(" backup - Backup sessions to archive");
1927
+ console.log(" restore-backup - Restore sessions from backup");
1928
+ console.log(" validate - Validate session integrity");
1929
+ console.log(" monitor - Monitor active sessions in real-time");
1929
1930
  console.log();
1930
- console.log('Enhanced features:');
1931
- console.log(' ✨ Comprehensive lifecycle management');
1932
- console.log(' ✨ Terminal session state preservation');
1933
- console.log(' ✨ Workflow and agent state tracking');
1934
- console.log(' ✨ Integrity validation and repair');
1935
- console.log(' ✨ Real-time session monitoring');
1936
- console.log(' ✨ Backup and restore capabilities');
1931
+ console.log("Enhanced features:");
1932
+ console.log(" ✨ Comprehensive lifecycle management");
1933
+ console.log(" ✨ Terminal session state preservation");
1934
+ console.log(" ✨ Workflow and agent state tracking");
1935
+ console.log(" ✨ Integrity validation and repair");
1936
+ console.log(" ✨ Real-time session monitoring");
1937
+ console.log(" ✨ Backup and restore capabilities");
1937
1938
  const subcommand = ctx.args[0];
1938
1939
  if (subcommand) {
1939
1940
  console.log();
@@ -1941,66 +1942,66 @@ Now, please proceed with the task: ${task}`;
1941
1942
  }
1942
1943
  };
1943
1944
  cli.command({
1944
- name: 'session',
1945
- description: 'Enhanced session management with comprehensive lifecycle support',
1945
+ name: "session",
1946
+ description: "Enhanced session management with comprehensive lifecycle support",
1946
1947
  action: enhancedSessionAction
1947
1948
  });
1948
1949
  } catch (err) {
1949
- warning('Enhanced session command not available');
1950
+ warning("Enhanced session command not available");
1950
1951
  }
1951
1952
  // Enhanced orchestration start command integration
1952
1953
  try {
1953
1954
  const enhancedStartAction = async (ctx)=>{
1954
- console.log(chalk.cyan('🧠 Enhanced Claude-Flow Orchestration System'));
1955
- console.log('Features: Service Management + Health Checks + Auto-Recovery + Process UI');
1955
+ console.log(chalk.cyan("🧠 Enhanced Claude-Flow Orchestration System"));
1956
+ console.log("Features: Service Management + Health Checks + Auto-Recovery + Process UI");
1956
1957
  console.log();
1957
1958
  const options = {
1958
1959
  daemon: ctx.flags.daemon || ctx.flags.d,
1959
1960
  port: ctx.flags.port || ctx.flags.p || 3000,
1960
- mcpTransport: ctx.flags.mcpTransport || ctx.flags['mcp-transport'] || 'stdio',
1961
+ mcpTransport: ctx.flags.mcpTransport || ctx.flags["mcp-transport"] || "stdio",
1961
1962
  ui: ctx.flags.ui || ctx.flags.u,
1962
1963
  verbose: ctx.flags.verbose || ctx.flags.v,
1963
- autoStart: ctx.flags.autoStart || ctx.flags['auto-start'],
1964
+ autoStart: ctx.flags.autoStart || ctx.flags["auto-start"],
1964
1965
  config: ctx.flags.config,
1965
1966
  force: ctx.flags.force,
1966
- healthCheck: ctx.flags.healthCheck || ctx.flags['health-check'],
1967
+ healthCheck: ctx.flags.healthCheck || ctx.flags["health-check"],
1967
1968
  timeout: ctx.flags.timeout || 60
1968
1969
  };
1969
1970
  if (options.ui) {
1970
- console.log('🎮 Launching interactive process management UI...');
1971
+ console.log("🎮 Launching interactive process management UI...");
1971
1972
  }
1972
1973
  if (options.daemon) {
1973
- console.log('🔧 Starting in daemon mode with enhanced service management...');
1974
+ console.log("🔧 Starting in daemon mode with enhanced service management...");
1974
1975
  }
1975
1976
  if (options.healthCheck) {
1976
- console.log('🏥 Performing pre-flight health checks...');
1977
+ console.log("🏥 Performing pre-flight health checks...");
1977
1978
  }
1978
1979
  console.log();
1979
- console.log('For full enhanced functionality, use: claude-flow-novice start [options]');
1980
- console.log('Available options: --daemon, --port, --mcp-transport, --ui, --verbose, --auto-start, --force, --health-check, --timeout');
1980
+ console.log("For full enhanced functionality, use: claude-flow-novice start [options]");
1981
+ console.log("Available options: --daemon, --port, --mcp-transport, --ui, --verbose, --auto-start, --force, --health-check, --timeout");
1981
1982
  // Fallback to basic start functionality
1982
1983
  try {
1983
1984
  const orch = await getOrchestrator();
1984
1985
  await orch.start();
1985
- success('Enhanced orchestration system started!');
1986
- info('Components initialized with enhanced features:');
1987
- console.log(' ✓ Event Bus with advanced routing');
1988
- console.log(' ✓ Orchestrator Engine with service management');
1989
- console.log(' ✓ Memory Manager with integrity checking');
1990
- console.log(' ✓ Terminal Pool with session recovery');
1991
- console.log(' ✓ MCP Server with enhanced transport');
1992
- console.log(' ✓ Coordination Manager with load balancing');
1986
+ success("Enhanced orchestration system started!");
1987
+ info("Components initialized with enhanced features:");
1988
+ console.log(" ✓ Event Bus with advanced routing");
1989
+ console.log(" ✓ Orchestrator Engine with service management");
1990
+ console.log(" ✓ Memory Manager with integrity checking");
1991
+ console.log(" ✓ Terminal Pool with session recovery");
1992
+ console.log(" ✓ MCP Server with enhanced transport");
1993
+ console.log(" ✓ Coordination Manager with load balancing");
1993
1994
  if (!options.daemon) {
1994
- info('Press Ctrl+C to stop the enhanced system');
1995
+ info("Press Ctrl+C to stop the enhanced system");
1995
1996
  const controller = new AbortController();
1996
1997
  const shutdown = ()=>{
1997
- console.log('\nShutting down enhanced system...');
1998
+ console.log("\nShutting down enhanced system...");
1998
1999
  controller.abort();
1999
2000
  };
2000
- process.on('SIGINT', shutdown);
2001
- process.on('SIGTERM', shutdown);
2001
+ process.on("SIGINT", shutdown);
2002
+ process.on("SIGTERM", shutdown);
2002
2003
  await new Promise((resolve)=>{
2003
- controller.signal.addEventListener('abort', ()=>resolve());
2004
+ controller.signal.addEventListener("abort", ()=>resolve());
2004
2005
  });
2005
2006
  }
2006
2007
  } catch (err) {
@@ -2010,399 +2011,399 @@ Now, please proceed with the task: ${task}`;
2010
2011
  };
2011
2012
  // Override the existing start command with enhanced version
2012
2013
  cli.command({
2013
- name: 'start',
2014
- description: 'Start the enhanced orchestration system with comprehensive service management',
2014
+ name: "start",
2015
+ description: "Start the enhanced orchestration system with comprehensive service management",
2015
2016
  options: [
2016
2017
  {
2017
- name: 'daemon',
2018
- short: 'd',
2019
- description: 'Run as daemon in background',
2020
- type: 'boolean'
2018
+ name: "daemon",
2019
+ short: "d",
2020
+ description: "Run as daemon in background",
2021
+ type: "boolean"
2021
2022
  },
2022
2023
  {
2023
- name: 'port',
2024
- short: 'p',
2025
- description: 'MCP server port',
2026
- type: 'number',
2024
+ name: "port",
2025
+ short: "p",
2026
+ description: "MCP server port",
2027
+ type: "number",
2027
2028
  default: 3000
2028
2029
  },
2029
2030
  {
2030
- name: 'mcp-transport',
2031
- description: 'MCP transport type (stdio, http)',
2032
- type: 'string',
2033
- default: 'stdio'
2031
+ name: "mcp-transport",
2032
+ description: "MCP transport type (stdio, http)",
2033
+ type: "string",
2034
+ default: "stdio"
2034
2035
  },
2035
2036
  {
2036
- name: 'ui',
2037
- short: 'u',
2038
- description: 'Launch interactive process management UI',
2039
- type: 'boolean'
2037
+ name: "ui",
2038
+ short: "u",
2039
+ description: "Launch interactive process management UI",
2040
+ type: "boolean"
2040
2041
  },
2041
2042
  {
2042
- name: 'verbose',
2043
- short: 'v',
2044
- description: 'Enable verbose logging',
2045
- type: 'boolean'
2043
+ name: "verbose",
2044
+ short: "v",
2045
+ description: "Enable verbose logging",
2046
+ type: "boolean"
2046
2047
  },
2047
2048
  {
2048
- name: 'auto-start',
2049
- description: 'Automatically start all processes',
2050
- type: 'boolean'
2049
+ name: "auto-start",
2050
+ description: "Automatically start all processes",
2051
+ type: "boolean"
2051
2052
  },
2052
2053
  {
2053
- name: 'config',
2054
- description: 'Configuration file path',
2055
- type: 'string'
2054
+ name: "config",
2055
+ description: "Configuration file path",
2056
+ type: "string"
2056
2057
  },
2057
2058
  {
2058
- name: 'force',
2059
- description: 'Force start even if already running',
2060
- type: 'boolean'
2059
+ name: "force",
2060
+ description: "Force start even if already running",
2061
+ type: "boolean"
2061
2062
  },
2062
2063
  {
2063
- name: 'health-check',
2064
- description: 'Perform health checks before starting',
2065
- type: 'boolean'
2064
+ name: "health-check",
2065
+ description: "Perform health checks before starting",
2066
+ type: "boolean"
2066
2067
  },
2067
2068
  {
2068
- name: 'timeout',
2069
- description: 'Startup timeout in seconds',
2070
- type: 'number',
2069
+ name: "timeout",
2070
+ description: "Startup timeout in seconds",
2071
+ type: "number",
2071
2072
  default: 60
2072
2073
  }
2073
2074
  ],
2074
2075
  action: enhancedStartAction
2075
2076
  });
2076
2077
  } catch (err) {
2077
- warning('Enhanced start command not available, using basic version');
2078
+ warning("Enhanced start command not available, using basic version");
2078
2079
  }
2079
2080
  // Help command
2080
2081
  cli.command({
2081
- name: 'help',
2082
- description: 'Show help information',
2082
+ name: "help",
2083
+ description: "Show help information",
2083
2084
  action: (ctx)=>{
2084
2085
  const command = ctx.args[0];
2085
- if (command === 'claude') {
2086
- console.log(bold(blue('Claude Instance Management')));
2086
+ if (command === "claude") {
2087
+ console.log(bold(blue("Claude Instance Management")));
2087
2088
  console.log();
2088
- console.log('Spawn and manage Claude Code instances with specific configurations.');
2089
+ console.log("Spawn and manage Claude Code instances with specific configurations.");
2089
2090
  console.log();
2090
- console.log(bold('Subcommands:'));
2091
- console.log(' spawn <task> Spawn Claude with specific configuration');
2092
- console.log(' batch <file> Execute multiple Claude instances from workflow');
2091
+ console.log(bold("Subcommands:"));
2092
+ console.log(" spawn <task> Spawn Claude with specific configuration");
2093
+ console.log(" batch <file> Execute multiple Claude instances from workflow");
2093
2094
  console.log();
2094
- console.log(bold('Spawn Options:'));
2095
- console.log(' -t, --tools <tools> Allowed tools (comma-separated)');
2096
- console.log(' --no-permissions Use --dangerously-skip-permissions flag');
2097
- console.log(' -c, --config <file> MCP config file path');
2098
- console.log(' -m, --mode <mode> Development mode (full/backend-only/frontend-only/api-only)');
2099
- console.log(' --parallel Enable parallel execution with BatchTool');
2100
- console.log(' --research Enable web research with WebFetchTool');
2101
- console.log(' --coverage <n> Test coverage target percentage (default: 80)');
2102
- console.log(' --commit <freq> Commit frequency (phase/feature/manual)');
2103
- console.log(' -v, --verbose Enable verbose output');
2104
- console.log(' -d, --dry-run Show what would be executed without running');
2095
+ console.log(bold("Spawn Options:"));
2096
+ console.log(" -t, --tools <tools> Allowed tools (comma-separated)");
2097
+ console.log(" --no-permissions Use --dangerously-skip-permissions flag");
2098
+ console.log(" -c, --config <file> MCP config file path");
2099
+ console.log(" -m, --mode <mode> Development mode (full/backend-only/frontend-only/api-only)");
2100
+ console.log(" --parallel Enable parallel execution with BatchTool");
2101
+ console.log(" --research Enable web research with WebFetchTool");
2102
+ console.log(" --coverage <n> Test coverage target percentage (default: 80)");
2103
+ console.log(" --commit <freq> Commit frequency (phase/feature/manual)");
2104
+ console.log(" -v, --verbose Enable verbose output");
2105
+ console.log(" -d, --dry-run Show what would be executed without running");
2105
2106
  console.log();
2106
- console.log(bold('Examples:'));
2107
- console.log(` ${blue('claude-flow-novice claude spawn')} "implement user authentication" --research --parallel`);
2108
- console.log(` ${blue('claude-flow-novice claude spawn')} "fix payment bug" --tools "View,Edit,Bash" --no-permissions`);
2109
- console.log(` ${blue('claude-flow-novice claude batch')} workflow.json --dry-run`);
2107
+ console.log(bold("Examples:"));
2108
+ console.log(` ${blue("claude-flow-novice claude spawn")} "implement user authentication" --research --parallel`);
2109
+ console.log(` ${blue("claude-flow-novice claude spawn")} "fix payment bug" --tools "View,Edit,Bash" --no-permissions`);
2110
+ console.log(` ${blue("claude-flow-novice claude batch")} workflow.json --dry-run`);
2110
2111
  console.log();
2111
- console.log('For more information, see: https://github.com/ruvnet/claude-code-flow/docs/11-claude-spawning.md');
2112
- } else if (command === 'swarm' || command === 'swarm-ui') {
2113
- console.log(bold(blue('Claude Swarm Mode')));
2112
+ console.log("For more information, see: https://github.com/ruvnet/claude-code-flow/docs/11-claude-spawning.md");
2113
+ } else if (command === "swarm" || command === "swarm-ui") {
2114
+ console.log(bold(blue("Claude Swarm Mode")));
2114
2115
  console.log();
2115
- console.log('Create self-orchestrating Claude agent swarms to tackle complex objectives.');
2116
+ console.log("Create self-orchestrating Claude agent swarms to tackle complex objectives.");
2116
2117
  console.log();
2117
- console.log(bold('Usage:'));
2118
- console.log(' claude-flow-novice swarm <objective> [options]');
2119
- console.log(' claude-flow-novice swarm-ui <objective> [options] # Uses blessed UI (avoids TTY issues)');
2118
+ console.log(bold("Usage:"));
2119
+ console.log(" claude-flow-novice swarm <objective> [options]");
2120
+ console.log(" claude-flow-novice swarm-ui <objective> [options] # Uses blessed UI (avoids TTY issues)");
2120
2121
  console.log();
2121
- console.log(bold('Options:'));
2122
- console.log(' -s, --strategy <s> Orchestration strategy (auto, research, development, analysis)');
2123
- console.log(' --max-agents <n> Maximum number of agents (default: 5)');
2124
- console.log(' --max-depth <n> Maximum delegation depth (default: 3)');
2125
- console.log(' --research Enable research capabilities for all agents');
2126
- console.log(' --parallel Enable parallel execution');
2127
- console.log(' --memory-namespace <ns> Shared memory namespace (default: swarm)');
2128
- console.log(' --timeout <minutes> Swarm timeout in minutes (default: 60)');
2129
- console.log(' --review Enable peer review between agents');
2130
- console.log(' --coordinator Spawn dedicated coordinator agent');
2131
- console.log(' -c, --config <file> MCP config file');
2132
- console.log(' -v, --verbose Enable verbose output');
2133
- console.log(' -d, --dry-run Preview swarm configuration');
2134
- console.log(' --vscode Use VS Code terminal integration');
2135
- console.log(' --monitor Enable real-time monitoring');
2136
- console.log(' --ui Use blessed terminal UI (avoids TTY issues)');
2122
+ console.log(bold("Options:"));
2123
+ console.log(" -s, --strategy <s> Orchestration strategy (auto, research, development, analysis)");
2124
+ console.log(" --max-agents <n> Maximum number of agents (default: 5)");
2125
+ console.log(" --max-depth <n> Maximum delegation depth (default: 3)");
2126
+ console.log(" --research Enable research capabilities for all agents");
2127
+ console.log(" --parallel Enable parallel execution");
2128
+ console.log(" --memory-namespace <ns> Shared memory namespace (default: swarm)");
2129
+ console.log(" --timeout <minutes> Swarm timeout in minutes (default: 60)");
2130
+ console.log(" --review Enable peer review between agents");
2131
+ console.log(" --coordinator Spawn dedicated coordinator agent");
2132
+ console.log(" -c, --config <file> MCP config file");
2133
+ console.log(" -v, --verbose Enable verbose output");
2134
+ console.log(" -d, --dry-run Preview swarm configuration");
2135
+ console.log(" --vscode Use VS Code terminal integration");
2136
+ console.log(" --monitor Enable real-time monitoring");
2137
+ console.log(" --ui Use blessed terminal UI (avoids TTY issues)");
2137
2138
  console.log();
2138
- console.log(bold('Examples:'));
2139
- console.log(` ${blue('claude-flow-novice swarm')} "Build a REST API"`);
2140
- console.log(` ${blue('claude-flow-novice swarm-ui')} "Build a REST API" # Avoids TTY issues`);
2141
- console.log(` ${blue('claude-flow-novice swarm')} "Research cloud architecture" --strategy research --research`);
2142
- console.log(` ${blue('claude-flow-novice swarm')} "Migrate app to microservices" --coordinator --review --ui`);
2139
+ console.log(bold("Examples:"));
2140
+ console.log(` ${blue("claude-flow-novice swarm")} "Build a REST API"`);
2141
+ console.log(` ${blue("claude-flow-novice swarm-ui")} "Build a REST API" # Avoids TTY issues`);
2142
+ console.log(` ${blue("claude-flow-novice swarm")} "Research cloud architecture" --strategy research --research`);
2143
+ console.log(` ${blue("claude-flow-novice swarm")} "Migrate app to microservices" --coordinator --review --ui`);
2143
2144
  console.log();
2144
- console.log(bold('TTY Issues?'));
2145
+ console.log(bold("TTY Issues?"));
2145
2146
  console.log("If you encounter 'Raw mode is not supported' errors, use:");
2146
- console.log(` - ${blue('claude-flow-novice swarm-ui')} <objective> # Recommended`);
2147
- console.log(` - ${blue('claude-flow-novice swarm')} <objective> --ui`);
2147
+ console.log(` - ${blue("claude-flow-novice swarm-ui")} <objective> # Recommended`);
2148
+ console.log(` - ${blue("claude-flow-novice swarm")} <objective> --ui`);
2148
2149
  console.log();
2149
- console.log('For more information, see:');
2150
- console.log(' - https://github.com/ruvnet/claude-code-flow/docs/12-swarm.md');
2151
- console.log(' - https://github.com/ruvnet/claude-code-flow/SWARM_TTY_SOLUTION.md');
2152
- } else if (command === 'sparc') {
2153
- console.log(bold(blue('SPARC Development Mode')));
2150
+ console.log("For more information, see:");
2151
+ console.log(" - https://github.com/ruvnet/claude-code-flow/docs/12-swarm.md");
2152
+ console.log(" - https://github.com/ruvnet/claude-code-flow/SWARM_TTY_SOLUTION.md");
2153
+ } else if (command === "sparc") {
2154
+ console.log(bold(blue("SPARC Development Mode")));
2154
2155
  console.log();
2155
- console.log('SPARC (Specification, Pseudocode, Architecture, Refinement, Completion)');
2156
- console.log('TDD-based development with specialized AI modes from .roomodes configuration.');
2156
+ console.log("SPARC (Specification, Pseudocode, Architecture, Refinement, Completion)");
2157
+ console.log("TDD-based development with specialized AI modes from .roomodes configuration.");
2157
2158
  console.log();
2158
- console.log(bold('Subcommands:'));
2159
- console.log(' modes List all available SPARC modes');
2160
- console.log(' info <mode> Show detailed information about a mode');
2161
- console.log(' run <mode> <task> Execute a task using a specific SPARC mode');
2162
- console.log(' tdd <task> Run full TDD workflow using SPARC methodology');
2163
- console.log(' workflow <file> Execute a custom SPARC workflow from JSON file');
2159
+ console.log(bold("Subcommands:"));
2160
+ console.log(" modes List all available SPARC modes");
2161
+ console.log(" info <mode> Show detailed information about a mode");
2162
+ console.log(" run <mode> <task> Execute a task using a specific SPARC mode");
2163
+ console.log(" tdd <task> Run full TDD workflow using SPARC methodology");
2164
+ console.log(" workflow <file> Execute a custom SPARC workflow from JSON file");
2164
2165
  console.log();
2165
- console.log(bold('Common Modes:'));
2166
- console.log(' spec-pseudocode Create specifications and pseudocode');
2167
- console.log(' architect Design system architecture');
2168
- console.log(' code Implement code solutions');
2169
- console.log(' tdd Test-driven development');
2170
- console.log(' debug Debug and troubleshoot issues');
2171
- console.log(' security-review Security analysis and review');
2172
- console.log(' docs-writer Documentation creation');
2173
- console.log(' integration System integration and testing');
2166
+ console.log(bold("Common Modes:"));
2167
+ console.log(" spec-pseudocode Create specifications and pseudocode");
2168
+ console.log(" architect Design system architecture");
2169
+ console.log(" code Implement code solutions");
2170
+ console.log(" tdd Test-driven development");
2171
+ console.log(" debug Debug and troubleshoot issues");
2172
+ console.log(" security-review Security analysis and review");
2173
+ console.log(" docs-writer Documentation creation");
2174
+ console.log(" integration System integration and testing");
2174
2175
  console.log();
2175
- console.log(bold('Options:'));
2176
- console.log(' -n, --namespace <ns> Memory namespace for this session');
2177
- console.log(' --no-permissions Skip permission prompts');
2178
- console.log(' -c, --config <file> MCP configuration file');
2179
- console.log(' -v, --verbose Enable verbose output');
2180
- console.log(' -d, --dry-run Preview what would be executed');
2181
- console.log(' --sequential Wait between workflow steps (default: true)');
2176
+ console.log(bold("Options:"));
2177
+ console.log(" -n, --namespace <ns> Memory namespace for this session");
2178
+ console.log(" --no-permissions Skip permission prompts");
2179
+ console.log(" -c, --config <file> MCP configuration file");
2180
+ console.log(" -v, --verbose Enable verbose output");
2181
+ console.log(" -d, --dry-run Preview what would be executed");
2182
+ console.log(" --sequential Wait between workflow steps (default: true)");
2182
2183
  console.log();
2183
- console.log(bold('Examples:'));
2184
- console.log(` ${blue('claude-flow-novice sparc modes')} # List all modes`);
2185
- console.log(` ${blue('claude-flow-novice sparc run code')} "implement user auth" # Run specific mode`);
2186
- console.log(` ${blue('claude-flow-novice sparc tdd')} "payment processing system" # Full TDD workflow`);
2187
- console.log(` ${blue('claude-flow-novice sparc workflow')} project-workflow.json # Custom workflow`);
2184
+ console.log(bold("Examples:"));
2185
+ console.log(` ${blue("claude-flow-novice sparc modes")} # List all modes`);
2186
+ console.log(` ${blue("claude-flow-novice sparc run code")} "implement user auth" # Run specific mode`);
2187
+ console.log(` ${blue("claude-flow-novice sparc tdd")} "payment processing system" # Full TDD workflow`);
2188
+ console.log(` ${blue("claude-flow-novice sparc workflow")} project-workflow.json # Custom workflow`);
2188
2189
  console.log();
2189
- console.log('For more information, see: https://github.com/ruvnet/claude-code-flow/docs/sparc.md');
2190
- } else if (command === 'start') {
2191
- console.log(bold(blue('Enhanced Start Command')));
2190
+ console.log("For more information, see: https://github.com/ruvnet/claude-code-flow/docs/sparc.md");
2191
+ } else if (command === "start") {
2192
+ console.log(bold(blue("Enhanced Start Command")));
2192
2193
  console.log();
2193
- console.log('Start the Claude-Flow orchestration system with comprehensive service management.');
2194
+ console.log("Start the Claude-Flow orchestration system with comprehensive service management.");
2194
2195
  console.log();
2195
- console.log(bold('Usage:'));
2196
- console.log(' claude-flow-novice start [options]');
2196
+ console.log(bold("Usage:"));
2197
+ console.log(" claude-flow-novice start [options]");
2197
2198
  console.log();
2198
- console.log(bold('Options:'));
2199
- console.log(' -d, --daemon Run as daemon in background');
2200
- console.log(' -p, --port <port> MCP server port (default: 3000)');
2201
- console.log(' --mcp-transport <type> MCP transport type (stdio, http)');
2202
- console.log(' -u, --ui Launch interactive process management UI');
2203
- console.log(' -v, --verbose Enable verbose logging');
2204
- console.log(' --auto-start Automatically start all processes');
2205
- console.log(' --config <path> Configuration file path');
2206
- console.log(' --force Force start even if already running');
2207
- console.log(' --health-check Perform health checks before starting');
2208
- console.log(' --timeout <seconds> Startup timeout in seconds (default: 60)');
2199
+ console.log(bold("Options:"));
2200
+ console.log(" -d, --daemon Run as daemon in background");
2201
+ console.log(" -p, --port <port> MCP server port (default: 3000)");
2202
+ console.log(" --mcp-transport <type> MCP transport type (stdio, http)");
2203
+ console.log(" -u, --ui Launch interactive process management UI");
2204
+ console.log(" -v, --verbose Enable verbose logging");
2205
+ console.log(" --auto-start Automatically start all processes");
2206
+ console.log(" --config <path> Configuration file path");
2207
+ console.log(" --force Force start even if already running");
2208
+ console.log(" --health-check Perform health checks before starting");
2209
+ console.log(" --timeout <seconds> Startup timeout in seconds (default: 60)");
2209
2210
  console.log();
2210
- console.log(bold('Examples:'));
2211
- console.log(` ${blue('claude-flow-novice start')} # Interactive mode`);
2212
- console.log(` ${blue('claude-flow-novice start --daemon')} # Background daemon`);
2213
- console.log(` ${blue('claude-flow-novice start --ui')} # Process management UI`);
2214
- console.log(` ${blue('claude-flow-novice start --health-check')} # With pre-flight checks`);
2215
- } else if (command === 'status') {
2216
- console.log(bold(blue('Enhanced Status Command')));
2211
+ console.log(bold("Examples:"));
2212
+ console.log(` ${blue("claude-flow-novice start")} # Interactive mode`);
2213
+ console.log(` ${blue("claude-flow-novice start --daemon")} # Background daemon`);
2214
+ console.log(` ${blue("claude-flow-novice start --ui")} # Process management UI`);
2215
+ console.log(` ${blue("claude-flow-novice start --health-check")} # With pre-flight checks`);
2216
+ } else if (command === "status") {
2217
+ console.log(bold(blue("Enhanced Status Command")));
2217
2218
  console.log();
2218
- console.log('Show comprehensive Claude-Flow system status with detailed reporting.');
2219
+ console.log("Show comprehensive Claude-Flow system status with detailed reporting.");
2219
2220
  console.log();
2220
- console.log(bold('Usage:'));
2221
- console.log(' claude-flow-novice status [options]');
2221
+ console.log(bold("Usage:"));
2222
+ console.log(" claude-flow-novice status [options]");
2222
2223
  console.log();
2223
- console.log(bold('Options:'));
2224
- console.log(' -w, --watch Watch mode - continuously update status');
2225
- console.log(' -i, --interval <seconds> Update interval in seconds (default: 5)');
2226
- console.log(' -c, --component <name> Show status for specific component');
2227
- console.log(' --json Output in JSON format');
2228
- console.log(' --detailed Show detailed component information');
2229
- console.log(' --health-check Perform comprehensive health checks');
2230
- console.log(' --history Show status history from logs');
2224
+ console.log(bold("Options:"));
2225
+ console.log(" -w, --watch Watch mode - continuously update status");
2226
+ console.log(" -i, --interval <seconds> Update interval in seconds (default: 5)");
2227
+ console.log(" -c, --component <name> Show status for specific component");
2228
+ console.log(" --json Output in JSON format");
2229
+ console.log(" --detailed Show detailed component information");
2230
+ console.log(" --health-check Perform comprehensive health checks");
2231
+ console.log(" --history Show status history from logs");
2231
2232
  console.log();
2232
- console.log(bold('Examples:'));
2233
- console.log(` ${blue('claude-flow-novice status')} # Basic status`);
2234
- console.log(` ${blue('claude-flow-novice status --watch')} # Live updates`);
2235
- console.log(` ${blue('claude-flow-novice status --detailed')} # Comprehensive info`);
2236
- console.log(` ${blue('claude-flow-novice status --component mcp')} # Specific component`);
2237
- } else if (command === 'monitor') {
2238
- console.log(bold(blue('Enhanced Monitor Command')));
2233
+ console.log(bold("Examples:"));
2234
+ console.log(` ${blue("claude-flow-novice status")} # Basic status`);
2235
+ console.log(` ${blue("claude-flow-novice status --watch")} # Live updates`);
2236
+ console.log(` ${blue("claude-flow-novice status --detailed")} # Comprehensive info`);
2237
+ console.log(` ${blue("claude-flow-novice status --component mcp")} # Specific component`);
2238
+ } else if (command === "monitor") {
2239
+ console.log(bold(blue("Enhanced Monitor Command")));
2239
2240
  console.log();
2240
- console.log('Real-time monitoring dashboard with comprehensive metrics and alerting.');
2241
+ console.log("Real-time monitoring dashboard with comprehensive metrics and alerting.");
2241
2242
  console.log();
2242
- console.log(bold('Usage:'));
2243
- console.log(' claude-flow-novice monitor [options]');
2243
+ console.log(bold("Usage:"));
2244
+ console.log(" claude-flow-novice monitor [options]");
2244
2245
  console.log();
2245
- console.log(bold('Options:'));
2246
- console.log(' -i, --interval <seconds> Update interval in seconds (default: 2)');
2247
- console.log(' -c, --compact Compact view mode');
2248
- console.log(' --focus <component> Focus on specific component');
2249
- console.log(' --alerts Enable alert notifications');
2250
- console.log(' --export <file> Export monitoring data to file');
2251
- console.log(' --threshold <percent> Alert threshold percentage (default: 80)');
2252
- console.log(' --log-level <level> Log level filter (error, warn, info, debug)');
2253
- console.log(' --no-graphs Disable ASCII graphs');
2246
+ console.log(bold("Options:"));
2247
+ console.log(" -i, --interval <seconds> Update interval in seconds (default: 2)");
2248
+ console.log(" -c, --compact Compact view mode");
2249
+ console.log(" --focus <component> Focus on specific component");
2250
+ console.log(" --alerts Enable alert notifications");
2251
+ console.log(" --export <file> Export monitoring data to file");
2252
+ console.log(" --threshold <percent> Alert threshold percentage (default: 80)");
2253
+ console.log(" --log-level <level> Log level filter (error, warn, info, debug)");
2254
+ console.log(" --no-graphs Disable ASCII graphs");
2254
2255
  console.log();
2255
- console.log(bold('Examples:'));
2256
- console.log(` ${blue('claude-flow-novice monitor')} # Basic monitoring`);
2257
- console.log(` ${blue('claude-flow-novice monitor --alerts')} # With alerting`);
2258
- console.log(` ${blue('claude-flow-novice monitor --focus mcp')} # Component focus`);
2259
- console.log(` ${blue('claude-flow-novice monitor --export data.json')} # Data export`);
2260
- } else if (command === 'session') {
2261
- console.log(bold(blue('Enhanced Session Management')));
2256
+ console.log(bold("Examples:"));
2257
+ console.log(` ${blue("claude-flow-novice monitor")} # Basic monitoring`);
2258
+ console.log(` ${blue("claude-flow-novice monitor --alerts")} # With alerting`);
2259
+ console.log(` ${blue("claude-flow-novice monitor --focus mcp")} # Component focus`);
2260
+ console.log(` ${blue("claude-flow-novice monitor --export data.json")} # Data export`);
2261
+ } else if (command === "session") {
2262
+ console.log(bold(blue("Enhanced Session Management")));
2262
2263
  console.log();
2263
- console.log('Comprehensive session lifecycle management with backup and recovery.');
2264
+ console.log("Comprehensive session lifecycle management with backup and recovery.");
2264
2265
  console.log();
2265
- console.log(bold('Commands:'));
2266
- console.log(' list List all saved sessions');
2267
- console.log(' save [name] Save current session state');
2268
- console.log(' restore <session-id> Restore a saved session');
2269
- console.log(' delete <session-id> Delete a saved session');
2270
- console.log(' export <session-id> <file> Export session to file');
2271
- console.log(' import <file> Import session from file');
2272
- console.log(' info <session-id> Show detailed session information');
2273
- console.log(' clean Clean up old or orphaned sessions');
2274
- console.log(' backup [session-id] Backup sessions to archive');
2275
- console.log(' restore-backup <file> Restore sessions from backup');
2276
- console.log(' validate [session-id] Validate session integrity');
2277
- console.log(' monitor Monitor active sessions');
2266
+ console.log(bold("Commands:"));
2267
+ console.log(" list List all saved sessions");
2268
+ console.log(" save [name] Save current session state");
2269
+ console.log(" restore <session-id> Restore a saved session");
2270
+ console.log(" delete <session-id> Delete a saved session");
2271
+ console.log(" export <session-id> <file> Export session to file");
2272
+ console.log(" import <file> Import session from file");
2273
+ console.log(" info <session-id> Show detailed session information");
2274
+ console.log(" clean Clean up old or orphaned sessions");
2275
+ console.log(" backup [session-id] Backup sessions to archive");
2276
+ console.log(" restore-backup <file> Restore sessions from backup");
2277
+ console.log(" validate [session-id] Validate session integrity");
2278
+ console.log(" monitor Monitor active sessions");
2278
2279
  console.log();
2279
- console.log(bold('Examples:'));
2280
- console.log(` ${blue('claude-flow-novice session list')} # List sessions`);
2281
- console.log(` ${blue('claude-flow-novice session save mywork')} # Save session`);
2282
- console.log(` ${blue('claude-flow-novice session restore abc123')} # Restore session`);
2283
- console.log(` ${blue('claude-flow-novice session validate --fix')} # Validate and fix`);
2280
+ console.log(bold("Examples:"));
2281
+ console.log(` ${blue("claude-flow-novice session list")} # List sessions`);
2282
+ console.log(` ${blue("claude-flow-novice session save mywork")} # Save session`);
2283
+ console.log(` ${blue("claude-flow-novice session restore abc123")} # Restore session`);
2284
+ console.log(` ${blue("claude-flow-novice session validate --fix")} # Validate and fix`);
2284
2285
  } else {
2285
2286
  // Show general help with enhanced commands
2286
- console.log(bold(blue('Claude-Flow Enhanced Orchestration System')));
2287
+ console.log(bold(blue("Claude-Flow Enhanced Orchestration System")));
2287
2288
  console.log();
2288
- console.log('Available commands:');
2289
- console.log(' start Enhanced orchestration system startup');
2290
- console.log(' status Comprehensive system status reporting');
2291
- console.log(' monitor Real-time monitoring dashboard');
2292
- console.log(' session Advanced session management');
2293
- console.log(' swarm Self-orchestrating agent swarms');
2294
- console.log(' sparc Enhanced TDD development modes');
2295
- console.log(' agent Agent management and coordination');
2296
- console.log(' task Task creation and management');
2297
- console.log(' memory Memory bank operations');
2298
- console.log(' mcp MCP server management');
2299
- console.log(' claude Claude instance spawning');
2289
+ console.log("Available commands:");
2290
+ console.log(" start Enhanced orchestration system startup");
2291
+ console.log(" status Comprehensive system status reporting");
2292
+ console.log(" monitor Real-time monitoring dashboard");
2293
+ console.log(" session Advanced session management");
2294
+ console.log(" swarm Self-orchestrating agent swarms");
2295
+ console.log(" sparc Enhanced TDD development modes");
2296
+ console.log(" agent Agent management and coordination");
2297
+ console.log(" task Task creation and management");
2298
+ console.log(" memory Memory bank operations");
2299
+ console.log(" mcp MCP server management");
2300
+ console.log(" claude Claude instance spawning");
2300
2301
  console.log();
2301
- console.log('For detailed help on any command, use:');
2302
- console.log(` ${blue('claude-flow-novice help <command>')}`);
2302
+ console.log("For detailed help on any command, use:");
2303
+ console.log(` ${blue("claude-flow-novice help <command>")}`);
2303
2304
  console.log();
2304
- console.log('Enhanced features:');
2305
- console.log(' ✨ Comprehensive service management');
2306
- console.log(' ✨ Real-time monitoring and alerting');
2307
- console.log(' ✨ Advanced session lifecycle management');
2308
- console.log(' ✨ Batch operations and parallel execution');
2309
- console.log(' ✨ Health checks and auto-recovery');
2310
- console.log(' ✨ Process management UI');
2305
+ console.log("Enhanced features:");
2306
+ console.log(" ✨ Comprehensive service management");
2307
+ console.log(" ✨ Real-time monitoring and alerting");
2308
+ console.log(" ✨ Advanced session lifecycle management");
2309
+ console.log(" ✨ Batch operations and parallel execution");
2310
+ console.log(" ✨ Health checks and auto-recovery");
2311
+ console.log(" ✨ Process management UI");
2311
2312
  }
2312
2313
  }
2313
2314
  });
2314
2315
  // Add enhanced command documentation
2315
- console.log(chalk.cyan('\n🚀 Enhanced Commands Loaded:'));
2316
- console.log(' ✓ start - Enhanced orchestration with service management');
2317
- console.log(' ✓ status - Comprehensive system status reporting');
2318
- console.log(' ✓ monitor - Real-time monitoring with metrics and alerts');
2319
- console.log(' ✓ session - Advanced session lifecycle management');
2320
- console.log(' ✓ sparc - Enhanced TDD with orchestration features');
2316
+ console.log(chalk.cyan("\n🚀 Enhanced Commands Loaded:"));
2317
+ console.log(" ✓ start - Enhanced orchestration with service management");
2318
+ console.log(" ✓ status - Comprehensive system status reporting");
2319
+ console.log(" ✓ monitor - Real-time monitoring with metrics and alerts");
2320
+ console.log(" ✓ session - Advanced session lifecycle management");
2321
+ console.log(" ✓ sparc - Enhanced TDD with orchestration features");
2321
2322
  console.log();
2322
- console.log('For detailed help on enhanced commands: claude-flow-novice help <command>');
2323
+ console.log("For detailed help on enhanced commands: claude-flow-novice help <command>");
2323
2324
  // Hive Mind command
2324
2325
  cli.command({
2325
- name: 'hive-mind',
2326
- description: 'Collective intelligence swarm management',
2326
+ name: "hive-mind",
2327
+ description: "Collective intelligence swarm management",
2327
2328
  aliases: [
2328
- 'hive',
2329
- 'swarm'
2329
+ "hive",
2330
+ "swarm"
2330
2331
  ],
2331
2332
  options: [
2332
2333
  {
2333
- name: 'command',
2334
- description: 'Hive Mind command (init, spawn, status, task, wizard)',
2335
- type: 'string'
2334
+ name: "command",
2335
+ description: "Hive Mind command (init, spawn, status, task, wizard)",
2336
+ type: "string"
2336
2337
  },
2337
2338
  {
2338
- name: 'swarm-id',
2339
- short: 's',
2340
- description: 'Swarm ID to operate on',
2341
- type: 'string'
2339
+ name: "swarm-id",
2340
+ short: "s",
2341
+ description: "Swarm ID to operate on",
2342
+ type: "string"
2342
2343
  },
2343
2344
  {
2344
- name: 'topology',
2345
- short: 't',
2346
- description: 'Swarm topology (mesh, hierarchical, ring, star)',
2347
- type: 'string',
2348
- default: 'hierarchical'
2345
+ name: "topology",
2346
+ short: "t",
2347
+ description: "Swarm topology (mesh, hierarchical, ring, star)",
2348
+ type: "string",
2349
+ default: "hierarchical"
2349
2350
  },
2350
2351
  {
2351
- name: 'max-agents',
2352
- short: 'm',
2353
- description: 'Maximum number of agents',
2354
- type: 'number',
2352
+ name: "max-agents",
2353
+ short: "m",
2354
+ description: "Maximum number of agents",
2355
+ type: "number",
2355
2356
  default: 8
2356
2357
  },
2357
2358
  {
2358
- name: 'interactive',
2359
- short: 'i',
2360
- description: 'Run in interactive mode',
2361
- type: 'boolean'
2359
+ name: "interactive",
2360
+ short: "i",
2361
+ description: "Run in interactive mode",
2362
+ type: "boolean"
2362
2363
  }
2363
2364
  ],
2364
2365
  action: async (ctx)=>{
2365
2366
  try {
2366
- const subcommand = ctx.args[0] || 'wizard';
2367
+ const subcommand = ctx.args[0] || "wizard";
2367
2368
  // Import hive-mind commands dynamically
2368
- const { hiveMindCommand } = await import('./hive-mind/index.js');
2369
+ const { hiveMindCommand } = await import("./hive-mind/index.js");
2369
2370
  // Execute the appropriate subcommand
2370
2371
  switch(subcommand){
2371
- case 'init':
2372
- const { initCommand } = await import('./hive-mind/init.js');
2372
+ case "init":
2373
+ const { initCommand } = await import("./hive-mind/init.js");
2373
2374
  await initCommand.parseAsync(process.argv.slice(3));
2374
2375
  break;
2375
- case 'spawn':
2376
- const { spawnCommand } = await import('./hive-mind/spawn.js');
2376
+ case "spawn":
2377
+ const { spawnCommand } = await import("./hive-mind/spawn.js");
2377
2378
  await spawnCommand.parseAsync(process.argv.slice(3));
2378
2379
  break;
2379
- case 'status':
2380
- const { statusCommand } = await import('./hive-mind/status.js');
2380
+ case "status":
2381
+ const { statusCommand } = await import("./hive-mind/status.js");
2381
2382
  await statusCommand.parseAsync(process.argv.slice(3));
2382
2383
  break;
2383
- case 'task':
2384
- const { taskCommand } = await import('./hive-mind/task.js');
2384
+ case "task":
2385
+ const { taskCommand } = await import("./hive-mind/task.js");
2385
2386
  await taskCommand.parseAsync(process.argv.slice(3));
2386
2387
  break;
2387
- case 'stop':
2388
- const { stopCommand } = await import('./hive-mind/stop.js');
2388
+ case "stop":
2389
+ const { stopCommand } = await import("./hive-mind/stop.js");
2389
2390
  await stopCommand.parseAsync(process.argv.slice(3));
2390
2391
  break;
2391
- case 'pause':
2392
- const { pauseCommand } = await import('./hive-mind/pause.js');
2392
+ case "pause":
2393
+ const { pauseCommand } = await import("./hive-mind/pause.js");
2393
2394
  await pauseCommand.parseAsync(process.argv.slice(3));
2394
2395
  break;
2395
- case 'resume':
2396
- const { resumeCommand } = await import('./hive-mind/resume.js');
2396
+ case "resume":
2397
+ const { resumeCommand } = await import("./hive-mind/resume.js");
2397
2398
  await resumeCommand.parseAsync(process.argv.slice(3));
2398
2399
  break;
2399
- case 'ps':
2400
- const { psCommand } = await import('./hive-mind/ps.js');
2400
+ case "ps":
2401
+ const { psCommand } = await import("./hive-mind/ps.js");
2401
2402
  await psCommand.parseAsync(process.argv.slice(3));
2402
2403
  break;
2403
- case 'wizard':
2404
+ case "wizard":
2404
2405
  default:
2405
- const { wizardCommand } = await import('./hive-mind/wizard.js');
2406
+ const { wizardCommand } = await import("./hive-mind/wizard.js");
2406
2407
  await wizardCommand.parseAsync(process.argv.slice(3));
2407
2408
  break;
2408
2409
  }
@@ -2413,25 +2414,25 @@ Now, please proceed with the task: ${task}`;
2413
2414
  });
2414
2415
  // Hook command for ruv-swarm integration
2415
2416
  cli.command({
2416
- name: 'hook',
2417
- description: 'Execute ruv-swarm hooks for agent coordination',
2417
+ name: "hook",
2418
+ description: "Execute ruv-swarm hooks for agent coordination",
2418
2419
  action: async (ctx)=>{
2419
2420
  try {
2420
- const { spawn } = await import('child_process');
2421
+ const { spawn } = await import("child_process");
2421
2422
  // Pass all arguments to ruv-swarm hook command
2422
2423
  const args = ctx.args.length > 0 ? ctx.args : [
2423
- '--help'
2424
+ "--help"
2424
2425
  ];
2425
- const child = spawn('npx', [
2426
- 'ruv-swarm',
2427
- 'hook',
2426
+ const child = spawn("npx", [
2427
+ "ruv-swarm",
2428
+ "hook",
2428
2429
  ...args
2429
2430
  ], {
2430
- stdio: 'inherit',
2431
+ stdio: "inherit",
2431
2432
  shell: true
2432
2433
  });
2433
2434
  await new Promise((resolve, reject)=>{
2434
- child.on('exit', (code)=>{
2435
+ child.on("exit", (code)=>{
2435
2436
  if (code === 0) {
2436
2437
  resolve();
2437
2438
  } else {
@@ -2439,7 +2440,7 @@ Now, please proceed with the task: ${task}`;
2439
2440
  resolve();
2440
2441
  }
2441
2442
  });
2442
- child.on('error', (err)=>{
2443
+ child.on("error", (err)=>{
2443
2444
  error(`Failed to execute hook command: ${getErrorMessage(err)}`);
2444
2445
  resolve();
2445
2446
  });
@@ -2457,37 +2458,37 @@ Now, please proceed with the task: ${task}`;
2457
2458
  function getCapabilitiesForType(type) {
2458
2459
  const capabilities = {
2459
2460
  coordinator: [
2460
- 'task-assignment',
2461
- 'planning',
2462
- 'delegation'
2461
+ "task-assignment",
2462
+ "planning",
2463
+ "delegation"
2463
2464
  ],
2464
2465
  researcher: [
2465
- 'web-search',
2466
- 'information-gathering',
2467
- 'analysis'
2466
+ "web-search",
2467
+ "information-gathering",
2468
+ "analysis"
2468
2469
  ],
2469
2470
  implementer: [
2470
- 'code-generation',
2471
- 'file-manipulation',
2472
- 'testing'
2471
+ "code-generation",
2472
+ "file-manipulation",
2473
+ "testing"
2473
2474
  ],
2474
2475
  analyst: [
2475
- 'data-analysis',
2476
- 'pattern-recognition',
2477
- 'reporting'
2476
+ "data-analysis",
2477
+ "pattern-recognition",
2478
+ "reporting"
2478
2479
  ],
2479
2480
  custom: [
2480
- 'user-defined'
2481
+ "user-defined"
2481
2482
  ]
2482
2483
  };
2483
2484
  return capabilities[type] || capabilities.custom;
2484
2485
  }
2485
2486
  function getDefaultPromptForType(type) {
2486
2487
  const prompts = {
2487
- coordinator: 'You are a coordination agent responsible for planning and delegating tasks.',
2488
- researcher: 'You are a research agent specialized in gathering and analyzing information.',
2489
- implementer: 'You are an implementation agent focused on writing code and creating solutions.',
2490
- analyst: 'You are an analysis agent that identifies patterns and generates insights.',
2488
+ coordinator: "You are a coordination agent responsible for planning and delegating tasks.",
2489
+ researcher: "You are a research agent specialized in gathering and analyzing information.",
2490
+ implementer: "You are an implementation agent focused on writing code and creating solutions.",
2491
+ analyst: "You are an analysis agent that identifies patterns and generates insights.",
2491
2492
  custom: "You are a custom agent. Follow the user's instructions."
2492
2493
  };
2493
2494
  return prompts[type] || prompts.custom;
@@ -2511,53 +2512,14 @@ This is a Claude-Flow AI agent orchestration system.
2511
2512
  `;
2512
2513
  }
2513
2514
  function createFullClaudeMd() {
2514
- return `# Claude Code Configuration
2515
-
2516
- ## Build Commands
2517
- - \`npm run build\`: Build the project using Deno compile
2518
- - \`npm run test\`: Run the full test suite
2519
- - \`npm run lint\`: Run ESLint and format checks
2520
- - \`npm run typecheck\`: Run TypeScript type checking
2521
- - \`npx claude-flow-novice start\`: Start the orchestration system
2522
- - \`npx claude-flow-novice --help\`: Show all available commands
2523
-
2524
- ## Code Style Preferences
2525
- - Use ES modules (import/export) syntax, not CommonJS (require)
2526
- - Destructure imports when possible (e.g., \`import { foo } from 'bar'\`)
2527
- - Use TypeScript for all new code
2528
- - Follow existing naming conventions (camelCase for variables, PascalCase for classes)
2529
- - Add JSDoc comments for public APIs
2530
- - Use async/await instead of Promise chains
2531
- - Prefer const/let over var
2532
-
2533
- ## Workflow Guidelines
2534
- - Always run typecheck after making code changes
2535
- - Run tests before committing changes
2536
- - Use meaningful commit messages following conventional commits
2537
- - Create feature branches for new functionality
2538
- - Ensure all tests pass before merging
2539
-
2540
- ## Project Architecture
2541
- This is a Claude-Flow AI agent orchestration system with the following components:
2542
- - **CLI Interface**: Command-line tools for managing the system
2543
- - **Orchestrator**: Core engine for coordinating agents and tasks
2544
- - **Memory System**: Persistent storage and retrieval of information
2545
- - **Terminal Management**: Automated terminal session handling
2546
- - **MCP Integration**: Model Context Protocol server for Claude integration
2547
- - **Agent Coordination**: Multi-agent task distribution and management
2548
-
2549
- ## Important Notes
2550
- - Use \`claude --dangerously-skip-permissions\` for unattended operation
2551
- - The system supports both daemon and interactive modes
2552
- - Memory persistence is handled automatically
2553
- - All components are event-driven for scalability
2554
-
2555
- ## Debugging
2556
- - Check logs in \`./claude-flow.log\`
2557
- - Use \`npx claude-flow-novice status\` to check system health
2558
- - Monitor with \`npx claude-flow-novice monitor\` for real-time updates
2559
- - Verbose output available with \`--verbose\` flag on most commands
2560
- `;
2515
+ // Use the template-based approach instead of hardcoded content
2516
+ try {
2517
+ return createEnhancedClaudeMd();
2518
+ } catch (error) {
2519
+ // Fallback to minimal template if enhanced template fails
2520
+ console.warn("Warning: Enhanced CLAUDE.md template not found, using minimal version");
2521
+ return createMinimalClaudeMd();
2522
+ }
2561
2523
  }
2562
2524
  function createMinimalMemoryBankMd() {
2563
2525
  return `# Memory Bank