Back to use cases
Code Quality

Auto-Fix PR Bugs Before Merge

Opulent reviews every PR for bugs and pushes fixes to the branch automatically.

Integrations
AuthorOpulent
CategoryCode Quality
FeaturesIntegrations
start it with one message
Review every PR on our enrolled repositories for bugs. For severe issues, push a fix commit to the branch automatically. Add a REVIEW.md file that defines our review guidelines and common bug patterns.
Run this in OpulentCopy it, swap the names for your own, and send it.
connected systems
GitHubManage repositories, track code changes, and collaborate on team projects
SentryReview errors, analyze root causes, and suggest fixes for rapid issue resolution
LinearTrack issues, manage projects, and organize workflows across your team
step 1

Enroll repos and enable auto-fix

Connect GitHub. In Opulent settings, enroll the repositories you want reviewed. Then enable Auto-Fix so Opulent can push fix commits to PR branches, not just post comments.

Limit Auto-Fix to the Opulent bot user in your repository settings to avoid loops with other automation. The safe choice is a selected-only allowlist.

Auto-fix settings:

- Enrolled repos: acme/frontend, acme/api-server
- Trigger: PR opened, commits pushed, or draft marked ready
- Response mode: Selected only
- Allowed bot: opulent-ai-integration[bot]

Warning: "All bots" can cause infinite loops if another bot
comments on Opulent's changes.
step 2

Write review guidelines in REVIEW.md

Opulent reads REVIEW.md in the repository to learn your team's conventions. The file defines what to flag, what to ignore, and the standards you want enforced on every PR.

<!-- REVIEW.md in repo root -->

## Review guidelines
- All API route handlers in src/routes/* must validate request body
  with Zod schemas before accessing properties.
- The useUnsafeEffect hook in src/hooks/useUnsafeEffect.ts is
  intentional, do not flag it as a missing-deps issue.
- Check for unhandled error cases in API calls.
- Ensure new database queries have appropriate indexes.
- Flag any console.log that is not behind a debug flag.
step 3

See Opulent catch and fix a bug

When a PR is opened, Opulent reviews the diff. It finds issues by severity and confidence and can push a fix commit for the ones it can resolve.

PR review:

Bug (Severe): Null reference in UserSettings.tsx:38.
  user.preferences.theme throws if preferences is undefined,
  which happens for accounts created before v2.3.

Fix pushed, commit e4a1b2c:
  const theme = user.preferences?.theme ?? 'system';

All findings are listed in the PR review panel with severity,
confidence, and a link to the diff. You can mark bugs as resolved
or ask follow-up questions using the codebase-aware chat.
step 4

Teach it your standards over time

After a production bug, add the pattern that would have caught it to REVIEW.md or to AGENTS.md. Opulent applies the updated rules to the next PR. Over time, the review becomes a codified version of your team's bug history.

You can also ask Opulent to check a specific pattern on any PR: 'Are there any API calls in this PR that don't handle the error case?' This focuses the review on the riskiest part of the diff.

step 5

Sharpen the auto-fix loop

When an auto-fix is wrong, revert it and add the exception to REVIEW.md or AGENTS.md. When Opulent misses a known bug class, add a rule and run a sample PR through the review to confirm it now catches it.

Add evals for the most common bug types: null references, unhandled errors, missing validation, missing indexes. These act as an automated regression suite for the review itself.

The natural chain: when Auto-Fix finds a bug it can't resolve, use Debug a Bug Report End-to-End; when a pattern repeats across many repos, use Fleet-Wide Maintenance Across Thousands of Repositories; when the bug is security-related, use Security Swarm: Fix Vulnerabilities at Scale.