finish-branch

Verify tests and guide branch completion with four workflow options.

Updated Nov 4, 2022
One-click install
npx skills add https://github.com/CityBear3/dotfiles --skill finish-branch-citybear3
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: finish-branch
Source: https://github.com/CityBear3/dotfiles/tree/main/claude/skills/finish-branch
Command: npx skills add https://github.com/CityBear3/dotfiles --skill finish-branch-citybear3

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Finishing a development branch safely requires running the right checks, choosing the correct workflow (PR, merge, keep, or discard), and performing cleanup without accidental loss of work.

Core Features & Use Cases

  • Test Verification Gate: Ensures the branch’s test suite passes before any completion action is offered.
  • Base Branch Resolution: Determines whether the branch should be merged back to main or master (or asks for confirmation).
  • Choice-Driven Completion: Presents exactly four options (create PR, merge locally, keep as-is, or discard) and executes them with guardrails, including confirmation for destructive deletion.

Quick Start

Use the finish-branch skill after your review is complete to verify tests and choose whether to create a PR, merge locally, keep, or discard the work.

Frequently Asked Questions about finish-branch

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely finish a git branch after code review?

To finish a git branch safely, run tests first, then choose to create a pull request, merge locally into the base branch, keep the branch, or discard it with validation and confirmation.

How do I verify tests before merging a git feature branch?

Verifying tests before merging a feature branch requires running the test suite as a mandatory gate before presenting any completion options, ensuring only tested code gets merged or discarded.

Can I automatically detect the merge-base branch for local git merging?

Yes, base branch resolution automatically detects whether to merge back to main or master, asking for confirmation if the base branch is ambiguous before proceeding with the local merge.

What is the best way to handle branch cleanup and safe deletion in git?

Safe branch cleanup handles deletion by applying guardrails and requiring explicit confirmation, preventing accidental loss of work when you choose to discard a finished development branch.

Does finishing a branch require a separate pull request workflow?

No, finishing a branch offers exactly four options including PR creation, which delegates to the create-pr skill, or you can merge locally, keep the branch, or discard the work entirely.

When should I not use an automated branch completion workflow?

You should not use automated branch completion if your tests are failing, as the test verification gate blocks all completion actions to ensure only passing code is merged or discarded.