From superpowers-beads
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
How this skill is triggered — by the user, by Claude, or both
Slash command
/superpowers-beads: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 verifying evidence, checking beads hygiene, and integrating through the appropriate branch workflow.
Guide completion of development work by verifying evidence, checking beads hygiene, and integrating through the appropriate branch workflow.
Core principle: Verify tests -> run beads preflight -> present options -> execute choice -> clean up.
Announce at start: "I'm using the finishing-a-development-branch skill to complete this work."
Use superpowers:verification-before-completion before any completion claim.
Run the project-specific verification commands fresh:
<test command>
<lint command>
<build or validation command>
If any verification fails:
Verification failed. Cannot proceed with merge or PR.
<show failing command and key output>
Stop. Fix the issue or create a follow-up blocker bead.
Run beads hygiene checks before integration. If the repo defines its own preflight script (e.g. scripts/preflight.sh), prefer that — it bundles the project-specific gates plus the beads checks. Otherwise fall back to the bd commands directly:
scripts/preflight.sh # if the repo provides one
# or, when no project-specific script exists:
bd preflight
bd orphans
bd stale
bd list --status=in_progress
bd preflight --check ships a default checklist tuned for Go/Nix projects; if it reports non-applicable checks, record that explicitly and run the applicable commands from its printed checklist manually rather than treating the whole step as failed.
Block merge or PR creation when:
Resolve hygiene issues before proceeding:
bd close <completed-id> --reason="<verified completion summary>"
bd update <still-active-id> --append-notes="<handoff or blocker>"
bd create --type=task --parent=<epic-id> --title="<follow-up>" --description="<remaining work>"
git branch --show-current
git status --short --branch
git merge-base HEAD origin/main
Default to main unless the issue or human partner names a different base branch.
Present exactly these options:
Implementation verified and beads preflight checked. What would you like to do?
1. Push branch and create a Pull Request
2. Merge back to <base-branch> locally
3. Keep the branch as-is
4. Discard this work
Which option?
For protected main, recommend option 1.
git push -u origin <feature-branch>
gh pr create --base <base-branch> --head <feature-branch> \
--title "<title>" \
--body "<summary, verification, and beads IDs>"
gh pr checks <pr-number> --watch
If required checks pass and policy permits merge:
gh pr merge <pr-number> --squash --delete-branch
After merge:
git status --short --branch
bd dolt pull
bd dolt push
If no Dolt remote is configured, stop and record the gap before claiming the beads handoff is complete. In Dolt-native repositories, bead changes do not travel through git-tracked JSONL by default.
Only use this when branch protection does not require PRs or the human partner explicitly asks for local merge.
git switch <base-branch>
git pull --rebase
git merge --ff-only <feature-branch> || git merge <feature-branch>
<test command>
bd preflight --check
git push
git branch -d <feature-branch>
Do not merge locally if verification or beads preflight fails.
Report:
Keeping branch <feature-branch>. Current state:
<git status --short --branch>
Do not clean up the branch or worktree.
Confirm first:
This will permanently delete:
- Branch <feature-branch>
- Commits: <commit-list>
- Worktree at <path, if any>
Type 'discard' to confirm.
Wait for exact confirmation. If confirmed:
git switch <base-branch>
git branch -D <feature-branch>
Only remove a worktree after confirmation.
For merged or discarded branches, check whether this is a separate worktree:
bd worktree list
Remove only the completed feature worktree:
bd worktree remove <worktree-path>
For option 3, keep the worktree.
| Option | Merge | Push | PR | Keep Worktree | Cleanup Branch |
|---|---|---|---|---|---|
| 1. Create PR | via PR | yes | yes | usually yes | after merge |
| 2. Merge locally | yes | yes | no | no | yes |
| 3. Keep as-is | no | no | no | yes | no |
| 4. Discard | no | no | no | no | force delete |
Skipping verification
Skipping beads preflight
bd preflight, bd orphans, bd stale, and bd list --status=in_progress.Creating PR with unresolved beads
Automatic cleanup
No confirmation for discard
discard confirmation.Never:
Always:
superpowers:verification-before-completion.main.Called by:
superpowers:subagent-driven-development after all issues close.superpowers:executing-plans after all ready issues complete.Pairs with:
superpowers:using-git-worktrees for worktree cleanup.superpowers:verification-before-completion for evidence before closing.Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub jbongaarts/superpowers-beads --plugin superpowers-beads