finishing-a-development-branch

Guides merging, pull request creation, or cleanup of completed Git development branches.

Updated Jun 11, 2026
One-click install
npx skills add https://github.com/marcocpt/trae_skills --skill finishing-a-development-branch-marcocpt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: finishing-a-development-branch
Source: https://github.com/marcocpt/trae_skills/tree/main/finishing-a-development-branch
Command: npx skills add https://github.com/marcocpt/trae_skills --skill finishing-a-development-branch-marcocpt

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When a feature branch is finished and tests pass, developers often face an ambiguous "what now?" moment that leads to skipped test verification, accidental work deletion, or forgotten worktree cleanup. This Skill structures the end-of-branch workflow into verified steps and explicit choices. ## Core Features & Use Cases - Test Gate Before Integration: Runs the project's test suite (npm test, cargo test, pytest, go test) and blocks any merge or PR until all tests pass. - Four Structured Options: Presents exactly four choices—local merge, push and create PR, keep branch as-is, or discard work—then executes the selected workflow with the correct git commands. - Safe Cleanup and Confirmation: Requires typing "discard" before deleting work, and removes git worktrees only for merge and discard paths. - Use Case: After completing a feature in a git worktree, invoke this Skill to verify tests, create a pull request via gh pr create, and clean up the worktree without manual git juggling. ## Quick Start Use the finishing-a-development-branch skill to wrap up my completed feature branch and help me decide whether to merge it or open a pull request.

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 finish a Git feature branch after development is complete?

First verify the test suite passes, then choose one of four options: merge locally into the base branch, push and create a pull request, keep the branch as-is, or discard the work. Each option runs the corresponding git commands and handles worktree cleanup.

How to create a pull request from a feature branch using the gh CLI?

Push the branch with git push -u origin <branch>, then run gh pr create with a title and body containing a summary of changes and a test plan checklist. The Skill generates this command sequence automatically when you choose the PR option.

Can I merge a branch if some tests are failing?

No. The workflow stops immediately when tests fail and reports the failure count. Merging or creating a PR is blocked until all tests pass, 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, using git worktree remove. When creating a PR or keeping the branch, the worktree is preserved since the work may still be needed.

How do I safely delete a Git branch without losing work?

Require explicit typed confirmation before deletion. The discard option lists the branch name, all commits, and the worktree path, then waits for the exact input "discard" before running git branch -D.