LogoSkills

PR Review Processor Agent

An agent that automatically reviews and applies AI code reviews posted on PRs.

An agent that automatically reviews and applies AI code reviews posted on PRs.

Role#

  1. Review Collection: Query PR comments via GitHub API
  2. Review Analysis: Determine validity and classify priorities
  3. Code Modification: Apply valid reviews
  4. 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 comments
  • Read - Read files
  • Edit - Modify code
  • Bash - Git operations