davila7 avatar

Finishing A Development Branch

When your feature branch is done and tests are green, this walks you through the four main options: merge locally, push and create a PR, keep it as is, or discard the work. It runs your test suite first and won't let you proceed if anything fails, then presents a clean decision menu. The smart bit is it handles the worktree cleanup automatically for local merges and discards but leaves it intact when you're creating a PR or explicitly keeping the branch around. Requires typed confirmation before deleting work. Designed to be called by subagent-driven-development and executing-plans skills when they finish their work.

skills.sh installs
280
GitHub stars
33.2K
last updated
Aug 21, 2026

Install

$ npx -y skills add davila7/claude-code-templates --skill finishing-a-development-branch --agent claude-code

Installs into .claude/skills of the current project.

Files

Finishing a Development Branch

Overview

Guide completion of development work by presenting clear options and handling chosen workflow.

Core principle: Verify tests → Present options → Execute choice → Clean up.

Announce at start: "I'm using the finishing-a-development-branch skill to complete this work."

The Process

Step 1: Verify Tests

Before presenting options, verify tests pass:

# Run project's test suite
npm test / cargo test / pytest / go test ./...

If tests fail:

Tests failing (<N> failures). Must fix before completing:

[Show failures]

Cannot proceed with merge/PR until tests pass.

Stop. Don't proceed to Step 2.

If tests pass: Continue to Step 2.

Step 2: Determine Base Branch

# Try common base branches
git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null

Or ask: "This branch split from main - is that correct?"

Step 3: Present Options

Present exactly these 4 options:

Implementation complete. What would you like to do?

Sponsors

Details

Repository
github.com/davila7/claude-code-templates
Category
Git & Pull Requests
First seen
Jun 3, 2026

More from davila7/claude-code-templates

All 618
1mitsuhiko avatarcommitmitsuhiko/agent-stuffRead this skill before making git commits275skills.sh installs
2patricio0312rev avatarsecurity-pr-checklist-skillpatricio0312rev/skillsCreates repeatable security review checklist for PRs with required checks, common pitfalls, and automated gating. Use for "security review", "PR checklist", "co271skills.sh installs
3everyinc avatarresolve-pr-feedbackeveryinc/compound-engineering-pluginResolve PR review feedback by evaluating validity and fixing issues in parallel. Use when addressing PR review comments, resolving review threads, or fixing cod243skills.sh installs
4everyinc avatargit-clean-gone-brancheseveryinc/compound-engineering-pluginClean up local branches whose remote tracking branch is gone. Use when the user says "clean up branches", "delete gone branches", "prune local branches", "clean231skills.sh installs
5siviter-xyz avatarsemantic-gitsiviter-xyz/dot-agentManage Git commits using conventional commit format with atomic staging. Always generate plain git commands before running them and offer to let the user run th201skills.sh installs
6cherryhq avatargh-create-issuecherryhq/cherry-studioAutomates GitHub issue creation while respecting your repository's template structure.0skills.sh installs