
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-codeInstalls 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- Brainstorming423.3K
- Systematic Debugging326.7K
- Writing Plans298.6K
- Using Superpowers283.7K
- Requesting Code Review276.5K
- Test Driven Development274.8K
- Verification Before Completion270.3K
- Executing Plans257.5K
- Subagent Driven Development252K
- Receiving Code Review235.1K
- Dispatching Parallel Agents231.3K
- Writing Skills231.3K
- Using Git Worktrees230.2K