Tooluck logoTooluck
SKILL.md

finishing-a-development-branch

Agent skill fromobra/superpowers

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

How to install finishing-a-development-branch

install finishing-a-development-branch
# install the superpowers pack with the skills CLI
npx skills add obra/superpowers

# or add only this skill to Claude Code: copy the folder

skills/finishing-a-development-branch/

# into

~/.claude/skills/finishing-a-development-branch/ (all projects)

.claude/skills/finishing-a-development-branch/ (one project)

skills/finishing-a-development-branch/SKILL.md

MITFull file
1# Finishing a Development Branch
2
3## Overview
4
5**Core principle:** Verify tests → Detect environment → Present options → Execute choice → Clean up.
6
7**Announce at start:** "I'm using the finishing-a-development-branch skill to complete this work."
8
9## Step 1: Verify Tests
10
11Run the project's full test suite (`npm test` / `cargo test` / `pytest` / `go test ./...`).
12
13**If tests fail**, report the failures and stop — the menu comes after a green suite:
14
15```
16Tests failing (<N> failures). Must fix before completing:
17
18[Show failures]
19```
20
21**If tests pass:** continue to Step 2.
22
23## Step 2: Detect Environment
24
25```bash
26GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)
27GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)
28# Capture now, while still inside the workspace — Step 5 changes directory
29# before cleanup (Step 6) needs this value
30WORKTREE_PATH=$(git rev-parse --show-toplevel)
31```
32
33This determines which menu to show and how cleanup works:
34
35| State | Menu | Cleanup |
36|-------|------|---------|
37| `GIT_DIR == GIT_COMMON` (normal repo) | Standard 3 options | No worktree to clean up |
38| `GIT_DIR != GIT_COMMON`, named branch | Standard 3 options | Provenance-based (see Step 6) |
39| `GIT_DIR != GIT_COMMON`, detached HEAD | Reduced 2 options (no merge) | Externally managed — leave in place |
40
41## Step 3: Determine Base Branch
42
43The base branch is whatever this work forked from — usually named in the
44…

Excerpt shown under the repository's MIT license.

More skills in superpowers

Keep exploring

Similar skill repositories

nexu-io /

open-design
107k

The 1st Collaborative AI Design Agent Workspace. Local-first and open source. Create motion, prototypes, websites, apps, dashboards, presentations, images, and videos with your team and AI agents. Share work, exchange feedback, and iterate together in one workspace.

40 skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates