From claudekit
Finalizes completed feature branches by verifying tests pass, identifying base branch, and offering git-based options to merge locally, create GitHub PR, keep as-is, or discard.
npx claudepluginhub duthaho/claudekit --plugin claudekitThis skill uses the workspace's default tool permissions.
- After implementing a feature
Guides finishing git development branches after tests pass: verifies tests, presents options to merge locally, create GitHub PR, keep as-is, or discard, executes with git/gh, cleans worktrees.
Guides finishing development branches: verifies tests pass, detects git worktree/detached HEAD state, presents merge/PR/keep/discard options, executes choice, and cleans up.
Verifies tests pass on completed dev branch, then presents options to merge locally, create GitHub PR, keep as-is, or discard; executes choice and cleans up worktree.
Share bugs, ideas, or general feedback.
Run the project's test suite:
npm test
# or
pytest
# or
go test ./...
Decision point:
⚠️ STOP: Tests failing
Cannot proceed with merge/PR until tests pass.
Fix failing tests first, then restart this workflow.
Identify which branch this feature branch originated from:
# Check tracking branch
git branch -vv
# Or check common bases
git merge-base main feature-branch
git merge-base develop feature-branch
Common base branches:
main or master - Productiondevelop - Developmentrelease/* - Release branchesOffer exactly four choices:
## Branch Completion Options
Your feature branch `feature/email-verification` is ready.
All tests pass (42/42).
Choose how to proceed:
1. **Merge locally** - Merge into [base] on your machine
2. **Create Pull Request** - Push and open PR for review
3. **Keep as-is** - Leave branch for later work
4. **Discard** - Delete this branch and all changes
Enter your choice (1-4):
# Switch to base branch
git checkout main
# Pull latest
git pull origin main
# Merge feature branch
git merge feature/email-verification
# Verify tests still pass
npm test
# Delete feature branch
git branch -d feature/email-verification
# Push branch to remote
git push -u origin feature/email-verification
# Create PR (using gh CLI)
gh pr create \
--title "Add email verification" \
--body "## Summary
- Implements email verification flow
- Adds verification token generation
- Includes tests for all scenarios
## Test Plan
- [x] Unit tests pass
- [x] Integration tests pass
- [x] Manual testing complete"
Branch preserved: feature/email-verification
Note: Remember to return to this branch later.
Current state: All tests passing, ready for merge.
⚠️ WARNING: This will delete all work on this branch.
Type "discard" to confirm: _______
If confirmed:
# Switch away from branch
git checkout main
# Force delete branch
git branch -D feature/email-verification
# If pushed to remote, delete there too
git push origin --delete feature/email-verification
For options 1, 2, and 4, cleanup the worktree environment:
# Remove worktree
git worktree remove ../feature-email-verification
# Or if worktree is in special location
git worktree remove /path/to/worktree
For option 3 (keep), preserve the worktree.
┌─────────────────────────┐
│ Tests Passing? │
└───────────┬─────────────┘
│
┌────┴────┐
│ NO │──────► STOP: Fix tests first
└─────────┘
│
YES
│
▼
┌─────────────────────────┐
│ Present 4 Options │
└───────────┬─────────────┘
│
┌───────┼───────┬───────┐
│ │ │ │
▼ ▼ ▼ ▼
Merge PR Keep Discard
│ │ │ │
▼ ▼ │ ▼
Cleanup Cleanup │ Confirm
│ │ │ │
▼ ▼ │ ▼
Done Done Done Cleanup
│
▼
Done
When choosing Option 2:
## Summary
[Brief description of changes]
## Changes
- [Change 1]
- [Change 2]
- [Change 3]
## Test Plan
- [ ] Unit tests pass
- [ ] Integration tests pass
- [ ] Manual testing scenarios:
- [ ] Scenario 1
- [ ] Scenario 2
## Screenshots (if applicable)
[Add screenshots here]
## Related Issues
Closes #[issue number]
- [ ] Tests pass on feature branch
- [ ] Base branch is up to date
- [ ] No merge conflicts
- [ ] Tests pass after merge
- [ ] Tests pass
- [ ] Branch pushed to remote
- [ ] PR description complete
- [ ] Reviewers assigned (if required)
- [ ] Confirmed with user (typed "discard")
- [ ] No valuable uncommitted changes
- [ ] Branch deleted locally
- [ ] Branch deleted from remote (if pushed)
pytest -v --cov=src # Full test suite
ruff check . && ruff format --check . # Lint + format
mypy src/ --strict # Type check
pip-audit # Security audit
alembic upgrade head && alembic check # Verify migrations
npm test # Full test suite
npm run lint # Lint
npm run build # Build (catches type errors)
npm audit --production # Security audit
npx prisma migrate status # Verify migrations
npm test # Tests
next lint # Lint
next build # Build (catches SSR/RSC issues)
Python/FastAPI PRs — include:
NestJS PRs — include:
Next.js PRs — include:
'use client' directives where needed?"Verify tests → Present options → Execute choice → Clean up"
Never:
requesting-code-review - Use before finishing the branch to get review feedback, especially for Option 2 (Create PR)verification-before-completion - Run verification checks before claiming the branch is ready to finishexecuting-plans - If the branch was created from an execution plan, return to the plan to mark tasks complete