Use this skill when implementation is complete and ready to merge, after all stories are done, or when asked what to do with a feature branch. Provides structured options for branch completion.
This skill inherits all available tools. When active, it can use any tool Claude has access to.
Structured process for completing work on a feature branch. Provides exactly 4 options - no variations.
MANDATORY: Run full test suite before presenting options.
npm test # Node.js
pytest # Python
go test ./... # Go
cargo test # Rust
If tests fail: STOP. Cannot proceed.
Tests are failing. Cannot complete branch.
Failures:
- [test name]: [error]
Please fix failing tests before completing the branch.
# Find where this branch split from
git merge-base HEAD main
# Or for repos using master
git merge-base HEAD master
Confirm with user if unclear: "This branch split from main - is that correct?"
Always present exactly these 4 options. No variations.
Implementation complete. Tests passing. What would you like to do?
1. **Merge back to [base-branch] locally**
- Merges changes into [base-branch]
- Deletes feature branch after merge
- Good for: Solo work, small changes
2. **Push and create a Pull Request**
- Pushes branch to remote
- Creates PR for review
- Good for: Team review, CI checks
3. **Keep the branch as-is**
- No merge or push
- Worktree preserved
- Good for: Not ready yet, need more work
4. **Discard this work**
- Deletes branch and changes
- Cannot be undone
- Good for: Abandoned experiments
Which option? (1-4)
# Switch to base branch
git checkout main
# Get latest
git pull origin main
# Merge feature
git merge feature/feature-name
# Run tests after merge
npm test
# Only delete after tests pass
git branch -d feature/feature-name
If merge conflicts: Report and help resolve, then re-run tests.
If tests fail after merge: Report and help fix before deleting branch.
# Push branch
git push -u origin feature/feature-name
# Create PR
gh pr create --title "[Title]" --body "## Summary
[Description of changes]
## Test Plan
- [How to verify]
---
š¤ Generated with [Claude Code](https://claude.com/claude-code)"
Report: "PR created: [URL]"
Do NOT cleanup worktree.
Report:
Keeping branch feature/feature-name.
Worktree preserved at: [path]
Resume work anytime by:
cd [path]
Requires explicit confirmation:
ā ļø This will permanently delete:
- Branch: feature/feature-name
- All uncommitted changes
- All commits not merged elsewhere
Type 'discard' to confirm:
Only proceed if user types exactly 'discard'.
# Switch away from branch
git checkout main
# Force delete branch
git branch -D feature/feature-name
For Options 1 and 4: Remove the worktree
git worktree remove .worktrees/feature-name
For Options 2 and 3: Keep the worktree
ā
Merged feature/feature-name into main
ā
Tests passing after merge
ā
Feature branch deleted
ā
Worktree cleaned up
Changes are now in main. Ready for next feature.
ā
Pushed feature/feature-name to origin
ā
PR created: [URL]
Branch and worktree preserved for any PR feedback.
After PR merges, clean up with:
git worktree remove .worktrees/feature-name
git branch -d feature/feature-name
Branch feature/feature-name preserved.
Worktree at: [path]
Resume anytime.
ā
Branch feature/feature-name deleted
ā
Worktree cleaned up
Work discarded. Ready for next feature.
implement completes all storiesgit-worktrees for full lifecyclespec-compliance-review and code-quality-review