Agent skill
git-prune
This skill should be used when pruning local branches that have been deleted on the remote. It fetches remote changes, identifies stale local branches, and safely deletes them.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/git-prune-codyswanngt-lisa-5
SKILL.md
Git Prune Local Branches
Remove local branches whose upstream tracking branches have been deleted on remote.
Workflow
Fetch and prune remote-tracking references
!git fetch --prune
Find and delete stale local branches
!git branch -vv | grep ': gone]' | awk '{print $1}'
Apply these requirements
- Preview: Show which branches will be deleted before deleting
- Safe Delete: Use
-d(safe delete) which refuses to delete unmerged branches - Report: Show summary of deleted branches
Never
- Force delete (
-D) without user confirmation - Delete the current branch
- Delete protected branches (dev, staging, main)
Execute
Execute the workflow now.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?