agents/skills/remove-unused-includes/SKILL.md
This skill provides a workflow and script to look through a given folder,
identify unused includes using clang-include-cleaner, and safely remove them
only if the affected targets continue to compile successfully.
compile_commands.json): Ensure your compilation
database is up-to-date. If not, generate a fresh compilation database using:
python3 tools/clang/scripts/generate_compdb.py -p out/Default -o compile_commands.json
Run the automated cleanup script located inside this skill's directory (resolve
the absolute <skill_directory_path> from the skill metadata):
python3 <skill_directory_path>/scripts/remove_unused_includes.py --src-root . --folder <relative_or_absolute_folder_path>
The script automatically:
.cc files in the specified folder.clang-include-cleaner.gn refs.Once execution is complete, verify the final changes using git:
git status
git diff