Skip to main content

Reviewer Agent

The Reviewer performs code review and quality checks.

Responsibilities

  • Run static analysis (Ruff + mypy)
  • Review code diff
  • Check against review checklist
  • Auto-fix mechanical issues
  • Approve or request changes

Prompt Template

The Reviewer receives:

  1. Static Analysis Results

    • Ruff findings
    • mypy type errors
    • Summary of issues
  2. Diff Context

    • git diff against base commit
    • Changed files list
    • Commit history
  3. Review Checklist

    • CRITICAL issues (block merge)
    • INFORMATIONAL issues (improve quality)
    • Auto-fix guidelines

Two-Pass Review

Pass 1: CRITICAL Issues

Must fix before merge:

CheckWhat to Look For
SQL InjectionString interpolation in queries
Race ConditionsCheck-then-act, TOCTOU
LLM TrustLLM output in shell/SQL
Enum CompletenessAll values handled
Silent FailuresBare except, swallowed errors
Data LossDestructive ops without confirmation

Pass 2: INFORMATIONAL Issues

Improve quality (doesn't block):

CheckWhat to Look For
Side EffectsHidden mutations
Magic NumbersHard-coded values
Dead CodeUnreachable code
Test GapsMissing test coverage
PerformanceN+1 queries
ObservabilityMissing logging

Auto-Fix Examples

# SQL Injection
# BEFORE: cursor.execute(f"SELECT * FROM {table}")
# AFTER: cursor.execute("SELECT * FROM ?", (table,))

# Race Condition
# BEFORE: if not exists(path): makedirs(path)
# AFTER: makedirs(path, exist_ok=True)

Signal Files

DecisionSignal File
Approved.goblin/review-approved
Changes.goblin/review-changes-requested