finishing-a-development-branch

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

Updated Aug 13, 2026
One-click install
npx skills add https://github.com/Viranya2006/Lumen --skill finishing-a-development-branch-viranya2006
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: finishing-a-development-branch
Source: https://github.com/Viranya2006/Lumen/tree/main/SKILLS/finishing-a-development-branch
Command: npx skills add https://github.com/Viranya2006/Lumen --skill finishing-a-development-branch-viranya2006

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When implementation work is finished, developers face an error-prone decision point: merge locally, open a pull request, or keep the branch. This Skill enforces a safe, repeatable workflow that verifies tests first, detects the git environment (normal repo, worktree, or detached HEAD), and executes the chosen integration path with correct cleanup. ## Core Features & Use Cases - Test-Gated Integration: Runs the full test suite before any merge or push, and re-verifies tests on the merged result before deleting anything. - Environment Detection: Distinguishes normal repositories, named-branch worktrees, and detached HEAD states to present the correct option menu and cleanup strategy. - Safe Worktree Cleanup: Removes only worktrees under .worktrees/ or worktrees/, leaving externally managed workspaces untouched, and requires typed confirmation before discarding work. - Use Case: After finishing a feature branch in a git worktree, use this Skill to confirm the base branch, merge locally, re-run tests, remove the worktree, and delete the branch without losing work. ## Quick Start Ask the assistant to finish the current development branch and it will verify tests, present merge, pull request, or keep options, and clean up the worktree accordingly.

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 in git?

Run the full test suite first, confirm the base branch the work forked from, then checkout the base, pull, and merge the feature branch. Re-run tests on the merged result before deleting the branch or removing any worktree.

How do I clean up a git worktree after merging?

Change directory to the main repository root, then run git worktree remove followed by git worktree prune. Only remove worktrees under .worktrees/ or worktrees/ directories; externally managed workspaces should be left in place.

What should I do with a detached HEAD after finishing work?

A detached HEAD workspace is externally managed, so merging locally is not offered. Push as a new branch with git push origin HEAD:refs/heads/<new-branch> to create a pull request, or keep the workspace as-is.

Why should tests be re-run after merging a branch locally?

A green test run only proves the tree it ran on. The merged result combines two branches and may fail even if both passed independently, so the suite must pass on the merged tree before deleting the branch.

When is it safe to delete a development branch and discard work?

Discard only on an explicit request from the user, confirmed by typing the exact word discard. The confirmation lists the branch, commits, and worktree path that will be permanently deleted before force-deleting with git branch -D.