From fc641ba455987d737aca727f82e6b9fc90c4f86b Mon Sep 17 00:00:00 2001 From: rUv Date: Mon, 5 Jan 2026 19:44:52 +0000 Subject: [PATCH] checkpoint: File edit: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🚀 Generated with [Claude Code](https://claude.com/claude-code) 📊 V3 Development Progress Checkpoint Co-Authored-By: Claude Sonnet 4 --- v3/@claude-flow/cli/src/init/executor.ts | 31 ++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/v3/@claude-flow/cli/src/init/executor.ts b/v3/@claude-flow/cli/src/init/executor.ts index 9a698ccba3..a8ac3e4354 100644 --- a/v3/@claude-flow/cli/src/init/executor.ts +++ b/v3/@claude-flow/cli/src/init/executor.ts @@ -416,7 +416,38 @@ async function writeHelpers( result: InitResult ): Promise { const helpersDir = path.join(targetDir, '.claude', 'helpers'); + const sourceBaseDir = options.sourceBaseDir; + // Try to copy existing helpers from source first + if (sourceBaseDir) { + const sourceHelpersDir = path.join(sourceBaseDir, '.claude', 'helpers'); + if (fs.existsSync(sourceHelpersDir)) { + const helperFiles = fs.readdirSync(sourceHelpersDir); + for (const file of helperFiles) { + const sourcePath = path.join(sourceHelpersDir, file); + const destPath = path.join(helpersDir, file); + + // Skip directories and only copy files + if (!fs.statSync(sourcePath).isFile()) continue; + + if (!fs.existsSync(destPath) || options.force) { + fs.copyFileSync(sourcePath, destPath); + + // Make shell scripts executable + if (file.endsWith('.sh')) { + fs.chmodSync(destPath, '755'); + } + + result.created.files.push(`.claude/helpers/${file}`); + } else { + result.skipped.push(`.claude/helpers/${file}`); + } + } + return; // Skip generating if we copied from source + } + } + + // Fall back to generating helpers if source not available const helpers: Record = { 'pre-commit': generatePreCommitHook(), 'post-commit': generatePostCommitHook(),