finishing-a-development-branch

Verify tests and finalize a git development branch with merge, PR, keep, or discard options.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/withmartian-sandbox/ghrc-x-3126672651424eddb640ecc81321a665 --skill finishing-a-development-branch-withmartian-sandbox
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: finishing-a-development-branch
Source: https://github.com/withmartian-sandbox/ghrc-x-3126672651424eddb640ecc81321a665/tree/main/default/skills/finishing-a-development-branch
Command: npx skills add https://github.com/withmartian-sandbox/ghrc-x-3126672651424eddb640ecc81321a665 --skill finishing-a-development-branch-withmartian-sandbox

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a deterministic workflow to finalize a development branch after implementation is complete and tests pass, eliminating ambiguity about whether to merge, create a PR, preserve work, or discard changes while protecting against accidental data loss.

Core Features & Use Cases

  • Test verification gating: Ensures tests pass before any merge or destructive action is offered or executed.
  • Base branch detection: Automatically determines the correct base branch (main or master) for merges and PRs.
  • Four explicit completion options: Presents and executes one of merge locally, push and create a pull request, keep the branch as-is, or discard work with typed confirmation.
  • Worktree and branch cleanup rules: Performs safe worktree removal and branch deletion only when appropriate and requires explicit confirmation for destructive actions.
  • Use Case: Finalize a completed feature branch after CI and local tests, then either merge locally, create a PR, preserve the branch for later, or securely discard it.

Quick Start

Use the finishing-a-development-branch skill to verify tests, choose one of merge, create PR, keep, or discard, and execute the chosen git and PR workflow with confirmation and cleanup.

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 finish a development branch and clean up worktrees after tests pass?▼

To finish a development branch safely, verify tests pass, detect the base branch, then choose to merge locally, create a pull request, keep the branch, or discard it. The workflow executes git and gh commands with typed confirmation for destructive actions and cleans up worktrees when appropriate.

Can I automatically merge a feature branch locally instead of creating a pull request?▼

Yes, you can automatically merge a feature branch locally. The workflow detects the base branch, such as main or master, and presents merging locally as one of four explicit completion options, executing the git commands required to finalize the merge after tests pass.

What is the best way to discard a git feature branch without losing work accidentally?▼

The best way to discard a git feature branch without accidental data loss is using a workflow that requires typed confirmation for destructive actions. This ensures branch deletion and worktree removal only execute when explicitly confirmed by the user.

Does this branch management workflow require passing tests before allowing a merge?▼

Yes, this branch management workflow requires passing tests before allowing a merge. Test verification gating ensures all tests must pass before any merge, pull request, or destructive discard action is offered or executed in the git repository.

How do I clean up a git worktree after finalizing a feature branch?▼

To clean up a git worktree after finalizing a feature branch, the workflow applies safe worktree removal rules. It automatically deletes the worktree only when appropriate, such as after a successful merge or confirmed discard, protecting active work from accidental deletion.

When should I keep a development branch instead of merging or discarding it?▼

You should keep a development branch when implementation is complete but you are not ready to finalize the work. The workflow presents keeping the branch as-is as one of four explicit options, preserving the worktree and branch for later action without executing destructive commands.