Skip to content

git-clean-gone-branches

清理远端 tracking branch 已消失的本地分支及相关 worktrees。

基本信息

字段内容
Skillgit-clean-gone-branches
类型internal-only
研发链路位置Internal
入口internal_only
Sourceskills/git-clean-gone-branches/SKILL.md

描述

Clean up local branches whose remote tracking branch is gone. Use when the user says "clean up branches", "delete gone branches", "prune local branches", "clean gone", or wants to remove stale local branches that no longer exist on the remote. Also handles removing associated worktrees for branches that have them.

何时使用

  • 本地分支列表堆积。
  • remote prune 后需要清理 gone branches。
  • 并行 worktree 工作结束后需要维护本地环境。

工作步骤

  • 由上层 workflow、维护任务或专项场景触发。
  • 读取当前任务的局部上下文和相关 source/runtime 文件。
  • 完成单一内部能力,不把自身暴露成公开 spec-first 入口。
  • 把结果返回给调用它的 workflow 或维护者。

输出

  • 局部维护结果、辅助产物、验证证据或给上层 workflow 的结构化摘要。
  • 是否写文件取决于调用场景和项目治理规则。

Agent 调度

  • internal skill 通常不是 persona dispatch 容器。
  • 如果它本身涉及审查、研究或浏览器验证,才按技能说明使用对应工具或 agent 能力。

边界

  • 属于维护操作,不是研发主链路节点。
  • 不应删除仍有未合并工作的分支。