Appearance
Review rules (OCR)
Open Code Review reads its rules from <repo>/.opencodereview/rule.json. /ocr-rules installs the checks of your installed rule stacks there. Install some first with /rules-install or write your own.
Install the rules
Run in the repository:
text
/ocr-rules- It lists the rule stacks and their checks.
- You select the stacks the project needs and, for each, its application directory (the repository root by default).
- It previews the merged file, with warnings for existing catch-all entries that would shadow the team rules.
- It writes the file only after your confirmation.
Monorepos
Globs are prefixed with each stack's application directory, so stacks in different directories do not shadow each other:
| Stack | Directory | Glob |
|---|---|---|
nestjs | apps/api | apps/api/**/*.controller.ts |
vue | apps/web | apps/web/{**/stores/**/*.{ts,js},**/*.store.{ts,js}} |
Merge behavior
- Existing entries,
include, andexcludeare kept and stay first, so project rules keep priority. - Team entries are identified by their
[<review-marker>]prefix and replaced on each run. Sources:paths point to the installed files under.opencode/rules/<stack>/, relative to the repository root.- Entries set
merge_system_rule: trueto keep OCR's built-in language rules.
TIP
Rerun /ocr-rules after updating the plugin or customizing the rules.
Share and use in CI
Commit .opencodereview/rule.json to share the rules with the team and with CI. Then run /review to review with them.