instruction-files
Discovery, auditing, and sync for AI agent instruction files (AGENTS.md, CLAUDE.md, SKILL.md).
What it does
AI coding tools like Claude Code use markdown instruction files to configure agent behavior per-project. These files drift out of sync as code evolves. instruction-files catches that drift automatically.
Checks:
| Check | What it catches |
|---|---|
| Staleness | Instruction files older than source code they describe |
| Tree paths | ## Project Structure blocks referencing files/dirs that don't exist |
| Line budget | Combined instruction files exceeding 1000 lines (context window pressure) |
| Actionable content | Large code blocks or tables without imperative context (copy-paste, not instructions) |
Usage
use ;
// Use a preset config
let config = agent_doc; // broad: many languages, many root markers
// or
let config = corky; // narrow: Rust-only, Cargo.toml root
// Run the full audit
run?;
Custom config
let config = AuditConfig ;
Individual checks
use *;
let root = find_root;
let files = find_instruction_files;
// Run checks individually
let issues = check_staleness;
let issues = check_tree_paths;
let issues = check_actionable;
let = check_line_budget;
File discovery
Searches for instruction files in standard locations:
- Root level:
AGENTS.md,README.md, optionallyCLAUDE.md - Skills:
.claude/**/SKILL.md,.agents/**/SKILL.md - Package level:
.agents/**/AGENTS.md,src/**/AGENTS.md
Project root is found by walking up from CWD, checking for marker files (Cargo.toml, package.json, etc.), then .git, then falling back to CWD.
Used by
- agent-doc -- Interactive document sessions with AI agents.
agent-doc audit-docsdelegates to this crate withAuditConfig::agent_doc(). - corky -- Email sync and draft management.
corky audit-docsdelegates withAuditConfig::corky().
Install
[]
= "0.1"
License
MIT