Add PR review agents#5
Conversation
- address-reviews: monitors a single PR for CodeRabbit comments, fixes actionable ones, replies with commit SHAs, polls every 5 minutes until the PR is merged or closed. - pr-review-orchestrator: finds open PRs with comments and dispatches one address-reviews agent per PR. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds two Claude agents: an orchestrator that finds open PRs with review comments and an address-reviews agent that classifies unresolved comments, applies one-commit-per-fix changes on the PR branch, validates (revert on failure), replies with commit SHAs, and polls until the PR closes or merges. Also adds a Markdown fenced-code language guidance. ChangesPR Review Automation Agents
Sequence DiagramsequenceDiagram
participant User
participant Orchestrator as pr-review-orchestrator
participant GitHub
participant AddressAgent as address-reviews
participant Validation as CI/Validator
User->>Orchestrator: Request PR review automation
Orchestrator->>GitHub: List open PRs
loop Each PR
Orchestrator->>GitHub: Fetch review comments
alt Has comments
Orchestrator->>AddressAgent: Dispatch with PR metadata
AddressAgent->>GitHub: Fetch PR data and comments
loop Each actionable comment
AddressAgent->>AddressAgent: Apply fix (one commit)
AddressAgent->>Validation: Run build/lint/test
alt Validation passes
AddressAgent->>GitHub: Push commit & reply with commit SHA
else Validation fails
AddressAgent->>AddressAgent: Revert commit & reply reporting failure
end
end
AddressAgent->>GitHub: Monitor PR state (5 min loop)
end
end
Orchestrator->>User: Report dispatched PRs
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.claude/agents/address-reviews.md:
- Around line 18-47: Three fenced command blocks in the markdown lack a language
specifier causing markdownlint MD040; update the three opening triple-backtick
fences that precede the command examples (the blocks containing "gh pr view
{number} --json state,headRefName,title", "gh api
repos/{owner}/{repo}/pulls/{number}/comments/{comment_id}/replies -f
body=\"Fixed in <commit_sha>\"", and the final "gh pr view {number} --json
state") to use ```bash so each block is ```bash ... ```; make the change in the
.claude/agents/address-reviews.md file, commit the single logical change, run
markdownlint to confirm MD040 is resolved, and push the commit.
- Around line 23-55: The monitoring loop in the address-reviews spec must
persist processed comment IDs to avoid duplicate fixes: modify the polling logic
(the "Monitoring loop" and steps that fetch comments with gh/pr API) to store
handled comment_id values in local persistent state (file or lightweight DB), on
each poll fetch only new comments using the GitHub REST `since` parameter or by
comparing incoming comment.id against the stored set, skip any comment whose id
is already persisted, and append newly-processed ids after successfully creating
a commit and replying via the existing gh api reply flow; optionally add a
switch to use GraphQL `reviewThreads.isResolved` when resolution detection is
required and recommend using GitHub webhooks (`pull_request_review_comment` or
webhooks processing) instead of polling to eliminate reprocessing.
In @.claude/agents/pr-review-orchestrator.md:
- Around line 13-26: The three unlabeled fenced code blocks showing shell
commands and a spawn prompt should be marked as bash to satisfy markdownlint
MD040: change the opening fences for the blocks containing "gh pr list --state
open --json number,title,headRefName", "gh api
repos/{owner}/{repo}/pulls/{number}/comments --jq 'length'", and the block with
the agent prompt "Work on PR #{number} ({title}) in this repository. The branch
is {headRefName}." so each begins with ```bash instead of ```; keep the block
contents unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: b0d80f51-4eb6-4289-a343-c2c23c428793
📒 Files selected for processing (2)
.claude/agents/address-reviews.md.claude/agents/pr-review-orchestrator.md
- Add bash/text language to all fenced code blocks (MD040) - Add comment ID tracking to prevent duplicate fixes across polling cycles Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary
address-reviewsagent: monitors a single PR for CodeRabbit review comments, fixes actionable ones (one commit per comment), replies with commit SHA, polls every 5 minutes until merged/closedpr-review-orchestratoragent: finds all open PRs with comments and dispatches oneaddress-reviewsagent per PRUsage
Invoke the orchestrator from conversation or agent view:
Or dispatch directly:
Test plan
/agentslibrary🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation