PR Review Skill
Use this skill to review GitHub pull requests comprehensively using multiple expert personas. Each persona brings specialized knowledge to identify issues from different perspectives.
Input
The skill takes a GitHub PR URL as input:
- Format:
https://github.com/{owner}/{repo}/pull/{number}
- Example:
https://github.com/agentic-community/mcp-gateway-registry/pull/123
Output
Creates review documentation in .scratchpad/pr-{pr-number}/ containing:
review.md - Comprehensive review from all personas
Workflow
Step 1: Parse PR URL and Fetch PR Details
- Extract the PR number from the URL
- Use
gh pr view {number} to get PR details
- Use
gh pr diff {number} to get the changes
- Identify which files are changed and their types (frontend, backend, etc.)
Step 2: Determine Relevant Personas
Based on the files changed, determine which personas should review:
| Changed Files |
Personas to Engage |
/frontend/** |
Merge Specialist, Frontend Developer, Chief Architect |
/registry/** |
Merge Specialist, Backend Developer, Security Engineer, SRE, Chief Architect |
/auth_server/** |
Merge Specialist, Backend Developer, Security Engineer, Chief Architect |
/terraform/**, /charts/**, /docker/** |
Merge Specialist, DevOps Engineer, SRE, Chief Architect |
/agents/**, /servers/** |
Merge Specialist, AI/Agent Developer, Backend Developer, Chief Architect |
/metrics-service/** |
Merge Specialist, SRE Engineer, Backend Developer, Chief Architect |
*.md, docs/** |
Merge Specialist, Chief Architect |
pyproject.toml, requirements*.txt |
Merge Specialist, DevOps Engineer, Security Engineer, Chief Architect |
tests/** |
Merge Specialist, Backend Developer, Chief Architect |
Note: Merge Specialist and Chief Architect always participate in every review.
Step 3: Run Tests and Quality Checks
Before reviewing, run the test suite to verify the PR doesn't break anything:
# Checkout the PR
gh pr checkout {pr-number}
# Run tests
uv run pytest tests/ -n 8 --tb=short
# Run linting
uv run ruff check . && uv run ruff format --check .
# Run security scan (if applicable)
uv run bandit -r registry/ auth_server/ -q
# Return to main branch when done
git checkout main
Step 4: Create Review Folder
Create the folder structure:
.scratchpad/pr-{pr-number}/
└── review.md
Step 5: Conduct Multi-Persona Review
For each relevant persona, adopt that perspective and review the changes. Reference the persona definition files:
- Merge Specialist - Always included
- Frontend Developer - For frontend changes
- Backend Developer - For backend/API changes
- Security Engineer - For auth/security changes
- DevOps Engineer - For infrastructure changes
- AI/Agent Developer - For agent/MCP changes
- SRE Engineer - For observability/metrics changes
- Chief Architect - Always included (final synthesis)
Step 6: Write Comprehensive Review (review.md)
Generate the review document using this structure:
# PR Review: #{pr-number} - {pr-title}
*Review Date: {date}*
*PR URL: {pr-url}*
*Author: {author}*
## PR Summary
{Brief description of what the PR does based on PR description and changes}
### Files Changed
| File | Type | Lines Added | Lines Removed |
|------|------|-------------|---------------|
| {file} | {type} | +{n} | -{n} |
### Test Results
| Check | Status | Details |
|-------|--------|---------|
| Unit Tests | {PASS/FAIL} | {summary} |
| Integration Tests | {PASS/FAIL} | {summary} |
| Linting | {PASS/FAIL} | {summary} |
| Security Scan | {PASS/FAIL} | {summary} |
---
## Review Panel
| Role | Reviewer | Verdict |
|------|----------|---------|
| Merge Specialist | Gatekeeper | {verdict} |
| {Role} | {Name} | {verdict} |
| Chief Architect | Atlas | {verdict} |
---
{Include each relevant persona's review section using the format from their persona file}
---
## Review Summary
| Reviewer | Verdict | Blockers | Key Concerns |
|----------|---------|----------|--------------|
| {Reviewer} | {verdict} | {count} | {summary} |
### Blockers (Must Fix)
1. {Blocker description}
- Raised by: {persona}
- File: `{file:line}`
- Fix: {suggested fix}
### Should Fix (Important)
1. {Issue description}
- Raised by: {persona}
- File: `{file:line}`
- Recommendation: {suggestion}
### Consider (Nice to Have)
1. {Suggestion}
- Raised by: {persona}
---
## Final Recommendation
**Overall Verdict: {APPROVE / APPROVE WITH CHANGES / REQUEST CHANGES}**
### Required Actions Before Merge
- [ ] {Action 1}
- [ ] {Action 2}
### Post-Merge Actions
- [ ] {Action 1}
Step 7: Present Review Summary
After creating the review document, present a summary to the user:
- Display the overall verdict
- List any blockers that must be addressed
- Provide the path to the full review document
- Offer to explain any specific findings in detail
Review Principles
From CLAUDE.md
- Simplicity: Code should be maintainable by entry-level developers
- No Over-engineering: Only make changes that are directly requested
- Security First: Check for OWASP vulnerabilities, proper input validation
- Test Coverage: Verify tests exist for new functionality
- Documentation: Ensure docstrings and comments are appropriate
Severity Levels
- Blocker: Must be fixed before merge (security vulnerabilities, failing tests, breaking changes)
- Major: Should be fixed before merge (code quality issues, missing tests)
- Minor: Nice to fix (style issues, documentation improvements)
Verdict Criteria
APPROVE:
- All tests pass
- No security vulnerabilities
- Code quality meets standards
- No breaking changes (or justified)
APPROVE WITH CHANGES:
- Minor issues that should be addressed
- No blockers
- Author can address and merge
REQUEST CHANGES:
- Failing tests
- Security vulnerabilities
- Breaking changes without justification
- Significant code quality issues
Example Usage
User: "/pr-review https://github.com/agentic-community/mcp-gateway-registry/pull/456"
- Parse URL: PR #456
- Fetch PR details and diff
- Identify changed files:
registry/routes/auth.py, tests/unit/test_auth.py
- Determine personas: Merge Specialist, Backend Developer, Security Engineer, Chief Architect
- Run tests: All pass
- Create
.scratchpad/pr-456/review.md
- Conduct reviews from each persona
- Present summary with verdict
Notes
- Always run tests before reviewing to ensure baseline quality
- Focus review effort on areas most relevant to the changed files
- Be constructive and specific - provide file/line references
- Acknowledge good practices, not just problems
- Consider the author's experience level when phrasing feedback
1---2name: pr-review3description: Review a GitHub pull request using multiple expert personas. Takes a PR URL as input, analyzes the changes, and generates comprehensive review feedback from different perspectives (Merge Specialist, Frontend, Backend, Security, DevOps, AI/Agent, SRE, Chief Architect).4license: Apache-2.05---67# PR Review Skill89Use this skill to review GitHub pull requests comprehensively using multiple expert personas. Each persona brings specialized knowledge to identify issues from different perspectives.1011## Input1213The skill takes a GitHub PR URL as input:14- Format: `https://github.com/{owner}/{repo}/pull/{number}`15- Example: `https://github.com/agentic-community/mcp-gateway-registry/pull/123`1617## Output1819Creates review documentation in `.scratchpad/pr-{pr-number}/` containing:20- `review.md` - Comprehensive review from all personas2122## Workflow2324### Step 1: Parse PR URL and Fetch PR Details25261. Extract the PR number from the URL272. Use `gh pr view {number}` to get PR details283. Use `gh pr diff {number}` to get the changes294. Identify which files are changed and their types (frontend, backend, etc.)3031### Step 2: Determine Relevant Personas3233Based on the files changed, determine which personas should review:3435| Changed Files | Personas to Engage |36|---------------|-------------------|37| `/frontend/**` | Merge Specialist, Frontend Developer, Chief Architect |38| `/registry/**` | Merge Specialist, Backend Developer, Security Engineer, SRE, Chief Architect |39| `/auth_server/**` | Merge Specialist, Backend Developer, Security Engineer, Chief Architect |40| `/terraform/**`, `/charts/**`, `/docker/**` | Merge Specialist, DevOps Engineer, SRE, Chief Architect |41| `/agents/**`, `/servers/**` | Merge Specialist, AI/Agent Developer, Backend Developer, Chief Architect |42| `/metrics-service/**` | Merge Specialist, SRE Engineer, Backend Developer, Chief Architect |43| `*.md`, `docs/**` | Merge Specialist, Chief Architect |44| `pyproject.toml`, `requirements*.txt` | Merge Specialist, DevOps Engineer, Security Engineer, Chief Architect |45| `tests/**` | Merge Specialist, Backend Developer, Chief Architect |4647**Note:** Merge Specialist and Chief Architect always participate in every review.4849### Step 3: Run Tests and Quality Checks5051Before reviewing, run the test suite to verify the PR doesn't break anything:5253```bash54# Checkout the PR55gh pr checkout {pr-number}5657# Run tests58uv run pytest tests/ -n 8 --tb=short5960# Run linting61uv run ruff check . && uv run ruff format --check .6263# Run security scan (if applicable)64uv run bandit -r registry/ auth_server/ -q6566# Return to main branch when done67git checkout main68```6970### Step 4: Create Review Folder7172Create the folder structure:7374```75.scratchpad/pr-{pr-number}/76└── review.md77```7879### Step 5: Conduct Multi-Persona Review8081For each relevant persona, adopt that perspective and review the changes. Reference the persona definition files:8283- [Merge Specialist](personas/merge-specialist.md) - Always included84- [Frontend Developer](personas/frontend-developer.md) - For frontend changes85- [Backend Developer](personas/backend-developer.md) - For backend/API changes86- [Security Engineer](personas/security-engineer.md) - For auth/security changes87- [DevOps Engineer](personas/devops-engineer.md) - For infrastructure changes88- [AI/Agent Developer](personas/ai-agent-developer.md) - For agent/MCP changes89- [SRE Engineer](personas/sre-engineer.md) - For observability/metrics changes90- [Chief Architect](personas/chief-architect.md) - Always included (final synthesis)9192### Step 6: Write Comprehensive Review (review.md)9394Generate the review document using this structure:9596```markdown97# PR Review: #{pr-number} - {pr-title}9899*Review Date: {date}*100*PR URL: {pr-url}*101*Author: {author}*102103## PR Summary104105{Brief description of what the PR does based on PR description and changes}106107### Files Changed108109| File | Type | Lines Added | Lines Removed |110|------|------|-------------|---------------|111| {file} | {type} | +{n} | -{n} |112113### Test Results114115| Check | Status | Details |116|-------|--------|---------|117| Unit Tests | {PASS/FAIL} | {summary} |118| Integration Tests | {PASS/FAIL} | {summary} |119| Linting | {PASS/FAIL} | {summary} |120| Security Scan | {PASS/FAIL} | {summary} |121122---123124## Review Panel125126| Role | Reviewer | Verdict |127|------|----------|---------|128| Merge Specialist | Gatekeeper | {verdict} |129| {Role} | {Name} | {verdict} |130| Chief Architect | Atlas | {verdict} |131132---133134{Include each relevant persona's review section using the format from their persona file}135136---137138## Review Summary139140| Reviewer | Verdict | Blockers | Key Concerns |141|----------|---------|----------|--------------|142| {Reviewer} | {verdict} | {count} | {summary} |143144### Blockers (Must Fix)1451461. {Blocker description}147 - Raised by: {persona}148 - File: `{file:line}`149 - Fix: {suggested fix}150151### Should Fix (Important)1521531. {Issue description}154 - Raised by: {persona}155 - File: `{file:line}`156 - Recommendation: {suggestion}157158### Consider (Nice to Have)1591601. {Suggestion}161 - Raised by: {persona}162163---164165## Final Recommendation166167**Overall Verdict: {APPROVE / APPROVE WITH CHANGES / REQUEST CHANGES}**168169### Required Actions Before Merge170171- [ ] {Action 1}172- [ ] {Action 2}173174### Post-Merge Actions175176- [ ] {Action 1}177```178179### Step 7: Present Review Summary180181After creating the review document, present a summary to the user:1821831. Display the overall verdict1842. List any blockers that must be addressed1853. Provide the path to the full review document1864. Offer to explain any specific findings in detail187188## Review Principles189190### From CLAUDE.md191192- **Simplicity**: Code should be maintainable by entry-level developers193- **No Over-engineering**: Only make changes that are directly requested194- **Security First**: Check for OWASP vulnerabilities, proper input validation195- **Test Coverage**: Verify tests exist for new functionality196- **Documentation**: Ensure docstrings and comments are appropriate197198### Severity Levels199200- **Blocker**: Must be fixed before merge (security vulnerabilities, failing tests, breaking changes)201- **Major**: Should be fixed before merge (code quality issues, missing tests)202- **Minor**: Nice to fix (style issues, documentation improvements)203204### Verdict Criteria205206**APPROVE**:207- All tests pass208- No security vulnerabilities209- Code quality meets standards210- No breaking changes (or justified)211212**APPROVE WITH CHANGES**:213- Minor issues that should be addressed214- No blockers215- Author can address and merge216217**REQUEST CHANGES**:218- Failing tests219- Security vulnerabilities220- Breaking changes without justification221- Significant code quality issues222223## Example Usage224225User: "/pr-review https://github.com/agentic-community/mcp-gateway-registry/pull/456"2262271. Parse URL: PR #4562282. Fetch PR details and diff2293. Identify changed files: `registry/routes/auth.py`, `tests/unit/test_auth.py`2304. Determine personas: Merge Specialist, Backend Developer, Security Engineer, Chief Architect2315. Run tests: All pass2326. Create `.scratchpad/pr-456/review.md`2337. Conduct reviews from each persona2348. Present summary with verdict235236## Notes237238- Always run tests before reviewing to ensure baseline quality239- Focus review effort on areas most relevant to the changed files240- Be constructive and specific - provide file/line references241- Acknowledge good practices, not just problems242- Consider the author's experience level when phrasing feedback