obra avatar

Finishing A Development Branch

When you finish implementing a feature branch, this handles the "now what?" moment by running your test suite first, then presenting exactly four options: merge locally, create a PR, keep the branch, or discard it. It won't let you proceed if tests are failing and requires typed confirmation before deleting work. The structure eliminates the back-and-forth of "should I merge or PR?" and handles git worktree cleanup automatically. Honestly, it's the kind of systematic approach that prevents you from leaving half-finished branches scattered around your repo or accidentally merging broken code.

skills.sh installs
227.7K
GitHub stars
315.2K
last updated
Aug 21, 2026

Install

$ npx -y skills add obra/superpowers --skill finishing-a-development-branch --agent claude-code

Installs into .claude/skills of the current project.

Files

Finishing a Development Branch

Overview

Core principle: Verify tests → Detect environment → Present options → Execute choice → Clean up.

Announce at start: "I'm using the finishing-a-development-branch skill to complete this work."

Step 1: Verify Tests

Run the project's full test suite (npm test / cargo test / pytest / go test ./...).

If tests fail, report the failures and stop — the menu comes after a green suite:

Tests failing (<N> failures). Must fix before completing:

[Show failures]

If tests pass: continue to Step 2.

Step 2: Detect Environment

GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)
GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)
# Capture now, while still inside the workspace — Step 5 changes directory
# before cleanup (Step 6) needs this value
WORKTREE_PATH=$(git rev-parse --show-toplevel)

This determines which menu to show and how cleanup works:

Sponsors

Details

Repository
github.com/obra/superpowers
Category
Git & Pull Requests

More from obra/superpowers

All 14
1warpdotdev avatarpr-walkthroughwarpdotdev/common-skillsGenerate a static interactive D3 walkthrough of a pull request. Use when the user wants a zoomable PR map, graph/canvas PR orientation, or alternate visualizati28.3Kskills.sh installs
2affaan-m avatargit-workflowaffaan-m/everything-claude-codegit workflow4.2Kskills.sh installs
3affaan-m avatargithub-opsaffaan-m/everything-claude-codegithub ops3.6Kskills.sh installs
4mattpocock avatargithub-triagemattpocock/skillsgithub triage3.2Kskills.sh installs
5steipete avatargithubsteipete/clawdisgithub2.8Kskills.sh installs
6cursor avatarweekly-reviewcursor/pluginsProduce a weekly synthesis of authored commits with highlights by bugfix, tech debt, and net-new work2.5Kskills.sh installs