finishing-a-development-branch

Guides completion of development branches through structured merge, pull request, or cleanup options.

Updated May 28, 2026
One-click install
npx skills add https://github.com/mpmf/SDD_Base --skill finishing-a-development-branch-mpmf
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: finishing-a-development-branch
Source: https://github.com/mpmf/SDD_Base/tree/main/.opencode/skills/superpowers/finishing-a-development-branch
Command: npx skills add https://github.com/mpmf/SDD_Base --skill finishing-a-development-branch-mpmf

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When implementation work is done, developers often face ambiguity about how to integrate the branch: merge locally, open a pull request, keep it, or discard it. This Skill removes that guesswork by verifying tests first, detecting the git environment, and presenting a fixed set of structured options with safe execution and cleanup. ## Core Features & Use Cases - Test-Gated Completion: Runs the project's test suite before offering any integration option and stops if tests fail. - Environment Detection: Distinguishes normal repos, named-branch worktrees, and detached HEAD states to present the correct option menu. - Safe Cleanup: Removes only self-created worktrees, requires typed confirmation before discarding work, and deletes branches only after successful merges. - Use Case: After finishing a feature in a git worktree, the assistant verifies tests pass, asks whether to merge to main or open a PR via gh pr create, then cleans up the worktree and branch accordingly. ## Quick Start Ask the assistant to finish the current development branch and choose whether to merge it, open a pull request, keep it, or discard it.

Frequently Asked Questions about finishing-a-development-branch

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I finish a development branch after implementation is complete?▼

First verify the project's test suite passes, then choose from four options: merge locally to the base branch, push and create a pull request, keep the branch as-is, or discard the work. Each option has a defined execution and cleanup procedure.

How do I create a pull request from a feature branch using git?▼

Push the branch with git push -u origin, then run gh pr create with a title and body containing a summary and test plan. The worktree is preserved so you can iterate on PR feedback.

Can I merge a branch when tests are failing?▼

No. The workflow stops immediately if tests fail and reports the failures. You must fix all failing tests before any merge or pull request option is offered.

Why does git branch -d fail when a worktree still exists?▼

Git refuses to delete a branch that is checked out in a worktree. You must remove the worktree first with git worktree remove from the main repo root, then delete the branch.

When should a git worktree not be removed after finishing work?▼

Do not remove worktrees when creating a pull request or keeping the branch, since you still need them. Also never remove worktrees created by an external harness; only clean up ones under .worktrees/, worktrees/, or ~/.config/superpowers/worktrees/.