pr-reviews
npx machina-cli add skill OutlineDriven/odin-claude-plugin/pr-review --openclawCode 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 10to 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.
- If no PR number is provided in the arguments, run
-
Gather PR Information:
- Run
gh pr view <number> --json title,description,url,baseRefName,headRefName,commits,reviewsto get PR details including title, description, base branch, head branch, commits, and review status. - Run
gh pr diff <number> --name-onlyto see the list of changed files. - Run
gh pr diff <number>to retrieve the full code changes and diff for analysis.
- Run
-
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.
Source
git clone https://github.com/OutlineDriven/odin-claude-plugin/blob/main/skills/pr-review/SKILL.mdView on GitHub Overview
This skill acts as an expert code reviewer for a given GitHub PR. It uses gh CLI to fetch PR metadata, diffs, and reviews, then delivers a concise, structured assessment focused on code quality, correctness, testing coverage, and security implications to guide a timely merge decision.
How This Skill Works
If no PR number is provided, it runs gh pr list --state open --limit 10 to pick the most relevant PR and explains why. It then gathers PR metadata via gh pr view <number> --json title,description,url,baseRefName,headRefName,commits,reviews, fetches the changed files with gh pr diff <number> --name-only, and retrieves the full patch with gh pr diff <number>. Finally, it analyzes the diffs for quality, correctness, testing, and security, and outputs a structured review with clear sections and actionable recommendations.
When to Use It
- User asks to review a specific pull request by number or branch
- User wants analysis of open PRs and their diffs for quality and risk
- User requests feedback on open PRs with structured quality, security, and testing assessments
- New contributors need guidance on standards and conformity to project conventions
- Before merging, to surface potential security, performance, or testing gaps
Quick Start
- Step 1: Ensure gh CLI is authenticated in the target repository context
- Step 2: Provide a PR number to review or let the tool auto-pick from gh pr list --state open --limit 10
- Step 3: Review the generated assessment and apply suggested changes or approvals
Best Practices
- Always fetch PR metadata and diff to understand intent and impact before writing feedback
- Cross-check the PR description and commits to align feedback with the intended changes
- Highlight concrete issues with file/area references and suggested code snippets
- Flag security-sensitive changes (auth, input validation, secrets handling) early
- Recommend tests and edge cases that cover new behavior and failure modes
Example Use Cases
- Review PR adding a new API endpoint in src/api/users.go and assess input validation and error handling
- Review PR that refactors shared utilities under common/ to reduce duplication and improve naming
- Review PR introducing authentication middleware in src/middleware/auth.go with proper token handling
- Review PR that upgrades dependencies in go.mod and assesses compatibility and tests
- Review PR introducing breaking API changes and verify client-facing impact and migration notes