finishing-a-development-branch

Guides merging, pushing, or keeping a completed development branch with worktree cleanup.

Updated Aug 3, 2026
One-click install
npx skills add https://github.com/Yvesdefaria/GymLab --skill finishing-a-development-branch-yvesdefaria
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: finishing-a-development-branch
Source: https://github.com/Yvesdefaria/GymLab/tree/main/.opencode/skills/finishing-a-development-branch
Command: npx skills add https://github.com/Yvesdefaria/GymLab --skill finishing-a-development-branch-yvesdefaria

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When implementation work is done and tests pass, deciding how to integrate a development branch is error-prone: merging into the wrong base, losing uncommitted files during worktree cleanup, or discarding work prematurely. This Skill provides a structured, safe decision workflow for finishing a development branch. ## Core Features & Use Cases - Test Verification Gate: Runs the full test suite before any integration decision and stops if failures exist. - Environment Detection: Distinguishes normal repositories, named-branch worktrees, and detached HEAD states to present the correct integration options. - Guided Integration Options: Offers merge locally, push and create a pull request, or keep the branch as-is, with explicit confirmation required before any destructive discard. - Safe Worktree Cleanup: Removes only self-created worktrees under .worktrees/ or worktrees/, and never force-removes worktrees containing uncommitted files without asking. - Use Case: After finishing a feature on a branch in a git worktree, use this Skill to verify tests, merge back to the base branch, re-run tests on the merged result, and clean up the worktree without losing uncommitted notes. ## Quick Start Ask the assistant to finish the current development branch now that implementation is complete and 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 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.

How do I remove a git worktree without losing uncommitted files?

Use git worktree remove, which refuses when modified or untracked files exist. If removal is refused, list the files with git status, then commit them, move them, or explicitly delete them before retrying. Never use --force on your own initiative.

What should I do with a branch on a detached HEAD?

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.

When should I delete a feature branch after merging?

Delete the branch with git branch -d only after the merged result passes the full test suite. If merged-result tests fail, leave the branch and worktree in place and investigate, since nothing has been pushed yet.

Why does git worktree remove fail with modified or untracked files?

The refusal means the worktree contains files that exist nowhere else, such as uncommitted plans or scratch work. Forcing removal would destroy them permanently, so review the file list and choose to commit, move, or delete them first.