Pre-PR Quality Gate
Before creating any pull request, run through every section below. All items must pass.
PR Size (Google Small CLs)
- Ideal: 50-100 lines changed. Maximum: 200 lines. Over 200 → split into stacked PRs.
- One PR = one concern — never bundle unrelated changes (Google).
- Separate refactoring PRs from feature/bugfix PRs — never mix formatting with logic (Google).
- If adding a new API, include a usage example in the same PR (Google).
- When in doubt, make the PR smaller — reviewers never complain about PRs too small (Google).
PR Checklist
Every item must pass before creating the PR:
All commits pushed to remote
- Run
git status— confirm nothing unpushed - Never create a PR with local-only commits
- Run
PR targets the correct branch
- Feature/fix PRs target
dev— never directly tomain - Release PRs (
dev→main) are allowed ONLY afterstaging-verifypasses with all changes verified - If targeting
mainwithout staging verification: STOP and runstaging-verifyfirst
- Feature/fix PRs target
PR links to issue
- Include
Closes #NUMBERorFixes #NUMBERin the PR body - Every PR must trace back to an issue — no orphan PRs
- Include
PR description follows the standard format
## Summary - What changed and why (1-3 bullet points) ## Test plan - How to verify this worksTests included in same PR as feature
- Unit tests at minimum; integration and E2E where appropriate
- No "we'll add tests later" — an untested PR is an incomplete PR
UI changes: include screenshots or recordings
- Before/after screenshots for visual changes
- Screen recordings for interaction changes
CI passing
- Run
gh pr checks NUMBER --watch --fail-fast - Never merge a PR with failing checks
- Run
Documentation updated if the PR changes how users build/test/interact (Google)
- README, API docs, setup guides — update in the same PR, not a follow-up
Self-review:
git diff dev...HEAD— read every line one more time- Look for: debug code, TODO comments, unused imports, hardcoded values
- Leave comments on non-obvious decisions
PR Title
- Conventional format:
feat: add document uploadorfix: sidebar collapse - Short, under 70 characters
- Details go in the body, not the title
Critical Rules
- Never merge
dev→mainwithout passingstaging-verify(Playwright verification on staging environment) - Never force-push to a shared PR branch after review has started
- Every PR must leave the system in a working state (Google)
Next Steps
Report to user: "PR #[N] created: [title]. Target: [branch]. Size: [+N/-N lines]"
Suggested next steps (user decides):
- UI changes → "Run ux-audit before merge"
- Backend only → "Wait for CI, then merge"
- Targets main → "Run staging-verify first"