finishing-a-development-branch

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

Updated Dec 20, 2025
One-click install
npx skills add https://github.com/cristoslc/LLM-personal-agent-patterns --skill finishing-a-development-branch-cristoslc
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: finishing-a-development-branch
Source: https://github.com/cristoslc/LLM-personal-agent-patterns/tree/main/L3-agents-core/.agents/skills/finishing-a-development-branch
Command: npx skills add https://github.com/cristoslc/LLM-personal-agent-patterns --skill finishing-a-development-branch-cristoslc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When implementation work is done, developers often face an ambiguous "what now?" moment that leads to broken merges, forgotten worktrees, or accidentally deleted work. This Skill enforces a disciplined completion workflow: verify tests, present clear options, execute the chosen path, and clean up safely. ## Core Features & Use Cases - Test Gate Before Completion: Runs the project's test suite first and blocks any merge or PR if tests fail, preventing broken code from reaching the base branch. - Four Structured Options: Presents exactly four choices — merge locally, push and create a PR, keep the branch as-is, or discard — eliminating open-ended ambiguity. - Safe Cleanup and Discard Protection: Requires typed "discard" confirmation before deleting work, and only removes git worktrees for options where they are no longer needed. - Use Case: After finishing a feature branch in a git worktree, invoke this Skill to verify tests pass, create a pull request via gh pr create, and clean up the worktree in one guided flow. ## Quick Start Ask the agent to finish the current development branch and walk you through the merge, PR, keep, or discard options after verifying 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 project's test suite passes, then choose between merging locally into the base branch, pushing and creating a pull request, keeping the branch, or discarding it. This Skill walks through each path with the exact git commands.

How to create a pull request from a feature branch with GitHub CLI?▼

Push the branch with git push -u origin, then run gh pr create with a title and body containing a summary and test plan. The Skill generates this PR template automatically when you choose the pull request option.

What happens if tests fail before merging a branch?▼

The workflow stops immediately and reports the failing tests. No merge or pull request is offered until the failures are fixed and the test suite passes, preventing broken code from reaching the base branch.

When should I clean up a git worktree after finishing a branch?▼

Remove the worktree only after a local merge or a confirmed discard. Keep it when creating a pull request or keeping the branch as-is, since the work may still need review or further changes.

How do I discard a development branch without losing work accidentally?▼

The Skill lists the branch, commits, and worktree that will be deleted, then requires you to type the exact word "discard" to confirm. It then force-deletes the branch with git branch -D and removes the worktree.