finishing-a-development-branch

Verify tests, then merge, push, preserve, or discard a feature branch.

1|Updated Mar 27, 2026
One-click install
npx skills add https://github.com/minfengyuan/harness-knowledge-base --skill finishing-a-development-branch-minfengyuan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: finishing-a-development-branch
Source: https://github.com/minfengyuan/harness-knowledge-base/tree/main/skills/finishing-a-development-branch
Command: npx skills add https://github.com/minfengyuan/harness-knowledge-base --skill finishing-a-development-branch-minfengyuan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provide a clear, safe workflow to conclude development work by verifying tests, choosing how to integrate a feature branch, and performing the chosen git operations while protecting work and preventing accidental deletions.

Core Features & Use Cases

  • Test-first verification: Require passing tests before any merge, push, or destructive action.
  • Structured decision surface: Present exactly four concise options (merge locally, push & create PR, keep branch, discard) to eliminate ambiguity.
  • Safe execution and cleanup: Determine base branch, execute git operations for merge/push/delete, and remove worktrees only when appropriate with typed confirmation for discards.
  • Use case: Finish a completed feature branch after local validation and choose whether to merge into main, open a PR for review, preserve the branch for later work, or discard with explicit confirmation.

Quick Start

Finish this feature branch by verifying tests pass, selecting one of the four options, and executing the corresponding git workflow.

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 git feature branch after tests pass?

To safely merge a git feature branch after tests pass, the workflow verifies tests first, identifies the correct base branch, then executes the merge locally or pushes to open a pull request. It presents four structured options to eliminate ambiguity.

What is the best way to clean up git worktrees after finishing a branch?

The best way to clean up git worktrees after finishing a branch is to use a workflow that removes worktrees only when appropriate. It executes git operations for merge, push, or delete, and performs worktree cleanup with explicit typed confirmation for destructive actions.

Can I push a feature branch and open a pull request without merging locally?

Yes, you can push a feature branch and open a pull request without merging locally. The workflow offers this as one of four fixed options, executing the git push command and preparing the branch for review after verifying that tests pass.

How do I discard a git feature branch without accidentally deleting my work?

To discard a git feature branch without accidental deletions, the workflow requires explicit typed confirmation before executing destructive git commands. This ensures you consciously approve the deletion of the branch and associated worktree only when intended.

Does finishing a feature branch require passing tests before integration?

Yes, finishing a feature branch requires passing tests before integration. The workflow enforces test-first verification, demanding that tests pass before allowing any merge, push, or destructive action to proceed on the feature branch.

When should I preserve a git branch instead of merging it into the base branch?

You should preserve a git branch instead of merging when implementation is complete but you want to keep it for later work. The workflow offers a dedicated option to keep the branch active without merging or discarding, preventing premature integration.