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 it works
Put a markdown file with the template below in your repository. Kody imports it as a rule, and the rule follows the file: edit the file and the rule changes, delete it and the rule is removed. Files are imported verbatim, with no LLM conversion. The frontmatter is read as written, the markdown body becomes the rule’s instructions exactly as you wrote it, and the Bad and Good examples are imported from the body. Each file produces one rule.- Automatic: rule files are synced in every connected repository.
- On merge: when a pull request that adds, changes, renames or removes a rule file is merged, the rule is created, updated or removed. Pull requests in a centralized config repository are not synced.
- Import now: for files already in the repository, open the repository’s Code review → Kody Rules → Configuration and click Import rule files now. It reads every rule file on the default branch.
- In the app: synced rules appear on the repository’s Kody Rules page with the Auto-sync origin and the file path as their source.
File location
Place rule files in one of these locations, at the repository root or in any subdirectory:.kody/rules/rules/**/*.md.rules/anddocs/coding-standards/(only files that follow the template)
path, not from where the file sits. A rule in services/billing/.kody/rules/ with no path still applies to every file.
Rule template
Fields
Only a non-emptytitle and a non-empty body are required. A file missing either is skipped.
severity is accepted as an alias for severity_min. A value outside the four levels falls back to "medium", and any scope other than "pull-request" is treated as "file". Other frontmatter keys are ignored.### Bad example); every fenced code block under such a heading becomes an example.
Example rules
File-level rule
Pull request-level rule
When a file stops syncing
- File does not follow the template. A file without frontmatter, a
titleor a body is skipped. If a rule was already imported from it, the rule keeps its last text and status, and the rule’s side panel warns that its file no longer syncs. The warning clears when the file parses again. - Keep a file out of sync. Add
@kody-ignorein the first or last 10 lines of the file. Its rule is removed on the next sync. - Stop importing a file.
enabled: falsestops the file from being imported. It does not remove or pause a rule that already exists; delete the file or use@kody-ignorefor that.
Self-hosted logs
On self-hosted deployments, search the logs for these markers:[kody-rules-sync]: a summary of each sync with the files imported, skipped (with the reason) and removed.[kody-rules-eval]: during a review, which rules (uuid and title) were selected for the changed files.
[kody-rules-eval] for the files you expect, check its Path: a rule only runs on files matching its path.