PlugWiki

finishing-a-development-branch Skill: Merge, PR or Keep, Safely

Makes your agent run the tests, then ask whether to merge locally, push a pull request or keep the branch, and clean up safely.

Installs
220.9K
on skills.sh
Stars
310.6K
on GitHub
Updated
Oct 2026
last repo commit

The skill triggers when implementation is complete and tests pass. It follows six steps: run the full test suite, detect whether you are in a worktree, confirm the base branch, present a short menu, run your choice, then clean up. The menu has 3 options: merge locally, push and open a pull request, or keep the branch as is. On a detached HEAD there are 2 options.

It never discards work on its own. It deletes a branch only after you type the word discard, never uses --force for worktree removal without asking, and never force-pushes unless you explicitly ask.

Good for

  • Developers who want a fixed finish routine after an agent builds a feature
  • Teams using git worktrees who fear lost or force-deleted work

Install finishing-a-development-branch

Claude Code

  1. 1

    Copy this prompt.

    Install the finishing-a-development-branch skill in Claude Code. Run this command:
    
    npx skills add https://github.com/obra/superpowers --skill finishing-a-development-branch
    
    Then check that it loaded and tell me how to use it.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Requires Node.js.

From its listing on skills.sh. Source.

What's in the skill

When it loads

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work

Sections in SKILL.md

  1. Overview
  2. Step 1: Verify Tests
  3. Step 2: Detect Environment
  4. Step 3: Determine Base Branch
  5. Step 4: Present Options
  6. Step 5: Execute Choice
  7. Option 1: Merge Locally
  8. Option 2: Push and Create PR
  9. Option 3: Keep As-Is
  10. If your human partner asks to discard the work
  11. Step 6: Cleanup Workspace
  12. Quick Reference
  13. Common Rationalizations

Key facts

Installs on skills.sh
220,875 (Nov 2, 2026)
Last repo commit
Oct 29, 2026

What it includes

  • Runs the full suite and stops with the failures if any test fails

    The menu appears only after a green run.

    Runs code · Step 1: Verify tests

  • Checks whether this is a normal repo, a named-branch worktree or a detached HEAD

    This decides which menu to show and how cleanup works.

    Runs code · Step 2: Detect environment

  • Confirms which branch the work forked from before any merge

    Merging into the wrong base is hard to undo.

    Step 3: Determine base branch

  • Offers 3 choices: merge locally, push and open a PR, or keep as is

    Detached HEAD gets 2: push as a new branch with a PR, or keep.

    Step 4: Present options

  • Merges and re-tests, or pushes the branch and creates a pull request

    Merge deletes the feature branch after a green result. The PR route keeps the worktree.

    Runs code · Step 5: Execute choice

  • Deletes a branch, commits and worktree only after you type "discard"

    Used only if you ask to throw the work away.

    Delete · Discard on request

  • Removes worktrees under .worktrees/ or worktrees/ and leaves others alone

    If removal is refused because of uncommitted files, it shows them and asks you.

    Delete · Step 6: Cleanup workspace

From the official docs

Permissions

Medium risk

The skill can merge, push and delete branches and worktrees. Confirm the base branch, and type discard only if you mean it.

What it can do

  • Read your data
  • Create and change things
  • Delete things
  • Read-only mode

Watch out for

  • It merges, pushes and deletes branches

    Option 1 merges locally and deletes the feature branch. Confirm the base branch it proposes before you pick it.

  • Discarding work is permanent

    Typing discard deletes the branch, its commits and the worktree. Say no unless you are sure.

  • Worktree removal can lose uncommitted files

    The skill refuses to force removal and asks you, but read the file list it shows.

Technical details
Talks toYour git remote and forge

Questions

What does finishing-a-development-branch do?

After the work is done and tests pass, it gives you a menu to merge, open a pull request or keep the branch, then cleans up the worktree where that is safe.

How do I install it in Claude Code, the Claude app or Codex?

Use the install box above. The Superpowers README also lists plugin installs for Claude Code, Codex and Cursor.

Can it delete my branch or work?

Only if you ask to discard it and then type the word discard. A merge also deletes the feature branch with git branch -d once the merged result passes tests.

Does it force-push?

No, not on its own. A rejected push means the remote moved, and the skill says to investigate and force-push only if you explicitly ask.

Is it safe?

It bundles no scripts. It runs git merge, push and worktree removal, so use it on a repo with a remote copy, and read the menu before you answer.

Do I need using-git-worktrees too?

No. It also works in a normal checkout. If you do use a worktree, it handles cleanup for those under .worktrees/ or worktrees/.

Information

updated Nov 2, 2026

Folder
skills/finishing-a-development-branch

obra/superpowersskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 2
  1. obra/superpowers finishing-a-development-branch SKILL.md · github.com
  2. obra/superpowers README · github.com

Updated Nov 2, 2026.