finishing-a-development-branch

Run the test suite before merging, opening a PR, keeping, or discarding a branch.

Updated Apr 24, 2026
One-click install
npx skills add https://github.com/otto-poblysh/pedagemy-early-access --skill finishing-a-development-branch-otto-poblysh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: finishing-a-development-branch
Source: https://github.com/otto-poblysh/pedagemy-early-access/tree/main/.agents/skills/finishing-a-development-branch
Command: npx skills add https://github.com/otto-poblysh/pedagemy-early-access --skill finishing-a-development-branch-otto-poblysh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents developers from accidentally merging or discarding unfinished work by enforcing a test-first gate and then guiding a clear, safe completion workflow.

Core Features & Use Cases

  • Test-verified completion: Ensures the branch is only finalized after the project’s test suite passes.
  • Structured integration options: Presents exactly four actionable next steps (merge locally, open a PR, keep as-is, or discard).
  • Safety guardrails for destructive actions: Requires typed confirmation before permanently deleting the branch and associated worktree.
  • Worktree-aware cleanup: Removes worktrees only for the scenarios where cleanup is safe (merge locally, discard), preserving them when the user chooses to keep the branch.

Use case example: After finishing a feature, run the tests, choose whether to merge into the base branch, create a PR for review, keep the branch for later iteration, or delete it if the work is no longer needed.

Quick Start

Use the finishing-a-development-branch skill to complete your branch by first verifying tests, then selecting one of the four structured workflow 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 finish a git branch and prevent merging unfinished code?

Finishing a development branch safely requires running the project test suite before allowing any integration actions. This ensures incomplete or broken code is never merged, offering structured options like merge, pull request, keep, or discard only after tests pass.

What's the best workflow for git branch cleanup and worktree removal after a merge?

A structured branch cleanup workflow removes the associated worktree only when you merge locally or discard the branch. It intentionally preserves the worktree if you choose to keep the branch, ensuring safe developer operations without accidental deletion.

Can I delete a git branch without accidentally removing an active worktree?

Yes, safe branch deletion requires a workflow that performs worktree cleanup only for safe cases like local merges or discards. It enforces a typed confirmation before irreversible branch deletion, preserving worktrees when you choose to keep the branch.

How do I verify tests before creating a pull request or merging a feature branch?

To verify tests before a pull request, use a branch completion workflow that enforces a test-first gate. The project test suite must pass before the system identifies the correct base branch and allows you to open a PR or merge locally.

What are my options after finishing a feature branch and passing the test suite?

After passing the test suite, you get four structured integration options: merge locally into the base branch, open a pull request for review, keep the branch as-is for later iteration, or safely discard it with typed confirmation.

Why should I use a structured merge workflow instead of manually deleting branches?

A structured merge workflow prevents accidental loss of unfinished work by enforcing a test-first gate and typed confirmation for destructive actions. Manual deletion lacks these safety guardrails, risking irreversible branch and worktree removal.