Install any skill in seconds. Free to start, no credit card required.
Get Started Free →kdlbs/clean-branches
Delete local branches whose remote has been deleted ([gone]), including their worktrees.
Passed 19 of 22 test cases with the skill, and 16 of 22 without it.
and 1 more in the full report
4 fixed16 passed either way2 still failing1 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 4 test cases the skill fixed. Same model, same prompt, with and without the skill.
When parsing the branch list in bash to find branches whose remote tracking references were deleted, what text pattern in square brackets indicates the remote tracking ref is missing?
| Checked | Without skill | With skill |
|---|---|---|
| Filters for the exact string [gone]. | Missed | Passed |
The instructions your model reads when the skill loads.
Remove local branches that have been deleted on the remote (marked [gone]), including any associated git worktrees.
Fetch and prune remote refs:
git fetch --prune
List branches to identify [gone] status:
git branch -v
Branches with a + prefix have associated worktrees that must be removed before deletion.
List worktrees for reference:
git worktree list
Remove worktrees and delete [gone] branches:
git branch -v | grep '\[gone\]' | sed 's/^[+* ]//' | awk '{print $1}' | while read branch; do
echo "Processing branch: $branch"
worktree=$(git worktree list | grep "\\[$branch\\]" | awk '{print $1}')
if [ ! -z "$worktree" ] && [ "$worktree" != "$(git rev-parse --show-toplevel)" ]; then
echo " Removing worktree: $worktree"
git worktree remove --force "$worktree"
fi
echo " Deleting branch: $branch"
git branch -D "$branch"
done
Report which branches and worktrees were removed. If none were [gone], say no cleanup was needed.
test cases passed, vs 16 / 22 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.