finishing-a-development-branch

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

Updated Jan 2, 2025
One-click install
npx skills add https://github.com/mcinnisd/gymbro --skill finishing-a-development-branch-mcinnisd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: finishing-a-development-branch
Source: https://github.com/mcinnisd/gymbro/tree/main/.agents/skills/finishing-a-development-branch
Command: npx skills add https://github.com/mcinnisd/gymbro --skill finishing-a-development-branch-mcinnisd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When a development branch is finished, developers often skip test verification, merge into the wrong base branch, or leave stale worktrees behind. This Skill enforces a disciplined completion workflow so branch integration happens safely and deliberately. ## Core Features & Use Cases - Test Gate Before Integration: Runs the project's full test suite (npm test, cargo test, pytest, go test) and blocks completion until the suite is green. - Environment Detection: Distinguishes normal repositories, named-branch worktrees, and detached HEAD states to present the correct integration options. - Structured Completion Menu: Offers merge locally, push and create a pull request, or keep the branch as-is, with safe worktree cleanup and branch deletion afterward. - Use Case: After finishing a feature in a git worktree, use this Skill to verify tests pass, merge into the confirmed base branch, remove the worktree, and delete the feature branch cleanly. ## 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 development is complete?

Run the full test suite first and stop if anything fails. Then confirm the base branch, check it out, pull latest changes, merge the feature branch, and re-run tests on the merged result before deleting the branch.

How do I clean up a git worktree after merging a branch?

Change directory to the main repository root, then run git worktree remove followed by git worktree prune to clear stale registrations. Only remove worktrees under .worktrees/ or worktrees/ directories that your tooling created.

What should I do when a git worktree is in detached HEAD state?

A detached HEAD worktree is externally managed, so do not attempt a local merge. Instead push as a new branch with git push origin HEAD:refs/heads/<new-branch> to create a pull request, or leave the workspace in place.

Why should tests be re-run after merging into the base branch?

A green test run only proves the tree it ran on. The merged result combines your branch with the latest base branch changes, so failures can appear even if both were green independently.

When is it safe to delete a development branch?

Delete a branch only after the merged result passes tests, using git branch -d for normal deletion. Force deletion with git branch -D should happen only after explicit confirmation that the work should be discarded.