audit-layer-boundaries — Claude Code command
audit-layer-boundaries analyzes architectural layer boundaries in Rust projects. It catches mixed responsibilities, misplaced database logic, and boundary leaks.
no license ★ 1,357 updated 2026-03-01
.claude/commands/audit-layer-boundaries.mdWhat audit-layer-boundaries does
The command maps your src/ modules against four architectural tiers: domain, application, adapters, and infrastructure. It guides the agent through inspecting code organization with shell search utilities to locate boundary infractions.
Inside the domain layer, it flags serialization derives, HTTP request types, and raw database annotations. For the application layer, it flags direct SQL execution and framework routing that should live in adapters. Adapters are inspected for complex business validation, while infrastructure files are checked for leaked handlers.
The routine executes standard bash, grep, and find commands under the hood. Claude Code requires terminal execution access to run these checks against the source tree.
What it helps with
- detect framework types and database queries leaking into domain entities
- spot business rules misplaced inside HTTP or storage adapters
- audit clean architecture separation across a Rust repository
- find direct persistence calls that bypass application port traits
Example prompts for the agent
- /rust:audit-layer-boundaries
- /rust:audit-layer-boundaries src/core/
- Review architectural layer boundaries in
src/domain/using/rust:audit-layer-boundaries
How to install audit-layer-boundaries
Manually: put the files in place
.claude/commands/audit-layer-boundaries.mdCall it with /audit-layer-boundaries. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/audit-layer-boundaries.mdCall it with /prompts:audit-layer-boundaries. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/audit-layer-boundaries.prompt.mdManually: put the files in place
.gemini/commands/audit-layer-boundaries.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about audit-layer-boundaries
How to install audit-layer-boundaries in Claude Code?
Place the command markdown definition into .claude/commands/audit-layer-boundaries.md inside your workspace.
What does audit-layer-boundaries do?
It audits Rust codebases to locate architectural boundary violations between domain, application, adapter, and infrastructure code.
Which tools does the command require?
It uses Claude Code permissions for Read, Glob, Grep, and Bash to inspect Rust files.