一键导入
clean-gone-branches
Clean up all git branches marked as [gone] (branches deleted on the remote but still existing locally), including removing associated worktrees.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Clean up all git branches marked as [gone] (branches deleted on the remote but still existing locally), including removing associated worktrees.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Run an autonomous CI/GitHub pull request review that inspects PR diffs and posts concise, high-confidence review findings to GitHub by default. Use in CI, GitHub Actions, Claude Code Routines, or other automated PR-review contexts where posting review comments is expected.
Use OpenAI Codex from AI coding agents to review code, run adversarial reviews, delegate coding tasks, and manage background jobs or sessions where supported. Use when the user wants a Codex code review, adversarial review, task delegation, session transfer, or job management (status, result, cancel).
Perform comprehensive code review on a pull request, checking for bugs, AGENTS.md/CLAUDE.md compliance, and historical context issues. Use when the user asks to review a PR or current changes.
Simplifies and refines code for clarity, consistency, and maintainability while preserving all functionality. Focuses on recently modified code unless instructed otherwise.
Commit staged and unstaged changes, push the branch to origin, and open a pull request using the GitHub CLI. Use when the user asks to commit, push, and create a PR in one workflow.
Create a single git commit from current staged and unstaged changes with an appropriate message. Use when the user asks to commit current work.
| name | clean-gone-branches |
| description | Clean up all git branches marked as [gone] (branches deleted on the remote but still existing locally), including removing associated worktrees. |
Remove stale local branches that have been deleted from the remote repository, along with any associated worktrees.
git branch -v shows branches marked as [gone].This skill is tool-agnostic and can be executed by Claude Code, Codex CLI, or Cursor CLI.
Before deleting anything, inspect the branch list and worktree list so the user can understand what will be removed.
List branches to identify any with [gone] status:
git branch -v
Branches with a + prefix have associated worktrees and must have their worktrees removed before deletion.
List worktrees that may need removal for [gone] branches:
git worktree list
Remove worktrees and delete [gone] branches. Strip leading +, *, or spaces from git branch -v output before extracting branch names:
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 [ -n "$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 results: List which worktrees and branches were removed. If no branches are marked as [gone], report that no cleanup was needed.
git branch -v as [gone]; do not infer stale branches by name.[gone] branches exist, a message indicating no cleanup was needed.