Skip to main content
Every team has conventions that generic linters don’t cover: architecture boundaries, naming patterns, testing requirements, or business-specific constraints. Custom code review rules let you encode them as checks Kody runs on every pull request.

Creating a rule in Kodus

  1. 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
  2. On the Review Rules tab, click New rule
  3. 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
Under Advanced settings you can add a Bad example and a Good example, which help Kody tell a violation from compliant code.

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
To have Kody check pull requests against CLAUDE.md, AGENTS.md or Cursor and Copilot instructions, see Coding-Agent Instructions. For the full reference, see Kody Rules.