Review rules
Review rules let you tell Codzee what your team cares about, in plain English. Codzee checks every pull request against them, on top of its normal review.
What a rule is
A rule is one sentence, like “Every API route calls requireAuth() before reading the request”. When a pull request breaks it, Codzee leaves a comment that names the rule. You can use rules for:
| Use it for | Example |
|---|---|
| Team conventions | “Use logger from src/lib/log, never console.log” |
| Where to look harder, or not at all | “Be extra strict on input validation in src/payments/**”, “Don’t comment on style in legacy/**” |
| Must-pass checks | “Every migration has a down() rollback”, which turns the check red when broken |
Add a rule
- Open Settings → Review rules.
- Pick one of the 10 templates, or click + Add rule to write your own.
- Fill in three things and save:
- Rule: write it the way you'd tell a new teammate. One rule per box, up to 500 characters.
- Applies to (optional): which files, like
src/api/**. Leave it empty for every file. - Severity: Suggestion, Important (the default) or Blocking.
Write rules that work
Name the exact thing to check: the function, the file or the pattern. Vague rules can't be checked.
| ✅ Clear: Codzee can check it | ❌ Too vague |
|---|---|
“Use logger from src/lib/log, never console.log” | “Write clean code” |
“Every API route calls requireAuth() before reading the request” | “Make it secure” |
| “Prices are stored in cents as integers, never floats” | “Be careful with money” |
“React components in components/ use named exports” | “Follow our conventions” |
“Don’t comment on code in legacy/” | “Ignore boring stuff” |
Choose which files
Use Applies to to limit a rule to some files. Separate patterns with commas, up to 10 per rule.
| Pattern | Matches |
|---|---|
src/api/** | every file under src/api/ |
**/*.sql | every SQL file, anywhere |
migrations/** | everything in migrations/ |
src/**/*.tsx | React files under src/ |
!**/*.test.ts | leaves out test files (on its own: every file except tests) |
legacy | that exact path, or anything under it, like legacy/old.js |
For example, src/**, !src/db/** means everything under src/ except src/db/. A ! pattern always wins.
How strict a rule is
- Suggestion: a light comment. Fine to ignore.
- Important: a normal review comment. This is the default.
- Blocking: fails the Codzee check until it's fixed.
- You write a ruleplain English, which files, how strict
- A pull request changes those filesCodzee checks it on every review
- Suggestiona light 💡 commentImportanta comment that names the ruleBlockinga comment, and the Codzee check fails
Blocking rules
Codzee checks blocking rules against the whole pull request on every review. If one is broken, the Codzee review check fails and lists it:
✖ Codzee review — 1 blocking rule broken · 1 comment posted · 1 major
1 blocking rule broken
- Every migration has a rollback — migrations/0042_add_orders.sql:3 — Adds the orders table with no down() to drop it.and a comment points at the line:
🔶 Bug | Major · ⛔ Blocking team rule: "Every migration has a rollback"
Adds the orders table with no down() to drop it.- Only when Codzee is sure. A rule only counts as broken on a line the pull request changes. If Codzee isn't sure, the check passes. It never blocks a merge on a guess.
- Push the fix and the next review turns the check green.
- If the rules can't be checked, the check shows neutral (“Couldn't check blocking rules, push again to retry”). A neutral check doesn't block merging.
- To actually stop merges, make the check required on your platform. See Block merges.
Org-wide and repo rules
When you add a rule, choose whether it's for every repository or just one. In a repository's view, each org-wide rule has an On for this repo switch, so you can turn it off for that repository only.
If a repository's rule disagrees with an org-wide rule, the repository wins. For example, with the org rule “Use logger, never console.log” and the acme/tools rule “console.log is fine in scripts/”, Codzee won't flag console.log in acme/tools/scripts/.
What you'll see
A comment from a broken rule keeps Codzee's usual label, so a serious bug still reads as serious, and adds the rule:
🔶 Bug | Major · ⚠️ Team rule: “API handlers must validate request bodies with zod”
createOrderreadsreq.body.itemswithout a zod schema. AddOrderSchema.parse(req.body)before using it.Rule set in Codzee settings · Manage rules
Suggestion rules show 💡 instead of ⚠️.
How many rules
| Plan | Rules turned on |
|---|---|
| Free | 10 |
| Team and trial | 50 |
| Enterprise | Unlimited |
If you're over the limit, the extra rules are skipped. A repository's own rules are kept first, then blocking rules, then important ones, then suggestions.
Coming next
Rules in your repository. Soon you'll be able to keep rules in a .codzee.md file in your repository, and Codzee will reuse files you already have, like AGENTS.md, CLAUDE.md and CONTRIBUTING.md. Here's the planned format:
# Codzee rules for acme/api
## Rules
- API handlers must validate request bodies with zod (src/api/**) [important]
- Every migration needs a down() rollback (migrations/**) [blocking]
- Use our logger, never console.log
- Don't comment on naming in legacy code (legacy/**) [suggestion]
- Prices are integers in cents, never floats (src/billing/**, src/orders/**)Can't find what you need? Email support@codzee.io and we'll help.