Creating a rule in Kodus
- Pick Global (or a repository / directory) in the scope picker at the top of the Code review group in the sidebar, then open Kody Rules
- On the Review Rules tab, click New rule
- Configure:
- Rule name: what the rule checks (e.g., “Service files must have tests”)
- Execution mode: Per file (checks each changed file, comments inline) or Per PR (checks the whole PR, posts one PR comment)
- Path: glob patterns that limit a Per file rule to specific files (e.g.,
src/services/**/*.ts); not used by Per PR rules - Instructions: what to check and how to decide
- Severity: Critical, High (the default), Medium, or Low
What helps a rule work
- Be specific. Name the pattern, the path and what counts as a violation.
- Point to your standards. Mention a file by path, such as
@file:docs/architecture.md, and Kody reads it when it judges the rule. The file is read from the pull request’s target branch. - Pick the right mode. Use Per file for what you can see in one file, and Per PR for requirements about the pull request as a whole: its description, its size, or whether related files change together.
Example: Enforcing a naming convention
You can create a file-level rule like:- Rule name: “React components must use PascalCase file names”
- Path:
src/components/**/*.tsx - Severity: High
- Instructions: “Flag any component file that doesn’t follow PascalCase naming.”
Example: Architecture boundary rule
Example: Test coverage rule
More ways to add rules
- Rules Library: click Discovery on the Kody Rules page to add ready-made rules and packs
- Repository rules: keep one rule per markdown file in your repository, in
.kody/rules - Auto-generation: Kody drafts rules from your reviewers’ past comments
- In a review thread: ask Kody to create or change a rule, for example
@kody update this rule to ignore test files
CLAUDE.md, AGENTS.md or Cursor and Copilot instructions, see Coding-Agent Instructions.
For the full reference, see Kody Rules.