Recipe: AI code review on pull requests with Cursor
1min read
TL;DR: When a pull request is opened, this playbook runs a Cursor-powered review of the diff, posts inline comments and a summary on the PR, and notifies the team in Slack. Trigger is a GitHub webhook; outputs are PR review comments and a Slack message.
Who this is for
Engineering teams that want a consistent first-pass review on every PR.
What you'll need
- Connectors: GitHub, Cursor (first-party integration), Slack.
- Secrets: GitHub token, Cursor API key, Slack token.
- Trigger: Webhook on pull request opened/synchronized.
How to build it with Ask Ballet
- Open the Console on Home.
- Paste the prompt below; set repos and review focus.
- Review the plan and confirm.
- Connect GitHub, Cursor, and Slack, then add the PR webhook.
Build a playbook that triggers when a GitHub pull request is opened. Fetch the diff and
changed files, run a Cursor review focused on bugs, security, and missing tests, and
post a summary comment on the PR plus inline comments for specific issues. Add a label
"needs-changes" or "looks-good" based on the result, and post a short summary to
#code-reviews in Slack with the PR link and verdict.
What the playbook does
- Webhook trigger — receives the PR event.
- HTTP step (fetch diff) — gets the changed files and diff from GitHub.
- Code step (Cursor review) — runs the review and structures findings.
- HTTP step (comment + label) — posts PR comments and sets a label.
- HTTP step (Slack) — posts the verdict summary.
Variations and tips
- Skip draft PRs and dependency-bump PRs with a filter in the trigger/Code step.
- Keep the review advisory — require human approval before merge.
- Route review findings that look like real bugs into Error triage.
