rust-review

rust-review is a command for Claude Code from EmilLindfors/a2a-rs. It costs 28 tokens per session (866 once invoked), scanned A, original, MIT.

A command for reviewing Rust changes for common Rust practices and hexagonal architecture, an approach that separates core logic from outside services and interfaces. It can review the working-tree diff, a branch, selected files, or a pull request.

In plain words
What is it for?
Use it before merging Rust changes or reviewing a pull request for idiomatic code and architectural fit.
Why use it?
It brings code-style and architecture checks into one review pass. It also directs the reviewer to look for issues such as unnecessary dynamic types, weak error handling, and panic-prone paths.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it before merging Rust changes or reviewing a pull request for idiomatic code and architectural fit.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/emillindfors/a2a-rs/rust-review
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/EmilLindfors/a2a-rs

Made for: Claude Code.

Wrote 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.

agentmods badge for rust-review

README.md
[![agentmods](https://agentmods.dev/badge/commands/emillindfors/a2a-rs/rust-review.svg)](https://agentmods.dev/commands/emillindfors/a2a-rs/rust-review)
Your own site
<a href="https://agentmods.dev/commands/emillindfors/a2a-rs/rust-review"><img src="https://agentmods.dev/badge/commands/emillindfors/a2a-rs/rust-review.svg" alt="Measured on agentmods" height="20"></a>
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 866 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00028 $0.00866
Opus 5 $0.00014 $0.00433
Sonnet 5 $0.00006 $0.00173
Haiku 4.5 $0.00003 $0.00087

Measured 8d ago against content hash 73c42a536027, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

rust-review 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 8d 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.

.agents/plugins/rust-patterns/commands/rust-review.md · 56 lines

How it starts

The opening of the file, as written. The whole thing — 56 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/rust-review

Run a combined Rust-patterns and hexagonal-architecture review over the scope given in $ARGUMENTS (default: the working-tree diff against the merge base of the current branch).

Procedure

  1. Determine scope.

    • If $ARGUMENTS is empty or diff, review uncommitted changes plus committed changes on the current branch vs. its merge base with main/master. Use git diff and git log to enumerate touched files.
    • If $ARGUMENTS is branch, review every Rust file changed on the current branch vs. its merge base.
    • If $ARGUMENTS looks like a path or glob, review those files.
    • If $ARGUMENTS is a number (a PR), fetch that PR's diff via the available GitHub tooling and review it.
  2. First pass — idiomatic Rust. Apply the refactor_idiomatic_rust skill. Flag: generics vs. dyn misuse, missing ?/error-propagation cleanups, imperative loops that would read better as combinators, weak closure bounds, stringly-typed APIs, missing impl Into/AsRef/Cow opportunities, panic-prone code in expected-failure paths.

  3. Second pass — advanced architecture. Apply the architectural_review skill. Flag: opportunities for capability mixins, typed commands replacing untyped buffers, mis-chosen concurrency primitives (Mutex where atomic/channel fits), unbounded channels, lazy_static! instead of OnceLock/LazyLock, library code returning anyhow::Error.

  4. Third pass — hexagonal compliance. Apply the hexagonal_review skill against the touched files. Flag the smells listed in rules/hexagonal_architecture.md §8: domain leaking framework types, ports exposing technology, errors leaking up, services constructing adapters, feature flags on the wrong layer.

  5. Synthesize. Combine findings into a single review. Deduplicate — if one root cause produces findings across multiple passes (e.g. "this port returns reqwest::Error" is both an error-architecture issue and a hex-boundary leak), report it once and tag it with both passes it came from.

Read the full file on GitHub · 56 lines

Changes

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.

  1. 8d ago First seen · 56 lines · 28 tokens per session scan A 73c42a536027

Subscribe to this mod's changes

rust-review is a command published in the GitHub repository EmilLindfors/a2a-rs (87 stars, last pushed today), licensed MIT. It adds 28 tokens to every session and 866 once invoked, about $0.0001 per session on Opus 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.