move-file

Move C++ source files and update #include and CMake references.

195|21|Updated Jan 17, 2026
One-click install
npx skills add https://github.com/Conceptual-Machines/magda-core --skill move-file
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: move-file
Source: https://github.com/Conceptual-Machines/magda-core/tree/main/.claude/skills/move-file
Command: npx skills add https://github.com/Conceptual-Machines/magda-core --skill move-file

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates moving a C++ source file and updating all #include references and CMakeLists.txt entries automatically. Use when the user wants to move or rename a C++ file.

Core Features & Use Cases

  • Move a C++ source and update all external and internal includes across the project.
  • Update magda/daw/CMakeLists.txt when moving a .cpp file to reflect the new path.
  • Maintain git history by using git mv and ensuring includes stay valid after refactors.

Quick Start

From the project root, run the script with the old path and new path to perform the move and update all references.

Frequently Asked Questions about move-file

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I move a C++ file and update all include references automatically?

To move a C++ file and update includes automatically, you run a Python script from the project root with the old and new file paths. This executes git mv, rewrites all external and internal #include references, and adjusts CMakeLists.txt entries to match the new location.

What is the best way to refactor C++ source files without breaking CMake build references?

Refactoring C++ source files without breaking CMake build references requires updating CMakeLists.txt entries alongside file moves. This Skill automates that process by moving the source file with git mv and automatically adjusting magda/daw/CMakeLists.txt paths to reflect the new file structure.

Does moving a .cpp file with git mv preserve history when updating CMakeLists.txt?

Moving a .cpp file with git mv preserves history because it records the relocation as a rename. This Skill uses git mv to maintain git history while simultaneously rewriting include paths and updating CMakeLists.txt build references to ensure the project remains valid.

Can I update CMakeLists.txt and include paths across an entire C++ project at once?

Yes, you can update CMakeLists.txt and include paths across an entire C++ project at once. The Skill scans the codebase to rewrite all external and internal #include references in .cpp and .hpp files, while adjusting CMake build entries to match the new file locations during reorganization.

What are the limitations of moving C++ header files and updating includes automatically?

When moving C++ header files and updating includes automatically, the Skill targets specific build configurations like magda/daw/CMakeLists.txt. It requires a Python script to execute the git mv operations and rewrites includes specifically for .cpp and .hpp files, limiting its scope to these formats.