claude-flow 2.5.0-alpha.131 → 2.5.0-alpha.133
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/.claude/settings.json +20 -20
- package/bin/claude-flow +1 -1
- package/dist/src/cli/simple-cli.js +188 -165
- package/dist/src/cli/simple-cli.js.map +1 -1
- package/dist/src/cli/simple-commands/init/copy-revised-templates.js +15 -3
- package/dist/src/cli/simple-commands/init/copy-revised-templates.js.map +1 -1
- package/dist/src/cli/simple-commands/init/index.js +181 -9
- package/dist/src/cli/simple-commands/init/index.js.map +1 -1
- package/dist/src/cli/simple-commands/init/template-copier.js +10 -0
- package/dist/src/cli/simple-commands/init/template-copier.js.map +1 -1
- package/dist/src/cli/simple-commands/init/templates/enhanced-templates.js +20 -20
- package/dist/src/cli/simple-commands/init/templates/enhanced-templates.js.map +1 -1
- package/dist/src/cli/validation-helper.js.map +1 -1
- package/dist/src/core/MCPIntegrator.js +99 -0
- package/dist/src/core/MCPIntegrator.js.map +1 -1
- package/dist/src/core/version.js +2 -2
- package/dist/src/core/version.js.map +1 -1
- package/dist/src/utils/metrics-reader.js +39 -37
- package/dist/src/utils/metrics-reader.js.map +1 -1
- package/package.json +1 -1
- package/src/cli/simple-commands/init/copy-revised-templates.js +10 -3
- package/src/cli/simple-commands/init/index.js +182 -0
- package/src/cli/simple-commands/init/template-copier.js +13 -0
- package/src/cli/simple-commands/init/templates/enhanced-templates.js +19 -16
- package/src/cli/simple-commands/init/templates/settings.json +20 -20
- package/src/cli/simple-commands/init/templates/statusline-command.sh +178 -0
- package/src/core/MCPIntegrator.ts +51 -0
package/.claude/settings.json
CHANGED
|
@@ -9,32 +9,29 @@
|
|
|
9
9
|
},
|
|
10
10
|
"permissions": {
|
|
11
11
|
"allow": [
|
|
12
|
-
"Bash(npx claude-flow
|
|
12
|
+
"Bash(npx claude-flow:*)",
|
|
13
13
|
"Bash(npm run lint)",
|
|
14
14
|
"Bash(npm run test:*)",
|
|
15
|
-
"Bash(npm test
|
|
15
|
+
"Bash(npm test:*)",
|
|
16
16
|
"Bash(git status)",
|
|
17
|
-
"Bash(git diff
|
|
18
|
-
"Bash(git log
|
|
19
|
-
"Bash(git add
|
|
20
|
-
"Bash(git commit
|
|
17
|
+
"Bash(git diff:*)",
|
|
18
|
+
"Bash(git log:*)",
|
|
19
|
+
"Bash(git add:*)",
|
|
20
|
+
"Bash(git commit:*)",
|
|
21
21
|
"Bash(git push)",
|
|
22
|
-
"Bash(git config
|
|
23
|
-
"Bash(git tag
|
|
24
|
-
"Bash(git branch
|
|
25
|
-
"Bash(git checkout
|
|
26
|
-
"Bash(git stash
|
|
27
|
-
"Bash(jq
|
|
28
|
-
"Bash(node
|
|
29
|
-
"Bash(which
|
|
22
|
+
"Bash(git config:*)",
|
|
23
|
+
"Bash(git tag:*)",
|
|
24
|
+
"Bash(git branch:*)",
|
|
25
|
+
"Bash(git checkout:*)",
|
|
26
|
+
"Bash(git stash:*)",
|
|
27
|
+
"Bash(jq:*)",
|
|
28
|
+
"Bash(node:*)",
|
|
29
|
+
"Bash(which:*)",
|
|
30
30
|
"Bash(pwd)",
|
|
31
|
-
"Bash(ls
|
|
31
|
+
"Bash(ls:*)"
|
|
32
32
|
],
|
|
33
33
|
"deny": [
|
|
34
|
-
"Bash(rm -rf /)"
|
|
35
|
-
"Bash(curl * | bash)",
|
|
36
|
-
"Bash(wget * | sh)",
|
|
37
|
-
"Bash(eval *)"
|
|
34
|
+
"Bash(rm -rf /)"
|
|
38
35
|
]
|
|
39
36
|
},
|
|
40
37
|
"hooks": {
|
|
@@ -110,5 +107,8 @@
|
|
|
110
107
|
]
|
|
111
108
|
},
|
|
112
109
|
"includeCoAuthoredBy": true,
|
|
113
|
-
"enabledMcpjsonServers": ["claude-flow", "ruv-swarm"]
|
|
110
|
+
"enabledMcpjsonServers": ["claude-flow", "ruv-swarm"],
|
|
111
|
+
"statusLine": {
|
|
112
|
+
"command": "/home/codespace/.claude/statusline-command.sh"
|
|
113
|
+
}
|
|
114
114
|
}
|
package/bin/claude-flow
CHANGED
|
@@ -1,47 +1,13 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
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
|
-
|
|
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
|
|
44
|
-
⚡ ALPHA 85: Advanced automation capabilities & stream-JSON chaining for multi-agent pipelines
|
|
10
|
+
🎯 ENTERPRISE FEATURES: Complete ruv-swarm integration with 27 MCP tools, neural networking, and production-ready infrastructure
|
|
45
11
|
|
|
46
12
|
USAGE:
|
|
47
13
|
claude-flow <command> [options]
|
|
@@ -175,8 +141,8 @@ function printSuccess(message) {
|
|
|
175
141
|
function printWarning(message) {
|
|
176
142
|
console.warn(`⚠️ Warning: ${message}`);
|
|
177
143
|
}
|
|
178
|
-
function showHelpWithCommands(
|
|
179
|
-
printHelp(
|
|
144
|
+
function showHelpWithCommands() {
|
|
145
|
+
printHelp();
|
|
180
146
|
console.log('\nRegistered Commands:');
|
|
181
147
|
const commands = listCommands();
|
|
182
148
|
for (const command of commands){
|
|
@@ -185,58 +151,14 @@ function showHelpWithCommands(plain = false) {
|
|
|
185
151
|
console.log('\nUse "claude-flow help <command>" for detailed usage information');
|
|
186
152
|
}
|
|
187
153
|
async function main() {
|
|
154
|
+
const args = Deno.args;
|
|
188
155
|
if (args.length === 0) {
|
|
189
|
-
printHelp(
|
|
156
|
+
printHelp();
|
|
190
157
|
return;
|
|
191
158
|
}
|
|
192
159
|
const command = args[0];
|
|
193
160
|
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
161
|
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
162
|
case 'version':
|
|
241
163
|
case '--version':
|
|
242
164
|
case '-v':
|
|
@@ -246,14 +168,9 @@ async function main() {
|
|
|
246
168
|
case '--help':
|
|
247
169
|
case '-h':
|
|
248
170
|
if (parsedArgs.length > 0) {
|
|
249
|
-
|
|
250
|
-
if (detailedHelp && !detailedHelp.includes('Help not available')) {
|
|
251
|
-
printCommandHelp(parsedArgs[0]);
|
|
252
|
-
} else {
|
|
253
|
-
showCommandHelp(parsedArgs[0]);
|
|
254
|
-
}
|
|
171
|
+
showCommandHelp(parsedArgs[0]);
|
|
255
172
|
} else {
|
|
256
|
-
|
|
173
|
+
showHelpWithCommands();
|
|
257
174
|
}
|
|
258
175
|
return;
|
|
259
176
|
}
|
|
@@ -263,7 +180,6 @@ async function main() {
|
|
|
263
180
|
return;
|
|
264
181
|
} catch (err) {
|
|
265
182
|
printError(err.message);
|
|
266
|
-
console.log(`\nRun "claude-flow ${command} --help" for usage information.`);
|
|
267
183
|
return;
|
|
268
184
|
}
|
|
269
185
|
}
|
|
@@ -283,12 +199,11 @@ async function main() {
|
|
|
283
199
|
console.log('📊 Real-time monitoring would display here');
|
|
284
200
|
break;
|
|
285
201
|
case 'spawn':
|
|
286
|
-
const
|
|
287
|
-
const spawnType = resolveLegacyAgentType(rawSpawnType);
|
|
202
|
+
const spawnType = subArgs[0] || 'general';
|
|
288
203
|
const spawnName = flags.name || `agent-${Date.now()}`;
|
|
289
204
|
printSuccess(`Spawning ${spawnType} agent: ${spawnName}`);
|
|
290
205
|
console.log('🤖 Agent would be created with the following configuration:');
|
|
291
|
-
console.log(` Type: ${spawnType}
|
|
206
|
+
console.log(` Type: ${spawnType}`);
|
|
292
207
|
console.log(` Name: ${spawnName}`);
|
|
293
208
|
console.log(' Capabilities: Research, Analysis, Code Generation');
|
|
294
209
|
console.log(' Status: Ready');
|
|
@@ -313,7 +228,7 @@ async function main() {
|
|
|
313
228
|
console.log(' • Max Pool Size: 10');
|
|
314
229
|
console.log(' • Idle Timeout: 5 minutes');
|
|
315
230
|
console.log(' • Shell: /bin/bash');
|
|
316
|
-
console.log(' • Working Directory: ' + cwd());
|
|
231
|
+
console.log(' • Working Directory: ' + process.cwd());
|
|
317
232
|
console.log(' Performance:');
|
|
318
233
|
console.log(' • Average Response Time: N/A');
|
|
319
234
|
console.log(' • Terminal Creation Time: N/A');
|
|
@@ -362,7 +277,7 @@ async function main() {
|
|
|
362
277
|
const terminalConfig = {
|
|
363
278
|
name: nameIndex >= 0 ? subArgs[nameIndex + 1] : 'terminal-' + Date.now(),
|
|
364
279
|
shell: shellIndex >= 0 ? subArgs[shellIndex + 1] : 'bash',
|
|
365
|
-
workingDirectory: wdIndex >= 0 ? subArgs[wdIndex + 1] : cwd(),
|
|
280
|
+
workingDirectory: wdIndex >= 0 ? subArgs[wdIndex + 1] : process.cwd(),
|
|
366
281
|
env: envIndex >= 0 ? subArgs[envIndex + 1] : '',
|
|
367
282
|
persistent: persistentIndex >= 0
|
|
368
283
|
};
|
|
@@ -1319,9 +1234,10 @@ ${flags1.mode === 'full' || !flags1.mode ? `Full-stack development covering all
|
|
|
1319
1234
|
console.log('Debug - Executing command:');
|
|
1320
1235
|
console.log(`claude ${claudeArgs.map((arg)=>arg.includes(' ') || arg.includes('\n') ? `"${arg}"` : arg).join(' ')}`);
|
|
1321
1236
|
}
|
|
1322
|
-
const
|
|
1237
|
+
const command = new Deno.Command('claude', {
|
|
1238
|
+
args: claudeArgs,
|
|
1323
1239
|
env: {
|
|
1324
|
-
...
|
|
1240
|
+
...Deno.env.toObject(),
|
|
1325
1241
|
CLAUDE_INSTANCE_ID: instanceId,
|
|
1326
1242
|
CLAUDE_FLOW_MODE: flags1.mode || 'full',
|
|
1327
1243
|
CLAUDE_FLOW_COVERAGE: (flags1.coverage || 80).toString(),
|
|
@@ -1331,18 +1247,17 @@ ${flags1.mode === 'full' || !flags1.mode ? `Full-stack development covering all
|
|
|
1331
1247
|
CLAUDE_FLOW_COORDINATION_ENABLED: flags1.parallel ? 'true' : 'false',
|
|
1332
1248
|
CLAUDE_FLOW_FEATURES: 'memory,coordination,swarm'
|
|
1333
1249
|
},
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
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
|
-
});
|
|
1250
|
+
stdin: 'inherit',
|
|
1251
|
+
stdout: 'inherit',
|
|
1252
|
+
stderr: 'inherit'
|
|
1345
1253
|
});
|
|
1254
|
+
const child = command.spawn();
|
|
1255
|
+
const status = await child.status;
|
|
1256
|
+
if (status.success) {
|
|
1257
|
+
printSuccess(`Claude instance ${instanceId} completed successfully`);
|
|
1258
|
+
} else {
|
|
1259
|
+
printError(`Claude instance ${instanceId} exited with code ${status.code}`);
|
|
1260
|
+
}
|
|
1346
1261
|
} catch (err) {
|
|
1347
1262
|
printError(`Failed to spawn Claude: ${err.message}`);
|
|
1348
1263
|
console.log('Make sure you have the Claude CLI installed.');
|
|
@@ -1895,7 +1810,7 @@ ${flags1.mode === 'full' || !flags1.mode ? `Full-stack development covering all
|
|
|
1895
1810
|
console.log('\nDid you mean:');
|
|
1896
1811
|
suggestions.forEach((cmd)=>console.log(` claude-flow ${cmd}`));
|
|
1897
1812
|
}
|
|
1898
|
-
exit(1);
|
|
1813
|
+
process.exit(1);
|
|
1899
1814
|
}
|
|
1900
1815
|
}
|
|
1901
1816
|
async function startRepl() {
|
|
@@ -1973,7 +1888,7 @@ Shortcuts:
|
|
|
1973
1888
|
},
|
|
1974
1889
|
config: async (key)=>{
|
|
1975
1890
|
try {
|
|
1976
|
-
const config = JSON.parse(await
|
|
1891
|
+
const config = JSON.parse(await fs.readFile('claude-flow.config.json', 'utf-8'));
|
|
1977
1892
|
if (key) {
|
|
1978
1893
|
const keys = key.split('.');
|
|
1979
1894
|
let value = config;
|
|
@@ -2001,25 +1916,21 @@ Shortcuts:
|
|
|
2001
1916
|
if (trimmed.startsWith('!')) {
|
|
2002
1917
|
const shellCmd = trimmed.substring(1);
|
|
2003
1918
|
try {
|
|
2004
|
-
|
|
2005
|
-
|
|
1919
|
+
const command = new Deno.Command('sh', {
|
|
1920
|
+
args: [
|
|
2006
1921
|
'-c',
|
|
2007
1922
|
shellCmd
|
|
2008
|
-
],
|
|
2009
|
-
|
|
2010
|
-
|
|
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);
|
|
1923
|
+
],
|
|
1924
|
+
stdout: 'piped',
|
|
1925
|
+
stderr: 'piped'
|
|
2022
1926
|
});
|
|
1927
|
+
const { stdout, stderr } = await command.output();
|
|
1928
|
+
if (stdout.length > 0) {
|
|
1929
|
+
console.log(new TextDecoder().decode(stdout));
|
|
1930
|
+
}
|
|
1931
|
+
if (stderr.length > 0) {
|
|
1932
|
+
console.error(new TextDecoder().decode(stderr));
|
|
1933
|
+
}
|
|
2023
1934
|
} catch (err) {
|
|
2024
1935
|
console.error(`Shell error: ${err.message}`);
|
|
2025
1936
|
}
|
|
@@ -2039,7 +1950,7 @@ Shortcuts:
|
|
|
2039
1950
|
const parts = trimmed.split(' ');
|
|
2040
1951
|
const command = parts[0];
|
|
2041
1952
|
const args = parts.slice(1);
|
|
2042
|
-
if (replCommands
|
|
1953
|
+
if (command in replCommands) {
|
|
2043
1954
|
await replCommands[command](...args);
|
|
2044
1955
|
return true;
|
|
2045
1956
|
}
|
|
@@ -2060,8 +1971,7 @@ Shortcuts:
|
|
|
2060
1971
|
const subCmd = args[0];
|
|
2061
1972
|
switch(subCmd){
|
|
2062
1973
|
case 'spawn':
|
|
2063
|
-
const
|
|
2064
|
-
const type = resolveLegacyAgentType(rawType);
|
|
1974
|
+
const type = args[1] || 'researcher';
|
|
2065
1975
|
const name = args[2] || `agent-${Date.now()}`;
|
|
2066
1976
|
const agent = {
|
|
2067
1977
|
id: `agent-${Date.now()}`,
|
|
@@ -2266,33 +2176,18 @@ Shortcuts:
|
|
|
2266
2176
|
console.log('Terminal commands: create, list, exec, attach, detach');
|
|
2267
2177
|
}
|
|
2268
2178
|
}
|
|
2269
|
-
const
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
rl.on('line', async (input)=>{
|
|
2279
|
-
input = input.trim();
|
|
2179
|
+
const decoder = new TextDecoder();
|
|
2180
|
+
const encoder = new TextEncoder();
|
|
2181
|
+
while(true){
|
|
2182
|
+
const prompt = replState.currentSession ? `claude-flow:${replState.currentSession}> ` : 'claude-flow> ';
|
|
2183
|
+
await Deno.stdout.write(encoder.encode(prompt));
|
|
2184
|
+
const buf = new Uint8Array(1024);
|
|
2185
|
+
const n = await Deno.stdin.read(buf);
|
|
2186
|
+
if (n === null) break;
|
|
2187
|
+
const input = decoder.decode(buf.subarray(0, n)).trim();
|
|
2280
2188
|
const shouldContinue = await processReplCommand(input);
|
|
2281
|
-
if (!shouldContinue)
|
|
2282
|
-
|
|
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
|
-
});
|
|
2189
|
+
if (!shouldContinue) break;
|
|
2190
|
+
}
|
|
2296
2191
|
}
|
|
2297
2192
|
function createMinimalClaudeMd() {
|
|
2298
2193
|
return `# Claude Code Integration
|
|
@@ -2609,30 +2504,30 @@ async function createSparcStructureManually() {
|
|
|
2609
2504
|
];
|
|
2610
2505
|
for (const dir of rooDirectories){
|
|
2611
2506
|
try {
|
|
2612
|
-
await
|
|
2507
|
+
await Deno.mkdir(dir, {
|
|
2613
2508
|
recursive: true
|
|
2614
2509
|
});
|
|
2615
2510
|
console.log(` ✓ Created ${dir}/`);
|
|
2616
2511
|
} catch (err) {
|
|
2617
|
-
if (!(err instanceof errors.AlreadyExists)) {
|
|
2512
|
+
if (!(err instanceof Deno.errors.AlreadyExists)) {
|
|
2618
2513
|
throw err;
|
|
2619
2514
|
}
|
|
2620
2515
|
}
|
|
2621
2516
|
}
|
|
2622
2517
|
let roomodesContent;
|
|
2623
2518
|
try {
|
|
2624
|
-
roomodesContent = await
|
|
2519
|
+
roomodesContent = await fs.readFile('.roomodes');
|
|
2625
2520
|
console.log(' ✓ Using existing .roomodes configuration');
|
|
2626
2521
|
} catch {
|
|
2627
2522
|
roomodesContent = createBasicRoomodesConfig();
|
|
2628
|
-
await
|
|
2523
|
+
await fs.writeFile('.roomodes', roomodesContent);
|
|
2629
2524
|
console.log(' ✓ Created .roomodes configuration');
|
|
2630
2525
|
}
|
|
2631
2526
|
const basicWorkflow = createBasicSparcWorkflow();
|
|
2632
|
-
await
|
|
2527
|
+
await fs.writeFile('.roo/workflows/basic-tdd.json', basicWorkflow);
|
|
2633
2528
|
console.log(' ✓ Created .roo/workflows/basic-tdd.json');
|
|
2634
2529
|
const rooReadme = createRooReadme();
|
|
2635
|
-
await
|
|
2530
|
+
await fs.writeFile('.roo/README.md', rooReadme);
|
|
2636
2531
|
console.log(' ✓ Created .roo/README.md');
|
|
2637
2532
|
console.log(' ✅ Basic SPARC structure created successfully');
|
|
2638
2533
|
} catch (err) {
|
|
@@ -3060,6 +2955,134 @@ This SPARC-enabled project follows a systematic development approach:
|
|
|
3060
2955
|
- Document architectural decisions in memory for future reference
|
|
3061
2956
|
- Regular security reviews for any authentication or data handling code
|
|
3062
2957
|
|
|
2958
|
+
For more information about SPARC methodology, see: https://github.com/ruvnet/claude-code-flow/docs/sparc.md
|
|
2959
|
+
`;
|
|
2960
|
+
}
|
|
2961
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
2962
|
+
await main();
|
|
2963
|
+
}
|
|
2964
|
+
|
|
2965
|
+
//# sourceMappingURL=simple-cli.js.mapsign choices"
|
|
2966
|
+
|
|
2967
|
+
# Store test results and coverage
|
|
2968
|
+
npx claude-flow memory store test_coverage "Authentication module: 95% coverage, all tests passing"
|
|
2969
|
+
|
|
2970
|
+
# Query previous work
|
|
2971
|
+
npx claude-flow memory query auth_implementation
|
|
2972
|
+
|
|
2973
|
+
# Export project memory
|
|
2974
|
+
npx claude-flow memory export project_backup.json
|
|
2975
|
+
\`\`\`
|
|
2976
|
+
|
|
2977
|
+
### Memory Namespaces
|
|
2978
|
+
- **\`spec\`**: Requirements and specifications
|
|
2979
|
+
- **\`arch\`**: Architecture and design decisions
|
|
2980
|
+
- **\`impl\`**: Implementation notes and code patterns
|
|
2981
|
+
- **\`test\`**: Test results and coverage reports
|
|
2982
|
+
- **\`debug\`**: Bug reports and resolution notes
|
|
2983
|
+
|
|
2984
|
+
## Workflow Examples
|
|
2985
|
+
|
|
2986
|
+
### Feature Development Workflow
|
|
2987
|
+
\`\`\`bash
|
|
2988
|
+
# 1. Start with specification
|
|
2989
|
+
npx claude-flow sparc run spec-pseudocode "User profile management feature"
|
|
2990
|
+
|
|
2991
|
+
# 2. Design architecture
|
|
2992
|
+
npx claude-flow sparc run architect "Profile service architecture with data validation"
|
|
2993
|
+
|
|
2994
|
+
# 3. Implement with TDD
|
|
2995
|
+
npx claude-flow sparc tdd "user profile CRUD operations"
|
|
2996
|
+
|
|
2997
|
+
# 4. Security review
|
|
2998
|
+
npx claude-flow sparc run security-review "profile data access and validation"
|
|
2999
|
+
|
|
3000
|
+
# 5. Integration testing
|
|
3001
|
+
npx claude-flow sparc run integration "profile service with authentication system"
|
|
3002
|
+
|
|
3003
|
+
# 6. Documentation
|
|
3004
|
+
npx claude-flow sparc run docs-writer "profile service API documentation"
|
|
3005
|
+
\`\`\`
|
|
3006
|
+
|
|
3007
|
+
### Bug Fix Workflow
|
|
3008
|
+
\`\`\`bash
|
|
3009
|
+
# 1. Debug and analyze
|
|
3010
|
+
npx claude-flow sparc run debug "authentication token expiration issue"
|
|
3011
|
+
|
|
3012
|
+
# 2. Write regression tests
|
|
3013
|
+
npx claude-flow sparc run tdd "token refresh mechanism tests"
|
|
3014
|
+
|
|
3015
|
+
# 3. Implement fix
|
|
3016
|
+
npx claude-flow sparc run code "fix token refresh in authentication service"
|
|
3017
|
+
|
|
3018
|
+
# 4. Security review
|
|
3019
|
+
npx claude-flow sparc run security-review "token handling security implications"
|
|
3020
|
+
\`\`\`
|
|
3021
|
+
|
|
3022
|
+
## Configuration Files
|
|
3023
|
+
|
|
3024
|
+
### SPARC Configuration
|
|
3025
|
+
- **\`.roomodes\`**: SPARC mode definitions and configurations
|
|
3026
|
+
- **\`.roo/\`**: Templates, workflows, and mode-specific rules
|
|
3027
|
+
|
|
3028
|
+
### Claude-Flow Configuration
|
|
3029
|
+
- **\`memory/\`**: Persistent memory and session data
|
|
3030
|
+
- **\`coordination/\`**: Multi-agent coordination settings
|
|
3031
|
+
|
|
3032
|
+
## Git Workflow Integration
|
|
3033
|
+
|
|
3034
|
+
### Commit Strategy with SPARC
|
|
3035
|
+
- **Specification commits**: After completing requirements analysis
|
|
3036
|
+
- **Architecture commits**: After design phase completion
|
|
3037
|
+
- **TDD commits**: After each Red-Green-Refactor cycle
|
|
3038
|
+
- **Integration commits**: After successful component integration
|
|
3039
|
+
- **Documentation commits**: After completing documentation updates
|
|
3040
|
+
|
|
3041
|
+
### Branch Strategy
|
|
3042
|
+
- **\`feature/sparc-<feature-name>\`**: Feature development with SPARC methodology
|
|
3043
|
+
- **\`hotfix/sparc-<issue>\`**: Bug fixes using SPARC debugging workflow
|
|
3044
|
+
- **\`refactor/sparc-<component>\`**: Refactoring using optimization mode
|
|
3045
|
+
|
|
3046
|
+
## Troubleshooting
|
|
3047
|
+
|
|
3048
|
+
### Common SPARC Issues
|
|
3049
|
+
- **Mode not found**: Check \`.roomodes\` file exists and is valid JSON
|
|
3050
|
+
- **Memory persistence**: Ensure \`memory/\` directory has write permissions
|
|
3051
|
+
- **Tool access**: Verify required tools are available for the selected mode
|
|
3052
|
+
- **Namespace conflicts**: Use unique memory namespaces for different features
|
|
3053
|
+
|
|
3054
|
+
### Debug Commands
|
|
3055
|
+
\`\`\`bash
|
|
3056
|
+
# Check SPARC configuration
|
|
3057
|
+
npx claude-flow sparc modes
|
|
3058
|
+
|
|
3059
|
+
# Verify memory system
|
|
3060
|
+
npx claude-flow memory stats
|
|
3061
|
+
|
|
3062
|
+
# Check system status
|
|
3063
|
+
npx claude-flow status
|
|
3064
|
+
|
|
3065
|
+
# View detailed mode information
|
|
3066
|
+
npx claude-flow sparc info <mode-name>
|
|
3067
|
+
\`\`\`
|
|
3068
|
+
|
|
3069
|
+
## Project Architecture
|
|
3070
|
+
|
|
3071
|
+
This SPARC-enabled project follows a systematic development approach:
|
|
3072
|
+
- **Clear separation of concerns** through modular design
|
|
3073
|
+
- **Test-driven development** ensuring reliability and maintainability
|
|
3074
|
+
- **Iterative refinement** for continuous improvement
|
|
3075
|
+
- **Comprehensive documentation** for team collaboration
|
|
3076
|
+
- **AI-assisted development** through specialized SPARC modes
|
|
3077
|
+
|
|
3078
|
+
## Important Notes
|
|
3079
|
+
|
|
3080
|
+
- Always run tests before committing (\`npm run test\`)
|
|
3081
|
+
- Use SPARC memory system to maintain context across sessions
|
|
3082
|
+
- Follow the Red-Green-Refactor cycle during TDD phases
|
|
3083
|
+
- Document architectural decisions in memory for future reference
|
|
3084
|
+
- Regular security reviews for any authentication or data handling code
|
|
3085
|
+
|
|
3063
3086
|
For more information about SPARC methodology, see: https://github.com/ruvnet/claude-code-flow/docs/sparc.md
|
|
3064
3087
|
`;
|
|
3065
3088
|
}
|