finishing-a-development-branch

Guides completion of development branches through structured merge, PR, keep, or discard options.

Updated Jun 20, 2026
One-click install
npx skills add https://github.com/dchavez3395/Puchica-hydrogen --skill finishing-a-development-branch-dchavez3395
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: finishing-a-development-branch
Source: https://github.com/dchavez3395/Puchica-hydrogen/tree/main/docs/superpowers/skills/openclaw-ports/finishing-a-development-branch
Command: npx skills add https://github.com/dchavez3395/Puchica-hydrogen --skill finishing-a-development-branch-dchavez3395

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When implementation work is done, developers often face an ambiguous "what now?" moment — risking merging broken code, deleting work accidentally, or leaving stale branches and worktrees behind. This Skill replaces that ambiguity with a verified, structured completion workflow. ## Core Features & Use Cases - Test-First Verification: Runs the project's test suite (or npm run build + npm run lint for repos without tests) before offering any completion option, blocking merges of failing code. - Environment-Aware Options: Detects normal repos, named-branch worktrees, and detached HEAD states via git internals, then presents exactly 4 options (merge locally, push and create PR, keep as-is, discard) or 3 for detached HEAD. - Safe Cleanup with Provenance: Removes only self-created worktrees under .worktrees/ or worktrees/, requires typed "discard" confirmation for deletion, and runs git worktree prune after removal. - Use Case: After finishing a feature on a branch in a git worktree, invoke this Skill to verify tests pass, choose "merge back to main locally", and have the worktree removed and branch deleted in the correct order. ## Quick Start Ask the assistant to finish the current development branch using the finishing-a-development-branch skill after all 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 finish a git feature branch after implementation?▼

First verify the test suite passes, then choose between merging locally, pushing a PR, keeping the branch, or discarding it. This Skill automates that flow, including worktree cleanup and branch deletion in the correct order.

How to clean up a git worktree after merging a branch?▼

Merge the branch first and verify tests on the result, then cd to the main repo root and run git worktree remove followed by git worktree prune. Only then delete the branch with git branch -d, since deletion fails while a worktree references it.

What if my repo has no test suite to verify before merging?▼

The Skill falls back to running npm run build and npm run lint as the verification gate for repos without tests. Both must pass before any merge, PR, or discard option is offered.

Why does git branch -d fail after merging?▼

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

When should I not remove a worktree after finishing work?▼

Never remove a worktree when creating a pull request, since you need it to iterate on review feedback, or when the worktree was created by an external harness rather than by you. Only clean up worktrees under .worktrees/ or worktrees/ directories.