finishing-a-development-branch

Verify tests and guide merge, PR, keep, or discard actions for Git branches.

1|Updated May 16, 2026
One-click install
npx skills add https://github.com/enigmaicon-eng/AI-Enterprise-OS --skill finishing-a-development-branch-enigmaicon-eng
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: finishing-a-development-branch
Source: https://github.com/enigmaicon-eng/AI-Enterprise-OS/tree/main/examples/superpowers/skills/finishing-a-development-branch
Command: npx skills add https://github.com/enigmaicon-eng/AI-Enterprise-OS --skill finishing-a-development-branch-enigmaicon-eng

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Finishing a development branch often risks merging broken code, deleting work prematurely, or taking unclear next steps after implementation is complete.

Core Features & Use Cases

  • Test-first completion gate: Verifies the project test suite before presenting any integration or cleanup options.
  • Environment-aware workflow: Detects whether you’re in a normal repo, named-branch worktree, or detached HEAD and adapts the offered options accordingly.
  • Safe, provenance-based cleanup: Cleans up worktrees only when they’re owned (e.g., created under typical superpowers worktree paths) and only for the merge/discard flows, otherwise preserving the workspace for ongoing PR iteration.

Quick Start

Use the finishing-a-development-branch skill when your implementation is ready and you want a guided choice to merge locally, create a PR, keep the branch, or discard it safely.

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 development branch without losing work?

To safely finish a git development branch, run your test suite first, then choose to merge, create a pull request, keep, or discard the branch through a guided confirmation process. This prevents merging broken code or deleting work prematurely.

How do I clean up a git worktree after merging a branch?

Git worktree cleanup after a branch merge removes the working directory only if it was created under recognized provenance paths, preserving the workspace for ongoing pull request iteration when needed.

What is the best way to handle a detached HEAD state before finishing a git branch?

Handling a detached HEAD state when finishing a branch requires detecting the git workspace state and adapting integration options accordingly, offering merge, pull request, keep, or discard actions specific to the detached context.

Do I need to run tests before merging a git branch?

Yes, running tests before merging a git branch is required as a completion gate, verifying the project test suite passes before presenting any integration or cleanup options to prevent merging broken code.

Can I discard git branch changes without accidental data loss?

You can discard git branch changes safely by requiring a typed confirmation before executing the discard action, ensuring intentional data loss prevention during the branch finishing workflow.

Does finishing a branch work differently in a git worktree versus a normal repository?

Finishing a branch in a git worktree versus a normal repository adapts offered options based on environment detection, applying correct cleanup rules for named-branch worktrees while preserving standard repository merge workflows.