From ae1a55d20ff893bdebf464886760beeebf5eb60f Mon Sep 17 00:00:00 2001 From: rUv Date: Fri, 18 Jul 2025 20:59:22 +0000 Subject: [PATCH] feat(init): Add .hive-mind directory initialization to init command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added .hive-mind directory creation to standard directory structure - Added hive-mind config.json initialization with default settings - Fixed missing imports for template functions (createAgentsReadme, createSessionsReadme, etc.) - Ensures init command creates both .swarm and .hive-mind directories - Provides complete v2.0.0 initialization including hive-mind system 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/cli/simple-commands/init/index.js | 45 +++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/cli/simple-commands/init/index.js b/src/cli/simple-commands/init/index.js index 8bb216b96a..d5eb84ca21 100644 --- a/src/cli/simple-commands/init/index.js +++ b/src/cli/simple-commands/init/index.js @@ -24,6 +24,20 @@ import { } from './templates/enhanced-templates.js'; import { getIsolatedNpxEnv } from '../../../utils/npx-isolated-cache.js'; import { updateGitignore, needsGitignoreUpdate } from './gitignore-updater.js'; +import { + createFullClaudeMd, + createSparcClaudeMd, + createMinimalClaudeMd, +} from './templates/claude-md.js'; +import { + createFullMemoryBankMd, + createMinimalMemoryBankMd, +} from './templates/memory-bank-md.js'; +import { + createFullCoordinationMd, + createMinimalCoordinationMd, +} from './templates/coordination-md.js'; +import { createAgentsReadme, createSessionsReadme } from './templates/readme-files.js'; /** * Check if Claude Code CLI is installed @@ -1077,6 +1091,7 @@ ${commands.map((cmd) => `- [${cmd}](./${cmd}.md)`).join('\n')} 'coordination/subtasks', 'coordination/orchestration', '.swarm', // Add .swarm directory for shared memory + '.hive-mind', // Add .hive-mind directory for hive-mind system ]; for (const dir of standardDirs) { @@ -1122,6 +1137,36 @@ ${commands.map((cmd) => `- [${cmd}](./${cmd}.md)`).join('\n')} console.log(` ⚠️ Could not initialize memory system: ${err.message}`); console.log(' Memory will be initialized on first use'); } + + // Initialize hive-mind configuration + try { + const hiveMindConfig = { + version: '2.0.0', + initialized: new Date().toISOString(), + defaults: { + queenType: 'strategic', + maxWorkers: 8, + consensusAlgorithm: 'majority', + memorySize: 100, + autoScale: true, + encryption: false, + }, + mcpTools: { + enabled: true, + parallel: true, + timeout: 60000, + }, + }; + + await fs.writeFile( + `${workingDir}/.hive-mind/config.json`, + JSON.stringify(hiveMindConfig, null, 2), + ); + + printSuccess('✓ Initialized hive-mind system'); + } catch (err) { + console.log(` ⚠️ Could not initialize hive-mind system: ${err.message}`); + } } // Update .gitignore with Claude Flow entries