rust-dependency-audit
Skill0 starsChanged 3 days agoMITView on GitHub
Audit a Rust project's dependencies - Cargo.toml requirements and Cargo.lock offline (wildcard versions, unpinned git dependencies, path dependencies that block publishing, test crates in normal dependencies, tokio full in libraries, deprecated or unmaintained crates such as failure, atty, dotenv, structopt, serde_yaml with their replacements, crates compiled in several versions, git and private-registry sources), then cargo audit and cargo deny for RustSec advisories, licenses and bans, and cargo machete, cargo udeps and cargo outdated for unused and old dependencies. Includes a ready deny.toml. Use when the user asks to audit or clean up Cargo dependencies, reduce build times or binary size from duplicate crates, check licenses, respond to a RustSec advisory, or set up cargo-deny in CI.
- Installs packages
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- rust-async-reviewSkill
- rust-borrow-checkerSkill
- rust-crates-publishSkill
- rust-error-handlingSkill
- rust-lint-ciSkill
- rust-testing-benchesSkill
- rust-unsafe-reviewSkill
- rust-workspace-setupSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 48
Start from assets/deny.toml.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill 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.
Files
Rust dependency audit
Goal: every dependency is wanted, maintained, free of known vulnerabilities, licensed compatibly and resolved to as few versions as practical.
Paths below are relative to this skill's folder (in Claude Code: ${CLAUDE_SKILL_DIR}).
When to use
- "Audit my dependencies", "are any of these crates unmaintained?", "check licenses"
- A RustSec advisory or Dependabot alert for a crate in
Cargo.lock - Slow builds or big binaries caused by duplicate crate versions
- Setting up
cargo denyin CI
When not to use
- Arranging dependencies across workspace members:
rust-workspace-setup - Publishing metadata and pre-publish checks:
rust-crates-publish - Reviewing unsafe code inside a dependency:
rust-unsafe-review
Workflow
- Offline pre-check (read-only, no network):
The list of unmaintained crates is a curated snapshot; treat it as a hint and confirm with step 2.python3 scripts/deps_check.py . python3 scripts/deps_check.py . --json --fail-on high - Advisory and policy scan (these tools download the RustSec advisory database; ask
before installing tools):
Start from assets/deny.toml; adjust the license allow-list with the user, never silently add licenses.cargo install --locked cargo-audit cargo-deny cargo audit # vulnerabilities, yanked and unmaintained crates cargo deny init # or copy assets/deny.toml and edit it cargo deny check # advisories, licenses, bans (duplicates), sources - Unused and outdated:
cargo install --locked cargo-machete && cargo machete # fast, heuristic cargo +nightly udeps --all-targets # precise, needs nightly cargo install --locked cargo-outdated && cargo outdated -R # root deps only cargo tree -d # duplicates and who pulls them cargo tree -i <crate> -e features # why a crate / feature is enabled - Decide per finding with references/remediation.md:
upgrade (semver-compatible first:
cargo update -p <crate>), replace (table of alternatives), remove, or accept with a dated reason indeny.tomlignore. - Apply changes one crate at a time,
cargo check --all-targetsandcargo testafter each; show the user theCargo.tomldiff and theCargo.locksummary (git diff --stat Cargo.lock). - Keep it green in CI:
cargo deny checkjob (orEmbarkStudios/cargo-deny-action) plus Dependabot or Renovate for Cargo; see references/remediation.md.
Decision points
- Vulnerability with a fix: upgrade now; if it is a transitive dependency,
cargo update -por upgrade the parent. No fix: check whether the vulnerable code path is used, document the decision, and add anignorewith the advisory id and a review date. - Unmaintained but no vulnerability: plan a replacement; it is not an emergency.
- Duplicate versions (
syn1 and 2,windows-sysx3): usually harmless at runtime but cost build time; fix only when the duplicated crate is large or you control the parent. - Default features:
default-features = falseplus the features you use, especially for libraries (every user inherits your features).
Output
deps_check: 13 findings (1 high, 5 medium); cargo audit: 1 vulnerability (RUSTSEC-YYYY-NNNN in <crate>)
Fixed: regex "*" -> "1.11"; failure -> thiserror; atty -> std::io::IsTerminal; criterion -> dev-deps
Accepted: syn 1.x via an old proc-macro dependency (upgrade pending upstream)
CI: added cargo deny check job with deny.tomlDoes 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
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.

