# audit-clean-arch

audit-clean-arch audits a Rust codebase against Clean Architecture rules. It locates improper layer dependencies, framework leaks, and concrete adapter couplings.

- command · `type=command` · Claude Code, Codex, GitHub Copilot, Gemini CLI · ★ 1357 repo stars
- Author: Quintin Henry (https://github.com/qdhenry/)
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/qdhenry/Claude-Command-Suite/tree/HEAD/.claude/commands/rust/audit-clean-arch.md
- Updated: 2026-03-01
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/commands/audit-clean-arch

## What it 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.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/commands/audit-clean-arch.md` — Call it with /audit-clean-arch. For all projects use ~/.claude/commands/

### Codex

**Manually: put the files in place**
- File: `~/.codex/prompts/audit-clean-arch.md` — Call it with /prompts:audit-clean-arch. Codex marks this format deprecated in favour of skills

### GitHub Copilot

**Manually: put the files in place**
- File: `.github/prompts/audit-clean-arch.prompt.md`

### Gemini CLI

**Manually: put the files in place**
- File: `.gemini/commands/audit-clean-arch.toml` — Gemini stores commands as TOML: the prompt text goes into the prompt field

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/qdhenry/Claude-Command-Suite/tree/HEAD/.claude/commands/rust/audit-clean-arch.md

## When to use it
- 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
- /rust:audit-clean-arch
- /rust:audit-clean-arch src/
- /rust:audit-clean-arch --focus dependencies

## Similar
- [arch-check](https://affpapa.org/en/nevibecode/skills/arch-check.md) — skill · 3900 installs
- [clean-architecture](https://affpapa.org/en/nevibecode/skills/pproenca-clean-architecture.md) — skill · 2100 installs
- [go-backend-clean-architecture](https://affpapa.org/en/nevibecode/skills/go-backend-clean-architecture.md) — skill · 105 installs
- [python-clean-architecture](https://affpapa.org/en/nevibecode/plugins/python-clean-architecture.md) — plugin · ★ 11 repo stars
- [android-clean-architecture](https://affpapa.org/en/nevibecode/skills/android-clean-architecture.md) — skill · 7200 installs
- [architecture-review](https://affpapa.org/en/nevibecode/skills/decebals-architecture-review.md) — skill · 394 installs

From the same set: [qdhenry/claude-command-suite](https://affpapa.org/en/nevibecode/by/qdhenry/claude-command-suite.md) — 112 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
