finishing-a-development-branch

Finalize a git feature branch with test validation and four user options.

1|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/xxih/ai-harness-zh --skill finishing-a-development-branch-xxih
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: finishing-a-development-branch
Source: https://github.com/xxih/ai-harness-zh/tree/main/references/translations/superpowers/skills/finishing-a-development-branch
Command: npx skills add https://github.com/xxih/ai-harness-zh --skill finishing-a-development-branch-xxih

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a structured, safety-first process for finishing a development branch so completed work is validated, integrated, or safely discarded without accidental data loss.

Core Features & Use Cases

  • Test-first validation: Requires running the project's test suite and blocks progress if tests fail.
  • Deterministic options: Presents exactly four choices (merge locally, push and create PR, keep branch, discard work) and executes the chosen flow.
  • Safe cleanup: Handles worktree removal and branch deletion with explicit confirmation for destructive actions; useful after finishing feature work, preparing releases, or cleaning abandoned branches.

Quick Start

Run the project's tests, present the four structured options to the user, and execute the selected git and worktree steps while requiring explicit confirmation before any destructive deletion.

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 feature branch and clean up the worktree?

To safely finish a git feature branch, you run tests, choose to merge, create a pull request, keep, or discard the branch, and then execute git and worktree cleanup operations with explicit confirmation before any destructive deletion.

What is the best way to ensure tests pass before merging a development branch?

The best way to ensure tests pass before merging a development branch is to use a workflow that enforces test validation first, blocking progress and branch integration if the test suite fails.

Can I discard a git branch and remove its worktree without accidental data loss?

Yes, you can discard a git branch and remove its worktree without accidental data loss by requiring explicit confirmation for destructive branch deletion before executing the cleanup operations.

Does the branch finalization process support creating pull requests instead of local merges?

Yes, the branch finalization process supports creating pull requests by presenting a deterministic option to push the branch and create a PR instead of performing a local git merge.

What happens if my test suite fails when finalizing a development branch?

If your test suite fails when finalizing a development branch, the test-first validation blocks progress, preventing you from proceeding to integration or cleanup options until tests pass.

When should I keep a branch instead of deleting it after feature work is complete?

You should keep a branch instead of deleting it after feature work is complete if you need to retain the work without integrating it immediately, selecting the keep branch option from the four fixed choices presented.