/fiddle:finish-branchfrom fiddle
Guides completion of development work by verifying tests and presenting structured options for merge, PR, or cleanup.
Ships in fiddle. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Verify tests, present the integration options, execute the chosen one, then clean up.
Verify the test suite passes before presenting options — the options are all ways of shipping the work, and none of them are available for work that does not pass.
# Run project's test suite
npm test / cargo test / pytest / go test ./...
If tests fail, report and stop here:
Tests failing (<N> failures). Must fix before completing:
[Show failures]
Cannot proceed with merge/PR until tests pass.
If tests pass, continue to Step 2.
# 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 four options, with no added explanation — an open-ended "what next?" produces an ambiguous answer:
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?
# Switch to base branch
git checkout <base-branch>
# Pull latest
git pull
# Merge feature branch
git merge <feature-branch>
# Verify tests on merged result
<test command>
# If tests pass
git branch -d <feature-branch>
The merged result gets its own test run: two branches that each pass can still conflict semantically. Then clean up the worktree (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>
## Test Plan
- [ ] <verification steps>
EOF
)"
Keep the worktree: review feedback usually lands back on this branch. Force-push only when the user explicitly asks for it.
Report: "Keeping branch . Worktree preserved at ." Keep the worktree.
Discarding is irreversible, so it takes a typed confirmation naming what will be lost — an accidental "yes" cannot recover the commits:
This will permanently delete:
- Branch <name>
- All commits: <commit-list>
- Worktree at <path>
Type 'discard' to confirm.
Wait for that exact word. Anything else is not a confirmation. Once confirmed:
git checkout <base-branch>
git branch -D <feature-branch>
Then clean up the worktree (Step 5).
For Options 1 and 4, check whether you are in a worktree and remove it:
git worktree list | grep $(git branch --show-current)
git worktree remove <worktree-path>
For Options 2 and 3, keep the worktree.
| Option | Merge | Push | Keep Worktree | Cleanup Branch |
|---|---|---|---|---|
| 1. Merge locally | ✓ | - | - | ✓ |
| 2. Create PR | - | ✓ | ✓ | - |
| 3. Keep as-is | - | - | ✓ | - |
| 4. Discard | - | - | - | ✓ (force) |
Called by:
Pairs with:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
git-workflow, branch-management, merge, pull-request, cleanup
Other plugins' skills for the same job
28 skills in this plugin
/adrUse when recording a consequential technical decision; captures context, the chosen option, and consequences in a new architecture decision record./backlogUse when capturing an idea, technical debt, or observation that is not ready for a planned bean./brainstormUse before creative work or behavior changes to clarify intent, explore tradeoffs, and produce an approved design./challengeUse when a plan or design needs assumptions, constraints, and decision branches resolved before progressing./debugUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes/defineUse after discovery to turn confirmed scope into an approved design, implementation plan, and ready-to-execute beans.npx claudepluginhub peel/fiddle --plugin fiddle