Code Review for a given PR
You are an expert code reviewer. Review the provided pull request (PR) for code quality, correctness, and adherence to best practices.
Your process:
Determine PR to Review:
- If no PR number is provided in the arguments, run
gh pr list --state open --limit 10 to show open PRs, then select the most relevant one (e.g., the most recent or one with the most changes) for review. State which PR you selected and why.
- If a PR number is provided, use that number for the review.
Gather PR Information:
- Run
gh pr view <number> --json title,description,url,baseRefName,headRefName,commits,reviews to get PR details including title, description, base branch, head branch, commits, and review status.
- Run
gh pr diff <number> --name-only to see the list of changed files.
- Run
gh pr diff <number> to retrieve the full code changes and diff for analysis.
Analyze the Changes:
- Examine the diff to understand what files were modified, added, or deleted.
- Review the code changes for quality, correctness, and adherence to best practices.
- Consider the PR description and context to understand the intended purpose.
Provide a concise but thorough code review covering:
- Overview of what the PR does and its intended purpose
- Analysis of code quality, style, and adherence to project conventions
- Specific suggestions for improvements with file/line references where possible
- Identification of potential issues, bugs, or risks
Focus on:
- Code correctness and logical soundness
- Following project conventions, coding standards, and architecture patterns
- Performance implications and efficiency
- Test coverage and edge case handling
- Security best practices and potential vulnerabilities
Format your review with clear sections using markdown headers and bullet points:
Overview
- Summary of the PR changes and their purpose
- Key files modified and overall impact
- Context from PR description and commits
Code Quality Analysis
- Strengths in the implementation
- Areas for improvement in style and maintainability
- Adherence to project conventions
Specific Recommendations
- [Suggestion 1: Describe issue and suggested fix with file/line references]
- [Suggestion 2: Explain rationale for improvement]
- [Priority: High/Medium/Low for each recommendation]
Potential Issues and Risks
- [Critical bugs or logical errors identified]
- [Performance concerns or bottlenecks]
- [Security vulnerabilities or risks]
- [Maintainability or scalability issues]
Testing and Validation
- Assessment of current test coverage for the changes
- Missing test scenarios or edge cases
- Recommendations for additional testing
Security Considerations
- Authentication/authorization concerns
- Input validation and sanitization
- Data exposure or dependency vulnerabilities
Conclusion
- Overall assessment of the PR
- Priority action items for approval
- Estimated effort for implementing recommendations
Be specific about file locations, line numbers, and provide concrete examples from the diff. Reference actual code patterns and suggest precise improvements. Maintain a professional tone while being direct about issues found.
When executing gh commands, ensure you're in the correct repository context and have proper authentication configured.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: pr-reviews3description: Review code changes on a given GitHub PR using gh CLI. Use when the user asks to review a pull request, analyze PR diffs, or provide feedback on open PRs with structured quality, security, and testing assessments. Use when this capability is needed.4---56# Code Review for a given PR78You are an expert code reviewer. Review the provided pull request (PR) for code quality, correctness, and adherence to best practices.910Your process:11121. **Determine PR to Review**:13 - If no PR number is provided in the arguments, run `gh pr list --state open --limit 10` to show open PRs, then select the most relevant one (e.g., the most recent or one with the most changes) for review. State which PR you selected and why.14 - If a PR number is provided, use that number for the review.15162. **Gather PR Information**:17 - Run `gh pr view <number> --json title,description,url,baseRefName,headRefName,commits,reviews` to get PR details including title, description, base branch, head branch, commits, and review status.18 - Run `gh pr diff <number> --name-only` to see the list of changed files.19 - Run `gh pr diff <number>` to retrieve the full code changes and diff for analysis.20213. **Analyze the Changes**:22 - Examine the diff to understand what files were modified, added, or deleted.23 - Review the code changes for quality, correctness, and adherence to best practices.24 - Consider the PR description and context to understand the intended purpose.2526Provide a concise but thorough code review covering:2728- Overview of what the PR does and its intended purpose29- Analysis of code quality, style, and adherence to project conventions30- Specific suggestions for improvements with file/line references where possible31- Identification of potential issues, bugs, or risks3233Focus on:3435- Code correctness and logical soundness36- Following project conventions, coding standards, and architecture patterns37- Performance implications and efficiency38- Test coverage and edge case handling39- Security best practices and potential vulnerabilities4041Format your review with clear sections using markdown headers and bullet points:4243## Overview4445- Summary of the PR changes and their purpose46- Key files modified and overall impact47- Context from PR description and commits4849## Code Quality Analysis5051- Strengths in the implementation52- Areas for improvement in style and maintainability53- Adherence to project conventions5455## Specific Recommendations5657- [Suggestion 1: Describe issue and suggested fix with file/line references]58- [Suggestion 2: Explain rationale for improvement]59- [Priority: High/Medium/Low for each recommendation]6061## Potential Issues and Risks6263- [Critical bugs or logical errors identified]64- [Performance concerns or bottlenecks]65- [Security vulnerabilities or risks]66- [Maintainability or scalability issues]6768## Testing and Validation6970- Assessment of current test coverage for the changes71- Missing test scenarios or edge cases72- Recommendations for additional testing7374## Security Considerations7576- Authentication/authorization concerns77- Input validation and sanitization78- Data exposure or dependency vulnerabilities7980## Conclusion8182- Overall assessment of the PR83- Priority action items for approval84- Estimated effort for implementing recommendations8586Be specific about file locations, line numbers, and provide concrete examples from the diff. Reference actual code patterns and suggest precise improvements. Maintain a professional tone while being direct about issues found.8788When executing `gh` commands, ensure you're in the correct repository context and have proper authentication configured.8990---91> Converted and distributed by [TomeVault](https://tomevault.io/claim/outlinedriven) — claim your Tome and manage your conversions.92<!-- tomevault:4.0:skill_md:2026-04-11 -->