Skip to content
OpenAgentsbeta
text
1# PR Reviewer
2
3A structured pull-request review workflow. Instead of an unstructured "look over this
4diff" pass, the agent gathers full context, assigns a risk tier, works a fixed
5correctness/security/tests/performance checklist, and reports findings in a
6severity-tagged format (blocker / major / minor / nit) with file:line references and
7concrete fixes.
8
9## When to use
10
11- Before merging any non-trivial PR, especially ones touching auth, payments, public
12 APIs, or shared/widely-imported code.
13- As a first pass before a human review, to surface the mechanical issues (missing
14 edge cases, weak tests, injection risks) so the human reviewer can focus on design
15 and product judgment.
16- On your own PRs before requesting review, to catch obvious issues early.
17
18Not a replacement for architectural/design review — it reviews the diff in front of
19it, not whether the feature should exist.
20
21## Install
22
23```bash
24npx openagents-cli add openagents/pr-reviewer
25```
26
27Or pick a runtime explicitly:
28
29```bash
30npx openagents-cli add openagents/pr-reviewer --runtime claude-code
31```
32
33| Runtime | Installed to |
34|---|---|
35| `claude-code` | `.claude/skills/pr-reviewer/` |
36| `cursor` | `.cursor/rules/pr-reviewer/` |
37| `codex` | `.codex/skills/pr-reviewer/` |
38| `generic` | `.openagents/pr-reviewer/` |
39
40## Inputs
41
42| name | type | required | default | description |
43|---|---|---|---|---|
44| `pr_ref` | string | yes | — | PR number, branch name, or commit range (e.g. `123`, `feature/x`, `main..HEAD`) |
45| `base_ref` | string | no | `main` | Base branch/ref to diff against |
46| `post_comments` | boolean | no | `false` | Post inline comments to the PR instead of just printing a report |
47
48## Example run
49
50```
51> Review PR #482 against main. Don't post comments, just give me the report.
52```
53
54The agent will:
551. Run `gh pr diff 482` and `gh pr view 482 --json title,body,files` for context.
562. Classify the PR as High/Medium/Low risk (e.g. High — touches `src/auth/session.ts`).
573. Work the checklist in `rules/review-checklist.md`.
584. Verify new tests actually exercise the changed behavior.
595. Print a report using `templates/review-comment.md`, ordered blocker → nit.
60
61## Files
62
63- `WORKFLOW.md` — the step-by-step procedure (entry point).
64- `rules/review-checklist.md` — the correctness/security/tests/performance checklist.
65- `templates/review-comment.md` — output format and severity definitions.
66
67## Limitations
68
69- Requires the `gh` CLI (or equivalent git/platform access) to fetch PR diffs and
70 metadata; without it, supply a local `git diff` range instead.
71- Does not run the test suite or a security scanner itself — it reads code, it doesn't
72 execute it. Pair with your CI for dynamic checks (fuzzing, SAST, dependency audits).
73- Large diffs (2000+ changed lines) are flagged rather than silently reviewed in full;
74 scope the review to specific files/directories for best results.
75- `post_comments: true` is a side-effectful action — the workflow always confirms the
76 exact comments before posting.
77

Keyboard shortcuts

Focus search
/
Go to Explore
ge
Go to Home
gh
Go to Tags
gt
Go to Collections
gc
Show this help
?
Close suggestions or this dialog
Esc