claude-flow 2.7.4 โ†’ 2.7.5

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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,51 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.7.5] - 2025-10-24
9
+
10
+ > **๐Ÿ› Critical Bug Fix**: MCP Server Stdio Mode - Fixed stdout corruption in stdio mode
11
+
12
+ ### ๐Ÿ› Bug Fixes
13
+
14
+ #### **MCP Server Stdio Mode Protocol Corruption (Critical)** - Issue #835
15
+ - **Fixed stdout pollution in stdio mode**: MCP server now maintains clean stdout for JSON-RPC protocol
16
+ - Added module-level `isStdioMode` flag for state tracking
17
+ - Implemented smart logging helpers that auto-route output based on mode
18
+ - In stdio mode: all messages route to stderr (keeps stdout clean for JSON-RPC)
19
+ - In HTTP mode: normal stdout behavior preserved
20
+
21
+ - **Comprehensive output replacement**: Replaced all 150+ console.log() and print*() calls
22
+ - `startMcpServer()` - All startup messages use smart helpers
23
+ - `stopMcpServer()` - All shutdown messages use smart helpers
24
+ - `listMcpTools()` - All tool listing uses smart helpers
25
+ - `manageMcpAuth()` - All auth messages use smart helpers
26
+ - `showMcpConfig()` - All config display uses smart helpers
27
+ - `showMcpHelp()` - All help text uses smart helpers
28
+ - `showMcpStatus()` - All status messages use smart helpers
29
+
30
+ ### ๐Ÿ“ Files Changed
31
+ - `src/cli/simple-commands/mcp.js` - Complete rewrite of logging system
32
+ - `tests/test-mcp-stdio.js` - Added verification test suite
33
+
34
+ ### ๐Ÿงช Testing
35
+ - โœ… Test 1: Module structure verification
36
+ - โœ… Test 2: Smart logging helpers present
37
+ - โœ… Test 3: No direct stdout usage in critical functions
38
+ - โœ… Build: Compilation successful
39
+
40
+ ### ๐Ÿ“Š Impact
41
+ - **Before**: โš ๏ธ MCP server unusable in stdio mode due to protocol corruption
42
+ - **After**: โœ… MCP server fully compatible with standard MCP clients in stdio mode
43
+
44
+ ### โœ… Backward Compatibility
45
+ - Fully backward compatible - no breaking changes
46
+ - HTTP mode retains original stdout behavior
47
+ - Only affects stdio mode output routing
48
+
49
+ ### ๐Ÿ”— Related
50
+ - Fixes #835 - MCP server stdio mode corrupted by stdout log messages
51
+ - Bug existed since July 8, 2025 (commit 29800626c, PR #167)
52
+
8
53
  ## [2.7.1] - 2025-10-22
9
54
 
10
55
  > **๐Ÿ› Critical Bug Fix**: MCP Pattern Persistence - Fixed neural pattern storage, search, and statistics
package/bin/claude-flow CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/bin/sh
2
2
  # Claude-Flow Smart Dispatcher - Detects and uses the best available runtime
3
3
 
4
- VERSION="2.7.4"
4
+ VERSION="2.7.5"
5
5
 
6
6
  # Determine the correct path based on how the script is invoked
7
7
  if [ -L "$0" ]; then
@@ -85,9 +85,4 @@ export class HelpFormatter {
85
85
  }
86
86
  }
87
87
 
88
- //# sourceMappingURL=help-formatter.js.map/\s+/g, ' ');
89
- return text;
90
- }
91
- }
92
-
93
88
  //# sourceMappingURL=help-formatter.js.map
@@ -1,47 +1,18 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env -S deno run --allow-all
2
+ import { promises as fs } from 'node:fs';
2
3
  import { executeCommand, hasCommand, showCommandHelp, listCommands } from './command-registry.js';
3
4
  import { parseFlags } from './utils.js';
4
- import { args, cwd, isMainModule, exit, readTextFile, writeTextFile, mkdirAsync, errors } from './node-compat.js';
5
- import { spawn } from 'child_process';
6
- import process from 'process';
7
- import readline from 'readline';
8
- import { getMainHelp, getCommandHelp, getStandardizedCommandHelp } from './help-text.js';
9
5
  import { VERSION } from '../core/version.js';
10
- const LEGACY_AGENT_MAPPING = {
11
- analyst: 'code-analyzer',
12
- coordinator: 'task-orchestrator',
13
- optimizer: 'perf-analyzer',
14
- documenter: 'api-docs',
15
- monitor: 'performance-benchmarker',
16
- specialist: 'system-architect',
17
- architect: 'system-architect'
18
- };
19
- function resolveLegacyAgentType(legacyType) {
20
- return LEGACY_AGENT_MAPPING[legacyType] || legacyType;
21
- }
22
- function printHelp(plain = false) {
23
- console.log(getMainHelp(plain));
24
- }
25
- function printCommandHelp(command) {
26
- const standardCommands = [
27
- 'agent',
28
- 'sparc',
29
- 'memory'
30
- ];
31
- if (standardCommands.includes(command)) {
32
- const help = getStandardizedCommandHelp(command);
33
- console.log(help);
34
- } else {
35
- const help = getCommandHelp(command);
36
- console.log(help);
37
- }
38
- }
39
- function printLegacyHelp() {
6
+ function printHelp() {
40
7
  console.log(`
41
8
  ๐ŸŒŠ Claude-Flow v${VERSION} - Enterprise-Grade AI Agent Orchestration Platform
42
9
 
43
- ๐ŸŽฏ ENTERPRISE FEATURES: Complete ruv-swarm integration with 90+ MCP tools, neural networking, and production-ready infrastructure
44
- โšก ALPHA 85: Advanced automation capabilities & stream-JSON chaining for multi-agent pipelines
10
+ ๐ŸŽฏ NEW IN v2.6.0: Multi-Provider Execution Engine with Agentic-Flow Integration
11
+ โ€ข 66+ specialized agents with multi-provider support (Anthropic, OpenRouter, ONNX, Gemini)
12
+ โ€ข 99% cost savings with OpenRouter, 352x faster local edits with Agent Booster
13
+ โ€ข Complete backwards compatibility with existing features
14
+
15
+ ๐ŸŽฏ ENTERPRISE FEATURES: Complete ruv-swarm integration with 27 MCP tools, neural networking, and production-ready infrastructure
45
16
 
46
17
  USAGE:
47
18
  claude-flow <command> [options]
@@ -77,9 +48,10 @@ USAGE:
77
48
  init [--sparc] # Initialize with enterprise environment + ruv-swarm
78
49
  start [--ui] [--swarm] # Start orchestration with swarm intelligence
79
50
  spawn <type> [--name] # Create AI agent with swarm coordination
80
- agent <subcommand> # Advanced agent management with neural patterns
51
+ agent <subcommand> # ๐Ÿ†• Multi-provider agent execution + management
81
52
  sparc <subcommand> # 17 SPARC modes with neural enhancement
82
53
  memory <subcommand> # Cross-session persistent memory with neural learning
54
+ config <subcommand> # ๐Ÿ†• Provider configuration management
83
55
  status # Comprehensive system status with performance metrics
84
56
 
85
57
  ๐Ÿค– NEURAL AGENT TYPES (ruv-swarm Integration):
@@ -94,20 +66,25 @@ USAGE:
94
66
 
95
67
  ๐ŸŽฎ ENTERPRISE QUICK START:
96
68
  # Initialize enterprise environment
97
- npx claude-flow@2.0.0 init --sparc
98
-
69
+ npx claude-flow@2.6.0-alpha.1 init --sparc
70
+
71
+ # ๐Ÿ†• Execute agents with multi-provider support
72
+ ./claude-flow agent run coder "Build REST API with auth" --provider anthropic
73
+ ./claude-flow agent run researcher "Research React 19" --provider openrouter # 99% cost savings
74
+ ./claude-flow agent agents # List all 66+ available agents
75
+
99
76
  # Start enterprise orchestration with swarm intelligence
100
77
  ./claude-flow start --ui --swarm
101
-
78
+
102
79
  # Deploy intelligent multi-agent development workflow
103
80
  ./claude-flow swarm "build enterprise API" --strategy development --parallel --monitor
104
-
81
+
105
82
  # GitHub workflow automation
106
83
  ./claude-flow github pr-manager "coordinate release with automated testing"
107
-
84
+
108
85
  # Neural memory management
109
86
  ./claude-flow memory store "architecture" "microservices with API gateway pattern"
110
-
87
+
111
88
  # Real-time system monitoring
112
89
  ./claude-flow status --verbose
113
90
 
@@ -175,8 +152,8 @@ function printSuccess(message) {
175
152
  function printWarning(message) {
176
153
  console.warn(`โš ๏ธ Warning: ${message}`);
177
154
  }
178
- function showHelpWithCommands(plain = false) {
179
- printHelp(plain);
155
+ function showHelpWithCommands() {
156
+ printHelp();
180
157
  console.log('\nRegistered Commands:');
181
158
  const commands = listCommands();
182
159
  for (const command of commands){
@@ -185,58 +162,14 @@ function showHelpWithCommands(plain = false) {
185
162
  console.log('\nUse "claude-flow help <command>" for detailed usage information');
186
163
  }
187
164
  async function main() {
165
+ const args = Deno.args;
188
166
  if (args.length === 0) {
189
- printHelp(usePlainHelp);
167
+ printHelp();
190
168
  return;
191
169
  }
192
170
  const command = args[0];
193
171
  const { flags, args: parsedArgs } = parseFlags(args.slice(1));
194
- const usePlainHelp = args.includes('--plain');
195
- let enhancedFlags = flags;
196
- try {
197
- const { detectExecutionEnvironment, applySmartDefaults } = await import('./utils/environment-detector.js');
198
- enhancedFlags = applySmartDefaults(flags);
199
- enhancedFlags._environment = detectExecutionEnvironment({
200
- skipWarnings: true
201
- });
202
- } catch (e) {
203
- enhancedFlags = flags;
204
- }
205
- if (command !== 'help' && command !== '--help' && command !== '-h' && (enhancedFlags.help || enhancedFlags.h)) {
206
- const detailedHelp = getCommandHelp(command);
207
- if (detailedHelp && !detailedHelp.includes('Help not available')) {
208
- printCommandHelp(command);
209
- } else if (hasCommand(command)) {
210
- showCommandHelp(command);
211
- } else {
212
- printError(`Unknown command: ${command}`);
213
- console.log('\nRun "claude-flow --help" to see available commands.');
214
- }
215
- return;
216
- }
217
172
  switch(command){
218
- case 'env-check':
219
- case 'environment':
220
- if (enhancedFlags._environment) {
221
- const env = enhancedFlags._environment;
222
- console.log(`\n๐Ÿ–ฅ๏ธ Environment Detection Results:`);
223
- console.log(` Terminal: ${env.terminalType}`);
224
- console.log(` Interactive: ${env.isInteractive ? 'Yes' : 'No'}`);
225
- console.log(` TTY Support: ${env.supportsRawMode ? 'Yes' : 'No'}`);
226
- console.log(` Detected: ${env.isVSCode ? 'VS Code' : env.isCI ? 'CI/CD' : env.isDocker ? 'Docker' : env.isSSH ? 'SSH' : 'Standard Terminal'}`);
227
- if (env.recommendedFlags.length > 0) {
228
- console.log(`\n๐Ÿ’ก Recommended flags:`);
229
- console.log(` ${env.recommendedFlags.join(' ')}`);
230
- }
231
- if (enhancedFlags.appliedDefaults && enhancedFlags.appliedDefaults.length > 0) {
232
- console.log(`\nโœ… Auto-applied:`);
233
- console.log(` ${enhancedFlags.appliedDefaults.join(' ')}`);
234
- }
235
- console.log();
236
- } else {
237
- console.log('Environment detection not available');
238
- }
239
- return;
240
173
  case 'version':
241
174
  case '--version':
242
175
  case '-v':
@@ -246,14 +179,9 @@ async function main() {
246
179
  case '--help':
247
180
  case '-h':
248
181
  if (parsedArgs.length > 0) {
249
- const detailedHelp = getCommandHelp(parsedArgs[0]);
250
- if (detailedHelp && !detailedHelp.includes('Help not available')) {
251
- printCommandHelp(parsedArgs[0]);
252
- } else {
253
- showCommandHelp(parsedArgs[0]);
254
- }
182
+ showCommandHelp(parsedArgs[0]);
255
183
  } else {
256
- printHelp(usePlainHelp);
184
+ showHelpWithCommands();
257
185
  }
258
186
  return;
259
187
  }
@@ -263,7 +191,6 @@ async function main() {
263
191
  return;
264
192
  } catch (err) {
265
193
  printError(err.message);
266
- console.log(`\nRun "claude-flow ${command} --help" for usage information.`);
267
194
  return;
268
195
  }
269
196
  }
@@ -283,12 +210,11 @@ async function main() {
283
210
  console.log('๐Ÿ“Š Real-time monitoring would display here');
284
211
  break;
285
212
  case 'spawn':
286
- const rawSpawnType = subArgs[0] || 'general';
287
- const spawnType = resolveLegacyAgentType(rawSpawnType);
213
+ const spawnType = subArgs[0] || 'general';
288
214
  const spawnName = flags.name || `agent-${Date.now()}`;
289
215
  printSuccess(`Spawning ${spawnType} agent: ${spawnName}`);
290
216
  console.log('๐Ÿค– Agent would be created with the following configuration:');
291
- console.log(` Type: ${spawnType}${rawSpawnType !== spawnType ? ` (resolved from: ${rawSpawnType})` : ''}`);
217
+ console.log(` Type: ${spawnType}`);
292
218
  console.log(` Name: ${spawnName}`);
293
219
  console.log(' Capabilities: Research, Analysis, Code Generation');
294
220
  console.log(' Status: Ready');
@@ -313,7 +239,7 @@ async function main() {
313
239
  console.log(' โ€ข Max Pool Size: 10');
314
240
  console.log(' โ€ข Idle Timeout: 5 minutes');
315
241
  console.log(' โ€ข Shell: /bin/bash');
316
- console.log(' โ€ข Working Directory: ' + cwd());
242
+ console.log(' โ€ข Working Directory: ' + process.cwd());
317
243
  console.log(' Performance:');
318
244
  console.log(' โ€ข Average Response Time: N/A');
319
245
  console.log(' โ€ข Terminal Creation Time: N/A');
@@ -362,7 +288,7 @@ async function main() {
362
288
  const terminalConfig = {
363
289
  name: nameIndex >= 0 ? subArgs[nameIndex + 1] : 'terminal-' + Date.now(),
364
290
  shell: shellIndex >= 0 ? subArgs[shellIndex + 1] : 'bash',
365
- workingDirectory: wdIndex >= 0 ? subArgs[wdIndex + 1] : cwd(),
291
+ workingDirectory: wdIndex >= 0 ? subArgs[wdIndex + 1] : process.cwd(),
366
292
  env: envIndex >= 0 ? subArgs[envIndex + 1] : '',
367
293
  persistent: persistentIndex >= 0
368
294
  };
@@ -1319,9 +1245,10 @@ ${flags1.mode === 'full' || !flags1.mode ? `Full-stack development covering all
1319
1245
  console.log('Debug - Executing command:');
1320
1246
  console.log(`claude ${claudeArgs.map((arg)=>arg.includes(' ') || arg.includes('\n') ? `"${arg}"` : arg).join(' ')}`);
1321
1247
  }
1322
- const child = spawn('claude', claudeArgs, {
1248
+ const command = new Deno.Command('claude', {
1249
+ args: claudeArgs,
1323
1250
  env: {
1324
- ...process.env,
1251
+ ...Deno.env.toObject(),
1325
1252
  CLAUDE_INSTANCE_ID: instanceId,
1326
1253
  CLAUDE_FLOW_MODE: flags1.mode || 'full',
1327
1254
  CLAUDE_FLOW_COVERAGE: (flags1.coverage || 80).toString(),
@@ -1331,18 +1258,17 @@ ${flags1.mode === 'full' || !flags1.mode ? `Full-stack development covering all
1331
1258
  CLAUDE_FLOW_COORDINATION_ENABLED: flags1.parallel ? 'true' : 'false',
1332
1259
  CLAUDE_FLOW_FEATURES: 'memory,coordination,swarm'
1333
1260
  },
1334
- stdio: 'inherit'
1335
- });
1336
- await new Promise((resolve)=>{
1337
- child.on('exit', (code)=>{
1338
- if (code === 0) {
1339
- printSuccess(`Claude instance ${instanceId} completed successfully`);
1340
- } else {
1341
- printError(`Claude instance ${instanceId} exited with code ${code}`);
1342
- }
1343
- resolve();
1344
- });
1261
+ stdin: 'inherit',
1262
+ stdout: 'inherit',
1263
+ stderr: 'inherit'
1345
1264
  });
1265
+ const child = command.spawn();
1266
+ const status = await child.status;
1267
+ if (status.success) {
1268
+ printSuccess(`Claude instance ${instanceId} completed successfully`);
1269
+ } else {
1270
+ printError(`Claude instance ${instanceId} exited with code ${status.code}`);
1271
+ }
1346
1272
  } catch (err) {
1347
1273
  printError(`Failed to spawn Claude: ${err.message}`);
1348
1274
  console.log('Make sure you have the Claude CLI installed.');
@@ -1895,7 +1821,7 @@ ${flags1.mode === 'full' || !flags1.mode ? `Full-stack development covering all
1895
1821
  console.log('\nDid you mean:');
1896
1822
  suggestions.forEach((cmd)=>console.log(` claude-flow ${cmd}`));
1897
1823
  }
1898
- exit(1);
1824
+ process.exit(1);
1899
1825
  }
1900
1826
  }
1901
1827
  async function startRepl() {
@@ -1973,7 +1899,7 @@ Shortcuts:
1973
1899
  },
1974
1900
  config: async (key)=>{
1975
1901
  try {
1976
- const config = JSON.parse(await readTextFile('claude-flow.config.json'));
1902
+ const config = JSON.parse(await fs.readFile('claude-flow.config.json', 'utf-8'));
1977
1903
  if (key) {
1978
1904
  const keys = key.split('.');
1979
1905
  let value = config;
@@ -2001,25 +1927,21 @@ Shortcuts:
2001
1927
  if (trimmed.startsWith('!')) {
2002
1928
  const shellCmd = trimmed.substring(1);
2003
1929
  try {
2004
- await new Promise((resolve)=>{
2005
- const proc = spawn('sh', [
1930
+ const command = new Deno.Command('sh', {
1931
+ args: [
2006
1932
  '-c',
2007
1933
  shellCmd
2008
- ], {
2009
- stdio: [
2010
- 'inherit',
2011
- 'pipe',
2012
- 'pipe'
2013
- ]
2014
- });
2015
- proc.stdout.on('data', (data)=>{
2016
- console.log(data.toString());
2017
- });
2018
- proc.stderr.on('data', (data)=>{
2019
- console.error(data.toString());
2020
- });
2021
- proc.on('exit', resolve);
1934
+ ],
1935
+ stdout: 'piped',
1936
+ stderr: 'piped'
2022
1937
  });
1938
+ const { stdout, stderr } = await command.output();
1939
+ if (stdout.length > 0) {
1940
+ console.log(new TextDecoder().decode(stdout));
1941
+ }
1942
+ if (stderr.length > 0) {
1943
+ console.error(new TextDecoder().decode(stderr));
1944
+ }
2023
1945
  } catch (err) {
2024
1946
  console.error(`Shell error: ${err.message}`);
2025
1947
  }
@@ -2039,7 +1961,7 @@ Shortcuts:
2039
1961
  const parts = trimmed.split(' ');
2040
1962
  const command = parts[0];
2041
1963
  const args = parts.slice(1);
2042
- if (replCommands[command]) {
1964
+ if (command in replCommands) {
2043
1965
  await replCommands[command](...args);
2044
1966
  return true;
2045
1967
  }
@@ -2060,8 +1982,7 @@ Shortcuts:
2060
1982
  const subCmd = args[0];
2061
1983
  switch(subCmd){
2062
1984
  case 'spawn':
2063
- const rawType = args[1] || 'researcher';
2064
- const type = resolveLegacyAgentType(rawType);
1985
+ const type = args[1] || 'researcher';
2065
1986
  const name = args[2] || `agent-${Date.now()}`;
2066
1987
  const agent = {
2067
1988
  id: `agent-${Date.now()}`,
@@ -2266,33 +2187,18 @@ Shortcuts:
2266
2187
  console.log('Terminal commands: create, list, exec, attach, detach');
2267
2188
  }
2268
2189
  }
2269
- const rl = readline.createInterface({
2270
- input: process.stdin,
2271
- output: process.stdout
2272
- });
2273
- function updatePrompt() {
2274
- rl.setPrompt(replState.currentSession ? `claude-flow:${replState.currentSession}> ` : 'claude-flow> ');
2275
- }
2276
- updatePrompt();
2277
- rl.prompt();
2278
- rl.on('line', async (input)=>{
2279
- input = input.trim();
2190
+ const decoder = new TextDecoder();
2191
+ const encoder = new TextEncoder();
2192
+ while(true){
2193
+ const prompt = replState.currentSession ? `claude-flow:${replState.currentSession}> ` : 'claude-flow> ';
2194
+ await Deno.stdout.write(encoder.encode(prompt));
2195
+ const buf = new Uint8Array(1024);
2196
+ const n = await Deno.stdin.read(buf);
2197
+ if (n === null) break;
2198
+ const input = decoder.decode(buf.subarray(0, n)).trim();
2280
2199
  const shouldContinue = await processReplCommand(input);
2281
- if (!shouldContinue) {
2282
- rl.close();
2283
- } else {
2284
- updatePrompt();
2285
- rl.prompt();
2286
- }
2287
- });
2288
- rl.on('SIGINT', ()=>{
2289
- console.log('\nExiting Claude-Flow...');
2290
- rl.close();
2291
- process.exit(0);
2292
- });
2293
- return new Promise((resolve)=>{
2294
- rl.on('close', resolve);
2295
- });
2200
+ if (!shouldContinue) break;
2201
+ }
2296
2202
  }
2297
2203
  function createMinimalClaudeMd() {
2298
2204
  return `# Claude Code Integration
@@ -2609,30 +2515,30 @@ async function createSparcStructureManually() {
2609
2515
  ];
2610
2516
  for (const dir of rooDirectories){
2611
2517
  try {
2612
- await mkdirAsync(dir, {
2518
+ await Deno.mkdir(dir, {
2613
2519
  recursive: true
2614
2520
  });
2615
2521
  console.log(` โœ“ Created ${dir}/`);
2616
2522
  } catch (err) {
2617
- if (!(err instanceof errors.AlreadyExists)) {
2523
+ if (!(err instanceof Deno.errors.AlreadyExists)) {
2618
2524
  throw err;
2619
2525
  }
2620
2526
  }
2621
2527
  }
2622
2528
  let roomodesContent;
2623
2529
  try {
2624
- roomodesContent = await readTextFile('.roomodes');
2530
+ roomodesContent = await fs.readFile('.roomodes');
2625
2531
  console.log(' โœ“ Using existing .roomodes configuration');
2626
2532
  } catch {
2627
2533
  roomodesContent = createBasicRoomodesConfig();
2628
- await writeTextFile('.roomodes', roomodesContent);
2534
+ await fs.writeFile('.roomodes', roomodesContent);
2629
2535
  console.log(' โœ“ Created .roomodes configuration');
2630
2536
  }
2631
2537
  const basicWorkflow = createBasicSparcWorkflow();
2632
- await writeTextFile('.roo/workflows/basic-tdd.json', basicWorkflow);
2538
+ await fs.writeFile('.roo/workflows/basic-tdd.json', basicWorkflow);
2633
2539
  console.log(' โœ“ Created .roo/workflows/basic-tdd.json');
2634
2540
  const rooReadme = createRooReadme();
2635
- await writeTextFile('.roo/README.md', rooReadme);
2541
+ await fs.writeFile('.roo/README.md', rooReadme);
2636
2542
  console.log(' โœ“ Created .roo/README.md');
2637
2543
  console.log(' โœ… Basic SPARC structure created successfully');
2638
2544
  } catch (err) {
@@ -3060,6 +2966,110 @@ This SPARC-enabled project follows a systematic development approach:
3060
2966
  - Document architectural decisions in memory for future reference
3061
2967
  - Regular security reviews for any authentication or data handling code
3062
2968
 
2969
+ For more information about SPARC methodology, see: https://github.com/ruvnet/claude-code-flow/docs/sparc.md
2970
+ `;
2971
+ }
2972
+ if (import.meta.url === `file://${process.argv[1]}`) {
2973
+ await main();
2974
+ }
2975
+
2976
+ //# sourceMappingURL=simple-cli.js.map sparc run spec-pseudocode "User profile management feature"
2977
+
2978
+ # 2. Design architecture
2979
+ npx claude-flow sparc run architect "Profile service architecture with data validation"
2980
+
2981
+ # 3. Implement with TDD
2982
+ npx claude-flow sparc tdd "user profile CRUD operations"
2983
+
2984
+ # 4. Security review
2985
+ npx claude-flow sparc run security-review "profile data access and validation"
2986
+
2987
+ # 5. Integration testing
2988
+ npx claude-flow sparc run integration "profile service with authentication system"
2989
+
2990
+ # 6. Documentation
2991
+ npx claude-flow sparc run docs-writer "profile service API documentation"
2992
+ \`\`\`
2993
+
2994
+ ### Bug Fix Workflow
2995
+ \`\`\`bash
2996
+ # 1. Debug and analyze
2997
+ npx claude-flow sparc run debug "authentication token expiration issue"
2998
+
2999
+ # 2. Write regression tests
3000
+ npx claude-flow sparc run tdd "token refresh mechanism tests"
3001
+
3002
+ # 3. Implement fix
3003
+ npx claude-flow sparc run code "fix token refresh in authentication service"
3004
+
3005
+ # 4. Security review
3006
+ npx claude-flow sparc run security-review "token handling security implications"
3007
+ \`\`\`
3008
+
3009
+ ## Configuration Files
3010
+
3011
+ ### SPARC Configuration
3012
+ - **\`.roomodes\`**: SPARC mode definitions and configurations
3013
+ - **\`.roo/\`**: Templates, workflows, and mode-specific rules
3014
+
3015
+ ### Claude-Flow Configuration
3016
+ - **\`memory/\`**: Persistent memory and session data
3017
+ - **\`coordination/\`**: Multi-agent coordination settings
3018
+
3019
+ ## Git Workflow Integration
3020
+
3021
+ ### Commit Strategy with SPARC
3022
+ - **Specification commits**: After completing requirements analysis
3023
+ - **Architecture commits**: After design phase completion
3024
+ - **TDD commits**: After each Red-Green-Refactor cycle
3025
+ - **Integration commits**: After successful component integration
3026
+ - **Documentation commits**: After completing documentation updates
3027
+
3028
+ ### Branch Strategy
3029
+ - **\`feature/sparc-<feature-name>\`**: Feature development with SPARC methodology
3030
+ - **\`hotfix/sparc-<issue>\`**: Bug fixes using SPARC debugging workflow
3031
+ - **\`refactor/sparc-<component>\`**: Refactoring using optimization mode
3032
+
3033
+ ## Troubleshooting
3034
+
3035
+ ### Common SPARC Issues
3036
+ - **Mode not found**: Check \`.roomodes\` file exists and is valid JSON
3037
+ - **Memory persistence**: Ensure \`memory/\` directory has write permissions
3038
+ - **Tool access**: Verify required tools are available for the selected mode
3039
+ - **Namespace conflicts**: Use unique memory namespaces for different features
3040
+
3041
+ ### Debug Commands
3042
+ \`\`\`bash
3043
+ # Check SPARC configuration
3044
+ npx claude-flow sparc modes
3045
+
3046
+ # Verify memory system
3047
+ npx claude-flow memory stats
3048
+
3049
+ # Check system status
3050
+ npx claude-flow status
3051
+
3052
+ # View detailed mode information
3053
+ npx claude-flow sparc info <mode-name>
3054
+ \`\`\`
3055
+
3056
+ ## Project Architecture
3057
+
3058
+ This SPARC-enabled project follows a systematic development approach:
3059
+ - **Clear separation of concerns** through modular design
3060
+ - **Test-driven development** ensuring reliability and maintainability
3061
+ - **Iterative refinement** for continuous improvement
3062
+ - **Comprehensive documentation** for team collaboration
3063
+ - **AI-assisted development** through specialized SPARC modes
3064
+
3065
+ ## Important Notes
3066
+
3067
+ - Always run tests before committing (\`npm run test\`)
3068
+ - Use SPARC memory system to maintain context across sessions
3069
+ - Follow the Red-Green-Refactor cycle during TDD phases
3070
+ - Document architectural decisions in memory for future reference
3071
+ - Regular security reviews for any authentication or data handling code
3072
+
3063
3073
  For more information about SPARC methodology, see: https://github.com/ruvnet/claude-code-flow/docs/sparc.md
3064
3074
  `;
3065
3075
  }