| name | finishing-a-development-branch |
| version | 1.0.0 |
| description | Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup |
| dependencies | {"@skill-module-example/using-git-worktrees":"^1.0.0"} |
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.
The Process
Step 1: Verify Tests
Before presenting options, verify tests pass. If tests fail, stop and fix them first.
Step 2: Determine Base Branch
Identify the base branch this feature branch split from.
Step 3: Present Options
Present exactly these 4 options:
- Merge back to base-branch locally
- Push and create a Pull Request
- Keep the branch as-is (I'll handle it later)
- Discard this work
Step 4: Execute Choice
Option 1: Merge Locally
Switch to base branch, pull latest, merge feature branch, verify tests, delete feature branch.
Option 2: Push and Create PR
Push branch, create PR with summary and test plan.
Option 3: Keep As-Is
Report branch name and worktree location. Don't cleanup worktree.
Option 4: Discard
Confirm first with explicit typed confirmation. Delete branch and cleanup.
Step 5: Cleanup Worktree
For Options 1, 2, 4: Remove worktree if applicable.
For Option 3: Keep worktree.
Quick Reference
| Option | Merge | Push | Keep Worktree | Cleanup Branch |
|---|
| 1. Merge locally | ✓ | - | - | ✓ |
| 2. Create PR | - | ✓ | ✓ | - |
| 3. Keep as-is | - | - | ✓ | - |
| 4. Discard | - | - | - | ✓ (force) |
Red Flags
Never:
- Proceed with failing tests
- Merge without verifying tests on result
- Delete work without confirmation
- Force-push without explicit request