Add PR review mode to code-review workflow#46
Conversation
|
Warning Review limit reached
Your plan includes 1 review of capacity. Refill in 58 minutes and 7 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (9)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
New /pr and /pr-continue commands for reviewing GitHub Pull Requests with deep cross-file analysis, conversational findings (no severity labels or formal tables), and optional GitHub review comment posting. Key design choices: - Separate commands from local review (/start, /continue) since PR review has a fundamentally different input model, role model, and output format - Single reviewer perspective (no dual-role implementor assessment) - Minimal artifacts (metadata + findings only) for round continuity - Full file fetching via gh API for context beyond the diff - Iterative re-review via /pr-continue with interdiff tracking Also updates clean.md to handle PR artifact directories, adds PR artifact table to controller, and references guidelines/review-protocol from PR skills. Co-authored-by: Cursor <cursoragent@cursor.com>
4a4a36b to
72666cd
Compare
|
Thanks for this, Gal — the design thinking here is solid, and the PR review capability is something worth having. Before getting into structural feedback, I want to raise a more fundamental question. Does this need to be a workflow? When a user says "Claude, review PR 123," Claude already:
The workflow adds structure around that — existing comment awareness, generated file skipping, preview before posting, a conversational format. But these are behaviors you can encode in a CLAUDE.md section or a lightweight custom slash command. They don't require a controller, artifact schema, and 500 lines of skill specifications. The multi-round case ( Compare this to the local review workflow, where the dual-role model, artifact-driven iteration loop, and decision tables are things you genuinely can't replicate with a one-liner. That workflow earns its complexity. I'm not sure this one does. If there's a concrete scenario where the workflow catches something a direct ask misses — not just "more consistently" but "at all" — I'd want to hear it. That would change my thinking. If the workflow does move forward, I'd suggest we make it a separate I also found a few implementation issues in the skills that should be addressed regardless:
|
|
Thanks for this review, @adalton. The fundamental question is fair and I want to address it directly. Does this need to be a workflow?You're right that Claude can do a PR review if you just ask. Where the workflow earns its keep is in the consistency and repeatability across team members and sessions — not in capability that doesn't otherwise exist. Specifically:
That said, your point about If you still feel a CLAUDE.md section or lightweight command is the right call after considering the above, I'm open to that. But I think the structured approach catches edge cases that a freeform ask misses in practice. Separate
|
|
Thanks for the follow-up, @galel12. Your four arguments are fair — existing comment awareness in particular is a behavior that a direct ask won't do without being told to. The question is what the right form factor is for encoding that. The behaviors this workflow guarantees — fetching existing comments, skipping generated files, previewing before posting, calibrating against project conventions — are all valuable. But they're declarative rules, not procedural logic. They don't need a controller, artifact schema, or multi-round state management. Compare to the local review workflow, where the dual-role model, decision tables, and artifact-driven iteration loop are structural capabilities that can't be expressed as a few lines of guidance. For PR review, the lightest effective solution is a section in the target project's ## PR Review
When reviewing a Pull Request:
- Fetch existing review comments (`gh api repos/{owner}/{repo}/pulls/{number}/comments`)
and review bodies (`gh api repos/{owner}/{repo}/pulls/{number}/reviews`) before
analyzing. Do not duplicate feedback that has already been given.
- Skip generated files (`*.gen.go`, `*.pb.go`, `vendor/`, `node_modules/`, lock files).
- Read full files for context, not just diffs.
- For fork PRs, use `headRepositoryOwner`/`headRepository` from `gh pr view` for
content API calls — the head SHA lives in the fork repo, not the base.
- Preview the full review before posting. Never post without confirmation.
- Use `line` + `side` instead of `position` for line-level review comments.
- Calibrate against the project's conventions in this file and CONTRIBUTING.md,
not generic preferences.This encodes every valuable behavior from the workflow in ~15 lines. It's discoverable by any AI tool that reads I'd suggest closing this PR and instead adding a PR review section to the target project(s) where the team wants this behavior. If we later find that declarative rules aren't enough — that there's a procedural need the model can't handle from guidance alone — that's evidence for revisiting the workflow approach. The implementation bug fixes (fork PRs, |
Summary
/prand/pr-continuecommands for reviewing GitHub Pull Requests with deep cross-file analysis, conversational findings, and optional GitHub review comment posting/start,/continue) unchanged -- the two modes have distinct input models, role models, and output formatsclean.md,controller.md,guidelines.md,SKILL.md, andREADME.mdto integrate the new commandsDesign decisions
git diff HEADgh pr diff+gh api contents/continue)New files
skills/pr.md-- Core PR review: parse URL/number, fetch metadata + diff + full files viagh, load existing comments, deep cross-file analysis, conversational findings, optional GitHub posting with previewskills/pr-continue.md-- Iterative re-review: interdiff since last reviewed SHA, progress tracking (fixed/remaining/new), follow-up or approving review postingcommands/pr.md-- Thin wrapper for/prcommands/pr-continue.md-- Thin wrapper for/pr-continueModified files
skills/controller.md-- PR phases, dispatch logic, artifact tables, next-step recommendations, context management noteguidelines.md-- PR-specific principles (read-only, single perspective, no quota, depth over breadth), hard limits (preview before posting, no local changes), safety and escalation rulesskills/clean.md-- Handles both{branch}/andpr-{number}/artifact directoriesSKILL.md-- Updated description and command routing for/pr,/pr-continueREADME.md-- PR prerequisites (gh), phases, typical flow, conversational findings docs, artifact layout, directory structureSkill reviewer results
Ran
skill-reviewer /reviewagainst the updated skill. Initial review found 7 suggestions (0 blockers), all addressed in this PR:previous_roundsinitialization guidanceclean.mdupdated for PR artifactsguidelines.mdandreview-protocol.mdreferenced from PR skillsMade with Cursor