Skip to content

The moment it happens

Get an AI first review on every pull request

Each new pull request gets a review comment pointing out likely bugs and risks, and Slack shows a one-line verdict with the link.

Runs
The moment it happens
Apps
GitHub, Slack
AI
Yes, uses the built-in AI allowance
Access
pull_requests:write; chat:write

Send this to your assistant

Create a ClickRuntime automation: when a pull request is opened in acme/web, have AI review the diff for bugs and risky changes, post the review as a PR comment, and post a one-line verdict to #code-review.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

A small engineering team has two senior developers who review everyone's code. Pull requests wait a day or more for their attention, and simple mistakes like a missing null check take a full review cycle to catch.

An AI first pass, posted as a comment the moment a pull request opens, catches the obvious issues before a person looks. The author can fix them straight away, and the senior reviewers spend their time on design rather than typos.

What you get out of it

  • Feedback in minutes, not a day

    Authors see likely problems straight after opening the pull request. Small fixes happen while the change is fresh in their mind.

  • Reviewers focus on what matters

    Obvious slips are flagged before a person reviews. Senior time goes on architecture, naming and product questions.

  • Risky changes are highlighted

    Changes to payments, authentication or data migrations are called out in the verdict. The team knows which pull requests deserve extra care.

  • Visible in Slack

    A one-line verdict with the link tells reviewers what is waiting and how much attention it needs. Nothing hides in a notification email.

How it works

What happens, step by step

  1. When a pull request is opened, GitHub notifies ClickRuntime straight away.

  2. ClickRuntime fetches the changed lines, leaving out lock files and generated code.

  3. AI reviews the changes for likely bugs and risky areas and gives an overall verdict.

  4. The review is posted as a comment on the pull request.

  5. A one-line verdict with a link is posted to your #code-review Slack channel.

Before it runs live

  • Connect GitHub
  • Connect Slack, then invite the app to the channel (type /invite @ClickRuntime there)
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Get an AI first review on every pull requestjust nowSucceeded
Slack · #code-reviewacme/web#418 Add saved carts: Looks fine overall; check the missing null check on guest users in cart.ts.

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Act only on the items that match your own rules, and skip the rest
  • Change what the AI looks for, or how it writes the result
  • Add another app, for example also send it to Google Sheets
  • Combine it with other GitHub and Slack steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
ai_pull_request_review_posted_to_slack.pyexample
from clickruntime import on_event, credentials, http, notify, verify, ai

def gh(method, path, **kw):
    resp = http.request(method, f"https://api.github.com{path}", headers={
        "Authorization": f"Bearer {credentials.connection('github', 'work')}", "Accept": "application/vnd.github+json"}, **kw)
    return resp.raise_for_status() or (resp.json() if resp.content else None)

SCHEMA = {"type": "object", "properties": {"verdict": {"type": "string"}, "review": {"type": "string"}}}

@on_event
def handle(event):
    if not verify.github(event.body, event.header("X-Hub-Signature-256"), credentials.secret("GITHUB_WEBHOOK_SECRET")):
        return {"ignored": "bad signature"}
    body = event.json
    if event.header("X-GitHub-Event") != "pull_request" or body["action"] not in ("opened", "ready_for_review"):
        return {"ignored": True}
    pr, repo = body["pull_request"], body["repository"]["full_name"]
    files = gh("GET", f"/repos/{repo}/pulls/{pr['number']}/files", params={"per_page": 100})
    diff = "\n".join(f"--- {f['filename']}\n{f.get('patch', '')}" for f in files
                     if not f["filename"].endswith((".lock", "package-lock.json", ".svg", ".png")))[:24000]
    result = ai.generate(f"PR: {pr['title']}\n{pr.get('body') or ''}\n\n{diff}", json_schema=SCHEMA, max_output_tokens=1200,
                         system="Review this diff. List likely bugs and risky changes with file names. Give a one-line verdict.").json
    gh("POST", f"/repos/{repo}/issues/{pr['number']}/comments", json={"body": f"**AI first review**\n\n{result['review']}"})
    notify.slack(f"<{pr['html_url']}|{repo}#{pr['number']} {pr['title']}>: {result['verdict']}", channel="#code-review")
    return {"reviewed": pr["number"]}

FAQ

Common questions

Does the AI approve or block pull requests?
No. It leaves a comment. Approval and merging stay with your team and your branch rules.
How large a pull request can it review?
It reads the changed lines up to a sensible size. Very large pull requests are reviewed on the first part, and the comment says so.
Can it skip certain files?
Yes. Lock files, generated code and images are left out by default, and you can add your own paths to skip.
What permissions does it need?
pull_requests:write; chat:write. Nothing else in your accounts is used.
Does it need AI?
Yes. It uses ClickRuntime's built-in AI, so you don't need an OpenAI or Anthropic key. Every plan includes a monthly AI allowance.
How many runs does it use?
One run for each event the app sends.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Get an AI first review on every pull request” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.