finishing-a-development-branch

Guides merging, PR creation, keeping, or discarding a completed development branch after verifying tests pass.

Updated May 19, 2026
One-click install
npx skills add https://github.com/davidsunglee/pi-flow --skill finishing-a-development-branch-davidsunglee
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: finishing-a-development-branch
Source: https://github.com/davidsunglee/pi-flow/tree/main/packages/pi-flow-core/skills/finishing-a-development-branch
Command: npx skills add https://github.com/davidsunglee/pi-flow --skill finishing-a-development-branch-davidsunglee

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When implementation work is done, developers often merge broken code, forget to clean up worktrees, or accidentally delete work. This Skill enforces a safe, structured completion workflow for Git branches. ## Core Features & Use Cases - Test Gate: Runs the project's test suite first and blocks any merge or PR if tests fail. - Four Structured Options: Presents exactly four choices — merge locally, push and create a PR, keep the branch as-is, or discard the work. - Safe Cleanup: Removes Git worktrees only when appropriate and requires typed confirmation before discarding work. - Use Case: After finishing a feature branch in a worktree, use this Skill to verify tests, create a pull request with gh pr create, and clean up the worktree in one guided flow. ## Quick Start Ask the assistant to finish the current development branch and choose whether to merge, open a PR, keep, 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 safely merge a feature branch after development is complete?▼

Verify the test suite passes first, then check out the base branch, pull latest changes, merge the feature branch, and re-run tests on the result. Only delete the feature branch after tests pass on the merged code.

How to create a GitHub pull request from a feature branch?▼

Push the branch with git push -u origin, then run gh pr create with a title and a body containing a summary of changes and a test plan checklist. The Skill generates this PR structure automatically.

When should I clean up a Git worktree after finishing a branch?▼

Remove the worktree only when merging locally or discarding the branch. Keep the worktree when creating a PR or keeping the branch as-is, since the work may still be needed for review feedback.

What happens if tests fail before merging a branch?▼

The workflow stops immediately and reports the failing tests. No merge, PR, or cleanup options are presented until the failures are fixed and the test suite passes.

Can I recover a branch after choosing to discard it?▼

No, discarding permanently deletes the branch, its commits, and the worktree. That is why the workflow requires typing 'discard' as explicit confirmation before executing the deletion.