Repository Rules are always kept in sync: there is no setting to turn on. They are the only files in a repository that become Kody Rules. Instructions written for coding agents (
CLAUDE.md, AGENTS.md, .cursor/rules) are handled separately, see Coding-Agent Instructions.How to Use
You can create custom Kody Rules directly in your repository by placing structured markdown files in specific directories. This allows you to version control your rules alongside your code and share them across your team.Repository rule files are imported verbatim — no LLM conversion. The frontmatter is parsed as-is, the markdown body becomes the rule’s instructions exactly as you wrote it (identifiers, formatting and wording preserved), and the Bad/Good examples are imported structurally. Each file produces one rule. A file that doesn’t parse as the template (missing frontmatter,
title or body) is skipped, and the sync logs it; nothing is generated from it.Synchronization
- Automatic Detection: Repository rules are detected and synchronized in every connected repository; there is nothing to enable
- Import now: On the repository’s Kody Rules → Configuration sheet, Import rule files now reads every rule file on the default branch
- Web Application: Synchronized rules appear on the repository’s Code review → Kody Rules page, with the Auto-sync origin (rules imported from coding-agent files before they stopped converting show Agent file instead)
- Real-time Updates: Changes to rule files are synced when Pull Requests are merged into the default branch
File Location
Place your rule files in one of these directories, at the repository root or in any subdirectory:.kody/rules/**/*.mdrules/**/*.md.rules/**anddocs/coding-standards/**(only files that follow the template)
Rule Template
Each rule file must follow this exact template structure:Template Fields
Required Fields
Only two things are strictly required: a non-emptytitle and a non-empty rule body. A file
missing either is skipped entirely.
Fields with defaults
Everything else is optional — omit it and the default applies.severity is accepted as an alias for severity_min, since it’s an easy thing to mistype and
the intent is unambiguous. Any value outside the four levels falls back to "medium", and any
scope other than "pull-request" is treated as "file".Example Rules
File-Level Rule Example
Pull Request-Level Rule Example
Setup Requirements
- Create rule files: Place
.mdfiles that follow the template in.kody/rules/**orrules/**. Files in.rules/**anddocs/coding-standards/**that follow the template are imported too. - Merge them: A rule file syncs when a Pull Request that adds, changes, renames or removes it is merged into the default branch. Removing the file removes its rule.
- Existing files: To import rule files that are already on the default branch, use Import rule files now in the repository’s Kody Rules → Configuration sheet.
Verifying sync and rule evaluation (self-hosted)
On self-hosted deployments the API logs carry grep-able markers for debugging:[kody-rules-sync]— per-run sync summary: which files were imported, skipped (with the reason) or removed.[kody-rules-eval]— per-file evaluation trace during a review: exactly which rules (uuid + title) were selected into the prompt for each reviewed file.
[kody-rules-eval] for the files you expect, check its Path glob — a rule only runs on files matching its path.