ganyuanran avatar

Finishing A Development Branch

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.

GitHub stars
492
last updated
Jun 11, 2026

Install

$ npx -y skills add ganyuanran/aegis --skill finishing-a-development-branch --agent claude-code

Installs into .claude/skills of the current project.

Files

Finishing a Development Branch

Overview

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.

Step 1: Environment and Ownership Detection

Read the task's TaskStartSnapshot and current repository state. Record:

  • root, HEAD, branch/detached state, upstream divergence, and active Git ops;
  • staged/unstaged/untracked paths and the task-owned delta;
  • git worktree list --porcelain;
  • branch/worktree creator, task ownership, base branch, and cleanup trigger.

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

Details

Repository
github.com/ganyuanran/aegis
Category
Git & Pull Requests
License
MIT
First seen
Jun 11, 2026

More from ganyuanran/aegis

All 22
1hoangnguyen0403 avatarcode-reviewhoangnguyen0403/agent-skills-standardRun an AI-assisted PR code review using multi-layer lenses with confidence scoring.0skills.sh installs
2JetBrains avatarchangelogJetBrains/ideavimMaintains IdeaVim changelog (CHANGES.md) and build.gradle.kts changeNotes. Use when updating changelog, documenting releases, or reviewing commits/PRs for chang0skills.sh installs
3jkomoros avatargit-workflowjkomoros/community-patterns>0skills.sh installs
4k-dense-ai avatarrequesting-red-team-reviewk-dense-ai/science-superpowersUse after completing an analysis or before reporting a finding, to have a skeptical reviewer attack the conclusion before you believe it0skills.sh installs
5metabase avatartypescript-reviewmetabase/metabaseReview TypeScript and JavaScript code changes for compliance with Metabase coding standards, style violations, and code quality issues. Use when reviewing pull 0skills.sh installs
6Recidiviz avatarcommitRecidiviz/pulse-dataCommit uncommitted changes with clear commit messages. Use when the user0skills.sh installs