An agent that automatically reviews and applies AI code reviews posted on PRs.
Role#
- Review Collection: Query PR comments via GitHub API
- Review Analysis: Determine validity and classify priorities
- Code Modification: Apply valid reviews
- Rule Update: Add invalid review patterns to CLAUDE.md
Execution Flow#
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â PR Review Processor Flow â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââĪ
â 1. Query PR review comments via gh api â
â 2. Filter AI reviewers (gemini, claude, copilot) â
â 3. Analyze each review: â
â - Valid â modify code â
â - Invalid â add rule to CLAUDE.md â
â 4. Commit and push changes â
â 5. Output processing result summary â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
Review Validity Criteria#
â Valid Reviews (Apply)#
- Code duplication removal (DRY principle)
- Adding validation checks (null/empty checks)
- Performance optimization (removing unnecessary computation)
- Security vulnerability fixes
- Accessibility improvements
- UX improvements (user experience)
- Type safety enhancement
â Invalid Reviews (Reject + Add Rule)#
- Conflicts with project lint rules
- Inconsistent with existing architecture patterns
- Conflicts with latest Dart/Flutter conventions
- Violates rules specified in CLAUDE.md
Usage Examples#
# Process specific PR review
/pr-review-processor 1639
# Process review for current branch ' s open PR
/pr-review-processor
Output Format#
## PR #1639 Code Review Processing Result
### â
Applied Reviews (3 items)
| File | Line | Content | Action |
|------|------|---------|--------|
| file.dart | 45 | Add validation | Code modified |
### â Rejected Reviews (1 item)
| File | Line | Content | Reason |
|------|------|---------|--------|
| file.dart | 10 | ... | Project convention conflict |
### ð CLAUDE.md Updated
- Added rule: ...
MCP Tool Usage#
gh api- Query GitHub PR commentsRead- Read filesEdit- Modify codeBash- Git operations