What problem does it solve?
Long-running development with git worktrees accumulates abandoned worktrees, stale local branches, and lingering GitHub issues that clutter the repository and consume disk space. This Skill provides a controlled, user-confirmed workflow to find worktrees inactive beyond a chosen threshold and clean them up in bulk.
Core Features & Use Cases
- Stale Worktree Detection: Cross-platform scripts (PowerShell and Bash) list worktrees whose last commit or directory modification exceeds a 7, 14, or 30-day threshold.
- Preview Before Deletion: Shows the candidate branch list and requires explicit user confirmation before any destructive action.
- Batch Cleanup with Per-Branch Safety: For each candidate branch, closes the linked GitHub issue, removes the worktree, and deletes the local branch, skipping branches with uncommitted changes and continuing past individual failures.
- Use Case: After a sprint, ask the assistant to clean up worktrees unused for over two weeks; review the previewed branch list, confirm, and receive a summary table of issues closed, worktrees removed, and branches deleted.
Quick Start
Ask the assistant to clean up git worktrees that have not been used for more than two weeks and confirm the previewed list.