From superpowers
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 integration, PR, or cleanup
How this skill is triggered — by the user, by Claude, or both
Slash command
/superpowers: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 / uv run pytest / go test ./...
If tests fail:
Tests failing (<N> failures). Must fix before completing:
[Show failures]
Cannot proceed with integration/PR until tests pass.
Stop. Don't proceed to Step 2.
If tests pass: Continue to Step 2.
# Check where your work diverged from trunk
jj log
# Identify the base - typically trunk() or the 'main' bookmark
jj log -r "trunk()"
jj log -r "bookmarks(exact:main)"
Or ask: "This work is based on main - is that correct?"
Present exactly 4 options:
Implementation complete. What would you like to do?
1. Integrate into main locally (rebase + move bookmark)
2. Push and create a Pull Request
3. Keep the work as-is (I'll handle it later)
4. Discard this work
Which option?
Don't add explanation - keep options concise.
# Rebase your changes onto trunk if needed
jj rebase -r <your-changes> -d 'trunk()'
# Move the main bookmark forward
jj bookmark set main -r <your-final-change>
# Or if the user has the 'tug' alias:
jj tug
# Verify tests on integrated result
<test command>
# Verify
jj log -r 'trunk()..@'
# Start fresh
jj new
Then: Cleanup workspace (Step 5), then Post-Integration Cleanup (Step 6)
# Ensure change has good description
jj desc -r <your-change> -m "<meaningful description>"
# Set a bookmark on your work if not already set
jj bookmark set <feature-name> -r <your-change>
# Push the bookmark
jj git push --remote origin -b <feature-name> --allow-new
# Create PR
gh pr create --title "<title>" --body "$(cat <<'EOF'
## Summary
<2-3 bullets of what changed>
## Test Plan
- [ ] <verification steps>
EOF
)"
Keep the workspace until PR is merged. Don't cleanup.
# Ensure it has a good description so you remember what it is
jj desc -r <your-change> -m "WIP: <what this is and what's left to do>"
# Optionally bookmark it for easy reference
jj bookmark set wip-<feature-name> -r <your-change>
Report: "Keeping work at revision . Workspace preserved at ."
Don't cleanup workspace.
Confirm first:
This will permanently discard:
- Changes: <change-list>
- Workspace at <path> (if applicable)
Type 'discard' to confirm.
Wait for exact confirmation.
If confirmed:
jj abandon <revisions-to-discard>
Then: Cleanup workspace (Step 5)
For Options 1, 2, 4:
Check if working in a jj workspace:
jj workspace list
If in a workspace other than the default:
# Return to main workspace
cd <repo-root>
# Forget the workspace record
jj workspace forget <workspace-name>
# Remove the directory (verify path first!)
rm -rf <workspace-path>
For Option 3: Keep workspace.
After integration, especially if there were conflicts:
# Clean any stale jj artifacts from git's index
# (jj uses git for storage, conflict markers can get stuck)
git status --porcelain | grep -E "\.jj-" && git rm --cached .jj-* 2>/dev/null
# Verify environment still works
direnv allow 2>/dev/null
# Run the actual app, not just tests
# (tests use temp dirs, won't catch missing production paths)
make serve # or equivalent
| Option | Integrate | Push | Keep Workspace | Cleanup | Post-Integration |
|---|---|---|---|---|---|
| 1. Integrate locally | ✓ | - | - | ✓ | ✓ |
| 2. Create PR | - | ✓ | ✓ | - | - |
| 3. Keep as-is | - | - | ✓ | - | - |
| 4. Discard | - | - | - | ✓ | - |
Skipping test verification
Open-ended questions
Automatic workspace cleanup
No confirmation for discard
Never:
git merge, git checkout, git branch - use jj equivalentsjj workspace forgetAlways:
rm -rfCalled by:
Pairs with:
npx claudepluginhub paulsmith/superpowersCreates 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.