finishing-a-development-branch

Guides completion of development branches through merge, pull request, keep, or discard workflows.

Updated May 16, 2026
One-click install
npx skills add https://github.com/michalo1334/ScenarioImpactDSL --skill finishing-a-development-branch-michalo1334
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: finishing-a-development-branch
Source: https://github.com/michalo1334/ScenarioImpactDSL/tree/main/.opencode/skills/finishing-a-development-branch
Command: npx skills add https://github.com/michalo1334/ScenarioImpactDSL --skill finishing-a-development-branch-michalo1334

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When implementation work is done, developers often face an ambiguous decision point: merge locally, open a pull request, keep the branch, or discard it. This Skill removes that ambiguity by verifying tests, detecting the git environment, and presenting a structured set of options with safe execution and cleanup. ## Core Features & Use Cases - Test Gate Before Completion: Runs the project's test suite first and refuses to proceed with merge or PR creation if any tests fail. - Environment-Aware Options: Detects normal repos, named-branch worktrees, and detached HEAD states, then presents the correct 4-option or 3-option menu. - Safe Worktree Cleanup: Uses provenance checks to only remove worktrees it created, changes to the main repo root before removal, and runs git worktree prune for self-healing. - Use Case: After finishing a feature in a git worktree, invoke this Skill to verify tests pass, choose "Push and create a Pull Request", and have the branch pushed with a structured PR body while the worktree is preserved for review iteration. ## Quick Start Ask the assistant to finish the current development branch and walk you through merge, pull request, keep, or discard options.

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 after implementation?▼

Verify the test suite passes first, then choose between merging locally, pushing and creating a pull request, keeping the branch, or discarding it. The Skill presents these as structured options and executes the chosen workflow with proper cleanup.

How to merge a git worktree branch back to main?▼

Change to the main repo root, check out the base branch, pull, merge the feature branch, and re-run tests on the merged result. Only after the merge succeeds should you remove the worktree and delete the branch.

Can I create a pull request from a detached HEAD state?▼

Yes, but the merge option is unavailable on a detached HEAD. The Skill presents a reduced 3-option menu: push as a new branch and create a PR, keep as-is, or discard the work.

Why does git branch -d fail when a worktree exists?▼

Branch deletion fails because the worktree still references the branch. Remove the worktree first with git worktree remove from the main repo root, then delete the branch.

When should a worktree not be cleaned up after finishing work?▼

Do not remove the worktree when creating a pull request or keeping the branch, since it is needed for PR iteration. Also never remove worktrees created by an external harness; only clean up worktrees under .worktrees/, worktrees/, or the superpowers config path.