agentleFS
DankosikDankosik/cargo-modernize/AGENTS.md

cargo-modernize

AGENTS.md0 starsChanged 4 days agoApache-2.0View on GitHub

cargo-modernize is a standalone Rust workspace modernization knowledge catalog, AI agent skill, and fast read-only CLI scanner. Run all four checks before completing any change: For catalog or rule edits, also run:

  • Installs packages

The file

We split this AGENTS.md into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Language & License: All code, diagnostics, documentation, comments, and rule explanations are written in English.

    line 18
  2. Distinctive:

    Run all four checks before completing any change:

    line 22
  3. Very specific:

    Do not commit untracked local scratch directories or ignored paths (specs/, target/).

    line 41

≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Development Guidelines (AGENTS.md)

cargo-modernize is a standalone Rust workspace modernization knowledge catalog, AI agent skill, and fast read-only CLI scanner.

Workspace Structure

  • catalog (cargo-modernize-catalog) — zero-runtime-dependency #![no_std] data crate (rust-version = "1.85") packaging build-time pre-digested release inventories (catalog/inventory/), declarative C1/C3/C4 rule passports (catalog/entries/), triage records (catalog/triage.toml), manifest/text rules, and paired compilable fixtures (catalog/fixtures/) inside its own manifest root so cargo package and cargo install are self-contained.
  • crates/cargo-modernize-core — internal workspace engine crate powering cargo-modernize: inventory & passport schemas, exclusive lossless AST adapter over ra_ap_syntax/ra_ap_parser, Ruff-model pure Rust CST rules organized by domain (rules/{control_flow,option_result,collections,str_bytes,io_fs_path,num_time,lazy_lock,mem_sync_ffi,syntax_macros}.rs), compact suggestion & validation SDK (sugg.rs), conflict resolver, import scope resolver, guidelines index, explain/why tracer, and workspace/VCS/filter passes. Never installs global process hooks (std::panic::set_hook) on its own.
  • crates/cargo-modernize — cargo modernize standalone CLI subcommand: argument parsing, silent worker panic hook installation, guidelines list, multi-ID explain, why, report rendering (text, compact, github, json), --write-keep, --check, and exit code mapping (0 / 1 / 2).
  • xtask — internal maintainer tooling (publish = false): cargo xtask inventory (extracting release inventories from rust-lang/rust using ra_ap_mbe), check-catalog (disk verification + rustc compilation of paired fixtures), export-clippy-candidates (local Markdown export of C4 rules), and stress-ui (parser/engine stress testing).

Toolchain & Dependency Constraints

  • Build MSRV & Binary Distribution: Build MSRV is Rust 1.98 (edition = "2024"), tracking pinned ra_ap_* parser crates (catalog independently keeps rust-version = "1.85" with zero runtime dependencies). Note that cargo-modernize analyzes user projects targeting any Rust version (1.56+) and any edition (2015–2024); prebuilt binaries (cargo-binstall, GitHub Releases) are the primary distribution channel for users running older Rust toolchains.
  • Pinned Parser Crates: ra_ap_syntax and ra_ap_parser (=0.0.352) plus rowan (=0.17.0) are pinned with exact = versions and accessed exclusively through the thin adapter module (crates/cargo-modernize-core/src/syntax_adapter.rs). Update parser versions only once per Rust release alongside full fixture execution.
  • Dependency Boundary: ra_ap_mbe, ra_ap_syntax-bridge, ra_ap_tt, and salsa belong strictly to xtask and must never be added to cargo-modernize-catalog, cargo-modernize-core, or cargo-modernize.
  • Unwind Safety: Profiles keep panic = "unwind" so unexpected parser or detector panics on malformed third-party files can be caught by catch_unwind and reported in the run summary without aborting the workspace scan; only the CLI binary (cargo-modernize) installs a silent panic hook.
  • Language & License: All code, diagnostics, documentation, comments, and rule explanations are written in English. Dual-licensed under MIT OR Apache-2.0.

Required Verification Commands

Run all four checks before completing any change:

cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace
cargo xtask --help

For catalog or rule edits, also run:

cargo xtask check-catalog

Catalog Authoring Principles

  • Derive rules strictly from primary upstream sources (catalog/inventory/*.toml, rust-lang/rust library/ bodies and dogfooding diffs, RELEASES.md, and the Rust Edition Guide) and open-source corpus evidence.
  • Every catalog entry must carry explicit class (c1 / c3 / c4), impact, track, requires, confidence, status, default, behavior, and semver metadata. Every executable rust-ast rule must have a 1-to-1 RuleSpec in crates/cargo-modernize-core/src/rules/ plus compilable <id>.rs (and <id>.fixed.rs when emitting replacements) fixtures with both positive (//~ <id>) and negative twin cases.
  • Do not commit untracked local scratch directories or ignored paths (specs/, target/).

Agent Skills

Engineering skills live in .agents/skills/ (.claude/skills is a symlink to it). The canonical user-facing rust-modern-guidelines skill lives in skills/rust-modern-guidelines/SKILL.md (symlinked into .agents/skills/rust-modern-guidelines for local development and packaged via .claude-plugin/, .agents/plugins/, and plugin.json). Maintainer skills in .agents/skills/ are adapted from Dankosik/rust-service-template-rest under the MIT license kept in each skill directory:

  • rust-modern-guidelines — two-step cargo modernize guidelines list -> explain + --diff modernization workflow.
  • rust-coder — writing or changing Rust code.
  • rust-idiomatic — types, signatures, trait impls, conversions, ownership.
  • rust-structural-quality — adding modules, traits, helpers, or deciding placement.
  • rust-errors — error types, failure mapping, exit codes, panic isolation.
  • rust-testing — writing or reviewing tests and rule fixtures.
  • rust-debugging — failing tests, wrong or missing findings, nondeterminism.
  • rust-performance — scan time, memory, and allocation claims.
  • rust-dependencies — adding or upgrading crates, features, toolchain, or edition.
  • rust-security — untrusted workspace input, file writes, subprocesses, resource bounds.
  • rust-verification — deciding what executed checks actually prove.
  • thermo-nuclear-code-quality-review — user-invoked read-only simplification audit of a diff, crate, or directory.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.