From super-radical-powers
Use ONLY at the end of a full plan/sprint when EVERY task is complete and tests pass — invoked once by subagent-driven-development or executing-plans after the final task, never after an individual task, mid-session, or whenever implementation "feels done". Guides merge/PR/keep/discard with archive-tagging so the feature branch is preserved for rewind/history.
How this skill is triggered — by the user, by Claude, or both
Slash command
/super-radical-powers:finishing-a-development-branchThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Guide completion of development work by presenting clear options and handling chosen workflow.
Guide completion of development work by presenting clear options and handling 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."
Before presenting options, verify tests pass:
# Run project's test suite
npm test / cargo test / pytest / go test ./...
If tests fail:
Tests failing (<N> failures). Must fix before completing:
[Show failures]
Cannot proceed with merge/PR until tests pass.
Stop. Don't proceed to Step 2.
If tests pass: Continue to Step 2.
Passing unit tests are not proof the feature is connected. Before presenting options, verify the feature was wired to be fully functional for its intended purpose:
If the feature is unwired with no documented exception — components built and unit-tested but never attached to their real entry point — STOP. This is the failure this gate exists to catch. Report it, then wire it (or get an explicit documented wiring exception from your human partner) before proceeding to options.
See skills/shared/task-format-reference.md for the wiring vocabulary.
# Try common base branches
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?"
Present exactly these 4 options:
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?
Don't add explanation - keep options concise.
# Switch to base branch
git checkout <base-branch>
# Pull latest
git pull
# Merge feature branch with --no-ff so the branch context is preserved
# in the merge commit (even after the branch ref is gone, the merge
# commit shows where the work came from).
# Record the Step 1.5 wiring status in the merge commit — especially a
# documented wiring exception — so the record survives on the base branch.
git merge --no-ff <feature-branch> \
-m "Merge <feature-branch>" \
-m "Wiring: <Wired via <entry point>, verified by <command> —OR— Documented wiring exception: <what's unwired> / blocker: <blocker> / follow-up: <issue>>"
# Verify tests on merged result
<test command>
# Tag the merged work — this is the rewind/history anchor.
# The tag survives even if someone later deletes the branch,
# and it makes the merge point easy to find (`git tag -l "archive/*"`).
git tag -a "archive/<feature-branch>" -m "Merged <feature-branch> into <base-branch>"
# DO NOT delete the feature branch by default.
# Keeping it gives a named pointer for rewind and history navigation.
# Only delete if the human partner explicitly asks for cleanup, e.g.:
# git branch -d <feature-branch>
# (The archive tag still preserves history in that case.)
Then ask:
Merge complete. Would you like to clean up the completed work?
a) Delete the feature branch (<feature-branch>) only
b) Remove the worktree at <path> only
c) Clean up both branch and worktree
d) Keep everything as-is
Note: The archive tag preserves history regardless of branch/worktree cleanup.
Execute whichever combination they choose. Then: Step 5.
# Push branch
git push -u origin <feature-branch>
# Create PR
gh pr create --title "<title>" --body "$(cat <<'EOF'
## Summary
<2-3 bullets of what changed>
## Wiring Status
<"Wired end-to-end via <entry point>, verified by <command>" — OR — "Documented wiring exception: <what's unwired> / blocker: <blocker> / follow-up: <issue>">
## Test Plan
- [ ] <verification steps>
EOF
)"
Then offer: "Once the PR is approved and merged on GitHub, let me know and I can clean up the branch and worktree." Then: Step 5.
Report: "Keeping branch . Worktree preserved at ."
Don't cleanup worktree.
Confirm first:
This will permanently delete:
- Branch <name>
- All commits: <commit-list>
- Worktree at <path>
Type 'discard' to confirm.
Wait for exact confirmation.
If confirmed:
git checkout <base-branch>
git branch -D <feature-branch>
Then: Cleanup worktree (Step 5)
For Option 1 (Merge Locally): After successful merge, proactively ask about cleanup using the prompt in Option 1 above. Execute whichever combination the human partner chooses (branch only, worktree only, both, or neither).
For Option 4 (Discard): Always remove the worktree.
For Options 2 and 3: Keep worktree. For Option 2, offer: "Once the PR is approved and merged on GitHub, let me know and I can clean up the branch and worktree."
Check if in worktree:
git worktree list | grep $(git branch --show-current)
If removing:
git worktree remove <worktree-path>
| Option | Merge | Push | Tag | Keep Branch | Keep Worktree |
|---|---|---|---|---|---|
| 1. Merge locally | ✓ (--no-ff) | - | ✓ archive/<name> | Ask | Ask |
| 2. Create PR | - | ✓ | - | ✓ | ✓ (offer cleanup after PR merged) |
| 3. Keep as-is | - | - | - | ✓ | ✓ |
| 4. Discard | - | - | - | - (force delete) | - |
Skipping test verification
Open-ended questions
Automatic worktree cleanup
Deleting the feature branch on merge
git branch -d <feature> after merge removes the named pointer to the work, making rewind/history-navigation harder even though commits still exist on the base brancharchive/<branch> tag. Only delete on explicit request from the human partner.Fast-forward merge erases branch context
git merge may fast-forward, leaving no merge commit to show the work came from a feature branchgit merge --no-ff in Option 1 so a merge commit records the integration pointNo confirmation for discard
Merging an unwired feature
Never:
archive/ tag instead--no-ff to preserve branch contextAlways:
archive/<feature-branch> tag on Option 1 before any cleanup discussionCalled by:
Pairs with:
npx claudepluginhub radicaldo/super-radical-powers --plugin super-radical-powersCreates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.