Public demo. Data resets daily at 3:00 UTC. Don't store anything sensitive.

agent-pr-review

v1.0 active

An agent reviews a pull request diff and emits a typed decision (approve, request_changes, or comment); a stub posts the review; the author is notified.

View instances
Owner
platform-team
SLA
30m
Trigger
api
Tags
developer-toolingcode-reviewagent-harnessai

Inputs

pr_url
string · required

Full GitHub PR URL (e.g. https://github.com/org/repo/pull/42)

repo
string · required

Repository slug (e.g. acme/api-gateway)

base_branch
string · required

Target branch the PR merges into (e.g. main)

author_email
string · required

PR author email for notification

reviewer_context
string

Optional instructions or focus areas for the review agent

Outputs

review_decision
string
summary
string
comment_url
string

Steps

  1. 1

    Collect PR details and diff

    collect-pr-details form

    Agent or engineer provides the diff and metadata needed for review

    Inputs
    pr_url process.inputs.pr_url repo process.inputs.repo base_branch process.inputs.base_branch
    Outputs
    title (string) description (string) diff (string) files_changed (number) lines_added (number) lines_removed (number)
  2. 2

    Agent code review

    review-pr judgment

    LLM reviews the PR diff for correctness, style, security issues, and test coverage; emits a typed decision with line-level comments

    Inputs
    pr_url process.inputs.pr_url repo process.inputs.repo base_branch process.inputs.base_branch title steps.collect-pr-details.outputs.title description steps.collect-pr-details.outputs.description diff steps.collect-pr-details.outputs.diff files_changed steps.collect-pr-details.outputs.files_changed reviewer_context process.inputs.reviewer_context
    Outputs
    review_decision (enum) summary (string) line_comments (string[]) security_flags (string[]) test_coverage_ok (boolean)
    threshold: 0.8 escalation: manual
  3. 3

    Post review comment (demo stub)

    post-comment automated

    Simulates posting the review to GitHub. In production, replace this script with a real GitHub API call. See NOTE in file header.

    Inputs
    pr_url process.inputs.pr_url review_decision steps.review-pr.outputs.review_decision summary steps.review-pr.outputs.summary line_comments steps.review-pr.outputs.line_comments
    Outputs
    comment_posted (boolean) comment_url (string)
    script: ./examples/steps/post-pr-comment.rb
  4. 4

    Notify PR author

    notify-author notification
    Inputs
    author_email process.inputs.author_email pr_url process.inputs.pr_url review_decision steps.review-pr.outputs.review_decision comment_url steps.post-comment.outputs.comment_url summary steps.review-pr.outputs.summary
Raw definition
---
opensop: '0.1'
process:
  sla:
    target: 30m
    warning: 15m
  name: agent-pr-review
  tags:
  - developer-tooling
  - code-review
  - agent-harness
  - ai
  owner: platform-team
  steps:
  - id: collect-pr-details
    name: Collect PR details and diff
    type: form
    inputs:
    - from: process.inputs.pr_url
      name: pr_url
    - from: process.inputs.repo
      name: repo
    - from: process.inputs.base_branch
      name: base_branch
    outputs:
    - name: title
      type: string
    - name: description
      type: string
    - name: diff
      type: string
      description: Full unified diff of the PR (git diff output)
    - name: files_changed
      type: number
    - name: lines_added
      type: number
    - name: lines_removed
      type: number
    timeout: 30m
    on_timeout: notify-and-wait
    description: Agent or engineer provides the diff and metadata needed for review
  - id: review-pr
    name: Agent code review
    type: judgment
    inputs:
    - from: process.inputs.pr_url
      name: pr_url
    - from: process.inputs.repo
      name: repo
    - from: process.inputs.base_branch
      name: base_branch
    - from: steps.collect-pr-details.outputs.title
      name: title
    - from: steps.collect-pr-details.outputs.description
      name: description
    - from: steps.collect-pr-details.outputs.diff
      name: diff
    - from: steps.collect-pr-details.outputs.files_changed
      name: files_changed
    - from: process.inputs.reviewer_context
      name: reviewer_context
    outputs:
    - name: review_decision
      type: enum
      values:
      - approve
      - request_changes
      - comment
    - name: summary
      type: string
      description: High-level review summary (1-3 paragraphs)
    - name: line_comments
      type: string[]
      description: Array of file:line:comment strings for specific feedback
    - name: security_flags
      type: string[]
      description: Any security concerns identified
    - name: test_coverage_ok
      type: boolean
    judgment:
      escalation: manual
      allow_agent: true
      confidence_threshold: 0.8
      require_human_review: false
    description: LLM reviews the PR diff for correctness, style, security issues,
      and test coverage; emits a typed decision with line-level comments
  - id: post-comment
    run: "./examples/steps/post-pr-comment.rb"
    name: Post review comment (demo stub)
    type: automated
    retry:
      max: 2
      backoff: exponential
    inputs:
    - from: process.inputs.pr_url
      name: pr_url
    - from: steps.review-pr.outputs.review_decision
      name: review_decision
    - from: steps.review-pr.outputs.summary
      name: summary
    - from: steps.review-pr.outputs.line_comments
      name: line_comments
    outputs:
    - name: comment_posted
      type: boolean
    - name: comment_url
      type: string
    validation: lenient
    description: Simulates posting the review to GitHub. In production, replace this
      script with a real GitHub API call. See NOTE in file header.
  - id: notify-author
    name: Notify PR author
    type: notification
    inputs:
    - from: process.inputs.author_email
      name: author_email
    - from: process.inputs.pr_url
      name: pr_url
    - from: steps.review-pr.outputs.review_decision
      name: review_decision
    - from: steps.post-comment.outputs.comment_url
      name: comment_url
    - from: steps.review-pr.outputs.summary
      name: summary
  inputs:
  - name: pr_url
    type: string
    required: true
    description: Full GitHub PR URL (e.g. https://github.com/org/repo/pull/42)
  - name: repo
    type: string
    required: true
    description: Repository slug (e.g. acme/api-gateway)
  - name: base_branch
    type: string
    required: true
    description: Target branch the PR merges into (e.g. main)
  - name: author_email
    type: string
    format: email
    required: true
    description: PR author email for notification
  - name: reviewer_context
    type: string
    description: Optional instructions or focus areas for the review agent
  outputs:
  - from: steps.review-pr.outputs.review_decision
    name: review_decision
    type: string
  - from: steps.review-pr.outputs.summary
    name: summary
    type: string
  - from: steps.post-comment.outputs.comment_url
    name: comment_url
    type: string
  trigger:
    type: api
  version: '1.0'
  on_error:
    notify:
      target: "#platform-alerts"
      channel: slack
  description: An agent reviews a pull request diff and emits a typed decision (approve,
    request_changes, or comment); a stub posts the review; the author is notified.