From 016016647cb8034da3e622d8777349790bf72b0d Mon Sep 17 00:00:00 2001 From: Aurelio <19254254+Aureliolo@users.noreply.github.com> Date: Sat, 28 Feb 2026 07:42:49 +0100 Subject: [PATCH] chore: add post-merge-cleanup skill for branch housekeeping --- .claude/skills/post-merge-cleanup/skill.md | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .claude/skills/post-merge-cleanup/skill.md diff --git a/.claude/skills/post-merge-cleanup/skill.md b/.claude/skills/post-merge-cleanup/skill.md new file mode 100644 index 0000000000..9a2283d21e --- /dev/null +++ b/.claude/skills/post-merge-cleanup/skill.md @@ -0,0 +1,25 @@ +# Post-Merge Cleanup + +Run this after squash-merging a PR to clean up the local repo. + +## Steps + +1. Switch to main and pull latest: + ```bash + git checkout main && git pull + ``` + +2. Prune remote tracking branches that no longer exist on the remote: + ```bash + git fetch --prune + ``` + +3. Delete local branches whose remote tracking branch is gone: + ```bash + git branch -vv | grep '\[.*: gone\]' | awk '{print $1}' | xargs -r git branch -D + ``` + If no gone branches exist, skip this step. + +4. Check for any remaining non-main local branches and report them. Do NOT delete branches that still have a remote — only report them. + +5. Confirm the workspace is clean with `git status`.