Digitorn
Digitorn
All templates
developerintermediate

Pull request reviewer

Fires on a GitHub or GitLab webhook, fetches the diff, reviews it with the read-before-edit guard, posts a structured review with severity tags (blocker, warning, nit) and file:line citations. Capped to N tool calls per PR by a behaviour rule so a freak 5000-line PR cannot drain your budget.

lines 44cost ~$0.05 per typical PRinstall hub://digitorn/pr-reviewer
Install in one command
digitorn install hub://digitorn/pr-reviewer
What you get
  • Posts a review within 2 minutes of PR open
  • Severity-tagged comments with file:line citations
  • Tool-call cap so freak PRs cannot blow the budget
  • Audit log of every review action
Credentials this template uses

Click each one for the credential setup command, scope guidance, and provider details.

The full YAML, ready to fork

app.yaml
1app:2  app_id: pr-reviewer3  name: "PR reviewer"4  version: "1.0.0"5  category: "developer-tools"67modules:8  filesystem: { config: { read_before_edit: true } }9  web: {}10  shell: {}1112execution:13  mode: background14  entry_agent: reviewer15  triggers:16    - id: pr-opened17      type: http18      path: /hooks/github-pr19      method: POST20      message: "{{event.body.pull_request.title}}\n\n{{event.body.pull_request.body}}"21  hooks:22    - id: pr_audit23      "on": turn_end24      condition: { type: always }25      action:26        type: shell27        command: |28          echo '{"ts":"$(date -u +%FT%TZ)","pr":"{{event.body.pull_request.id}}"}' \29            >> /var/log/digitorn/pr-review-audit.jsonl30    - id: pr_budget_cap31      "on": tool_start32      condition:33        type: expression34        expr: "session.tool_calls.total >= 30"35      action:36        type: gate37        message: "PR review budget cap reached. Ask a human to extend."3839agents:40  - id: reviewer41    modules: [filesystem, {web: [fetch]}, {shell: [bash]}]42    brain:43      provider: anthropic44      model: claude-sonnet-4-645      credential:46        ref: anthropic_main47        scope: per_user48        provider: anthropic49    system_prompt: |50      Review the PR diff. Tag each comment with severity (blocker, warning, nit).51      Cite file:line for every comment. Be terse.

How it works

webhook trigger on PR open
The runtime exposes /hooks/github-pr. GitHub fires a POST when a PR opens. The trigger spawns the reviewer agent with the PR title and body as the goal.
behavior rule for the cost ceiling
behavior.rules with tool_calls > 30 → gate. Past 30 tool calls in one session, the runtime stops the agent and the user is asked to extend the budget. Catches the runaway-PR case cheaply.
audit hook for compliance
A turn_end hook serialises the turn (PR id, tools called, comments posted) into a JSONL audit log. Useful when someone asks 'show me every review the agent did on account X'.
Read the deep dive

Hooks: 4 production patterns we ship today on Digitorn

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 templates

developerStarter coder/templates/starter-coderdeveloperClaude Code clone/templates/claude-code-cloneresearchDeep research agent/templates/deep-researchmessagingSlack helper/templates/slack-helperopsWeekly digest reporter/templates/weekly-digestknowledgeDocumentation generator/templates/doc-writercreativeLive React app builder/templates/react-buildermessagingVoice assistant/templates/voice-assistantopsScheduled data pipeline/templates/data-pipeline