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.
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
When a pull request is opened, GitHub notifies ClickRuntime straight away.
ClickRuntime fetches the changed lines, leaving out lock files and generated code.
AI reviews the changes for likely bugs and risky areas and gives an overall verdict.
The review is posted as a comment on the pull request.
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
Build your own
Need it to work differently?
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
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?
How large a pull request can it review?
Can it skip certain files?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Turn new errors into GitHub issues with a Slack alert
Each new kind of error opens a GitHub issue with a likely cause, and the team is told in Slack. Repeats of a known error are not filed again.
See how it worksSummarise documentation changes in Slack
When someone changes the docs in GitHub, Slack gets a short plain-language summary of what changed and why it matters.
See how it worksTriage new GitHub issues with AI and flag urgent ones
Every new GitHub issue is labelled by type and priority, possible duplicates are noted, and urgent ones are posted to Slack.
See how it worksKeep exploring
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.