Expand description
Lint and migrate AI agent rule files per agent-rules-spec.
§Quick start
use agent_rules_tool::{lint_string, migrate_string, LintOptions, MigrateOptions};
use agent_rules_tool::format::RuleFormat;
let report = lint_string(content, &LintOptions::default())?;
assert!(report.valid);
let migrated = migrate_string(
content,
&MigrateOptions {
from: RuleFormat::Cursor,
to: RuleFormat::Agents,
..Default::default()
},
)?;§Modules
Re-exports§
pub use error::Error;pub use format::RuleFormat;pub use format::RuleFormatArg;pub use lint::exceeds_threshold;pub use lint::lint_directory;pub use lint::lint_string;pub use migrate::InputRule;pub use migrate::MigrateOptions;pub use migrate::MigrateResult;pub use migrate::MigrateSummary;pub use migrate::MigrateWarning;pub use migrate::build_inputs_from_dirs;pub use migrate::migrate_paths;pub use migrate::migrate_string;
Modules§
- cli
- CLI definitions for the
agent-rules-toolbinary. - discover
- Known tool rule directories and format inference from paths.
- error
- Error types returned by parse, lint, migrate, and I/O operations.
- format
- Rule format identifiers and auto-detection from frontmatter.
- io
- Atomic file writes used by migrate output.
- lint
- Lint rule file content against the embedded JSON Schema and RFC semantics.
- migrate
- Migrate agent rule files between tool-native and canonical formats.
- parse
- Parse markdown rule files into YAML frontmatter and body text.
- report
- YAML serialization of lint reports for CLI
--reportoutput. - schema
- JSON Schema validation of rule frontmatter against the embedded schema.
- spec
- Spec citations, URLs, and embedded vendored artifacts from agent-rules-spec.
- walk
- Recursive discovery of rule files on disk.
Structs§
- File
Lint Result - Lint result for one file within a directory scan.
- Lint
Options - Options controlling
lint_stringandlint_directory. - Lint
Report - Result of linting one rule file’s content.
- Spec
Index - Vendored agent-rules-spec index manifest.
- Spec
Index Entry - One entry in
SpecIndex::files. - Violation
- A single lint finding with a citation into the spec or schema.
Enums§
- Severity
- Violation severity for lint results and exit-code thresholds.
Functions§
- load_
spec_ index - Load the embedded spec index from
spec::EMBEDDED_INDEX.