finishing-a-development-branch

Guides merge, pull request, or cleanup of completed Git development branches.

Updated Aug 2, 2026
One-click install
npx skills add https://github.com/kxnzee/multi-repo-specs --skill finishing-a-development-branch-kxnzee
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: finishing-a-development-branch
Source: https://github.com/kxnzee/multi-repo-specs/tree/main/extensions/superpowers/skills/finishing-a-development-branch
Command: npx skills add https://github.com/kxnzee/multi-repo-specs --skill finishing-a-development-branch-kxnzee

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When implementation work is done, developers often merge broken code, delete worktrees prematurely, or lose track of branches. This Skill enforces a safe, structured completion workflow for Git branches and worktrees. ## Core Features & Use Cases - Test-Gated Completion: Verifies the project's test suite passes before offering any merge or PR options, stopping immediately on failures. - Environment Detection: Distinguishes normal repositories, named-branch worktrees, and detached HEAD states to present the correct option menu and cleanup behavior. - Structured Options & Safe Cleanup: Presents exactly four options (merge locally, push and create PR, keep as-is, discard) with typed confirmation for destructive actions and provenance-based worktree removal. - Use Case: After finishing a feature in a Git worktree, run this Skill to verify tests, merge into the base branch, remove the worktree, and delete the feature branch in the correct order. ## Quick Start Use the finishing-a-development-branch skill to complete my current feature branch now that all tests pass.

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 safely merge a Git feature branch after implementation?▼

Verify the test suite passes first, then checkout the base branch, pull with fast-forward, merge the feature branch, and re-run tests on the merged result. Only delete the feature branch after the merge succeeds and any worktree is removed.

How to clean up a Git worktree after merging a branch?▼

Change directory to the main repository root, then run git worktree remove with the captured worktree path. Only delete the branch after removal succeeds, and never remove worktrees created by external tooling.

Why does git branch -d fail after merging in a worktree?▼

The branch deletion fails because a linked worktree still references that branch. Remove the worktree first with git worktree remove from the main checkout, then delete the branch.

Can I create a pull request from a detached HEAD state?▼

Yes, but first create a user-approved branch at the captured HEAD commit, then push it to the confirmed remote and open the PR through the hosting CLI or API. The externally managed worktree is preserved.

When should I not clean up a Git worktree after finishing work?▼

Skip cleanup when you push and create a pull request, since you need the worktree to iterate on review feedback. Also preserve worktrees created by external harnesses or platforms, regardless of directory naming.