Move C++ File
Automates moving a C++ source file and updating all related references.
Usage
Run from the project root:
python3 .claude/skills/move-file/move-file.py [--dry-run] <old-path> <new-path>
Both paths are relative to the project root. Use --dry-run to preview what would change without modifying any files.
Example
# Preview changes first (no files modified)
python3 .claude/skills/move-file/move-file.py --dry-run \
magda/daw/core/Config.hpp \
magda/daw/engine/Config.hpp
# Move a header from core/ to engine/
python3 .claude/skills/move-file/move-file.py \
magda/daw/core/Config.hpp \
magda/daw/engine/Config.hpp
What It Does
git mvthe file (preserves git history)- Updates external
#includereferences in all.cpp/.hppfiles:- Relative includes (
"../core/Config.hpp") → recomputed relative path from referencing file - Project-root-relative includes (
"magda/daw/core/Config.hpp") → updated path
- Relative includes (
- Updates includes within the moved file (recomputes relative paths from the new location)
- Updates
magda/daw/CMakeLists.txtsource entries (for.cppfiles only)
After Running
Review all changes before building:
git diff
make debug