To use Repository Rules, you must have Rules File Detection enabled in your settings. The same sync mechanism that detects IDE rule files also processes repository-based rules.
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.Synchronization
- Automatic Detection: Repository rules are automatically detected and synchronized when enabled
- 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/**/*.md
rules/**/*.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 | Array of glob patterns |
severity_min | Minimum severity level | "low" , "medium" , "high" , "critical" |
Example Rules
File-Level Rule Example
Pull Request-Level Rule Example
Setup Requirements
To use Repository Rules, you need to:- Enable Rules File Detection: Go to your settings and toggle “Auto-sync rules from repo”
- Create rule files: Place
.md
files in.kody/rules/**
orrules/**
directories - Commit changes: Repository rules are detected when Pull Requests are closed
Repository Rules use the same synchronization mechanism as Rules File Detection. Once enabled, both IDE tool rules and repository rules will be automatically synced.