Repository Rules use the same auto-sync mechanism as IDE rule file detection. Enable “Auto-sync rules from repo” in settings to activate both features. See Rules File Detection for setup.
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. Files that don’t parse as the template (missing frontmatter or
title) fall back to the LLM importer used for free-form files.Synchronization
- Automatic Detection: Repository rules are automatically detected and synchronized when enabled
- Manual Sync: Add
@kody-syncto any rule file to sync it individually (works even with auto-sync disabled) - Web Application: Synchronized rules appear in your Kodus web application dashboard
- Real-time Updates: Changes to rule files are synced when Pull Requests are closed
File Location
Place your rule files in one of these directories:.kody/rules/**/*.mdrules/**/*.md
Rule Template
Each rule file must follow this exact template structure:Template Fields
Required Fields
| Field | Description | Values |
|---|---|---|
title | Rule name displayed in the interface | Any descriptive string |
scope | Rule analysis scope | "file" or "pull-request" |
path | File paths where rule applies. The rule fires on files matching any of the globs | Array of glob patterns |
severity_min | Minimum severity level | "low", "medium", "high", "critical" |
Optional Fields
| Field | Description |
|---|---|
uuid | Stable rule identifier — keeps the same platform rule across renames |
enabled | Set to false to skip importing this file (an already-imported rule is not removed) |
languages, buckets | Informational metadata |
Example Rules
File-Level Rule Example
Pull Request-Level Rule Example
Setup Requirements
To use Repository Rules, you have two options:Option 1: Enable Auto-Sync (Recommended)
- Enable Rules File Detection: Toggle “Auto-sync rules from repo” in settings
- Create rule files: Place
.mdfiles in.kody/rules/**orrules/**directories - Automatic sync: All rule files sync when PRs are closed
Option 2: Manual Sync (Selective)
- Create rule files: Place
.mdfiles in.kody/rules/**orrules/**directories - Add sync marker: Include
@kody-syncanywhere in the rule file - Commit changes: Only marked files will sync (auto-sync toggle stays off)