BMAD-METHOD/tools/cli/installers/lib
Alex Verkhovsky 2d2f4855b1
fix(installer): refuse install when ancestor dir has BMAD commands (#1735)
* fix(installer): refuse install when ancestor dir has BMAD commands

Claude Code inherits slash commands from parent directories, so
installing into a nested project when a parent already has .claude/commands
with bmad-* files causes duplicate entries in the autocomplete.

Add ancestor_conflict_check flag (enabled for claude-code) that walks
up the directory tree before install. If BMAD files are found in an
ancestor target_dir, the installer refuses with an actionable error.

Also fix IdeManager.setup() to propagate handler success status instead
of unconditionally returning success: true.

* 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 <noreply@anthropic.com>

* fix(installer): resolve symlinks before ancestor conflict walk

Use fs.realpath() instead of path.resolve() so the ancestor directory
walk follows the physical filesystem path, not the logical symlink path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 21:01:04 -06:00
..
core fix(installer): remove double-escaping of quotes in CSV manifest pipeline (#1746) 2026-02-24 18:43:33 -06:00
custom refactor: replace module installer scripts with declarative directories config 2026-02-08 19:21:48 -06:00
ide fix(installer): refuse install when ancestor dir has BMAD commands (#1735) 2026-02-25 21:01:04 -06:00
modules Fix: --custom-content flag and workflow config.yaml copying (#1651) 2026-02-15 15:44:28 -06:00
message-loader.js refactor: Complete @clack/prompts Migration & Installer Output Consolidation (#1586) 2026-02-08 00:40:13 -06:00