finishing-a-development-branch

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

Updated Aug 12, 2026
One-click install
npx skills add https://github.com/Barbaros911/As-mine --skill finishing-a-development-branch-barbaros911
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: finishing-a-development-branch
Source: https://github.com/Barbaros911/As-mine/tree/main/.claude/skills/finishing-a-development-branch
Command: npx skills add https://github.com/Barbaros911/As-mine --skill finishing-a-development-branch-barbaros911

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When implementation work is done and tests pass, developers still face a risky decision: how to integrate the branch without losing work, merging into the wrong base, or destroying uncommitted files in a worktree. This Skill enforces a safe, structured completion workflow. ## Core Features & Use Cases - Test-Gated Integration: Runs the full test suite first and stops if anything fails, so only green work gets integrated. - Environment-Aware Options: Detects normal repos, named-branch worktrees, and detached HEAD states, then presents the correct merge/push/keep menu. - Safe Worktree Cleanup: Removes only self-created worktrees, refuses to force-delete uncommitted files without explicit confirmation, and verifies the merged result before deleting branches. - Use Case: After finishing a feature in a Git worktree, use this Skill to verify tests, merge back to the base branch, confirm the merged result is green, and clean up the worktree without losing scratch files. ## Quick Start Use the finishing-a-development-branch skill to complete this work now that implementation is done and 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 finished feature branch back into main?▼

Run the full test suite first, confirm the base branch the work forked from, then check out the base, pull, and merge the feature branch. Verify tests pass on the merged result before deleting the branch or removing any worktree.

What should I do with a Git worktree after implementation is complete?▼

If you merge locally or discard the work, remove the worktree with git worktree remove and prune stale registrations. If you create a pull request or keep the branch, preserve the worktree so PR feedback can be addressed there.

Can I merge a branch when Git is in a detached HEAD state?▼

No, a detached HEAD worktree is externally managed, so local merging is not offered. The options are to push HEAD as a new remote branch and open a pull request, or leave the workspace as-is.

Why does git worktree remove refuse with modified or untracked files?▼

The refusal means the worktree contains files that exist nowhere else, such as uncommitted plans or scratch work. Never use --force on your own initiative; show the file list and choose to commit, move, or explicitly delete them first.

When should I not force-delete a development branch?▼

Force deletion with git branch -D is only appropriate after an explicit discard request confirmed by typing 'discard'. Otherwise use git branch -d after a verified green merge so unmerged commits are never lost silently.