Skip to main content
command CX Codex

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

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/audit-clean-arch.md
Open on GitHub

What 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.toml dependency 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.md

Call it with /audit-clean-arch. For all projects use ~/.claude/commands/

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.

Similar slash commands

All slash commands for Code review and refactoring →

From the same set112

The whole set →
audit-env-variables audit-env-variables scans environment variables in a JS/TS codebase, flags unused ones, guesses the service behind each variable name, and maps where it's referenced in code. CX Codex +1 ★ 1,357repo stars release-manager release-manager handles SemVer bumps, drafts changelog records, and verifies checklists before production deployment. CX Codex ★ 1,357repo stars incremental-feature-build The incremental-feature-build command breaks a request into testable features, tracks progress in project files, and works through features one at a time. Use it for multi-stage implementation tasks. CX Codex +1 ★ 1,357repo stars spec-workflow-setup spec-workflow-setup — a slash command that walks you through wiring the spec-workflow MCP server into Claude: dependencies, .mcp.json, .spec-workflow.json, then a connection check. CX Codex +1 ★ 1,357repo stars suggest-refactor The suggest-refactor command reviews Rust code for clean-architecture violations and returns ranked refactoring steps with code examples. CX Codex +1 ★ 1,357repo stars simulation_examples simulation_examples — a set of ready prompts for the simulation commands in Claude: how to frame a decision, a market response or a timeline before you commit to it. CX Codex +1 ★ 1,357repo stars azure-devops-specialist azure-devops-specialist configures Microsoft Azure services and sets up CI/CD automation using the Azure CLI and MCP tools. Helpful when building pipelines and managing cloud deployments. CX Codex ★ 1,357repo stars skill-validator-agent skill-validator-agent is a Claude Code subagent that checks skill YAML, structure, file links, and scripts. Run it when creating a skill or reviewing changes. CX Codex ★ 1,357repo stars

Project sponsors

Companies that keep this analytics open