GitHub code review operations - approve PRs, request changes, comment on code, and manage review workflows using gh CLI
Performs GitHub code review operations using gh CLI - approves PRs, requests changes, adds comments, and manages review workflows when reviewing pull requests
/plugin marketplace add Nice-Wolf-Studio/agent-github-skills/plugin install nice-wolf-studio-github-skills@Nice-Wolf-Studio/agent-github-skillsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
This skill provides code review operations for pull requests, including approving, requesting changes, commenting on code, and managing review workflows.
Approve a PR indicating the changes look good.
Request changes on a PR with specific feedback.
Add general comments or review feedback without approving/rejecting.
Comment on specific lines or ranges of code.
See all reviews submitted on a PR.
Dismiss a stale or incorrect review.
Simple approval:
gh pr review 123 --approve --repo owner/repo-name
Approval with comment:
gh pr review 123 --approve --repo owner/repo-name --body "LGTM! Great work on this feature."
Approve after testing:
gh pr checkout 123 --repo owner/repo-name
# Run tests
npm test
# If tests pass
gh pr review 123 --approve --body "Tested locally. All tests pass."
Request changes with feedback:
gh pr review 123 --request-changes --repo owner/repo-name --body "Please address the following issues:
- Add error handling in auth.js
- Update unit tests
- Fix typo in README"
Request changes with specific concerns:
gh pr review 123 --request-changes --repo owner/repo-name --body "Security concern: The API key is exposed in the client code. Please move it to environment variables."
General comment:
gh pr review 123 --comment --repo owner/repo-name --body "This looks good overall, but I have a few questions before approving."
Comment without formal review:
gh pr comment 123 --repo owner/repo-name --body "Have you considered using async/await instead of promises here?"
Ask for clarification:
gh pr comment 123 --repo owner/repo-name --body "Can you explain the rationale behind the new caching strategy?"
Comment on specific line (interactive):
gh pr view 123 --repo owner/repo-name --web
# Use web interface to add inline comments
Comment on code via API:
# First, get the PR diff to find the position
gh pr diff 123 --repo owner/repo-name
# Add review comment at specific position
gh api repos/owner/repo-name/pulls/123/reviews \
-f body="Review comments" \
-f event="COMMENT" \
-f 'comments[][path]=src/main.js' \
-f 'comments[][position]=10' \
-f 'comments[][body]=Consider adding error handling here'
Multiple inline comments:
gh api repos/owner/repo-name/pulls/123/reviews \
-f body="Found several issues" \
-f event="REQUEST_CHANGES" \
-f 'comments[][path]=src/auth.js' \
-f 'comments[][line]=25' \
-f 'comments[][body]=This function needs error handling' \
-f 'comments[][path]=src/utils.js' \
-f 'comments[][line]=45' \
-f 'comments[][body]=Add input validation'
List all reviews:
gh pr view 123 --repo owner/repo-name --json reviews
View reviews with details:
gh api repos/owner/repo-name/pulls/123/reviews --jq '.[] | {reviewer: .user.login, state: .state, body: .body}'
Check review decision:
gh pr view 123 --repo owner/repo-name --json reviewDecision --jq '.reviewDecision'
# Returns: APPROVED, CHANGES_REQUESTED, REVIEW_REQUIRED, or null
See who approved:
gh api repos/owner/repo-name/pulls/123/reviews --jq '.[] | select(.state=="APPROVED") | .user.login'
See who requested changes:
gh api repos/owner/repo-name/pulls/123/reviews --jq '.[] | select(.state=="CHANGES_REQUESTED") | {reviewer: .user.login, feedback: .body}'
Dismiss a review:
gh api repos/owner/repo-name/pulls/123/reviews/<review-id>/dismissals \
-X PUT \
-f message="Addressed in latest commit"
Find and dismiss outdated reviews:
# Get review ID
REVIEW_ID=$(gh api repos/owner/repo-name/pulls/123/reviews --jq '.[0].id')
# Dismiss it
gh api repos/owner/repo-name/pulls/123/reviews/$REVIEW_ID/dismissals \
-X PUT \
-f message="Code has been updated per feedback"
# 1. Get list of PRs needing review
gh pr list --search "review-requested:@me" --repo owner/repo-name
# 2. View PR details
gh pr view 123 --repo owner/repo-name
# 3. Check out PR locally for testing
gh pr checkout 123 --repo owner/repo-name
# 4. Review the code
git log --oneline -5
git diff main..HEAD
# 5. Run tests
npm test
# 6. Check code quality
npm run lint
# 7. Submit review
gh pr review 123 --approve --body "Reviewed and tested. Looks good!"
# 1. Start review
gh pr view 123 --repo owner/repo-name --comments
# 2. Check changed files
gh pr diff 123 --repo owner/repo-name --name-only
# 3. Review each file
gh pr diff 123 --repo owner/repo-name -- src/component.js
# 4. Test locally
gh pr checkout 123
npm install
npm test
npm run build
# 5. Add feedback
gh pr review 123 --comment --body "Tested locally. A few suggestions:
- Add JSDoc comments to public methods
- Consider extracting the validation logic
- Tests look good!"
# 6. Follow up after changes
gh pr review 123 --approve --body "Thanks for addressing the feedback!"
# 1. Review the PR
gh pr view 123 --repo owner/repo-name
# 2. Identify issues
gh pr diff 123 --repo owner/repo-name
# 3. Request changes with specific feedback
gh pr review 123 --request-changes --body "Please address:
**Security:**
- [ ] Move API keys to environment variables
- [ ] Add input sanitization
**Testing:**
- [ ] Add unit tests for new functions
- [ ] Update integration tests
**Documentation:**
- [ ] Update README with new API usage
- [ ] Add inline comments for complex logic"
# 4. Wait for updates
gh pr view 123 --json commits --jq '.commits | length'
# 5. Re-review after changes
gh pr review 123 --approve --body "All concerns addressed. Thanks!"
# Request reviews from specific people
gh pr edit 123 --repo owner/repo-name \
--add-reviewer security-expert,frontend-lead,qa-engineer
# Check review status
gh pr view 123 --json reviews --jq '.reviews[] | {reviewer: .author.login, status: .state}'
# Remind reviewers
gh pr comment 123 --body "@security-expert @frontend-lead Friendly reminder to review when you have time"
# Check if all required reviews are complete
gh pr view 123 --json reviewDecision
# View feedback as PR author
gh pr view 123 --comments
# Address each comment
git commit -m "fix: address review feedback"
git push
# Comment on resolution
gh pr comment 123 --body "Updated per review feedback:
- Added error handling
- Improved test coverage
- Updated documentation"
# Request re-review
gh api repos/owner/repo-name/pulls/123/requested_reviewers \
-f 'reviewers[]=reviewer-username'
gh pr review 123 --comment --body "## Security Review Checklist
- [ ] Input validation present
- [ ] Authentication checks in place
- [ ] Authorization verified
- [ ] No sensitive data in logs
- [ ] SQL injection prevention
- [ ] XSS prevention
- [ ] CSRF protection
- [ ] Dependencies up to date
Please confirm these are addressed."
gh pr review 123 --comment --body "## Performance Review
- [ ] No N+1 queries
- [ ] Appropriate caching
- [ ] Database indexes present
- [ ] No blocking operations in main thread
- [ ] Pagination for large datasets
- [ ] Efficient algorithms used
Please verify performance implications."
gh pr review 123 --comment --body "## Code Quality Checklist
- [ ] Follows project style guide
- [ ] No code duplication
- [ ] Proper error handling
- [ ] Meaningful variable names
- [ ] Functions are single-purpose
- [ ] Comments explain why, not what
- [ ] Tests added/updated
Overall structure looks good!"
COMMENTED - General feedback without approval/rejection
APPROVED - Changes approved
CHANGES_REQUESTED - Changes needed before merge
DISMISSED - Review no longer relevant
pull-request-management to view PR details before reviewingcommit-operations to review commit historyissue-management to reference related issuesrepository-management to check file historyWhen reviewing in browser:
r - Start a reviewc - Comment on linee - Edit commentctrl+enter - Submit commentCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.