finishing-a-development-branch

Finish Git feature branches with merge, pull request, keep, or discard options.

Updated May 7, 2026
One-click install
npx skills add https://github.com/TumeloRamaphosa/StudEx-Valley-OS --skill finishing-a-development-branch-tumeloramaphosa
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: finishing-a-development-branch
Source: https://github.com/TumeloRamaphosa/StudEx-Valley-OS/tree/main/.claude/skills/superpowers/skills/finishing-a-development-branch
Command: npx skills add https://github.com/TumeloRamaphosa/StudEx-Valley-OS --skill finishing-a-development-branch-tumeloramaphosa

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Finishing a development branch safely by ensuring tests pass, choosing the right merge/PR/cleanup path, and avoiding common Git worktree and branch-deletion mistakes.

Core Features & Use Cases

  • Test-first completion: Forces a verification step before offering integration options to prevent merging broken code.
  • Environment-aware workflow: Detects normal repo vs named worktree vs detached HEAD, then presents the correct set of options.
  • Safe cleanup logic: Cleans up worktrees only when it owns them (for Options 1 and 4) and avoids deleting harness-owned workspaces.

Quick Start

Use the finishing-a-development-branch skill when your implementation is complete and you want the AI to verify tests and present a precise merge, PR, keep, or discard menu based on your current Git state.

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?

Finishing a development branch safely requires running test validation first, then selecting a merge, pull request, keep, or discard path based on your git environment state. This ensures clean worktree cleanup and prevents merging broken code.

How does git worktree cleanup work when discarding changes?

Git worktree cleanup works by detecting whether you are in a normal repo, named worktree, or detached HEAD state. It then executes provenance-safe worktree removal only for owned workspaces, requiring confirmation before discarding any changes.

What is the best way to manage a pull request workflow after implementation?

The best way to manage a pull request workflow after implementation is to enforce test validation before presenting integration options. This environment-aware process detects your Git state and structures the merge, PR, keep, or discard menu accordingly.

Does this branch management approach work with detached HEAD states?

Yes, this branch management approach works with detached HEAD states. It detects GIT_DIR versus GIT_COMMON environments and detached HEAD versus named worktree conditions to present the correct set of merge, keep, or discard options.

Why do I need to run tests before merging a development branch?

You need to run tests before merging a development branch to prevent integrating broken code into the main release workflow. This test-first completion step forces a validation check using the appropriate test command before presenting integration options.