Digitorn
Digitorn
← All use cases
developer

Build a automated code reviewer in YAML

An agent that reads a PR diff, surfaces risks, and posts a structured review.

filesystemwebtriggers.webhookbehavior
The pattern

A coding agent that watches for new pull requests, fetches the diff, runs lint and security checks, and posts a structured review with risk tags. Works with GitHub, GitLab, or any system that fires a webhook. Cost-controlled by behaviour rules so a freak 5000-line PR cannot drain your budget.

What good looks like
  • Posts within 2 minutes of PR open
  • Cites file:line for every comment
  • Tags severity (blocker, warning, nit) consistently
  • Stays under N tool calls per PR
Common pitfalls
  • Reviewing every commit instead of every PR (noisy)
  • Missing the read-before-edit guard, hallucinating file contents
  • No turn cap, runaway cost on huge PRs
  • Generic prose without file:line citations

The minimum YAML to ship this

app.yaml
1modules:2  filesystem: { config: { read_before_edit: true } }3  web: {}45triggers:6  - id: pr-opened7    kind: webhook8    path: /hooks/github-pr9    target: { agent: reviewer, message: "{{event.body.pull_request.title}}" }1011behavior:12  rules:13    - condition: tool_calls > 3014      action: gate1516agents:17  - id: reviewer18    modules: [filesystem, {web: [fetch]}]19    brain: { model: claude-sonnet-4-6 }20    system_prompt: "Review the diff. Tag severity. Cite file:line for each comment."
Ship in 5 minutes

Install Digitorn and deploy this agent

# 1. install runtime
curl -sSL https://digitorn.ai/install | sh

# 2. save the YAML above to ~/.digitorn/apps/my-code-review/app.yaml
mkdir -p ~/.digitorn/apps/my-code-review
# paste the YAML into app.yaml

# 3. deploy
digitorn deploy my-code-review
Read the deep dive

How to build a Claude Code clone in YAML

Read article
Newsletter

Get the next post in your inbox.

Engineering notes from the Digitorn team. No marketing, no launch announcements, no "10 prompts that will change your life". Just the things we write that we'd want to read.

One-click unsubscribe. We never share your address. Powered by our own infrastructure, not a tracker.

Other things you can build

communicationSlack copilot/use-cases/slack-botknowledgeResearch agent with citations/use-cases/research-agentdeveloperDocumentation generator/use-cases/documentation-generatorcommunicationVoice assistant/use-cases/voice-assistantopsScheduled reporter/use-cases/cron-reporterdeveloperPR triager/use-cases/pr-triagerknowledgeMeeting note-taker/use-cases/meeting-notesopsEmail triager/use-cases/email-triagecreativeLive React app builder/use-cases/react-builder