finishing-a-development-branch

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

Updated Jul 23, 2026
One-click install
npx skills add https://github.com/shrek-abaper/sap-nexus-agent --skill finishing-a-development-branch-shrek-abaper
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: finishing-a-development-branch
Source: https://github.com/shrek-abaper/sap-nexus-agent/tree/main/.comet/skills/skills/finishing-a-development-branch
Command: npx skills add https://github.com/shrek-abaper/sap-nexus-agent --skill finishing-a-development-branch-shrek-abaper

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 fixed set of structured options with safe execution and cleanup. ## Core Features & Use Cases - Test-Gated Completion: Runs the project test suite before offering any integration option and stops if tests fail. - Environment Detection: Distinguishes normal repositories, named-branch worktrees, and detached HEAD states to present the correct option menu. - Safe Cleanup with Provenance: Removes only self-created worktrees under .worktrees/ or worktrees/, requires typed confirmation before discarding work, and prunes stale worktree registrations. - Use Case: After finishing a feature in a git worktree with all tests passing, use this Skill to merge the branch back to main, remove the worktree, and delete the feature branch in the correct order. ## Quick Start Ask the assistant to finish the current development branch and it will verify tests, detect the workspace state, and present merge, pull request, keep, or discard 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 finish a development branch after implementation is complete?▼

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

How do I merge a feature branch and clean up its git worktree?▼

Change to the main repository root, check out the base branch, pull, merge the feature branch, and re-run tests on the merged result. Only after the merge succeeds, remove the worktree with git worktree remove, prune stale registrations, then delete the branch.

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

Git refuses to delete a branch that is checked out in a worktree. Remove the worktree first with git worktree remove from the main repository root, then delete the branch. Running the removal from inside the worktree itself also fails.

Should I remove the worktree after creating a pull request?▼

No. Keep the worktree alive after pushing and opening a pull request because you need it to iterate on review feedback. Worktree cleanup only applies to the local merge and discard options.

What happens with a detached HEAD when finishing development work?▼

A detached HEAD indicates an externally managed workspace, so the local merge option is unavailable. The reduced menu offers pushing as a new branch with a pull request, keeping the state as-is, or discarding, with no worktree cleanup performed.