finishing-a-development-branch

Guides completion of development branches through structured merge, pull request, or cleanup options.

Updated Jun 9, 2026
One-click install
npx skills add https://github.com/gyc-12/Archipelago --skill finishing-a-development-branch-gyc-12
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: finishing-a-development-branch
Source: https://github.com/gyc-12/Archipelago/tree/main/modules/collaboration-runtime/src-tauri/experts/skills/finishing-a-development-branch
Command: npx skills add https://github.com/gyc-12/Archipelago --skill finishing-a-development-branch-gyc-12

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When implementation work is done, developers often face an ambiguous decision point: merge locally, open a pull request, keep the branch, or discard it. This Skill removes that ambiguity by verifying tests first, detecting the git environment, and presenting a fixed set of structured options with safe execution and cleanup. ## Core Features & Use Cases - Test-Gated Completion: Runs the project's test suite before offering any integration option and stops if tests fail. - Environment Detection: Distinguishes normal repositories, named-branch worktrees, and detached HEAD states to present the correct option menu. - Safe Cleanup with Provenance: Removes only self-created worktrees, requires typed confirmation before discarding work, and runs git worktree prune after removal. - Use Case: After finishing a feature branch in a git worktree, the Skill verifies tests pass, offers merge/PR/keep/discard options, merges into the base branch, removes the worktree, and deletes the branch in the correct order. ## Quick Start Ask the assistant to finish the current development branch and choose whether to merge it, open a pull request, keep it, or discard it.

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 finish a git feature branch after implementation is complete?

First verify the project's test suite passes, then choose one of four options: merge back to the base branch locally, push and create a pull request, keep the branch as-is, or discard the work. The Skill executes the chosen option and handles branch and worktree cleanup.

How do I create a pull request from a feature branch using git?

Push the branch with git push -u origin, then run gh pr create with a title and a body containing a summary and test plan. The worktree is preserved so you can iterate on pull request feedback.

Does this workflow support git worktrees and detached HEAD states?

Yes. It detects the environment by comparing git rev-parse --git-dir and --git-common-dir. Detached HEAD workspaces get a reduced three-option menu without local merge, and only self-created worktrees are cleaned up.

Why does git branch -d fail when a worktree still uses the branch?

Git refuses to delete a branch that is checked out in a worktree. The correct order is to merge first, remove the worktree from the main repository root with git worktree remove, and only then delete the branch.

What happens if tests fail before merging a branch?

The process stops immediately and reports the failing tests. No merge, pull request, or cleanup option is offered until the test suite passes, preventing broken code from being integrated.