You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 25, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 25, 2026. It is now read-only.
cleanup-legacy.py: unchecked --module-code / --also-remove are passed to rmtree — '' or '.' deletes all of _bmad (agent memory included), '..' deletes the whole project #155
cleanup-legacy.py joins --module-code and every --also-remove value onto --bmad-dir, then calls shutil.rmtree on the result. The script is shipped in skills/bmad-bmb-setup/scripts/, the module-builder setup-skill template, and samples/sample-module-setup/. Nothing validates these values:
Value
Path(bmad_dir) / value
What gets deleted
--module-code ""
_bmad/
all of _bmad: every module's config, _config/ manifests, and every agent's sanctum under _bmad/memory/
--module-code .
_bmad/.
same as above
--module-code ..
_bmad/..
the whole project directory, source code included
--also-remove ../src
_bmad/../src
any folder outside _bmad
The --skills-dir safety check doesn't help. verify_skills_installed() skips every directory that contains no SKILL.md, so it reports skills_verified: true and removal continues. This is related to #96 (deleting live config dirs) and #121/#136 (validating module codes), but the impact here is total data loss from a single bad argument. The module code reaches this command through a {module-code} substitution done by the scaffolder or the LLM.
Require --module-code and each --also-remove value to be a single, non-empty, non-dot path segment, e.g. ^[A-Za-z0-9_][A-Za-z0-9_.-]*$ and not . or ...
Resolve each target and refuse anything that is not a strict child of the resolved --bmad-dir.
Activity