| name | aif-review |
| description | Perform code review on staged changes or a pull request. Checks for bugs, security issues, performance problems, and best practices. Use when user says "review code", "check my code", "review PR", or "is this code okay". |
| argument-hint | [PR number or empty] |
| allowed-tools | Bash(git *) Bash(gh *) Read Glob Grep |
Code Review Assistant
Perform thorough code reviews focusing on correctness, security, performance, and maintainability.
Behavior
Without Arguments (Review Staged Changes)
- Run
git diff --cached to get staged changes
- If nothing staged, run
git diff for unstaged changes
- Analyze each file's changes
With PR Number/URL
- Use
gh pr view <number> --json to get PR details
- Use
gh pr diff <number> to get the diff
- Review all changes in the PR
Review Checklist
Correctness
Security
Performance
Best Practices
Testing
Output Format
## Code Review Summary
**Files Reviewed:** [count]
**Risk Level:** 🟢 Low / 🟡 Medium / 🔴 High
### Critical Issues
[Must be fixed before merge]
### Suggestions
[Nice to have improvements]
### Questions
[Clarifications needed]
### Positive Notes
[Good patterns observed]
Review Style
- Be constructive, not critical
- Explain the "why" behind suggestions
- Provide code examples when helpful
- Acknowledge good code
- Prioritize feedback by importance
- Ask questions instead of making assumptions
Examples
User: /aif-review
Review staged changes in current repository.
User: /aif-review 123
Review PR #123 using GitHub CLI.
User: /aif-review https://github.com/org/repo/pull/123
Review PR from URL.
Integration
If GitHub MCP is configured, can:
- Post review comments directly to PR
- Request changes or approve
- Add labels based on review outcome
Tip: Context is heavy after code review. Consider /clear or /compact before continuing with other tasks.