finishing-a-development-branch

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

Updated Jul 21, 2026
One-click install
npx skills add https://github.com/afonsoft/gamehub --skill finishing-a-development-branch-afonsoft
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: finishing-a-development-branch
Source: https://github.com/afonsoft/gamehub/tree/main/.claude/skills/finishing-a-development-branch
Command: npx skills add https://github.com/afonsoft/gamehub --skill finishing-a-development-branch-afonsoft

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When implementation work is done, developers often face an ambiguous decision point: merge locally, open a pull request, keep the branch, or discard it. This Skill removes that ambiguity by verifying tests first, detecting the git environment, and presenting a structured set of completion options with safe execution and cleanup. ## Core Features & Use Cases - Test Gate Before Completion: Runs the project's test suite and blocks any merge or PR until all tests pass. - Environment Detection: Distinguishes normal repositories, named-branch worktrees, and detached HEAD states to present the correct option menu. - Structured Options and Safe Cleanup: Presents exactly four options (merge, PR, keep, discard), executes the chosen workflow, and removes worktrees only when provenance confirms ownership. - Use Case: After finishing a feature on a branch in a git worktree, invoke this Skill to verify tests, merge back to main, remove the worktree, and delete the branch in the correct order. ## Quick Start Use the finishing-a-development-branch skill to complete this 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 finish a git feature branch after implementation is complete?▼

First verify the test suite passes, then choose between merging locally into the base branch, pushing and creating a pull request, keeping the branch, or discarding it. The Skill presents these as structured options and executes the chosen workflow.

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

Change directory to the main repository root, run git worktree remove with the worktree path, then run git worktree prune. Only remove worktrees under .worktrees/, worktrees/, or ~/.config/superpowers/worktrees/ to avoid deleting externally managed workspaces.

Can I merge a branch when tests are failing?▼

No. The Skill stops immediately when tests fail and reports the failures. Merge or pull request creation is blocked until the test suite passes, preventing broken code from reaching the base branch.

What happens to the worktree when creating a pull request?▼

The worktree is preserved when creating a pull request. Cleanup only runs for local merges and discards, because the user needs the worktree alive to iterate on PR feedback.

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

Branch deletion fails because the worktree still references the branch. Remove the worktree first from the main repository root, then delete the branch with git branch -d.