
You've finished implementing a feature and all tests pass. Now what? This skill gives you four clear options: merge locally, push and create a PR, keep the branch for later, or discard the work entirely. The smart part is it runs your test suite first and won't let you proceed if anything fails, then cleans up git worktrees automatically for the merge and discard paths while preserving them when you might still need them. It also forces you to type "discard" before nuking any work, which has probably saved someone from a bad day. Works as the final step in subagent-driven-development and executing-plans workflows, handling that awkward moment when the code works but you haven't decided what to do with it yet.
$ npx -y skills add ganyuanran/aegis --skill finishing-a-development-branch --agent claude-codeInstalls into .claude/skills of the current project.
Integration choice and checkout lifetime are separate. Verify first, mutate only task-owned resources, then prove what was removed or retained.
Core principle: fresh evidence -> authorized integration -> ownership-aware cleanup -> Git/path readback.
Announce at start: explain which branch/worktree lifecycle is being closed.
Read the task's TaskStartSnapshot and current repository state. Record:
HEAD, branch/detached state, upstream divergence, and active Git ops;git worktree list --porcelain;Stop on conflicts, unexplained detached state, failed verification, dirty/untracked state in
a cleanup target, or unknown ownership. Do not infer the base from the names
main or master; use task records, repository authority, or explicit user
direction. Never auto-stash, reset, clean, pull, rebase, amend, force-push, or
bypass hooks.
Sponsors