finishing-a-development-branch

Guides completion of development branches through structured merge, pull request, or cleanup options.

Updated Sep 16, 2022
One-click install
npx skills add https://github.com/ryuya-matsunawa/dotfiles --skill finishing-a-development-branch-ryuya-matsunawa
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: finishing-a-development-branch
Source: https://github.com/ryuya-matsunawa/dotfiles/tree/main/agents/.agents/skills/finishing-a-development-branch
Command: npx skills add https://github.com/ryuya-matsunawa/dotfiles --skill finishing-a-development-branch-ryuya-matsunawa

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 first, detecting the git environment, and presenting a fixed set of structured options with safe execution and cleanup. ## Core Features & Use Cases - Test-Gated Completion: Runs the project's test suite before offering any options and refuses to proceed if tests fail. - Environment Detection: Distinguishes normal repositories, named-branch worktrees, and detached HEAD states to present the correct option menu. - Safe Cleanup: Removes only self-created worktrees under .worktrees/ or worktrees/, requires typed confirmation before discarding work, and runs git worktree prune after removal. - 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 the worktree preserved for PR iteration. ## Quick Start Ask the assistant to finish the current development branch and present the available completion 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 finish a development branch after implementation is complete?▼

Verify the test suite passes first, then choose from four structured options: merge back to the base branch locally, push and create a pull request, keep the branch as-is, or discard the work. The correct menu depends on whether you are in a normal repo, worktree, or detached HEAD state.

How to safely remove a git worktree after merging a branch?▼

Merge and verify tests first, then cd to the main repository root before running git worktree remove, since running it from inside the worktree fails silently. Follow with git worktree prune to clean stale registrations, then delete the branch.

Should I clean up the worktree when creating a pull request?▼

No. When pushing a branch to create a pull request, the worktree must be preserved so you can iterate on review feedback. Worktree cleanup only applies to the local merge and discard options.

What happens if tests fail before merging a feature branch?▼

The process stops immediately and reports the failing tests. No merge, pull request, or cleanup options are presented until all tests pass, preventing broken code from being integrated.

Can I discard a development branch without confirmation?▼

No. Discarding work requires typing the exact word 'discard' after reviewing the branch name, commit list, and worktree path that will be permanently deleted. This prevents accidental loss of unmerged work.