com um clique
cleanup-git
// Remove merged local branches and stale git worktrees. Use when the user says "cleanup branches", "prune worktrees", "tidy git", "remove merged branches", "gone branches", or wants to clean local git state.
// Remove merged local branches and stale git worktrees. Use when the user says "cleanup branches", "prune worktrees", "tidy git", "remove merged branches", "gone branches", or wants to clean local git state.
Playwright primitives for real-browser automation — dev-server detection, a Node.js script runner, and helpers for clicks, form fills, screenshots, multi-viewport, custom HTTP headers. Use when a task needs an actual browser (rendered DOM, visual checks, multi-page flows, cross-browser behavior). Not for API tests or logic tests where curl or JSDOM is cheaper.
Playwright primitives for real-browser automation — dev-server detection, a Node.js script runner, and helpers for clicks, form fills, screenshots, multi-viewport, custom HTTP headers. Use when a task needs an actual browser (rendered DOM, visual checks, multi-page flows, cross-browser behavior). Not for API tests or logic tests where curl or JSDOM is cheaper.
Playwright primitives for real-browser automation — dev-server detection, a Node.js script runner, and helpers for clicks, form fills, screenshots, multi-viewport, custom HTTP headers. Use when a task needs an actual browser (rendered DOM, visual checks, multi-page flows, cross-browser behavior). Not for API tests or logic tests where curl or JSDOM is cheaper.
Playwright primitives for real-browser automation — dev-server detection, a Node.js script runner, and helpers for clicks, form fills, screenshots, multi-viewport, custom HTTP headers. Use when a task needs an actual browser (rendered DOM, visual checks, multi-page flows, cross-browser behavior). Not for API tests or logic tests where curl or JSDOM is cheaper.
Remove merged local branches and stale git worktrees. Use when the user says "cleanup branches", "prune worktrees", "tidy git", "remove merged branches", "gone branches", or wants to clean local git state.
Remove merged local branches and stale git worktrees. Use when the user says "cleanup branches", "prune worktrees", "tidy git", "remove merged branches", "gone branches", or wants to clean local git state.
| description | Remove merged local branches and stale git worktrees. Use when the user says "cleanup branches", "prune worktrees", "tidy git", "remove merged branches", "gone branches", or wants to clean local git state. |
| name | cleanup-git |
Clean local git branches and worktrees after work has merged. Dry-run first. Destructive commands require user approval.
Prefer a repo-local scripts/cleanup-git.sh when the target repo ships one. If it does not, use the bundled skill script from this skill's scripts/ directory. Manual fallback: git fetch --prune, inspect git worktree list, then remove only branches/worktrees that meet the same rules below.
Run from anywhere inside a repository:
scripts/cleanup-git.sh
scripts/cleanup-git.sh --apply
scripts/cleanup-git.sh --apply --force
scripts/cleanup-git.sh --base <ref>
The script fetches/prunes remotes, then chooses the comparison branch:
refs/remotes/<remote>/HEAD.main, master, trunk, develop, or dev.<remote>/{main,master,trunk,develop,dev}.Use --base <ref> only for unusual repositories.
MERGED state, is merged into the detected base branch, or whose upstream is gone.When gh is available, PR MERGED state is the source of truth for squash/rebase merges. Do not miss those just because git merge-base --is-ancestor fails after history rewrite. If no PR is found, or gh is unavailable, fall back to the git-based checks.
Hard guards:
main, master, trunk, develop, dev.Soft guard:
--force overrides only this guard.scripts/cleanup-git.sh and show the preview.remove ... (PR merged), remove ... (upstream gone), KEEP ... (dirty), KEEP ... (PR merged, N ahead — use --force).KEEP line as a human decision.scripts/cleanup-git.sh --apply.--force only when the user confirms ahead commits are throwaway.