Prepare PR
Overview
Prepare a PR branch for merge with review fixes, green gates, and an updated head branch.
Safety
- •Never push to
mainororigin/main. Push only to the PR head branch. - •Never run bare
git pushwithout specifying remote and branch. - •Do not run
git clean -fdxorgit add -Aorgit add ..
Completion Criteria
- •Rebase PR commits onto
origin/main. - •Fix all BLOCKER and IMPORTANT items from
.local/review.md. - •Run required gates and pass.
- •Commit prep changes.
- •Push updated HEAD back to the PR head branch.
- •Write
.local/prep.mdwith prep summary. - •Output:
PR is ready for /mergepr.
Steps
- •Identify PR meta (author, head branch, head repo URL)
- •Fetch PR branch tip into local ref
- •Rebase PR commits onto latest main
- •Fix issues from
.local/review.md - •Update CHANGELOG.md if flagged
- •Update docs if flagged
- •Commit prep fixes (stage specific files only)
- •Run required gates:
pnpm install && pnpm build && pnpm ui:build && pnpm check && pnpm test - •Push to PR head branch with
--force-with-lease - •Verify PR is not behind main
- •Write
.local/prep.md
Guardrails
- •Worktree only. Do not delete on success.
- •Do not run
gh pr merge. Never push to main. - •Max 3 fix-and-rerun cycles for gates.