Finishing a Development Branch

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

309,696 stars 27,549 forksGit & Code Review Plugin marketplace

Install

Claude Code plugin
/plugin marketplace add obra/superpowers

The repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add obra/superpowers --skill finishing-a-development-branch
Manual install
git clone --depth 1 https://github.com/obra/superpowers.git /tmp/superpowers
mkdir -p ~/.claude/skills
cp -r /tmp/superpowers/skills/finishing-a-development-branch ~/.claude/skills/finishing-a-development-branch

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# 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

```bash
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:

| State | Menu | Cleanup |
|-------|------|---------|
| `GIT_DIR == GIT_COMMON` (normal repo) | Standard 3 options | No worktree to clean up |
| `GIT_DIR != GIT_COMMON`, named branch | Standard 3 options | Provenance-based (see Step 6) |
| `GIT_DIR != GIT_COMMON`, detached HEAD | Reduced 2 options (no merge) | Externally managed — leave in place |

## Step 3: Determine Base Branch

The base branch is whatever this work forked from — usually named in the
Read the full skill on GitHub

Details

Skill name
finishing-a-development-branch
Path
skills/finishing-a-development-branch/SKILL.md
License
MIT
Repo updated
29 October 2026

FAQ

What does the Finishing a Development Branch skill do?

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

How do I install the Finishing a Development Branch skill?

Claude Code plugin: /plugin marketplace add obra/superpowers. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Finishing a Development Branch popular?

It lives in obra/superpowers, which has 309,696 GitHub stars and 27,549 forks, and is included in 6 curated skill lists.

Related skills

Browse the most popular Claude skills, all git & code review skills, or write your own with the skills generator.