audit-clean-arch — Claude Code command: what it does, how to install
audit-clean-arch audits a Rust codebase against Clean Architecture rules. It locates improper layer dependencies, framework leaks, and concrete adapter couplings.
no license ★ 1,357 updated 2026-03-01
.claude/commands/audit-clean-arch.mdWhat audit-clean-arch does
The audit inspects a Rust project in structured phases, mapping out directories into domain, application, adapters, and infrastructure tiers. It reviews module imports to catch inverted dependencies. Domain code must stay isolated from frameworks like Axum or database drivers like SQLx.
Next, it scans for port traits and verifies decoupled architecture. Use cases must rely on trait objects such as dynamic repository references rather than concrete database structures. It also inspects Cargo.toml to see whether third-party crates leak into core domain layers.
The execution relies on Bash, Grep, Glob, and file reading permissions.
What it helps with
- Detect database and framework imports inside domain entities
- Verify inward dependency directions across architectural layers
- Flag use cases bound directly to concrete adapter structs
- Check
Cargo.tomldependency boundaries across modules
Example prompts for the agent
- /rust:audit-clean-arch
- /rust:audit-clean-arch src/
- /rust:audit-clean-arch --focus dependencies
How to install audit-clean-arch
Manually: put the files in place
.claude/commands/audit-clean-arch.mdCall it with /audit-clean-arch. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/audit-clean-arch.mdCall it with /prompts:audit-clean-arch. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/audit-clean-arch.prompt.mdManually: put the files in place
.gemini/commands/audit-clean-arch.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about audit-clean-arch
How to install audit-clean-arch in Claude Code?
Save the command markdown file to .claude/commands/audit-clean-arch.md. Claude Code will pick it up automatically.
What does audit-clean-arch do?
It reviews module boundaries in Rust projects, checking dependency directions and ports-and-adapters design. It reports cases where business logic imports external adapters or libraries.
What tools are required to run this command?
The command requires Read, Grep, Glob, and Bash tools to scan project directories and inspect file contents.