finishing-a-development-branch

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

Updated Aug 5, 2026
One-click install
npx skills add https://github.com/JhonMA82/api-starter --skill finishing-a-development-branch-jhonma82
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: finishing-a-development-branch
Source: https://github.com/JhonMA82/api-starter/tree/main/.agents/skills/finishing-a-development-branch
Command: npx skills add https://github.com/JhonMA82/api-starter --skill finishing-a-development-branch-jhonma82

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When implementation work is done and tests pass, deciding how to integrate the branch—merge locally, open a pull request, or keep it—often leads to inconsistent or risky Git operations, especially with worktrees and detached HEAD states. ## Core Features & Use Cases - Test Gate Before Integration: Runs the full test suite first and stops if anything fails, so only green work gets integrated. - Environment-Aware Menus: Detects normal repos, named-branch worktrees, and detached HEAD states to present the correct integration options. - Safe Cleanup: Removes only self-created worktrees under .worktrees/ or worktrees/, verifies merged results before deleting branches, and requires typed confirmation before discarding work. - Use Case: After finishing a feature 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 safely. ## Quick Start Ask the assistant to finish the current development branch and it will verify tests, detect the Git environment, and present merge, pull request, or keep-as-is 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. Re-run tests on the merged result before deleting the feature branch or cleaning up any worktree.

How do I create a pull request from a Git worktree?▼

Push the feature branch with git push -u origin, then open the pull request against the base branch using the forge's CLI or the URL printed on push. Keep the worktree in place so PR feedback can be addressed there.

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

No. A detached HEAD indicates an externally managed workspace, so local merging is not offered. The options are pushing HEAD as a new remote branch for a pull request or keeping the workspace as-is.

When is it safe to remove a Git worktree after merging?▼

Remove a worktree only after the merged result passes tests and only if it lives under .worktrees/ or worktrees/, meaning the tooling created it. Worktrees owned by the host environment must be left in place.

What happens if tests fail on the merged result?▼

The process stops immediately with the branch and worktree left untouched. Since nothing has been pushed, the merge is local and recoverable while the failure is investigated.