CR

Code Reviewer Engineering specialist role system prompt

Engineering & Architecture · Top-25 Rank #2 (95/100)

Audits pull requests for correctness, security, and contract regressions first—skipping praise, nitpick noise, and stubborn false pushback.

7 operating rules (5–15 sweet spot) 1,247 chars · ~312 tokens 0 instruction-linter issues ChatGPT 1,500-char & CLAUDE.md ready
Step 1 · Copy or export

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

Step 2 · Canonical MIT Markdown

The complete code-reviewer.md template.

Behavioral rubric syntax without theatrical persona fluff. Edit any line to match your repository, stack, or team boundaries.

Read-only template · ~/.agenttune/roles/code-reviewer.md
# 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.md 1247 chars · 7 rules · MIT
Multi-turn anti-drift anchor hook (~18 tokens)

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.]
§ I · See the difference

Same Code Reviewer task. Two outputs.

Side-by-side comparison showing how explicit role boundaries fix default assistant failure modes.

Real-world prompt

"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."

Generic AI assistant

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!

Code Reviewer template

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.

What changed: Generic AI buries a critical path-traversal vulnerability under compliments and soft 'one small suggestion' phrasing. The Code Reviewer opens with Request Changes, cites exact file:line and exploit trigger, and skips cosmetic variable-rename commentary.
§ II · Operating rules & lint audit

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.

#2 / 72
Taxonomy rank (95/100)
7 rules
Optimal 5–15 budget
1247 ch
Fits 1,500-char ChatGPT cap
0 issues
Verified by core.check()
  • 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.
§ III · Original research & empirical data

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.

Truth Calibration vs. Groveling & False Contrarianism (n = 256)AgentTune 2x2 Pushback Calibration benchmark (n = 256) comparing truth calibration, groveling/flattery, and false contrarianism across four postures. Truth Calibration %: Agreeable Warm 98.4, Naive Pushback 90.6, Default Baseline 100.0, Calibrated Truth Anchor 100.0; Grovel / Flattery %: Agreeable Warm 42.2, Naive Pushback 6.3, Default Baseline 18.8, Calibrated Truth Anchor 0.0; False Contrarianism %: Agreeable Warm 0.0, Naive Pushback 9.4, Default Baseline 0.0, Calibrated Truth Anchor 0.0.Truth Calibration %Grovel / Flattery %False Contrarianism %scale 0 to 10098.442.20.0Agreeable Warm90.66.39.4Naive Pushback100.018.80.0Default Baseline100.00.00.0Calibrated Truth Anchor
From AgentTune's 2x2 Pushback Calibration benchmark (n = 256 across 4 models). Naive 'always argue' rules dropped valid correction updates to 84.4% (37.5% false contrarianism on Gemini 4 Neon); Calibrated Truth Anchor held 100.0% truth calibration and 0.0% groveling.

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.

§ IV · Agentic team handoffs

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.

Upstream inputs required

What to hand this agent first

Git diff, PR goal, linked issue or PRD, and test output from Backend, Frontend, or Full-Stack Engineer.

Downstream handoffs

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.
Stop & escalation gates

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.
§ V · Questions

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

Full 25-role machine catalog: /library/roles/index.json · Subagents pack: /subagents/index.json · Empirical dataset: /research/data/specialist-roles-analysis.json · MCP server: https://agent-tune.com/mcp (get_role, get_pod).

Copied ✓