Skip to content

Finish a Development Branch

Guides an agent through wrapping up finished git work: test, then merge, PR, or keep, with safe cleanup.

Stars
8,444
Licence
MIT
Files
1 file

What it does

Once a coding task is done and tests pass, this skill makes the agent follow a fixed sequence: run the project's test suite, check whether it is in a normal repo, a named-branch worktree, or a detached HEAD, confirm the base branch, and then show the user a short menu of options. The options are merging locally, pushing and opening a pull request, or leaving the branch alone. Discarding work is only done if the user explicitly asks for it and types the word 'discard'. The agent is also told to be careful about deleting git worktrees, only removing ones it created under .worktrees/ or worktrees/.

Great for

  • Developers who use git branches or worktrees with an AI coding agent and want a consistent finish step
  • Teams that want the agent to ask before merging, pushing, or deleting anything
  • People who often forget to confirm the base branch before merging

Skip it if

  • Projects without git: the skill assumes git commands and branch structure, so it will not help there
  • Users who want the agent to merge or delete automatically without confirmation: the skill deliberately waits for the user's choice, which may feel slow
  • Repos where the test command is unknown or unusual: the agent must find the right test command itself, and a wrong one may give misleading results

Try asking

  • “I've finished the login feature and the tests pass. Help me finish this branch.”
  • “Wrap up this work: should we merge locally, open a PR, or keep the branch?”
  • “The feature is done, please open a pull request against main.”
  • “Discard this experimental branch and its worktree, I've decided we don't need it.”
Step-by-step guide: how to use Finish a Development BranchInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 1 original files, the MIT licence and an attribution note.

    finishing-a-development-branch.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip finishing-a-development-branch.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip finishing-a-development-branch.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Ask the agent to name the base branch explicitly if it is not main, since merging into the wrong branch is costly
  • Keep the worktree if you plan to revise the PR after review; the skill is designed to preserve it
  • Read the file list the agent shows before confirming any worktree removal, because uncommitted files are not recoverable

What's inside

  • SKILL.md

Redistributed unmodified from jnMetaCode/superpowers-zh under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.