finishing-a-development-branch

Guides merging, pushing, or discarding a completed development branch with test verification and worktree cleanup.

Updated Aug 14, 2026
One-click install
npx skills add https://github.com/bill80362/laravel-thread-admin --skill finishing-a-development-branch-bill80362
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: finishing-a-development-branch
Source: https://github.com/bill80362/laravel-thread-admin/tree/main/.github/superpowers/finishing-a-development-branch
Command: npx skills add https://github.com/bill80362/laravel-thread-admin --skill finishing-a-development-branch-bill80362

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When a feature branch is finished, developers face risky decisions: merge locally, open a pull request, keep the branch, or discard it. This Skill enforces a safe, repeatable workflow that verifies tests first, confirms the base branch, and cleans up git worktrees correctly. ## Core Features & Use Cases - Test-Gated Integration: Runs the full test suite before presenting any integration options, and re-verifies tests on the merged result. - Environment Detection: Distinguishes normal repositories, named-branch worktrees, and detached HEAD states to show the correct option menu and cleanup path. - Safe Cleanup: Removes only worktrees under .worktrees/ or worktrees/, requires the exact word "discard" before deleting work, and never force-pushes without explicit approval. - Use Case: After finishing a feature in a git worktree, invoke this Skill to run tests, choose between a local merge or a pull request, and have the worktree and branch cleaned up safely. ## Quick Start Ask the assistant to finish the current development branch using the finishing-a-development-branch skill and present the integration options.

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 finished feature branch in git?

Run the full test suite first, confirm the base branch, then check out the base branch, pull, and merge the feature branch. Re-run tests on the merged result before deleting the branch with git branch -d.

How do I clean up a git worktree after merging a branch?

Switch to the main repository root, then run git worktree remove followed by git worktree prune. Only remove worktrees located under .worktrees/ or worktrees/ directories; leave externally managed workspaces untouched.

What should I do with a detached HEAD worktree when work is finished?

A detached HEAD worktree is externally managed, so do not merge or clean it up. Either push it as a new branch with git push origin HEAD:refs/heads/<new-branch> to create a pull request, or leave it in place.

Why should tests run again after merging a branch locally?

Tests that passed on the feature branch only prove that tree was green. The merged result can introduce conflicts or regressions, so the suite must pass on the merged tree before deleting the branch.

When is it safe to delete or discard a development branch?

Delete with git branch -d only after a successful local merge with passing tests. Permanent discard requires explicit user confirmation with the exact word "discard", followed by worktree removal and git branch -D.