finishing-a-development-branch

Verify tests pass before merging git branches or creating pull requests.

63|2|Updated Mar 29, 2026
One-click install
npx skills add https://github.com/xhyqaq/superpowers-plus --skill finishing-a-development-branch-xhyqaq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: finishing-a-development-branch
Source: https://github.com/xhyqaq/superpowers-plus/tree/main/skills/finishing-a-development-branch
Command: npx skills add https://github.com/xhyqaq/superpowers-plus --skill finishing-a-development-branch-xhyqaq

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers often face risky, inconsistent workflows when completing feature branches, leading to broken merges, accidental code loss, or leftover unused worktrees and branches cluttering the repository.

Core Features & Use Cases

  • Pre-completion test verification: Automatically checks that all project tests pass before offering any completion options to prevent merging broken code.
  • Environment-aware option presentation: Detects the current git environment (normal repository, named worktree, detached HEAD) to show only relevant, safe completion options.
  • End-to-end workflow handling: Manages the full process from local merge or PR creation to safe worktree and branch cleanup, with guardrails like mandatory confirmation for discarding work.
  • Use Case: After finishing a feature implementation, use this skill to safely merge your branch to the main codebase, open a PR for team review, or clean up unused work without risking lost commits.

Quick Start

Use the finishing-a-development-branch skill to complete your current feature branch work after confirming 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 safely merge a git development branch without losing code or breaking the main codebase?

To safely merge a git development branch, you must enforce mandatory test verification before offering any merge options, applying structured guardrails and environment-aware workflows across normal repositories, named worktrees, and detached HEAD states to prevent accidental code loss.

What is the best way to clean up unused git worktrees and branches after finishing a feature?

The best way to clean up unused git worktrees and branches is through an end-to-end workflow that manages local merges and PR creation, followed by automated worktree cleanup for harness-managed workspaces with mandatory confirmation before discarding work.

Can I create a pull request from a detached HEAD or named worktree environment?

Yes, you can create a pull request from a detached HEAD or named worktree environment because the workflow detects your current git environment and presents only relevant, safe completion options like PR creation tailored to that specific state.

How do I prevent broken code from being merged into the main repository?

To prevent broken code from being merged, you must execute pre-completion test verification that automatically checks and ensures all project tests pass before offering any branch integration or pull request creation options.

Does this branch completion workflow work across normal repositories and named worktrees?

Yes, this branch completion workflow works across normal repositories, named worktrees, and detached HEAD environments by applying environment-aware option presentation to ensure safe merges, PR creation, and worktree cleanup for each specific context.

Why do I need mandatory confirmation when discarding work during branch cleanup?

You need mandatory confirmation when discarding work during branch cleanup because it acts as a guardrail against accidental code loss, ensuring that unused branches and worktrees are removed only after explicit user approval.