From 886a070d2beaffcfbfa0f21491e6402523c83569 Mon Sep 17 00:00:00 2001 From: Alex Verkhovsky Date: Tue, 24 Feb 2026 19:34:39 -0700 Subject: [PATCH] Address code review feedback from CodeRabbit and Augment - Move "Setting up..." log after conflict check so it only shows when install will proceed - Fix rm command: add -rf flags and correct quoting for glob outside quotes - Improve error wording: "ancestor installation" instead of misleading "ancestor directory" - Use case-insensitive startsWith for bmad file detection (macOS/Windows) - Document ancestor_conflict_check in the installer config schema Co-Authored-By: Claude Opus 4.6 --- tools/cli/installers/lib/ide/_config-driven.js | 10 +++++----- tools/cli/installers/lib/ide/platform-codes.yaml | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tools/cli/installers/lib/ide/_config-driven.js b/tools/cli/installers/lib/ide/_config-driven.js index c0fea9a62..221f46905 100644 --- a/tools/cli/installers/lib/ide/_config-driven.js +++ b/tools/cli/installers/lib/ide/_config-driven.js @@ -34,17 +34,15 @@ class ConfigDrivenIdeSetup extends BaseIdeSetup { * @returns {Promise} Setup result */ async setup(projectDir, bmadDir, options = {}) { - if (!options.silent) await prompts.log.info(`Setting up ${this.name}...`); - // Check for BMAD files in ancestor directories that would cause duplicates if (this.installerConfig?.ancestor_conflict_check) { const conflict = await this.findAncestorConflict(projectDir); if (conflict) { await prompts.log.error( - `Found existing BMAD commands in ancestor directory: ${conflict}\n` + + `Found existing BMAD commands in ancestor installation: ${conflict}\n` + ` ${this.name} inherits commands from parent directories, so this would cause duplicates.\n` + ` Please remove the BMAD files from that directory first:\n` + - ` rm "${conflict}/"bmad*`, + ` rm -rf "${conflict}"/bmad*`, ); return { success: false, @@ -55,6 +53,8 @@ class ConfigDrivenIdeSetup extends BaseIdeSetup { } } + if (!options.silent) await prompts.log.info(`Setting up ${this.name}...`); + // Clean up any old BMAD installation first await this.cleanup(projectDir, options); @@ -570,7 +570,7 @@ LOAD and execute from: {project-root}/{{bmadFolderName}}/{{path}} try { if (await fs.pathExists(candidatePath)) { const entries = await fs.readdir(candidatePath); - const hasBmad = entries.some((e) => typeof e === 'string' && e.startsWith('bmad')); + const hasBmad = entries.some((e) => typeof e === 'string' && e.toLowerCase().startsWith('bmad')); if (hasBmad) { return candidatePath; } diff --git a/tools/cli/installers/lib/ide/platform-codes.yaml b/tools/cli/installers/lib/ide/platform-codes.yaml index b97b82ae1..69ffd6848 100644 --- a/tools/cli/installers/lib/ide/platform-codes.yaml +++ b/tools/cli/installers/lib/ide/platform-codes.yaml @@ -198,6 +198,9 @@ platforms: # artifact_types: [agents, workflows, tasks, tools] # artifact_types: array (optional) # Filter which artifacts to install (default: all) # skip_existing: boolean (optional) # Skip files that already exist (default: false) +# ancestor_conflict_check: boolean (optional) # Refuse install when ancestor dir has BMAD files +# # in the same target_dir (for IDEs that inherit +# # commands from parent directories) # ============================================================================ # Platform Categories