rust-dependencies
Resolution. Use before adding or upgrading a crate or feature, changing toolchain or edition, or writing a non-domain parser, encoder, wrapper, or coordination helper instead of a library.
Install
npx skills add https://github.com/Dankosik/cargo-modernize/tree/main/.agents/skills/rust-dependencies
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install dankosik-cargo-modernize@llmmart
git clone https://github.com/Dankosik/cargo-modernize.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole dankosik/cargo-modernize collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
Rust Dependencies
Resolution. Weigh the behavior and maintenance the application would own against a crate's compatibility, operating, and supply-chain costs, preferring a maintained crate for non-trivial general mechanisms when it fits the requirement.
Library versus custom code. Check the current owner, std, and installed workspace crates (including sibling modules and optional features already in Cargo.lock) first, delegating generic mechanics to the library while keeping domain or protocol policy in the caller. When a gap remains, evaluate candidate crates from official docs and resolved source for the exact version, defaults, features, accepted inputs, cancellation, and failure precedence. Choose custom code when a tiny fixed grammar or a concrete boundary/operating divergence favors it, documenting that concrete reason at the site.
Proportional evaluation. Match evaluation depth to the decision: record behavior, toolchain, license, and trust fit concisely in the change evidence for routine crates, and compare alternatives in depth when guarantees, maintenance, or trust boundaries materially diverge (recording new capability choices under specs/). Apply the same bar to custom general machinery.
Workspace manifest and lockfile. Declare shared versions once in [workspace.dependencies], enable only required features per member crate, and check resolved features, duplicate versions, and coupled families (such as ra_ap_*, toml/toml_edit). Keep ra_ap_syntax and ra_ap_parser on exact = pins reached only through the core syntax adapter, and keep ra_ap_mbe, ra_ap_syntax-bridge, ra_ap_tt, and salsa confined to xtask. Update Cargo.lock deliberately through Cargo during dependency changes, inspect and include its diff, and run validation with --locked while keeping Cargo's integrity checks intact.
Toolchain and scope. Move the workspace edition/rust-version together with any toolchain pin and the build MSRV stated in AGENTS.md and README.md in one reviewed change, verifying compatibility beyond the declared minimum version rather than assuming Cargo metadata proves runtime fit. Review advisories, licenses, build scripts, and proc-macros in proportion to trust impact, and verify default-feature and runtime behavior directly where claimed.
Files (cargo-modernize)
-
LICENSE 1 KB · in bundle
-
SKILL.md 2.5 KB
--- name: rust-dependencies description: "Resolution. Use before adding or upgrading a crate or feature, changing toolchain or edition, or writing a non-domain parser, encoder, wrapper, or coordination helper instead of a library." --- # Rust Dependencies **Resolution.** Weigh the behavior and maintenance the application would own against a crate's compatibility, operating, and supply-chain costs, preferring a maintained crate for non-trivial general mechanisms when it fits the requirement. **Library versus custom code.** Check the current owner, `std`, and installed workspace crates (including sibling modules and optional features already in `Cargo.lock`) first, delegating generic mechanics to the library while keeping domain or protocol policy in the caller. When a gap remains, evaluate candidate crates from official docs and resolved source for the exact version, defaults, features, accepted inputs, cancellation, and failure precedence. Choose custom code when a tiny fixed grammar or a concrete boundary/operating divergence favors it, documenting that concrete reason at the site. **Proportional evaluation.** Match evaluation depth to the decision: record behavior, toolchain, license, and trust fit concisely in the change evidence for routine crates, and compare alternatives in depth when guarantees, maintenance, or trust boundaries materially diverge (recording new capability choices under `specs/`). Apply the same bar to custom general machinery. **Workspace manifest and lockfile.** Declare shared versions once in `[workspace.dependencies]`, enable only required features per member crate, and check resolved features, duplicate versions, and coupled families (such as `ra_ap_*`, `toml`/`toml_edit`). Keep `ra_ap_syntax` and `ra_ap_parser` on exact `=` pins reached only through the core syntax adapter, and keep `ra_ap_mbe`, `ra_ap_syntax-bridge`, `ra_ap_tt`, and `salsa` confined to `xtask`. Update `Cargo.lock` deliberately through Cargo during dependency changes, inspect and include its diff, and run validation with `--locked` while keeping Cargo's integrity checks intact. **Toolchain and scope.** Move the workspace `edition`/`rust-version` together with any toolchain pin and the build MSRV stated in `AGENTS.md` and `README.md` in one reviewed change, verifying compatibility beyond the declared minimum version rather than assuming Cargo metadata proves runtime fit. Review advisories, licenses, build scripts, and proc-macros in proportion to trust impact, and verify default-feature and runtime behavior directly where claimed.
Reviews (0)
No reviews yet.
Comments
Sign in to join the conversation.
No comments yet. Start the conversation.