finishing-a-development-branch

Enforce test verification and structured options before git branch integration.

Updated Jun 26, 2026
One-click install
npx skills add https://github.com/wangx7/skills-collection --skill finishing-a-development-branch-wangx7
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: finishing-a-development-branch
Source: https://github.com/wangx7/skills-collection/tree/main/superpowers-main/skills/finishing-a-development-branch
Command: npx skills add https://github.com/wangx7/skills-collection --skill finishing-a-development-branch-wangx7

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers often face uncertainty when completing work on a feature branch, leading to broken merges, accidental data loss, or unhandled worktree cleanup that leaves stale git state.

Core Features & Use Cases

  • Mandatory test verification: Ensures no broken code is merged or pushed by requiring all tests to pass before presenting integration options.
  • Environment-aware workflows: Detects git repository state (normal repo, named worktree, detached HEAD) to present the correct set of integration and cleanup options.
  • Safe end-to-end handling: Manages the full branch completion process from merge/PR creation to provenance-aware worktree and branch cleanup, with guardrails like confirmation prompts for destructive actions.
  • Use Case: After finishing a feature on a git worktree, use this skill to safely merge changes to the main branch, push a PR for team review, or clean up the branch if the work is no longer needed, without risking lost commits or failing CI.

Quick Start

Use the finishing-a-development-branch skill to safely complete work on your current feature branch once all project 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 feature branch without losing uncommitted work?

To safely merge a git feature branch, you should enforce mandatory test verification and use environment-aware workflows that detect your repository state. This prevents accidental data loss by adding guardrails like confirmation prompts before any destructive merge or cleanup actions.

What is the best way to clean up a git worktree after finishing a feature?

The best way to clean up a git worktree is using provenance-aware cleanup workflows that track the original branch context. This ensures stale git state is removed safely without losing commits, especially when working with named worktrees or detached HEAD states.

How do I create a pull request only after all tests pass on my development branch?

You can create a pull request after tests pass by enforcing a mandatory test verification step before presenting integration options. This structured workflow ensures no broken code is pushed, preventing failing CI and unverified merges during branch finalization.

Does this branch finalization workflow support detached HEAD states and named worktrees?

Yes, this branch finalization workflow supports detached HEAD states and named worktrees by detecting the exact git repository state. It then presents the correct set of environment-aware integration and cleanup options tailored to your specific git context.

Why do my development branches leave stale git state after merging?

Development branches leave stale git state when cleanup is handled inconsistently without provenance-aware tracking. Applying structured branch finalization workflows with guardrails ensures your worktree and branch cleanup matches the original context, preventing leftover state.

When should I not use an automated git merge workflow for my feature branch?

You should not use an automated git merge workflow if your project tests are failing or if you have uncommitted changes in a detached HEAD state. The workflow requires passing tests and a clean repository state to guarantee a safe code integration.