Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

fix: correct claude-flow init configuration placement (fixes #276)

rUv4265b95f3e76
diff --git a/src/cli/simple-commands/init/gitignore-updater.js b/src/cli/simple-commands/init/gitignore-updater.js
index 872b59b9cd..641c26cd41 100644
--- a/src/cli/simple-commands/init/gitignore-updater.js
+++ b/src/cli/simple-commands/init/gitignore-updater.js
@@ -11,7 +11,8 @@ import { existsSync, readTextFile, writeTextFile } from '../../node-compat.js';
const CLAUDE_FLOW_GITIGNORE_ENTRIES = `
# Claude Flow generated files
.claude/settings.local.json
-.claude/mcp.json
+.mcp.json
+claude-flow.config.json
.swarm/
.hive-mind/
memory/claude-flow-data.json
diff --git a/src/cli/simple-commands/init/help.js b/src/cli/simple-commands/init/help.js
index a3e8a2bf67..6cc6e86a9d 100644
--- a/src/cli/simple-commands/init/help.js
+++ b/src/cli/simple-commands/init/help.js
@@ -58,9 +58,10 @@ export function showInitHelp() {
console.log(' claude-flow init --list-backups # Show available backups');
console.log();
console.log('What gets created:');
- console.log(' β€’ .claude/settings.json - Global configuration with hooks and features');
+ console.log(' β€’ .claude/settings.json - Claude Code configuration with hooks');
console.log(' β€’ .claude/settings.local.json - Pre-approved MCP permissions (no prompts!)');
- console.log(' β€’ .claude/mcp.json - MCP server configuration for easy setup');
+ console.log(' β€’ .mcp.json - Project-scoped MCP server configuration');
+ console.log(' β€’ claude-flow.config.json - Claude Flow features and performance settings');
console.log(' β€’ .claude/commands/ directory with 20+ Claude Code slash commands');
console.log(' β€’ CLAUDE.md with project instructions (v2.0.0 enhanced by default)');
console.log(' β€’ memory/ directory for persistent context storage');
diff --git a/src/cli/simple-commands/init/index.js b/src/cli/simple-commands/init/index.js
index 9761da9801..f94ca8ab93 100644
--- a/src/cli/simple-commands/init/index.js
+++ b/src/cli/simple-commands/init/index.js
@@ -988,7 +988,7 @@ async function enhancedClaudeFlowInit(flags, subArgs = []) {
try {
// Check existing files
const existingFiles = [];
- const filesToCheck = ['CLAUDE.md', '.claude/settings.json'];
+ const filesToCheck = ['CLAUDE.md', '.claude/settings.json', '.mcp.json', 'claude-flow.config.json'];
for (const file of filesToCheck) {
if (existsSync(`${workingDir}/${file}`)) {
@@ -1047,7 +1047,7 @@ async function enhancedClaudeFlowInit(flags, subArgs = []) {
console.log('[DRY RUN] Would create .claude/settings.local.json with default MCP permissions');
}
- // Create mcp.json for easy MCP server configuration
+ // Create .mcp.json at project root for MCP server configuration
const mcpConfig = {
"mcpServers": {
"claude-flow": {
@@ -1064,10 +1064,39 @@ async function enhancedClaudeFlowInit(flags, subArgs = []) {
};
if (!dryRun) {
- await Deno.writeTextFile(`${claudeDir}/mcp.json`, JSON.stringify(mcpConfig, null, 2));
- printSuccess('βœ“ Created .claude/mcp.json for MCP server configuration');
+ await Deno.writeTextFile(`${workingDir}/.mcp.json`, JSON.stringify(mcpConfig, null, 2));
+ printSuccess('βœ“ Created .mcp.json at project root for MCP server configuration');
} else {
- console.log('[DRY RUN] Would create .claude/mcp.json for MCP server configuration');
+ console.log('[DRY RUN] Would create .mcp.json at project root for MCP server configuration');
+ }
+
+ // Create claude-flow.config.json for Claude Flow specific settings
+ const claudeFlowConfig = {
+ "features": {
+ "autoTopologySelection": true,
+ "parallelExecution": true,
+ "neuralTraining": true,
+ "bottleneckAnalysis": true,
+ "smartAutoSpawning": true,
+ "selfHealingWorkflows": true,
+ "crossSessionMemory": true,
+ "githubIntegration": true
+ },
+ "performance": {
+ "maxAgents": 10,
+ "defaultTopology": "hierarchical",
+ "executionStrategy": "parallel",
+ "tokenOptimization": true,
+ "cacheEnabled": true,
+ "telemetryLevel": "detailed"
+ }
+ };
+
+ if (!dryRun) {
+ await Deno.writeTextFile(`${workingDir}/claude-flow.config.json`, JSON.stringify(claudeFlowConfig, null, 2));
+ printSuccess('βœ“ Created claude-flow.config.json for Claude Flow settings');
+ } else {
+ console.log('[DRY RUN] Would create claude-flow.config.json for Claude Flow settings');
}
// Create command documentation
@@ -1214,7 +1243,7 @@ ${commands.map(cmd => `- [${cmd}](./${cmd}.md)`).join('\n')}
console.log('\n πŸ“‹ To add MCP servers manually:');
console.log(' claude mcp add claude-flow npx claude-flow@alpha mcp start');
console.log(' claude mcp add ruv-swarm npx ruv-swarm@latest mcp start');
- console.log('\n πŸ’‘ Or copy .claude/mcp.json to your Claude Desktop config directory');
+ console.log('\n πŸ’‘ MCP servers are defined in .mcp.json (project scope)');
}
} else if (!dryRun && !isClaudeCodeInstalled()) {
console.log('\n⚠️ Claude Code CLI not detected!');
@@ -1223,7 +1252,7 @@ ${commands.map(cmd => `- [${cmd}](./${cmd}.md)`).join('\n')}
console.log('\n πŸ“‹ After installing, add MCP servers:');
console.log(' claude mcp add claude-flow npx claude-flow@alpha mcp start');
console.log(' claude mcp add ruv-swarm npx ruv-swarm@latest mcp start');
- console.log('\n πŸ’‘ Or copy .claude/mcp.json to your Claude Desktop config directory');
+ console.log('\n πŸ’‘ MCP servers are defined in .mcp.json (project scope)');
}
// Final instructions
diff --git a/src/cli/simple-commands/init/templates/enhanced-templates.js b/src/cli/simple-commands/init/templates/enhanced-templates.js
index 503df94d2b..44b5c36a60 100644
--- a/src/cli/simple-commands/init/templates/enhanced-templates.js
+++ b/src/cli/simple-commands/init/templates/enhanced-templates.js
@@ -1259,6 +1259,10 @@ function createEnhancedSettingsJsonFallback() {
"Bash(eval *)"
]
},
+ enabledMcpjsonServers: [
+ "claude-flow",
+ "ruv-swarm"
+ ],
hooks: {
PreToolUse: [
{
@@ -1311,36 +1315,6 @@ function createEnhancedSettingsJsonFallback() {
}
]
},
- mcpServers: {
- "claude-flow": {
- command: "npx",
- args: ["claude-flow", "mcp", "start"],
- env: {
- CLAUDE_FLOW_HOOKS_ENABLED: "true",
- CLAUDE_FLOW_TELEMETRY_ENABLED: "true",
- CLAUDE_FLOW_REMOTE_READY: "true",
- CLAUDE_FLOW_GITHUB_INTEGRATION: "true"
- }
- }
- },
- includeCoAuthoredBy: true,
- features: {
- autoTopologySelection: true,
- parallelExecution: true,
- neuralTraining: true,
- bottleneckAnalysis: true,
- smartAutoSpawning: true,
- selfHealingWorkflows: true,
- crossSessionMemory: true,
- githubIntegration: true
- },
- performance: {
- maxAgents: 10,
- defaultTopology: "hierarchical",
- executionStrategy: "parallel",
- tokenOptimization: true,
- cacheEnabled: true,
- telemetryLevel: "detailed"
- }
+ includeCoAuthoredBy: true
}, null, 2);
}
\ No newline at end of file
diff --git a/src/cli/simple-commands/init/templates/settings.json b/src/cli/simple-commands/init/templates/settings.json
index b496cc6e4c..73865e5597 100644
--- a/src/cli/simple-commands/init/templates/settings.json
+++ b/src/cli/simple-commands/init/templates/settings.json
@@ -85,39 +85,9 @@
}
]
},
- "mcpServers": {
- "claude-flow": {
- "command": "npx",
- "args": [
- "claude-flow",
- "mcp",
- "start"
- ],
- "env": {
- "CLAUDE_FLOW_HOOKS_ENABLED": "true",
- "CLAUDE_FLOW_TELEMETRY_ENABLED": "true",
- "CLAUDE_FLOW_REMOTE_READY": "true",
- "CLAUDE_FLOW_GITHUB_INTEGRATION": "true"
- }
- }
- },
"includeCoAuthoredBy": true,
- "features": {
- "autoTopologySelection": true,
- "parallelExecution": true,
- "neuralTraining": true,
- "bottleneckAnalysis": true,
- "smartAutoSpawning": true,
- "selfHealingWorkflows": true,
- "crossSessionMemory": true,
- "githubIntegration": true
- },
- "performance": {
- "maxAgents": 10,
- "defaultTopology": "hierarchical",
- "executionStrategy": "parallel",
- "tokenOptimization": true,
- "cacheEnabled": true,
- "telemetryLevel": "detailed"
- }
+ "enabledMcpjsonServers": [
+ "claude-flow",
+ "ruv-swarm"
+ ]
}
\ No newline at end of file