Borrowing it
Nothing to install: this file belongs to flashus/detrix. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/flashus/detrix/main/.claude/commands/audit-crate.mdgit clone --depth 1 https://github.com/flashus/detrixWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/flashus/detrix/audit-crate)<a href="https://agentmods.dev/commands/flashus/detrix/audit-crate"><img src="https://agentmods.dev/badge/commands/flashus/detrix/audit-crate/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/flashus/detrix/audit-crate"><img src="https://agentmods.dev/badge/commands/flashus/detrix/audit-crate.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00013 | $0.00920 |
| Opus 5.5 | $0.00005 | $0.00368 |
| Sonnet 5.5 | $0.00003 | $0.00184 |
| Haiku 4.5 | $0.00001 | $0.00092 |
Grade A, and why
audit-crate scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 100 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are a senior Rust developer performing a focused code audit of a single crate in the Detrix project.
Target
Audit the crate specified in: "$ARGUMENTS"
Parse the arguments as: <crate-name> [scope]
<crate-name>is required (e.g.detrix-core,detrix-api)[scope]is optional:branch,uncommitted, orproject(default:project)
If scope is branch: only audit files changed on current branch vs main (use git diff main...HEAD -- crates/<crate-name>/).
If scope is uncommitted: only audit uncommitted changes (use git diff -- crates/<crate-name>/).
If scope is project: audit the entire crate.
Instructions
Read CLAUDE.md first to understand the architecture rules, then audit the crate thoroughly. Use Serena's symbolic tools (get_symbols_overview, find_symbol, find_referencing_symbols) to navigate efficiently — avoid reading entire files unless necessary.
Checklist
Architecture & Design
- Clean Architecture layer violations (check dependency rules: core depends on NOTHING, ports on core+config only, application on ports+core+config only, infrastructure implements port traits)
- God files / god modules (files with too many responsibilities)
- Over-complex code / doom pyramids (deeply nested if/match/loop)
- Proper component wiring — compare patterns across the crate
- Config parameter dataflow — params properly passed through layers
Error Handling
.map_err()— should useFrom/TryFromimpls instead; use extension trait pattern to keep contextunwrap()/expect()/panic!()in non-test code — app must never panic- Similar/duplicate error variants that should be consolidated
- Proper error propagation with
?operator
Type System & Constants
Arc<dyn Trait + Send + Sync>— verify proper type aliases are used- Hardcoded strings or magic numbers — should be enums/constants
- Hardcoded values where config values should be forwarded
- Default values — are they sensible? Could they cause issues?
- Constants should be defaults only; actual values from detrix.toml
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 100 lines · 13 tokens per session scan A c2a2db83a292
audit-crate is a command published in the GitHub repository flashus/detrix (28 stars, last pushed 2mo ago), licensed MIT. It adds 13 tokens to every session and 920 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
rust-critique
Deep code critique — read the target Rust code and apply the full review process. Evaluates soundness, ownership, error handling, type design, async correctness, performance, and architecture. Think like a senior Rust engineer giving honest feedback.
rust-harden
Harden Rust code — replace unwrap with proper error handling, add safety comments to unsafe blocks, enable overflow checks, validate inputs at boundaries. The defensive hardening pass.
rust-teach
One-time setup that scans your Rust project, understands its patterns and conventions, and writes a Rust-specific context section to your CLAUDE.md. Run once per project to establish persistent Rust guidelines.
rust-types
Strengthen the type system — replace primitive obsession with newtypes, booleans with enums, stringly-typed APIs with domain types. Make illegal states unrepresentable.
rust-polish
Final pre-merge polish — remove dead code, verify doc comments, clean clippy, check all Result paths, remove debug artifacts. The last 5% that takes 50% of the effort.
rust-review
Comprehensive Rust code review for ownership, lifetimes, error handling, unsafe usage, and idiomatic patterns. Invokes the rust-reviewer agent.