Skip to main content
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.
New rules are active, or wait in Pending review when Kody knowledge approval is on. The file is the source of truth. A rule’s text, path, severity and status are replaced from the file each time it syncs, so change the file rather than the rule in the app. A rule paused in the app becomes active again the next time its file syncs.

File location

Place rule files in one of these locations, at the repository root or in any subdirectory:
  • .kody/rules/
  • rules/**/*.md
  • .rules/ and docs/coding-standards/ (only files that follow the template)
A rule’s scope comes from its 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-empty title 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.
The Bad and Good examples come from headings that contain “bad” or “good” (for example ### 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 title or 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-ignore in the first or last 10 lines of the file. Its rule is removed on the next sync.
  • Stop importing a file. enabled: false stops the file from being imported. It does not remove or pause a rule that already exists; delete the file or use @kody-ignore for 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.
If a rule is active in the app but never shows in [kody-rules-eval] for the files you expect, check its Path: a rule only runs on files matching its path.

Rule limits

The Free plan and unlicensed self-hosted instances run at most 10 active rules, including rules from files. See rule limits.