Repository navigation
Conversation
- .claude/agents/pr-reviewer.md: agent definition with severity model and strict output contract - claude-review: fetch PR diff via API, truncate by whole files, call claude -p, validate the four sections, print or post as a COMMENT review - GitHub Action on pull_request_target (API-only, never checks out PR code) - samples: two real PRs reviewed (+350/-0 and +56/-30) - 19 offline unittest tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4
What
pr-review-agent/ — a Claude Code agent that reviews a real PR diff and returns a structured Markdown review, plus a CLI and a GitHub Action that posts it.
Acceptance criteria
The two real reviews (dogfooding)
Both were produced from the actual fetched diffs, not written by hand as a demo.
#5096 (bash changelog generator, +350/-0) — found the real defects in that submission:
pallets/flask#5918 (automatic OPTIONS routing, +56/-30):
The first sample reviews my own PR and reports my own bugs. That is the point: it is a diff-level review, not a pitch.
Why the output can be trusted enough to post
Security of the Action
Uses pull_request_target (needed to comment on fork PRs) and is safe only because it never checks out PR code: it checks out the base repo with sparse-checkout: pr-review-agent and reads the diff over the API. The README says explicitly not to add a head-SHA checkout to it. Permissions are contents: read, pull-requests: write.
Tests
python3 -m unittest discover -s tests -v -> 19 tests, no network: URL parsing, prompt assembly, whole-file truncation, description cap, fence stripping, section/confidence validation, offline end-to-end, output file, --dry-run (asserts the model is never called), exit codes, --post requiring --pr, and the missing-claude error path.
Live path verified against GitHub: fetched #5096 (+350/-0), #5097, flask#5918 (+56/-30), flask#5665 (+8/-18) through --dry-run, which exercises URL parsing, API fetch, file list and diff truncation without a model call.
Notes