finishing-a-development-branch

Guides merging, pushing, or preserving a completed development branch after tests pass.

Updated Aug 19, 2026
One-click install
npx skills add https://github.com/Base-Analitica/mouse-hub --skill finishing-a-development-branch-base-analitica
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: finishing-a-development-branch
Source: https://github.com/Base-Analitica/mouse-hub/tree/main/.jcode/skills/finishing-a-development-branch
Command: npx skills add https://github.com/Base-Analitica/mouse-hub --skill finishing-a-development-branch-base-analitica

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When implementation work is done and tests pass, developers face an error-prone decision point: merge locally, open a pull request, or keep the branch. This Skill structures that decision, verifies the test suite first, detects the git environment (normal repo, worktree, or detached HEAD), and executes the chosen integration path safely with proper cleanup. ## Core Features & Use Cases - Test Gate Before Integration: Runs the full test suite and stops if anything fails, so only green work gets merged or pushed. - Environment-Aware Menus: Detects normal repos, named-branch worktrees, and detached HEAD states, then presents the correct set of integration options for each. - Safe Worktree Cleanup: Removes only self-created worktrees under .worktrees/ or worktrees/, refuses to force-delete uncommitted files, and requires explicit typed confirmation before discarding work. - Use Case: After finishing a feature branch in a git worktree, use this Skill to verify tests, merge into the confirmed base branch, re-test the merged result, and clean up the worktree and branch. ## 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 feature branch after tests pass?▼

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. Re-run tests on the merged result before deleting the branch or cleaning up any worktree.

What should I do with a git worktree after finishing a branch?▼

If the worktree lives under .worktrees/ or worktrees/, remove it with git worktree remove followed by git worktree prune. If removal is refused due to uncommitted files, show the files and ask whether to commit, move, or delete them rather than forcing removal.

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

No. A detached HEAD indicates an externally managed workspace, so local merge is not offered. The options are pushing HEAD as a new remote branch for a pull request, or leaving the workspace as-is for the host environment to manage.

Why does git worktree remove refuse to delete my worktree?▼

Removal is refused when the worktree contains modified or untracked files that exist nowhere else, such as uncommitted plans or scratch work. Never use --force on your own initiative; list the files with git status and ask how to handle them first.

When is it safe to delete a feature branch after merging?▼

Delete the branch only after the merged result passes the full test suite on the base branch. If merged-result tests fail, leave the branch and worktree in place and investigate, since nothing has been pushed and the merge is recoverable.