| name | finishing-a-development-branch |
| description | Guides the process of completing a feature branch — verifying tests, choosing merge/PR/keep/discard, and cleaning up the worktree. Use when all tasks on a feature branch are done, or when the user says "I'm done", "ready to merge", "wrap this up", or "finish the branch". Always verify tests pass and get an explicit merge decision before cleanup. |
Finishing a Development Branch
Announce: "I'm using the finishing-a-development-branch skill."
Step 1: Final Verification
Before anything else, confirm the branch is actually done:
[your test command]
git status
git diff main...HEAD --stat
git log main..HEAD --oneline
If tests are failing: do not proceed. Fix the failures first.
Step 2: Self-Review
Read through the diff with fresh eyes:
git diff main...HEAD
Ask:
- Does this match the spec/plan?
- Any debug code, TODOs, or print statements left in?
- Any files accidentally modified?
Step 3: Choose a Path
Present these options to the user:
A) Merge directly
cd ../project-main
git merge feature/feature-name
git worktree remove ../project-feature-name
git branch -d feature/feature-name
B) Open a Pull Request
git push origin feature/feature-name
C) Keep branch, not merging yet
git push origin feature/feature-name
git worktree remove ../project-feature-name
D) Discard the work
cd ../project-main
git worktree remove ../project-feature-name
git branch -D feature/feature-name
Step 4: Cleanup
After merge (options A or after B's PR merges):
git worktree remove ../project-feature-name
git branch -d feature/feature-name
git push origin --delete feature/feature-name
Checklist