/tslateman-skills:rust-review [path or crate to review, defaults to working-tree changes]from tslateman-skills
Review Rust code for agent-typical anti-patterns: clone-to-satisfy-the- borrow-checker, silent error swallowing, string-matched error control flow, bare unwrap, lint suppression. Runs Clippy with a strict targeted lint set, then judges each trigger with an ownership and architecture lens. Use when: reviewing agent-written Rust, before committing Rust changes, or on "rust review", "review this rust", "clippy pass", "check for clone abuse". For generic bug hunts use /code-review; for generic judgment use /vibe-check.
Ships in tslateman-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Agent-written Rust has a signature failure mode: the minimal local edit
that makes the compiler error vanish. .clone() silences the borrow
checker, unwrap_or_default() silences a Result, #[allow] silences a
lint. Each edit compiles; the debt is architectural and invisible to
cargo check. This review hunts that debt class specifically.
Reference: Rust Design Patterns book, anti-patterns section (rust-unofficial.github.io/patterns/anti_patterns/), especially "Clone to satisfy the borrow checker".
Changed files:
!git diff --name-only HEAD 2>/dev/null | grep '\.rs$' || echo "(not a git repo or no changed .rs files — review the given path instead)"
Review $ARGUMENTS if given; otherwise the changed .rs files above;
otherwise ask which crate. Read the scoped files fully before judging —
every finding needs the surrounding ownership context, not just the line.
Run Clippy with the targeted lint set (default lints plus the ones that catch this debt class):
cargo clippy --all-targets -- \
-W clippy::unwrap_used \
-W clippy::redundant_clone \
-W clippy::clone_on_ref_ptr \
-W clippy::needless_pass_by_value \
-W clippy::or_fun_call \
-W clippy::comparison_chain \
-W clippy::large_types_passed_by_value
Note: redundant_clone is a nursery lint — treat its hits as leads to
verify, not verdicts. If the workspace has its own lint config
([lints] in Cargo.toml, clippy.toml), respect it and say so.
Then grep the scoped files for triggers Clippy can't judge:
| Trigger | Suspicion |
|---|---|
.clone() | Borrow-checker silencer? Or legitimate ownership transfer / Rc/Arc refcount bump? |
.unwrap() | Should be expect("why this holds") or ? propagation |
unwrap_or_default() / .ok() discarding | Silent error swallowing — is the error genuinely ignorable? |
.contains( / .starts_with( on error strings | Error control flow by string match — wants enum variants (thiserror) |
else if let chains | Usually a match in disguise |
#[allow( | Who silenced the lint, and is the reason written down? |
unsafe, as casts | Standard scrutiny: invariant documented? |
For each trigger hit, decide which of three buckets it belongs in — this is the review's actual work:
Arc::clone for a thread handoff is not a finding.unwrap → expect/?,
else if let chain → match, drop a provably redundant clone.Cow, lifetimes on the struct,
error enum with variants) and its blast radius. Do not apply it
without asking — this bucket is why the review exists.A repeated trigger is one finding, not many: five clones of the same
String field point at one struct's ownership design.
Findings ordered by severity, each with file:line, the bucket, why it
matters in one sentence, and the suggested fix. Then a one-paragraph
verdict: is this code compile-shaped or design-shaped? End with the
counts: N fine / N mechanical / N restructure.
If the user asks you to apply fixes, apply bucket 2 directly and
cargo clippy && cargo test after; bucket 3 gets a plan first.
.clone() or #[allow] as a fix.cargo check passing is the floor, not the verdict.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
tslateman-skills@tslateman is listed by tslateman/claude-plugins — review the source before installing
npx claudepluginhub tslateman/claude-plugins --plugin tslateman-skills61 skills in this plugin
/adrGenerate Architecture Decision Records that capture the reasoning behind technical decisions. Use when the user asks to "create an ADR", "document a decision", "record why we chose X", or discusses architectural trade-offs worth preserving./arenaSpawn N parallel candidates at the same task, pick a base, graft the strongest parts of the losers into it. Use for /arena, 'arena this', 'throw it in the arena', or when one attempt at a non-trivial artifact would lock in the wrong shape./automagic-problem-discoveryAudit a workspace for recurring friction, pick the highest-leverage one, and build the automation that removes it. Use when the user asks "what should I automate", "what's wasting my time", "find the friction in my workflow", wants a self-improvement pass over their own tooling, or runs this on a recurring loop./blast-radiusFind what a change could break somewhere else before it ships, beyond the diff, and prove the one fact it's safe because of by running real code instead of writing it up. Use for 'blast radius of X', 'what could this break', or reviewing a small diff you don't trust./brainstormThis skill should be used when the user asks to "brainstorm", "generate ideas", "ideate", "what are my options", "think of ways to", "explore possibilities", or wants divergent thinking on any topic. Also triggers on "what could we do about", "help me think through", or "creative options for"./broRe-explain the previous assistant message in a much simpler way — for when the reply made you go 'bro what'. Use /bro to get a plain-language version of the last answer.