Skip to main content

Module plugin

Module plugin 

Source
Expand description

Plugin API for loading rules from YAML configuration files.

Users can define custom rules via YAML files in:

  • ~/.kardo/plugins/*.yaml (global plugins)
  • .kardo/rules/*.yaml (project-local rules)
  • Standard rule packages (shipped with Kardo)

YAML schema:

id: "custom-my-rule"
name: "My Custom Rule"
category: freshness | integrity | configuration | agent_setup | structure | custom
severity: high | medium | low
pattern:
  type: file_missing | file_stale | content_match | regex
  target: "CLAUDE.md"          # file path or pattern
  threshold: 30                 # for file_stale: days
message: "Description of what's wrong"
suggestion: "How to fix it"

Structs§

PluginLoader
Discovers and loads YAML rule plugins from multiple directories.
RulePlugin
A collection of YAML rules loaded from a directory.
YamlRule
A rule loaded from a YAML definition file. Implements the Rule trait so it can be added to a RuleSet.
YamlRuleDef
A rule definition loaded from YAML.

Enums§

YamlPattern
The pattern type that determines how a YAML rule matches.
YamlRuleError
Validation errors for YAML rule definitions.