skills/superpowers/finishing-a-development-branch/SKILL.md
Use when implementation is complete and all tests pass, to choose and execute the integration path: merge locally, push PR, keep as-is, or discard.
npx skillsauth add jbro/pi-agent finishing-a-development-branchInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Guide completion of development work by presenting clear options and handling the 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."
npm test / cargo test / pytest / go test ./...
If tests fail — show failures, stop. Do not proceed to Step 2.
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?"
For polished user-facing status/PR text, use the writing-clearly-and-concisely skill.
Implementation complete. What would you like to do?
1. Merge back to <base-branch> locally
2. Push and create a Pull Request
3. Keep the branch as-is (I'll handle it later)
4. Discard this work
Which option?
git checkout <base-branch>
git pull
git merge <feature-branch>
<test command> # re-verify on merged result
git branch -d <feature-branch>
Then: Step 5 (cleanup worktree).
git push -u origin <feature-branch>
gh pr create --title "<title>" --body "$(cat <<'EOF'
## Summary
<2-3 bullets of what changed>
## Test Plan
- [ ] <verification steps>
EOF
)"
Then: Step 5 (cleanup worktree).
Report: "Keeping branch <name>. Worktree preserved at <path>." Do not clean up.
Confirm first:
This will permanently delete:
- Branch <name>
- All commits: <commit-list>
- Worktree at <path>
Type 'discard' to confirm.
Wait for exact word. If confirmed:
git checkout <base-branch>
git branch -D <feature-branch>
Then: Step 5 (cleanup worktree).
git worktree list | grep $(git branch --show-current)
git worktree remove <worktree-path>
| Option | Merge | Push | Keep Worktree | Delete Branch | |--------|-------|------|---------------|---------------| | 1. Merge locally | ✓ | — | — | ✓ | | 2. Create PR | — | ✓ | ✓ | — | | 3. Keep as-is | — | — | ✓ | — | | 4. Discard | — | — | — | ✓ (force) |
Never:
Always:
Called by: executing-plans (Step 5) after all batches complete
Pairs with: using-git-worktrees — cleans up the worktree created by that skill
testing
Use when writing or editing human-facing prose that needs clearer, more concise wording.
development
Use when you have a spec or requirements for a multi-step task, before touching code
data-ai
Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
tools
Use when starting any conversation or task, to determine which skills apply before responding or taking any action.