Agent skill

Finishing A Development Branch

by GanyuanRan in GanyuanRan/Aegis

A skill your agent uses when verified work needs integration or cleanup of an existing task-created branch/worktree, or the user explicitly requests merge, PR, or branch lifecycle handling.

MITAuto-check passedDevelopment

Install Finishing A Development Branch

skills CLI
$ npx skills add GanyuanRan/Aegis --skill finishing-a-development-branch -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install GanyuanRan/Aegis finishing-a-development-branch --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/GanyuanRan/Aegis.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/finishing-a-development-branch .claude/skills/finishing-a-development-branch && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
finishing-a-development-branch
GitHub stars
1.3k
Used in
1 other repo
Token cost
~1.4k tokens
SKILL.md length
744 words
Files
1
Skills in repo
21
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when verified work needs integration or cleanup of an existing task-created branch/worktree, or the user explicitly requests merge, PR, or branch lifecycle handling.

  • Works in 6 steps: Environment and Ownership Detection → Fresh Verification → Choose the Authorized Outcome → …
  • Verified work needs integration
  • SKILL.md covers Overview, Step 1: Environment and…, Step 2: Fresh Verification and Step 3: Choose the Authorized…, plus 5 more sections
  • Calls git

What it does

Finishing A Development Branch is an agent skill from GanyuanRan/Aegis. Use when verified work needs integration or cleanup of an existing task-created branch/worktree, or the user explicitly requests merge, PR, or branch lifecycle handling.

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Git worktrees. It works with Git. The repository describes itself as: Make AI coding agents architecture-aware: baseline-first, evidence-verified, drift-checked, and safe across long tasks. The licence is MIT.

When your agent uses it

  • Verified work needs integration
  • Cleanup of an existing task-created branch/worktree
  • The user explicitly requests merge
  • Branch lifecycle handling

Example prompts

  • “/finishing-a-development-branch”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Environment and Ownership Detection
  2. Fresh Verification
  3. Choose the Authorized Outcome
  4. Execute Without Hidden Mutation
  5. Prove Integration Before Branch Deletion
  6. Cleanup in Dependency Order

What it can do on your machine

Read from SKILL.md and the folder at commit 61867e9. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Finishing A Development Branch loads about 1.4k tokens when it runs. Until then it costs about 50 tokens; SKILL.md has 744 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~50
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from GanyuanRan/Aegis at commit 61867e9, republished under its MIT licence (© GanyuanRan). 744 words, ~1,401 tokens.

Download SKILL.mdSave it as .claude/skills/finishing-a-development-branch/SKILL.md (or your agent's skills folder).
name
finishing-a-development-branch
description
Use when verified work needs integration or cleanup of an existing task-created branch/worktree, or the user explicitly requests merge, PR, or branch lifecycle handling.

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.

For a trusted host-managed detached checkout, follow the repository's approved managed-workspace contract: verify host binding, default cwd, root, and HEAD; then use its scoped local-commit and native handoff path. Report detached HEAD in the receipt. This exception does not authorize automatic deletion of the detached checkout or bypass unknown ownership/binding.

If no task-created branch/worktree exists and integration was not requested, skip this workflow: report the local task commit plus Task clean and Repository clean; do not invent merge/PR ceremony.

Step 2: Fresh Verification

Run the smallest current-authority test set that proves the completed task. If it fails, preserve all work and return to diagnosis. Do not present the branch as ready.

Step 3: Choose the Authorized Outcome

When a task branch actually needs disposition, present only applicable choices:

  1. merge into the recorded base locally;
  2. push and create/update a PR;
  3. keep the branch for later integration;
  4. discard the exact task-owned branch/worktree.

Push, PR, remote deletion, release, and force operations require explicit user authorization. Discard requires a fresh, exact typed confirmation naming branch, worktree path, and commits/delta to lose. Generic agreement is insufficient.

Step 4: Execute Without Hidden Mutation

Local merge

Verify the target checkout is safe, switch to the recorded base, merge without an implicit pull, and rerun verification on the merged result. If integration or verification fails, preserve both histories and stop.

Push or PR

Push only the authorized task branch and create/update the PR with summary and fresh test evidence. PR creation does not itself prove merge and does not require the temporary worktree to remain.

Keep branch

Retain the branch. Remove a clean task-created temporary worktree by default; retain it only for an explicit ongoing-checkout need and report why.

Discard

After exact confirmation, remove only the named clean task-owned worktree, then the named branch. If either differs from the confirmation, stop and ask again.

Show full SKILL.md (297 more words)Show less

Step 5: Prove Integration Before Branch Deletion

Use evidence matching the merge strategy:

  • merge/fast-forward: prove the task tip is an ancestor of the recorded base;
  • squash/rebase: use fresh PR merge metadata plus strategy-appropriate patch equivalence (git cherry for rebased commits; stable patch-id or bounded changed-path/tree comparison for squashes), not an ancestor-only test;
  • unmerged/open PR: keep the branch unless discard was exactly confirmed.

Never delete a branch merely because a PR was opened or a similarly named commit exists.

Step 6: Cleanup in Dependency Order

For a clean task-owned resource:

  1. move to another safe registered checkout; never remove the current working directory;
  2. remove/unregister the worktree first with git worktree remove <exact-path>;
  3. read back git worktree list --porcelain;
  4. verify the exact path no longer exists;
  5. only then delete an integrated or exactly confirmed branch;
  6. read back branch refs, HEAD, and repository status.

Do not use routine --force, global git worktree prune, wildcard deletion, or cleanup of resources absent from the task ownership record. On Windows, Git may unregister a worktree while its directory remains locked: re-check registration and the exact resolved path, remove only a proven task-owned clean residual when safe, otherwise retain it and report the lock/path. Never widen deletion scope.

Final Git Receipt

Report:

  • current branch and commit SHA/message, or the reason no commit exists;
  • Task clean: yes|no and Repository clean: yes|no independently;
  • branch/worktree created, removed, or retained, with evidence/reason;
  • integration evidence and any remaining user action.

Task clean means no uncommitted task-owned delta remains. Repository clean means no staged, unstaged, or untracked repository state remains.

This is a local Git receipt, not authoritative completion or merge truth beyond the evidence read back.

Integration

Called only when branch/worktree integration or explicit lifecycle handling is in scope. Pairs with using-git-worktrees and verification-before-completion.

© GanyuanRan, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/finishing-a-development-branch of GanyuanRan/Aegis.

Open the folder on GitHubat commit 61867e9

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in GanyuanRan/Aegis, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Finishing A Development Branch next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Finishing A Development Branch compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Finishing A Development Branch this skillGanyuanRan/Aegis1.3k1 repos~1.4kAutomated safety check: PassMIT
Finishing a Development Branchobra/superpowers297k5 repos~1.9kAutomated safety check: PassMIT
Finishing A Development Branchfarm-fe/farm5.6k35 repos~1.8kAutomated safety check: PassMIT
Git Worktree Cleanuplobehub/lobehub83k—~2.8kAutomated safety check: PassCustom licence
Pre-Release PR Triagejamiepine/voicebox57k—~3.1kAutomated safety check: PassMIT
Ccmanager Configkbwo/ccmanager1.3k—~1.5kAutomated safety check: PassMIT

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    297k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • A skill your agent uses when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for…

    5.6k GitHub starsUsed in 35 repos~1.8k tokens
    DevelopmentAuto-check passed
  • Git Worktree Cleanup

    lobehub/lobehub

    Audits stale Git worktrees and branches with a bundled script, classifies each one, and deletes only after you approve the exact candidates.

    83k GitHub stars~2.8k tokensUpdated today
    DevelopmentAuto-check passed
  • Pre-Release PR Triage

    jamiepine/voicebox

    Sorts a backlog of open pull requests into must-merge, candidate, superseded and deferred, writes a triage doc and works the merge loop before a release.

    57k GitHub stars~3.1k tokensUpdated 4 days ago
    DevelopmentAuto-check passed
  • Ccmanager Config

    kbwo/ccmanager

    Set up, review, or repair a CCManager config — .ccmanager.json at a git repository root, or the global ~/.config/ccmanager/config.json.

    1.3k GitHub stars~1.5k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Builds a Cap feature in an isolated Git worktree with disposable dev resources, verification, a recorded demo and a neutral pull request, started with /building.

    23k GitHub stars~2.5k tokensUpdated today
    DevelopmentAuto-check: warnings

More from GanyuanRan/Aegis

All 21 skills in this repo
  • Anti Entropy Governance

    GanyuanRan/Aegis

    A skill your agent uses when touching retiring old logic, collapsing duplicate owners, removing fallbacks, or schema/persistence/source-of-truth boundaries; identify opportunities automatically…

    1.3k GitHub starsUsed in 1 repo~3.1k tokens
    Auto-check passed
  • Executing Plans

    GanyuanRan/Aegis

    A skill your agent uses when executing a written implementation plan across sessions or with review checkpoints.

    1.3k GitHub starsUsed in 1 repo~2.3k tokens
    Auto-check passed
  • First Principles Review

    GanyuanRan/Aegis

    A skill your agent uses when asked for first-principles or Occam's-razor review, or when high-risk decisions involve competing constraints, fallback growth, duplicate owners, or architecture…

    1.3k GitHub starsUsed in 1 repo~2.5k tokens
    Auto-check passed
  • Goal Framing

    GanyuanRan/Aegis

    A skill your agent uses when the user explicitly sets an Aegis goal with /aegis-goal, Aegis goal:, or asks to define goal, success evidence, stop condition, or task boundaries before work.

    1.3k GitHub starsUsed in 1 repo~1.2k tokens
    Auto-check passed
  • A skill your agent uses when the user asks to establish shared project language, or project work exposes a conflicting, renamed, or deprecated domain term that needs active semantic modeling.

    1.3k GitHub starsUsed in 1 repo~1.5k tokens
    Auto-check: warnings
  • A skill your agent uses when the user asks to create, write, update, amend, supersede, or evaluate an ADR, architecture decision record, durable architecture decision, decision log, or baseline sync…

    1.3k GitHub starsUsed in 1 repo~1.5k tokens
    Auto-check passed

Works with

Categories

Questions about Finishing A Development Branch

What does Finishing A Development Branch do?

A skill your agent uses when verified work needs integration or cleanup of an existing task-created branch/worktree, or the user explicitly requests merge, PR, or branch lifecycle handling. Finishing A Development Branch is an agent skill from GanyuanRan/Aegis. Use when verified work needs integration or cleanup of an existing task-created branch/worktree, or the user explicitly requests merge, PR, or branch lifecycle handling.

When should I use Finishing A Development Branch?

Finishing A Development Branch fits situations like: verified work needs integration; cleanup of an existing task-created branch/worktree; the user explicitly requests merge; branch lifecycle handling.

How do I install Finishing A Development Branch in Claude Code?

Run `npx skills add GanyuanRan/Aegis --skill finishing-a-development-branch -a claude-code`. Or copy the skill folder (skills/finishing-a-development-branch in GanyuanRan/Aegis) into .claude/skills/finishing-a-development-branch in your project. Claude Code loads it when a task matches its description.

How do I install Finishing A Development Branch in Codex?

Run `npx skills add GanyuanRan/Aegis --skill finishing-a-development-branch -a codex`. Or copy the skill folder (skills/finishing-a-development-branch in GanyuanRan/Aegis) into .agents/skills/finishing-a-development-branch in your project. Codex loads it when a task matches its description.

Can I use Finishing A Development Branch in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add GanyuanRan/Aegis --skill finishing-a-development-branch -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/finishing-a-development-branch, .gemini/skills/finishing-a-development-branch, .github/skills/finishing-a-development-branch and .opencode/skills/finishing-a-development-branch in your project.

What does Finishing A Development Branch need to run?

Going by SKILL.md and its folder, Finishing A Development Branch needs the command-line tools its instructions call (git).

Does Finishing A Development Branch access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Finishing A Development Branch safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Finishing A Development Branch use?

Finishing A Development Branch is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Finishing A Development Branch use?

About 1.4k tokens (SKILL.md is roughly 5.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Finishing A Development Branch?

Skills that share tags, products or a category with Finishing A Development Branch: Finishing a Development Branch (obra/superpowers, 297k stars), Finishing A Development Branch (farm-fe/farm, 5.6k stars), Git Worktree Cleanup (lobehub/lobehub, 83k stars) and Pre-Release PR Triage (jamiepine/voicebox, 57k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Finishing A Development Branch?

GanyuanRan (a GitHub user) maintains it in GanyuanRan/Aegis, which has 1,337 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on October 10, 2026.

Source: GanyuanRan/Aegis on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.