PR Merge Champion
Overview
A systematic playbook for preparing, reviewing, and documenting pull requests to ensure they are high-quality, free of common oversights, and optimized for instant maintainer approval and merging.
When to Use This Skill
- Use when preparing to open a new pull request on GitHub or any Git hosting platform.
- Use when self-auditing a feature or bug-fix branch for code cleanliness and consistency.
- Use when trying to minimize review cycles and speed up the integration of your changes.
How It Works
Step 1: Pre-Flight Clean Up & Rebase
Before presenting your code to reviewers, clean up any workspace noise and ensure your branch is up to date:
- Rebase your feature branch on top of the latest target branch (e.g.,
main or master) to resolve conflicts early.
- Clean up untracked, temp, or swap files from your repository.
- Run local linters, formatters, and compilers to ensure no stylistic or syntax errors exist.
Step 2: Critical Self-Review
Review your own diff line-by-line as if you were the reviewer. Look out for:
- Leftover debugging statements (e.g.,
console.log, print, breakpoints, or custom debug flags).
- Unnecessary changes, white-space only diffs, or commented-out code blocks.
- Incomplete
TODO comments that should be resolved or turned into tracked issues.
- Correctness of error handling and edge cases.
Step 3: Local Verification & Test Suite
Verify that all changes work as expected:
- Run the project's automated test suite locally to verify no regressions are introduced.
- Check test coverage for any new code blocks you added.
- Manually test the critical paths and edge cases of your feature or bug fix.
Step 4: Crafting the Pull Request Description
Write a high-signal, structured PR description. A great description tells the story of the changes:
- Summary: A concise explanation of the changes.
- Context / Why: Why this change is necessary and what problem it solves.
- Verification: Explicit details on how you tested it (test commands, screenshots, or step-by-step reproduction).
- Checklist: Conform to the repository's contributing guidelines and checklist requirements.
Examples
Example 1: Creating a Clean PR Description
# Pull Request: Implement Rate Limiting on Authentication Endpoint
## Summary
Introduces an IP-based rate limiter on the `/api/v1/auth/login` endpoint using Redis to prevent brute-force attacks.
## Why
We identified a high volume of login attempts targeting single accounts. This rate limiting window slows down attackers while keeping the system responsive for genuine users.
## Verification
- Ran unit tests: `npm run test tests/auth.test.js` (all green)
- Manually verified using Postman: sending 15 requests in under 60 seconds returns `429 Too Many Requests`.
## Checklist
- [x] Code follows the style guide
- [x] Unit tests added/updated
- [x] Documentation updated
Example 2: Self-Review Clean Up Commands
Before committing, run these commands to inspect the diff for accidental additions:
# Check the names of files changed to ensure no unwanted files are staged
git status --porcelain
# Review the actual diff for any leftover print statements or debuggers
git diff | grep -E "(console\.log|debugger|print\(|var_dump|binding\.pry)"
Best Practices
- ✅ Keep PRs Small and Focused: A PR with fewer than 200 lines of changes gets reviewed and merged significantly faster than a large one.
- ✅ Perform a Self-Review first: Finding your own bugs and formatting issues first builds trust with the maintainers.
- ✅ Respect Repository Guidelines: Check the project's
CONTRIBUTING.md and pull request templates, and adhere to them strictly.
- ❌ Do Not Bundle Unrelated Changes: Avoid sneaking refactoring or unrelated bug fixes into a feature PR. Create separate PRs instead.
- ❌ Do Not Ignore CI Failures: Always fix failing tests, linters, or security scans on your branch before requesting a review.
Limitations
- This skill does not replace project-specific CI/CD validation, automated testing, or domain-expert reviews.
- It assumes a standard Git and GitHub-like environment, though the core principles apply to GitLab, Bitbucket, and other platforms.
Common Pitfalls
- Problem: A PR is left open for a long time due to minor formatting or style comments.
Solution: Always run the repository's local formatter (e.g., Prettier, ESLint, Black) before committing.
- Problem: Merge conflicts occur immediately after opening the PR.
Solution: Pull the latest main branch and rebase or merge it into your branch daily.
Related Skills
@pr-writer - For Sentry-specific PR writing guidelines.
@clean-code - To ensure code quality before submitting.
1---2name: pr-merge-champion3description: Optimize pull requests for quick approval and merging by ensuring clean diffs, comprehensive self-reviews, and structured documentation.4license: MIT5---67# PR Merge Champion89## Overview1011A systematic playbook for preparing, reviewing, and documenting pull requests to ensure they are high-quality, free of common oversights, and optimized for instant maintainer approval and merging.1213## When to Use This Skill1415- Use when preparing to open a new pull request on GitHub or any Git hosting platform.16- Use when self-auditing a feature or bug-fix branch for code cleanliness and consistency.17- Use when trying to minimize review cycles and speed up the integration of your changes.1819## How It Works2021### Step 1: Pre-Flight Clean Up & Rebase2223Before presenting your code to reviewers, clean up any workspace noise and ensure your branch is up to date:241. Rebase your feature branch on top of the latest target branch (e.g., `main` or `master`) to resolve conflicts early.252. Clean up untracked, temp, or swap files from your repository.263. Run local linters, formatters, and compilers to ensure no stylistic or syntax errors exist.2728### Step 2: Critical Self-Review2930Review your own diff line-by-line as if you were the reviewer. Look out for:311. Leftover debugging statements (e.g., `console.log`, `print`, breakpoints, or custom debug flags).322. Unnecessary changes, white-space only diffs, or commented-out code blocks.333. Incomplete `TODO` comments that should be resolved or turned into tracked issues.344. Correctness of error handling and edge cases.3536### Step 3: Local Verification & Test Suite3738Verify that all changes work as expected:391. Run the project's automated test suite locally to verify no regressions are introduced.402. Check test coverage for any new code blocks you added.413. Manually test the critical paths and edge cases of your feature or bug fix.4243### Step 4: Crafting the Pull Request Description4445Write a high-signal, structured PR description. A great description tells the story of the changes:461. **Summary**: A concise explanation of the changes.472. **Context / Why**: Why this change is necessary and what problem it solves.483. **Verification**: Explicit details on how you tested it (test commands, screenshots, or step-by-step reproduction).494. **Checklist**: Conform to the repository's contributing guidelines and checklist requirements.5051## Examples5253### Example 1: Creating a Clean PR Description5455```markdown56# Pull Request: Implement Rate Limiting on Authentication Endpoint5758## Summary59Introduces an IP-based rate limiter on the `/api/v1/auth/login` endpoint using Redis to prevent brute-force attacks.6061## Why62We identified a high volume of login attempts targeting single accounts. This rate limiting window slows down attackers while keeping the system responsive for genuine users.6364## Verification65- Ran unit tests: `npm run test tests/auth.test.js` (all green)66- Manually verified using Postman: sending 15 requests in under 60 seconds returns `429 Too Many Requests`.6768## Checklist69- [x] Code follows the style guide70- [x] Unit tests added/updated71- [x] Documentation updated72```7374### Example 2: Self-Review Clean Up Commands7576Before committing, run these commands to inspect the diff for accidental additions:7778```bash79# Check the names of files changed to ensure no unwanted files are staged80git status --porcelain8182# Review the actual diff for any leftover print statements or debuggers83git diff | grep -E "(console\.log|debugger|print\(|var_dump|binding\.pry)"84```8586## Best Practices8788- ✅ **Keep PRs Small and Focused**: A PR with fewer than 200 lines of changes gets reviewed and merged significantly faster than a large one.89- ✅ **Perform a Self-Review first**: Finding your own bugs and formatting issues first builds trust with the maintainers.90- ✅ **Respect Repository Guidelines**: Check the project's `CONTRIBUTING.md` and pull request templates, and adhere to them strictly.91- ❌ **Do Not Bundle Unrelated Changes**: Avoid sneaking refactoring or unrelated bug fixes into a feature PR. Create separate PRs instead.92- ❌ **Do Not Ignore CI Failures**: Always fix failing tests, linters, or security scans on your branch before requesting a review.9394## Limitations9596- This skill does not replace project-specific CI/CD validation, automated testing, or domain-expert reviews.97- It assumes a standard Git and GitHub-like environment, though the core principles apply to GitLab, Bitbucket, and other platforms.9899## Common Pitfalls100101- **Problem:** A PR is left open for a long time due to minor formatting or style comments.102 **Solution:** Always run the repository's local formatter (e.g., Prettier, ESLint, Black) before committing.103- **Problem:** Merge conflicts occur immediately after opening the PR.104 **Solution:** Pull the latest main branch and rebase or merge it into your branch daily.105106## Related Skills107108- `@pr-writer` - For Sentry-specific PR writing guidelines.109- `@clean-code` - To ensure code quality before submitting.