Skip to content

Scaffolded setup skill deletes live v6 config (cleanup-legacy + merge cleanup); still present in v2.0.0 #96

Description

@bigmacdaddy75

Summary

The bmad-module-builder scaffolder emits a setup skill whose cleanup steps delete config that is live on BMAD v6. Confirmed still present in v2.0.0 — the v2 rebuild did not touch bmad-module-builder/assets/setup-skill-template (last change 2026-06-02).

Details

cleanup-legacy.py builds dirs_to_remove = [module_code, "core"] + also_remove and shutil.rmtrees each. On v6 these are live:

  • _bmad/core/config.yaml — live core config (user_name, project_name, language settings) read by core/bmm skills
  • _bmad/<module>/config.yaml, _bmad/<module>/module-help.csv — live module config/help
  • _bmad/_config/ — installer manifests + bmad-help.csv

The --skills-dir safety check only guards directories that contain a SKILL.md. On v6 these config directories have none, so find_skill_dirs returns empty, verification is skipped, and removal proceeds — while the JSON reports skills_verified: true.

merge-config.py (cleanup_legacy_configs) and merge-help-csv.py (cleanup_legacy_csvs) have the same file-level deletions for core/config.yaml, <module>/config.yaml, and the per-module module-help.csv.

Reproduction

npx bmad-method@latest install --modules bmm --tools claude-code --yes
# then run the scaffolded setup skill's cleanup invocation:
python3 cleanup-legacy.py --bmad-dir _bmad --module-code <m> --also-remove _config --skills-dir .claude/skills

Result: core/config.yaml, <module>/ config + help, and _config/ manifests are deleted; project_name is lost (it isn't migrated up by merge-config.py); /bmad-help's catalog (_config/bmad-help.csv) is gone.

Why it's wrong on v6

The consolidate-and-delete model assumes the installer staged redundant skill payloads + per-module config into _bmad/<module>/ and core/. Fresh-install probes of 6.0.1, 6.6.0, and 6.8.0 all show the opposite: per-module config.yaml is live, skills live at .claude/skills/, and nothing is staged redundantly under _bmad/. The model matches a pre-v6 (v4/v5) layout, not any v6 release.

Impact

Affects every module scaffolded by bmad-module-builder that coexists with bmm-core v6, including bmad-bmb-setup itself.

Suggested fix

Gate removal on "verified-redundant skill payload": remove a directory only if it contains ≥1 SKILL.md whose skills are verified installed at the skills dir, and never remove a directory containing config files. This no-ops safely on v6 while still cleaning genuine pre-v6 payload dirs — no version check needed. Apply the same guard to the cleanup_legacy_* file deletions in merge-config.py / merge-help-csv.py.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions