| Crates.io | cargo-usage-rules |
| lib.rs | cargo-usage-rules |
| version | 0.2.0 |
| created_at | 2025-12-09 07:42:00.7874+00 |
| updated_at | 2025-12-09 07:42:00.7874+00 |
| description | A cargo subcommand to aggregate usage-rules.md files from Rust dependencies for AI agent consumption. Inspired by https://github.com/ash-project/usage_rules |
| homepage | |
| repository | https://github.com/pallas-jp/cargo-usage-rules |
| max_upload_size | |
| id | 1974984 |
| size | 88,966 |
A cargo subcommand that aggregates usage-rules.md files from your Rust project dependencies into a single file for AI agent consumption.
Inspired by the Elixir ash-project/usage_rules. They have some pretty compelling evidence of it's efficacy.
cargo install cargo-usage-rules
Or with binstall:
cargo binstall cargo-usage-rules
Or from source:
cargo install --git https://github.com/pallas-jp/cargo_usage_rules
cargo usage-rules sync --all
cargo usage-rules list
cargo usage-rules sync --all --output AI.md
cargo usage-rules sync --inline serde,tokio,clap
cargo usage-rules sync --all --remove old-crate,deprecated-dep
# Markdown links (default)
cargo usage-rules sync --all --link-to-folder usage-rules
# Claude @ links
cargo usage-rules sync --all --link-to-folder usage-rules --link-style at
In my experience using the inspiring project, linked mode works great and doesn't pollute the context window, so syncing all with the default linked mode.
If you have few dependencies then inline might be more performant for you, but YMMV.
cargo-usage-rules scans your Rust project dependencies (from crates.io, git, local paths, etc) for:
usage-rules.md files (main usage guidance)It then aggregates these files into a single output file (default: Agents.md)
with clear package boundaries marked by HTML comments.
This project also has some general rust guidance (see the base file) inspired by various sources (see acknowledgements).
To make your crate discoverable by cargo-usage-rules, add a usage-rules.md file to your crate's root directory:
# My Awesome Crate
## Quick Start
[Your usage guidance for AI agents here]
## Common Patterns
[Examples and best practices]
## Common Mistakes
[What to avoid]