code-review
Code review workflow using GitHub CLI. Use when reviewing pull requests, checking PR diffs, adding review comments, or approving/requesting changes on PRs.
When & Why to Use This Skill
This Claude skill automates and enhances the code review workflow by leveraging the GitHub CLI. It allows for deep pull request analysis, including diff reviews, CI status checks, and mandatory impact analysis to identify breaking changes. By enforcing structured feedback and documentation-backed citations, it helps engineering teams maintain high code quality and consistency while ensuring a safe, read-only interaction with repositories.
Use Cases
- Streamlining Pull Request Reviews: Rapidly summarize PR changes and view diffs directly within Claude to accelerate the approval process without switching contexts.
- Comprehensive Impact Analysis: Automatically search for all callers of modified functions or interfaces using ripgrep to ensure that changes don't introduce regressions in large codebases.
- Evidence-Based Feedback: Generate structured review comments that require citations from official documentation, ensuring that all suggestions are technically sound and verifiable.
- CI/CD Status Monitoring: Quickly verify the results of automated checks and GitHub Action runs for a specific PR to ensure that only passing code is considered for merging.
| name | code-review |
|---|---|
| description | Code review workflow using GitHub CLI. Use when reviewing pull requests, checking PR diffs, adding review comments, or approving/requesting changes on PRs. |
| - Bash(gh pr list | *) |
| - Bash(gh pr view | *) |
| - Bash(gh pr diff | *) |
| - Bash(gh pr checks | *) |
| - Bash(gh pr checkout | *) |
| - Bash(gh issue list | *) |
| - Bash(gh issue view | *) |
| - Bash(gh run list | *) |
| - Bash(gh run view | *) |
| - Bash(gh api | *) |
Code Review Skill
Rules
Read-Only Operations
This skill only allows read-only GitHub operations. Write operations require explicit user instruction outside this skill.
For gh api: GET requests only. No -X POST/PUT/PATCH/DELETE or -f/-F flags.
Citation Required
Every issue raised MUST reference official documentation with URL or doc name. Do not raise issues without documentation support.
Workflow
- Get PR overview -
gh pr view <number> - Review diff -
gh pr diff <number> - Impact analysis - Search callers of modified functions
- Check CI -
gh pr checks <number> - Output findings - Use format below
For detailed commands: See references/gh-commands.md
Impact Analysis (REQUIRED)
When functions/methods/interfaces are modified:
- Identify modified functions from diff
- Search all callers:
rg "functionName" --type <lang> - Verify caller compatibility
- Report breaking changes
Check for: signature changes, return type changes, renamed functions, modified APIs.
Output Format
## Review Summary
### Issues Found
#### [File: path/to/file.ext, Line: XX]
**Issue**: [Description]
**Reference**: [Official documentation URL]
**Suggestion**: [How to fix]
### Impact Analysis
- [Affected callers and compatibility status]
### Recommendation
- [ ] Approve / [ ] Request Changes / [ ] Comment Only
Checklist
- Changes align with purpose
- Logic correct, edge cases handled
- All callers of modified functions identified
- No breaking changes to public APIs
- Security: input validation, no hardcoded secrets
- Tests added/updated, CI passing