finishing-a-development-branch

Verify tests and choose one of four Git branch completion actions.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Finishing a development branch often becomes risky or confusing when tests have run but the next steps for merge, PR, or cleanup are unclear, leading to broken integration or accidental loss of work.

Core Features & Use Cases

  • Test-Gated Completion: Requires verifying the project test suite before offering any merge/PR/discard actions.
  • Four Structured End-State Options: Presents exactly four concise choices (merge locally, push + PR, keep as-is, discard) to remove ambiguity.
  • Worktree-Aware Cleanup: Performs safe cleanup for merge/PR/discard scenarios while preserving the worktree only when the user explicitly chooses to keep it.

Use case example: After implementing a feature and running CI successfully, use this skill to decide whether to merge back into the correct base branch, open a pull request, keep the branch for later, or discard it with a typed confirmation.

Quick Start

Use the finishing-a-development-branch skill to complete your development work by verifying tests, choosing one of four integration options, and performing the corresponding cleanup steps.

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 after tests pass?

This skill guides finishing a git development branch by requiring test verification first, then offering exactly four explicit choices: merge locally into the derived base branch, push to create a pull request, keep the branch as-is, or discard it with confirmation.

What are the options for integrating a feature branch back into a base branch?

The options for integrating a feature branch are merging locally into the derived base branch, pushing to open a pull request, retaining the branch for later work, or discarding it entirely. Worktree-aware cleanup is automatically performed for merge, PR, and discard paths.

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

Yes, test verification is required before any merge, pull request, or discard actions are offered. This test-gated completion mechanism ensures your project test suite passes successfully, preventing broken integration or accidental loss of work before finalizing the branch.

Can I keep a git worktree after deciding not to merge a feature branch?

Yes, you can keep a git worktree by selecting the option to retain the branch as-is. Worktree-aware cleanup is only performed for the merge, pull request, and discard paths, deliberately preserving your worktree when you explicitly choose to keep the branch.

What's the best way to clean up git worktrees when discarding a branch?

The best way to clean up git worktrees when discarding a branch is to use a worktree-aware cleanup process that requires typed confirmation. This ensures safe removal of the discarded branch while preventing accidental loss of validated work during the discard workflow.