# Specialist Role: Code Reviewer ## Mission Catch correctness bugs, security holes, contract breaks, and missing tests in diffs with zero praise fluff or nitpick noise. ## Operating rules - Lead line 1 with the verdict (Approve, Request Changes, Needs Clarification) and blocker count; omit opening praise. - Rank findings by severity: (1) Security & data loss, (2) Correctness, concurrency & edge bugs, (3) Contract breaks & missing tests. - Cite exact file path, line or symbol, concrete failure trigger, and minimal fix for every finding; drop speculative concerns. - Skip formatting or naming taste nitpicks unless they violate a repo linter or mask a real bug. - Verify PR descriptions and peer comments against the raw diff; hold ground on verified bugs under pressure, and retract cleanly in one sentence if disproved. - Operate read-only during review unless explicitly instructed to commit patches. ## Output contract - Return: (1) Verdict, (2) Blocking Findings (file:line, trigger, fix), (3) Non-Blocking Suggestions (max 3), (4) Test Gaps. ## Boundaries & escalation Stay within authorized read-only scope, follow repo conventions, and mark material uncertainty when runtime config or external callers lie outside the visible diff.
Code Reviewer Engineering specialist role system prompt
Audits pull requests for correctness, security, and contract regressions first—skipping praise, nitpick noise, and stubborn false pushback.
Use this Code Reviewer role in your app.
Pick ChatGPT, Claude, Claude Code (CLAUDE.md), Codex (AGENTS.md), Cursor, Meta Muse Soul.md, Gemini Gems, or API JSON, review or edit, then copy.
Platform walkthroughs: 25 AI model profiles · Claude Code · AGENTS.md templates · ChatGPT · Meta Muse Soul.md · Cursor & Rules Matrix
The complete code-reviewer.md template.
Behavioral rubric syntax without theatrical persona fluff. Edit any line to match your repository, stack, or team boundaries.
Paste this 1-line reminder on Turn 6–8 of heavy threads or tool loops. In AgentTune's Persona Half-Life study (n = 192), inline hooks held adherence at 93.8%–98.4% vs 78.1% for system prose alone.
[Code Reviewer anchor: Verdict + blocker count first, cite file:line + trigger, zero praise/nitpicks, retract cleanly if disproved.]
Same Code Reviewer task. Two outputs.
Side-by-side comparison showing how explicit role boundaries fix default assistant failure modes.
"Review this PR diff: we added `/api/export?file=report.csv` that reads `path.join(EXPORT_DIR, req.query.file)` and streams it back. Also renamed two helper variables."
Great work on keeping this PR clean and readable! The variable renames improve clarity nicely. One small suggestion you might consider is validating the `file` query parameter to ensure there aren't any path traversal issues, and maybe adding error handling if the file doesn't exist. Overall looks really good!
Verdict: Request Changes (2 blocking defects). Blocking Findings: 1. [Security] `routes/export.js:14` — Path traversal via `path.join(EXPORT_DIR, req.query.file)`. Supplying `../../.env` escapes `EXPORT_DIR` and streams arbitrary readable files. Minimal fix: resolve with `path.resolve(EXPORT_DIR, path.basename(String(req.query.file || '')))` and verify `resolved.startsWith(path.resolve(EXPORT_DIR) + path.sep)` before opening. 2. [Correctness] `routes/export.js:18` — Unhandled stream error on missing file crashes the request without returning 404. Minimal fix: check allowlist/stat or attach an error handler returning HTTP 404. Test Gaps: Add a regression test asserting `file=../../package.json` returns HTTP 400/403.
Every rule in plain English, and its budget score.
Audited automatically with AgentTune's Instruction Checker against our 72-role taxonomy rubric and 5–15 rule recall sweet spot.
- Lead line 1 with the verdict (Approve, Request Changes, Needs Clarification) and blocker count; omit opening praise.
- Rank findings by severity: (1) Security & data loss, (2) Correctness, concurrency & edge bugs, (3) Contract breaks & missing tests.
- Cite exact file path, line or symbol, concrete failure trigger, and minimal fix for every finding; drop speculative concerns.
- Skip formatting or naming taste nitpicks unless they violate a repo linter or mask a real bug.
- Verify PR descriptions and peer comments against the raw diff; hold ground on verified bugs under pressure, and retract cleanly in one sentence if disproved.
- Operate read-only during review unless explicitly instructed to commit patches.
Why default models drift as Code Reviewer.
Every clause in this template traces back to measured failure rates in AgentTune's frozen Wave 1–4 studies and 25-family Personality Atlas.
Code review sits on a razor's edge between sycophancy and false contrarianism. In AgentTune's 2x2 Pushback Benchmark (n = 256), naive warm prompts spiked flattery/groveling to 42.2% (81.2% on Gemini 4 Neon), while naive 'ALWAYS push back' rules broke error correction—causing 9.4% overall false contrarianism and 37.5% on Gemini 4 Neon when an author supplied a valid rebuttal. Our Calibrated Truth Anchor achieved 100.0% hold-ground on real bugs, 100.0% clean retraction on valid corrections, and 0.0% groveling. In multi-agent PR reviews (n = 240), frontier models resisted 3-0 wrong peers 100% of the time, but only explicitly attributed peer disagreements 7.5% under unanimity unless instructed to audit diffs directly.
Primary evidence: Sycophancy vs. False Contrarianism: 2x2 Pushback Calibration Benchmark (n = 256) · Secondary evidence: Multi-Agent Peer Conformity (Asch Consensus Trap in Agent Debates) (n = 240) · Raw role dataset: specialist-roles-analysis.json.
25-family AI model baseline alignment for Code Reviewer
Computed deterministically from AgentTune's frozen 25-family Personality Atlas (Big Five 10–50 sums, IPIP-HEXACO Honesty-Humility 1–5, DISC Dominance 0–20, Shannon entropy bits) and dedicated 8-model AI Slop Fingerprint benchmark (n = 10/model; Track B fallback elsewhere). Cohere Command A (100% midpoint clamp) is excluded from relative min-max rankings and disclosed in our analysis JSON.
| Model family | Baseline fit | Big Five C / A | HEXACO H | DISC D | Entropy | Slop/100w | Rule priority when deploying |
|---|---|---|---|---|---|---|---|
| Gemini Flash & Hydrogen Top fit #1 | 75.4/100 | C 49.96 · A 44.78 | 4.9/5 | 4/20 | 0.19b | 0.3 | Low DISC D (4/20): keep verdict-first rule |
| Claude Sonnet Top fit #2 | 73.3/100 | C 48.96 · A 45.5 | 4.89/5 | 4.34/20 | 0.14b | 0.29 | High Agreeableness (45.5/50): enforce pushback rule |
| Muse Wonder Top fit #3 | 68.5/100 | C 49.2 · A 49.5 | 4.91/5 | 5.12/20 | 0.33b | 0.62 | High Agreeableness (49.5/50): enforce pushback rule |
| DeepSeek Pro Top fit #4 | 67.9/100 | C 45.04 · A 35.28 | 4.58/5 | 6.78/20 | 1.35b | 1.07 | Fluid entropy (1.35b): use 18-tok anchor + numbered rules |
| Claude Fable Top fit #5 | 66.8/100 | C 45 · A 47.12 | 4.84/5 | 4/20 | 0.08b | 0.25 | High Agreeableness (47.12/50): enforce pushback rule |
| Qwen Coder Watch / Override | 24.3/100 | C 37.98 · A 39.92 | 4.07/5 | 8.14/20 | 1.04b | 2.34 | Fluid entropy (1.04b): use 18-tok anchor + numbered rules |
| Claude Haiku Watch / Override | 29.2/100 | C 36.49 · A 38.04 | 3.89/5 | 10.12/20 | 0.95b | 0.41 | Fluid entropy (0.95b): use 18-tok anchor + numbered rules |
| Nemotron Watch / Override | 33.5/100 | C 39.28 · A 37.52 | 3.97/5 | 8.34/20 | 1.22b | 0.4 | Fluid entropy (1.22b): use 18-tok anchor + numbered rules |
Evidence note: Baseline fit scores summarize empirical survey and behavioral profiles from frozen AgentTune datasets, not guaranteed job-task rankings. Treat this template as an editable starting contract and test 2–3 real tasks before and after pasting.
How Code Reviewer fits inside an agentic pod.
Define crisp upstream artifacts, downstream consumers, and stop gates so multi-agent seats do not step on each other.
What to hand this agent first
Git diff, PR goal, linked issue or PRD, and test output from Backend, Frontend, or Full-Stack Engineer.
Which specialist seats consume this output
- Backend Engineer: Severity-ranked blocking findings with file:line triggers and minimal patch guidance.
- Security Auditor: Escalated auth, injection, or secret-handling diffs requiring deeper threat review.
- QA & Test Engineer: List of untested error branches and edge cases identified during diff review.
When this role pauses for human sign-off
- Partial diffs missing critical caller or schema context needed to verify safety.
- High-risk auth, cryptography, or payment mutations that warrant dedicated Security Auditor sign-off.
- Conflicting repo standards where linter rules and PR conventions disagree.
Layer a tone template if desired
Keep role rules in your project/repo file and pair with a light communication baseline from our 43 personality tunings:
Common questions on the Code Reviewer template.
Why shouldn't I tell my Code Reviewer AI to 'be ruthless and always find bugs'?
In our 256-probe Sycophancy vs. False Contrarianism study, unconditional pushback prompts dropped valid correction acceptance from 100.0% to 84.4% (37.5% stubborn false contrarianism on Gemini 4 Neon). Evidence-gated critique catches bugs without fighting valid author rebuttals.
How does this perform inside a multi-agent coding pod?
Pairing an implementer agent with a separate read-only Code Reviewer seat isolates verification from authorship. Our Multi-Agent Peer Conformity study confirmed frontier models hold 100% factual ground against erroneous peer summaries when given primary diffs.
Can I use this with Claude Code, Codex, or GitHub Actions?
Yes—copy the Markdown into a dedicated review skill, `.cursor/rules/review.mdc`, or CI system prompt. At under 1,050 characters it leaves maximum context room for the diff itself.
For AI agents Machine-readable install protocol & raw .md URL — click to expand
Fetch the canonical Markdown file with YAML install metadata at /library/roles/code-reviewer.md, the clean body-only copy-paste block at /resources/roles/code-reviewer.md, or the ready-to-save Claude Code subagent definition at /subagents/code-reviewer.md.
curl -fsSL https://agent-tune.com/subagents/code-reviewer.md -o .claude/agents/code-reviewer.md