Review Rules#
Review rules let you teach MergeMonkey your team's conventions — things a reviewer can't know from the diff alone: "we never log PII", "all money math uses integer cents", "new endpoints must check workspace membership". Rules can be set per repository or workspace-wide, and both levels combine.
There are two kinds:
| General rule | Keyword rules | |
|---|---|---|
| What it is | One free-text instruction block | Up to 10 focused rules, each tagged with trigger keywords |
| Applies to | Every review (Lite and Full) | Full reviews (agent tier) |
| How it's delivered | Injected into every review's context | Agent sees a keyword index and fetches a rule's full text only when the code it's examining matches |
| Best for | Broad, always-relevant guidance | Specific conventions that only matter for certain code (payments, auth, migrations) |
| Size | Up to 1,000 characters | Up to 800 characters each, 1–4 keywords |
Keyword rules stay out of the prompt until they're needed — so you can define ten detailed conventions without paying their token cost on every review.
Per-repository rules#
- Open Dashboard → Repositories.
- Find the repository and click its Rules button.
- In the modal:
- General rule — write the guidance that should apply to every review of this repo.
- Keyword rules — click Add rule, write the rule content, then add keywords. Click Suggest to have your configured AI model propose keywords from the rule text — pick the ones that fit, or type your own. Every rule needs at least one keyword.
- Save. Rules apply from the next review — no re-install, no webhook change.
Each keyword rule has an on/off toggle, so you can disable one temporarily without deleting it.
Keywords are matched against the code the agent is investigating. Pick tokens that
actually appear in the relevant code — function names, table names, module paths,
API names (stripe, webhook, migration) —
not abstract topics like "security".
Workspace-wide rules#
Owners and admins can set rules that apply to every repository in a workspace:
- Open your workspace's Settings page.
- Find the Review Rules section and click Manage.
- The editor works exactly like the per-repo modal — one general rule plus keyword rules.
Workspace and repository rules combine: a repo's reviews get the workspace general rule and the repo general rule together, and the agent's rule index lists keyword rules from both levels. The per-repo Rules modal shows inherited workspace rules read-only, so you always see the full picture in one place.
How rules reach the review#
- The general rule is added to the review context of every run — both the fast Lite pass and Full agent reviews.
- Keyword rules appear to the Full-review agent as a compact index (rule title + keywords). When the agent investigates code that relates to a rule's keywords, it fetches that rule's full text with a tool call before judging the code — and skips rules that aren't relevant to the diff.
Rules guide attention and add context — they can't force MergeMonkey to report something without evidence, suppress a real finding, or change how the reviewer operates. Rule text is always treated as data, never as instructions that override the review process.
Limits#
| Limit | Value |
|---|---|
| General rule length | 1,000 characters |
| Keyword rules per repository (and per workspace) | 10 |
| Keyword rule length | 800 characters |
| Keywords per rule | 4 |
Writing rules that work#
- Be concrete. "Use
db.transaction()for multi-table writes" beats "be careful with the database". - One convention per keyword rule. Small, focused rules match better and cost fewer tokens than one catch-all.
- State the fix, not just the ban. "Don't use
moment— usedate-fns" tells the reviewer what to suggest. - Put always-true guidance in the general rule, and code-area-specific guidance in keyword rules.