audit-dependencies — Claude Code command: Rust dependency audit
audit-dependencies audits dependency direction in Rust projects and flags layer violations. Use it when reviewing architecture or preparing a refactor.
no license ★ 1,357 updated 2026-03-01
.claude/commands/audit-dependencies.mdWhat audit-dependencies does
This command examines how a Rust codebase links its Infrastructure, Adapters, Application, and Domain layers. It extracts crate imports, reviews external dependencies, checks the domain and application boundaries, and looks for adapter implementations of application ports.
It also inspects Cargo.toml, including workspace member dependencies, and can focus on a path or module supplied as an argument. The command works through Read, Grep, Glob, and Bash. It needs a Rust project with identifiable layers; without that structure, the audit has little architectural evidence to assess.
What it helps with
- find outer-layer imports inside the domain
- spot direct database dependencies in application code
- map dependency flow across Rust layers
- check whether adapters implement application ports
- review workspace links in
Cargo.toml
Example prompts for the agent
- Run
/rust:audit-dependenciesto audit dependency direction across the Rust project. - Focus the audit on
src/application/with/rust:audit-dependencies src/application/. - Use
/rust:audit-dependenciesto find imports that point from inner layers to outer ones.
How to install audit-dependencies
Manually: put the files in place
.claude/commands/audit-dependencies.mdCall it with /audit-dependencies. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/audit-dependencies.mdCall it with /prompts:audit-dependencies. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/audit-dependencies.prompt.mdManually: put the files in place
.gemini/commands/audit-dependencies.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about audit-dependencies
How do I install audit-dependencies in Claude Code?
Copy the command file to .claude/commands/audit-dependencies.md.
What does audit-dependencies do?
It reviews dependency direction in Rust code across the Domain, Application, Adapters, and Infrastructure layers. It also checks project and workspace dependencies in Cargo.toml.
Can audit-dependencies target one Rust module?
Yes. Add a path or module after the command, such as /rust:audit-dependencies src/application/, to limit the audit scope.