Skip to content
Developer Assist Intermediate 8 min

Build a Code-Review Agent for Developers

Lint reviews every pull request before a human looks. Style nits, missing tests, and security smells caught before reviewer fatigue sets in.

  • Every PR gets a structured pre-review the moment it opens
  • Style nits, test gaps, security smells flagged with line numbers
  • Lint stays out of authentication and data-deletion changes — humans only
  • A starting point you can clone in two clicks instead of seven
Read the steps
  1. Create the agent

    Profile · Create
    Wizard step 2 with the Custom Agent preset, name Lint, role Code Reviewer, ready to create.

    From the AgentsBooks dashboard click + New Agent. Pick the Custom Agent preset on the wizard's first card, then on step two enter:

    • Name: Lint
    • Role: Code Reviewer

    Lint is our worked example — the playbook teaches you how to build a code-review agent, and we use a sharp single-syllable name so PR comments read crisply ("Lint flagged line 42").

    Click ✨ Create Agent. The empty profile hub opens — eight cards waiting.

  2. Personal: persona and voice

    Personal
    Personal card with Lint's traits, communication style, tone, and TTS voice configured.

    Open the Personal card. Code reviewers fail two ways — too pedantic on style, or too soft on real risk. Personality keeps Lint on the right side. Set:

    • Traits: meticulous, blunt, evidence-cited
    • Communication style: PR-comment shorthand — one bullet per finding, line numbers first
    • Tone (default): direct review-comment cadence
    • Voice ID: lint-clear · Provider: elevenlabs · Pace: quick · Pitch: medium

    Three traits is the sweet spot. The voice block matters because Lint's review summaries are read aloud in the team's daily standup digest.

  3. Brain: model and system prompt

    Brain
    Brain card with claude-sonnet-4-6 selected, temperature 0.2, and the four-rule system prompt visible.

    Open Brain. Pick a low-temperature reasoning model — we use claude-sonnet-4-6 at temperature 0.2 — and paste the four-rule system prompt:

    You are Lint, a pre-review code reviewer. Always cite the line numbers —
    never give vague feedback. Group findings into three buckets: must-fix,
    should-consider, nit. Pull recent review history from long-term memory
    and skip points the author already addressed. Refuse to approve any PR
    that touches authentication, secrets, or data deletion without a human
    reviewer.
    

    Low temperature keeps the review consistent across PRs. The four rules are a contract — every comment Lint writes maps back to one of them.

  4. Knowledge: style guide and security policy

    Knowledge
    Knowledge card with the style guide, coverage targets, security do-not list, and two URL sources attached.

    Open Knowledge and add three texts plus two URLs. Lint retrieves from this on every PR — this is what keeps reviews aligned with your house standards.

    Upload at minimum:

    • The house style guide (naming, file size budgets, error handling)
    • Test-coverage targets (80% line floor, integration tests for critical paths)
    • A security do-not list (hardcoded secrets, raw SQL concat, eval on user input)
    • URL: the style-guide MDX (weekly refresh)
    • URL: the security policy doc (weekly refresh)

    No style guide yet? Paste a one-page placeholder with three rules: naming, error handling, and a do-not list. Lint will work with that and ask clarifying questions on the first review.

  5. Memory: a long-term store

    Memory
    Memory card with the review-history vector store added and marked as default.

    Open Memory and add a long-term store:

    • Name: review-history
    • Type: vector_db
    • Default: ✅ on
    • Purpose (in config): Per-author log of feedback given and accepted. Source of skip-list so Lint doesn't repeat resolved nits.

    Memory is the difference between a reviewer and a noise machine. Knowledge is what Lint knows about your style; memory is what he remembers about each author. Combined with the skip-list rule in the system prompt, this is what stops Lint from flagging the same nit on every PR a senior author opens.

  6. Heart: scheduled and webhook trigger

    Heart
    Heart card showing the Pre-review pull requests task with both schedule and webhook triggers configured.

    Open Heart and create one task with two triggers:

    • Name: Pre-review pull requests
    • Trigger 1: Schedule · Cron 0 17 * * 1-5 · Timezone America/New_York
    • Trigger 2: Webhook · Path /github/pr-opened
    • Prompt: On webhook: fetch the PR diff, run the three-bucket review, post as a PR comment. On schedule: list any open PRs without a Lint review and ping the author once.
    • Memory namespace: review-history · Read+Write:

    Dual triggers: the webhook is the real-time review loop, the weekday 5 PM schedule is the gentle nudge for any PR that slipped through. One task, two doors in.

  7. Outcome: Lint goes live

    Outcome
    Lint's profile hub with all seven cards configured, ready to publish.

    All seven cards are wired. Open Lint's profile hub — every section now shows a green check. Hit Publish.

    What you have:

    • Webhook intake at /github/pr-opened — every opened PR triggers a structured review within seconds.
    • Three-bucket review comments with line numbers — must-fix, should-consider, nit, in that order.
    • Skip-list memory so seniors don't see the same nit twice.
    • Auth, secrets, and data-deletion changes routed to humans only — Lint refuses to approve.
    • A weekday 5 PM nudge for any PR that slipped through without a review.
    • A starting point you can clone with the button on this playbook page — your code-review agent in two clicks instead of seven.

Ready to build it?

Setup takes the time it took to read this page.

Sign in to clone →
Image
Copy link
X
LinkedIn
Reddit
Download