Full pre-merge workflow for a GitHub issue — rebase, /verify, acceptance criteria audit, /code-review, /create-pr, and post-merge cleanup. Run after /human-test passes. Triggers on "ready to merge", "prepare the PR", "merge this", or "finalize
Full pre-merge workflow: rebase, quality suite, acceptance criteria audit, code review,
PR creation, and post-merge cleanup. Run this after /human-test passes.
Usage: /pr-prep 42
This command orchestrates: /verify → /code-review → /create-pr → cleanup.
git fetch origin main
git rebase origin/main
If there are conflicts, resolve them carefully. For any non-obvious conflict, ask the user for guidance rather than guessing at intent.
/verify
All checks must be green before proceeding. Fix anything failing.
Before running the code review, confirm the required gates have been run. Check the PR description for these checkboxes — if either is unchecked and not marked N/A, stop and run them now.
gh pr view $ARGUMENTS --json body --jq '.body'
Gates required before merge:
/security-review — mandatory if the diff touches: auth, sessions, JWT, user data, payments, file uploads, external integrations, or any new API route/performance-review — mandatory if the diff touches: database queries, findMany, list/table rendering, search endpoints, background jobs, or package.jsonIf either applies and hasn't been run: run it now and address findings before proceeding.
gh issue view $ARGUMENTS
Go through every acceptance criterion and confirm it is satisfied:
Final Acceptance Criteria Audit — Issue #[N]:
✅ [Criterion 1] — [test name or observable behavior]
✅ [Criterion 2] — [test name or observable behavior]
✅ TypeScript: no errors
✅ All tests passing
If any criterion is unmet, fix it now. Do not proceed with an unmet criterion.
/code-review
Address any Critical or Warning findings before marking the PR ready.
/create-pr
CI will run. Once a reviewer approves and all checks are green, the PR can be merged.
Merge strategy: squash merge — keeps main history clean, one commit per feature.
Once merged:
# Remove the worktree (run from the main repo directory, not the worktree)
git worktree remove [worktree-path]
git branch -d [branch-name]
Close the issue if not auto-closed by "Closes #N":
gh issue close $ARGUMENTS \
--comment "Completed in PR #[pr-number] — merged to main."
Check if the milestone is now complete:
gh issue list --milestone "[milestone-name]" --state open
If all issues are closed:
gh api repos/:owner/:repo/milestones/[milestone-number] \
--method PATCH \
--field state="closed"
/parallel-status
See what other features are in progress, what's ready to start, and what needs attention.