BMAD-METHOD/tools/installer
Brian 3da984a491
fix(config): promote project_name to core (closes #2279) (#2348)
* fix(config): promote project_name to core, fixes #2279

project_name was a bmm-specific prompt despite being a universal
project-level concept used by every module — including core skills like
bmad-brainstorming, which loads from _bmad/core/config.yaml and was
silently broken because project_name lived under bmm. Users without bmm
installed could not run brainstorming at all.

Move:
- src/core-skills/module.yaml: declare project_name with prompt
  "What is your project called?" and default {directory_name}, matching
  what bmm previously had.
- src/bmm-skills/module.yaml: remove the bmm definition; add project_name
  to the "Variables from Core Config inserted" header comment so
  contributors can see what's inherited.

Migration for existing installs:
- tools/installer/modules/official-modules.js: after loadExistingConfig
  reads each per-module config.yaml, hoist any keys that are now declared
  in core but appear under non-core modules. Without this, the partition
  logic in writeCentralConfig (which strips core keys from non-core
  buckets) would silently drop the user's prior project_name on the next
  quick-update. Generic — handles project_name today and any future
  module→core promotions.
- The hoist preserves precedence: an existing core value beats a stale
  module-side copy.

--yes seed:
- tools/installer/ui.js: add project_name to the hardcoded core seed
  (using path.basename(directory) to match the {directory_name} default)
  so non-interactive fresh installs populate it. Without this the seed
  silently omits project_name and core skills fall back to literals.

Tests:
- test/test-installation-components.js Suite 43 (9 assertions) covers
  the schema move, the loadExistingConfig hoist, and the precedence rule.
- Suite 35 fixture updated: project_name moved from bmm bucket to core,
  with a stale bmm copy left in place to verify it gets stripped.

Verified manually:
- Fresh install -y: project_name lands in [core] of config.toml.
- Existing install with project_name in bmm/config.yaml: quick-update
  hoists it to [core] and strips it from [modules.bmm].

* fix(installer): harden config-load against malformed config.yaml

Per augment review on #2348: loadExistingConfig stored any truthy
yaml.parse result (including scalars like '42'), which would later crash
_hoistCoreKeysFromLegacyModuleConfigs at \`key in cfg\` with
"Cannot use 'in' operator to search for ... in 42".

- loadExistingConfig: only keep parses that are plain objects (not
  scalars or arrays). A corrupt config.yaml is now treated the same as
  a parse error — skipped, not crashed-on.
- _hoistCoreKeysFromLegacyModuleConfigs: belt-and-suspenders type guards
  on _existingConfig.core (in case it's populated by some other path)
  and on each module cfg in the loop.
- Test Suite 43 adds 2 assertions covering a scalar core/config.yaml:
  loadExistingConfig must not crash, and bmm.project_name must still
  hoist into a clean core bucket.
2026-04-27 23:31:59 -05:00
..
commands fix(installer): require --tools for fresh --yes installs; remove --tools none (#2346) 2026-04-27 23:01:23 -05:00
core fix(installer): support local custom-source modules in resolveInstalledModuleYaml and TOML key (#2316) 2026-04-26 12:55:56 -05:00
ide fix(installer): require --tools for fresh --yes installs; remove --tools none (#2346) 2026-04-27 23:01:23 -05:00
modules fix(config): promote project_name to core (closes #2279) (#2348) 2026-04-27 23:31:59 -05:00
README.md refactor(installer): restructure installer with clean separation of concerns (#2129) 2026-03-27 06:50:07 -06:00
bmad-cli.js fix(publish): advance @next dist-tag after stable release (#2320) 2026-04-26 10:30:41 -05:00
cli-utils.js chore(installer): remove 1,683 lines of dead code (#2247) 2026-04-10 20:24:50 -07:00
file-ops.js fix(installer): replace fs-extra with native node:fs to prevent file loss 2026-04-13 00:44:28 -05:00
fs-native.js fix(installer): add missing sync and async methods to fs-native wrapper 2026-04-13 09:59:41 -05:00
install-messages.yaml feat(installer): overhaul branding, versioning, and skill cleanup (#2223) 2026-04-07 02:31:36 -05:00
message-loader.js fix(installer): replace fs-extra with native node:fs to prevent file loss 2026-04-13 00:44:28 -05:00
project-root.js fix(installer): route community installs through PluginResolver when marketplace.json ships (#2331) 2026-04-26 22:50:47 -05:00
prompts.js chore(installer): remove 1,683 lines of dead code (#2247) 2026-04-10 20:24:50 -07:00
ui.js fix(config): promote project_name to core (closes #2279) (#2348) 2026-04-27 23:31:59 -05:00
yaml-format.js refactor(installer): restructure installer with clean separation of concerns (#2129) 2026-03-27 06:50:07 -06:00

README.md

BMad CLI Tool

Installing external repo BMad official modules

For external official modules to be discoverable during install, ensure an entry for the external repo is added to external-official-modules.yaml.

For community modules - this will be handled in a different way. This file is only for registration of modules under the bmad-code-org.

Post-Install Notes

Modules can display setup guidance to users after configuration is collected during npx bmad-method install. Notes are defined in the module's own module.yaml — no changes to the installer are needed.

Simple Format

Always displayed after the module is configured:

post-install-notes: |
  Thank you for choosing the XYZ Cool Module
  For Support about this Module call 555-1212  

Conditional Format

Display different messages based on a config question's answer:

post-install-notes:
  config_key_name:
    value1: |
      Instructions for value1...      
    value2: |
      Instructions for value2...      

Values without an entry (e.g., none) display nothing. Multiple config keys can each have their own conditional notes.

Example: TEA Module

The TEA module uses the conditional format keyed on tea_browser_automation:

post-install-notes:
  tea_browser_automation:
    cli: |
      Playwright CLI Setup:
        npm install -g @playwright/cli@latest
        playwright-cli install --skills      
    mcp: |
      Playwright MCP Setup (two servers):
        1. playwright    — npx @playwright/mcp@latest
        2. playwright-test — npx playwright run-test-mcp-server      
    auto: |
      Playwright CLI Setup:
        ...
      Playwright MCP Setup (two servers):
        ...      

When a user selects auto, they see both CLI and MCP instructions. When they select none, nothing is shown.