Review rules
Teach reviewers your project's conventions with AGENTS.md and path-scoped rules.
Reviewers combine three layers of guidance.
Built-in rules
The correctness reviewer gets general correctness rules (logic errors, broken contracts, hidden failures, resource and concurrency bugs, data integrity, security defects visible in the change), plus language rules for the files in its bundle; the security and performance reviewers get their own rule sets instead:
| Language | Extensions |
|---|---|
| TypeScript / JavaScript | .ts .tsx .mts .cts .js .jsx .mjs .cjs |
| Python | .py .pyi |
| Go | .go |
| Java | .java |
Each reviewer prompt also lists what it must not flag: style, formatting, speculation without a reachable input, missing tests or docs, refactoring ideas, and issues in code the change does not touch.
AGENTS.md
A root AGENTS.md goes to reviewers as repository guidelines, truncated at 20,000 characters. It is read at the revision under review (for pull requests, the base commit, so a pull request cannot rewrite it). Use it for conventions to enforce: architecture boundaries, error-handling policy, forbidden APIs.
.ocra/rules.json
Path-scoped rules apply only when a bundle contains a matching file:
{
"rules": [
{
"path": "services/billing/**",
"rule": "Every write must carry an idempotency key. Flag handlers that retry without one."
},
{
"path": ["**/*.sql", "db/migrations/**"],
"rule": "Migrations must be backward compatible with the previous release."
}
]
}path: one glob or a list of globs.rule: free text given to the reviewer.
An invalid rules.json stops the run with an error. For pull requests it is read from the base commit.
Rules from plugins
Plugins can contribute rules too, for example a shared company rule pack. See Plugins.