finishing-a-development-branch

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

Updated Apr 29, 2026
One-click install
npx skills add https://github.com/fred-meng/harness --skill finishing-a-development-branch-fred-meng
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: finishing-a-development-branch
Source: https://github.com/fred-meng/harness/tree/main/.github/skills/finishing-a-development-branch
Command: npx skills add https://github.com/fred-meng/harness --skill finishing-a-development-branch-fred-meng

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When implementation work is done, developers often merge broken code, forget to verify tests, or leave stale branches and worktrees behind. This Skill enforces a disciplined completion workflow so every finished branch is integrated, kept, or discarded safely. ## Core Features & Use Cases - Test Gate Before Completion: 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—then executes the chosen path with the correct git commands. - Safe Cleanup and Discard Protection: Cleans up git worktrees only when appropriate and requires typed confirmation before permanently deleting a branch. - Use Case: After finishing a feature branch in a git worktree, invoke this Skill to verify tests pass, create a pull request with a summary and test plan via gh pr create, and remove the worktree. ## Quick Start Use the finishing-a-development-branch skill to complete my current feature branch now that all tests pass.

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 test suite passes, then choose one of four options: merge locally into the base branch, push and create a pull request, keep the branch as-is, or discard the work. Each option has defined git commands and cleanup rules.

How to create a pull request from a feature branch using git and GitHub CLI?

Push the branch with git push -u origin, then run gh pr create with a title and body containing a summary of changes and a test plan checklist. Verify tests pass before pushing to avoid failing PRs.

Should I merge a branch when tests are failing?

No. Failing tests block completion entirely—fix the failures first, then re-run the suite. Merging broken code or creating a failing PR propagates defects into the base branch.

When should I remove a git worktree after finishing a branch?

Remove the worktree only after merging locally or discarding the branch. Keep it when creating a pull request or keeping the branch as-is, since the work may still need follow-up changes.

How do I safely delete a git branch without losing work?

Require explicit typed confirmation before deletion, listing the branch name, commits, and worktree path that will be destroyed. Then use git branch -D to force-delete only after confirmation is received.