Skip to content

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 ruleKeyword rules
What it isOne free-text instruction blockUp to 10 focused rules, each tagged with trigger keywords
Applies toEvery review (Lite and Full)Full reviews (agent tier)
How it's deliveredInjected into every review's contextAgent sees a keyword index and fetches a rule's full text only when the code it's examining matches
Best forBroad, always-relevant guidanceSpecific conventions that only matter for certain code (payments, auth, migrations)
SizeUp to 1,000 charactersUp 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#

  1. Open Dashboard → Repositories.
  2. Find the repository and click its Rules button.
  3. 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.
  4. 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.

Choosing keywords

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:

  1. Open your workspace's Settings page.
  2. Find the Review Rules section and click Manage.
  3. 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 are advisory

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#

LimitValue
General rule length1,000 characters
Keyword rules per repository (and per workspace)10
Keyword rule length800 characters
Keywords per rule4

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 — use date-fns" tells the reviewer what to suggest.
  • Put always-true guidance in the general rule, and code-area-specific guidance in keyword rules.