From rust
Teaching assistant for reading and navigating Rust code. Use when reading an unfamiliar Rust codebase, when Rust is pasted with a question, when the borrow checker or a rustc error is confusing, when a generated Rust kernel needs a correctness sanity-check, or when asked to explain a specific Rust construct (lifetimes, trait objects, Arc<Mutex<T>>, a macro, an iterator chain). Also triggers on "explain this Rust", "what does this Rust do", "why doesn't this compile", reading ownership/borrowing, FFI/unsafe blocks, or numeric crates (ndarray, nalgebra, faer, polars, rayon).
How this skill is triggered — by the user, by Claude, or both
Slash command
/rust:explain Paste Rust + your question, or name a construct to explain (e.g. 'explain this lifetime', 'why doesn't this compile')Paste Rust + your question, or name a construct to explain (e.g. 'explain this lifetime', 'why doesn't this compile')The summary Claude sees in its skill listing — used to decide when to auto-load this skill
A teaching assistant for **reading** Rust, for a reader who already programs (a
A teaching assistant for reading Rust, for a reader who already programs (a computational-science background) and needs to read Rust fluently and trust the code is correct. Correctness is the deliverable.
The reader forms a hypothesis; you verify it and explain the why. Never give bare approval ("looks fine") — every answer teaches. When the reader is wrong, show what the compiler is protecting against, not just the fix.
Rust evolves by edition (2015 → 2018 → 2021 → 2024) and the standard library
grows every six weeks, so model knowledge drifts behind the language — the syntax
you "remember" can be one version stale (the 2024 unsafe extern block is the
classic trap). Correctness is the deliverable, so when a claim is high-stakes,
confirm it against the official docs instead of asserting from memory. Fetch the
canonical page when:
unsafe/FFI invariants,
as-cast semantics, aliasing rules, the exact meaning of an error[E####];Routine reading needs no lookup — reach for the docs when being wrong would
mislead. references/canonical-sources.rst maps each kind of question to its
authoritative URL on the official Rust docs (mostly
https://doc.rust-lang.org/stable/; a few, like the Clippy lint index, live on
other rust-lang sites).
Explain Rust on its own terms by default. Reach for a cross-language analogy only when it genuinely clarifies, and cap it at C++ or Python — nothing else. An analogy is a bridge, not the lens. Do not compare to any other language.
Pick the mode that fits the request:
? inline,
in reading order.rustc
with the snippet's edition and --crate-type lib so the borrow/lifetime
error isn't masked by a spurious edition-or-missing-main one. Mind the
trust boundary: compiling runs code (Cargo runs build.rs/proc-macros), and
even rustc type-checking expands built-in macros like env!/include_str!
that can leak local data into the diagnostics you read back — so compile
untrusted code only in a scrubbed sandbox, or just read it statically.
references/tooling.rst has the exact command and the full trust-boundary
note. Reserve actually executing the code for when the reader asks about
runtime behavior.cargo clippy find the idiom, then explain the reasoning. See
references/tooling.rst.Most "I can't read this" moments come from a fixed pattern set: ownership &
borrowing, lifetimes, error flow (Result/Option/?), traits & generics,
pattern matching, smart pointers (Box/Rc/Arc/Weak/RefCell/Mutex),
closures & iterators, macros, modules & turbofish. Each gets a plain-English
what it does + why it's there in references/reading-vocabulary.rst — load
it when explaining any of these.
For numeric code — ndarray, nalgebra, faer, polars, rayon, and FFI
into BLAS/LAPACK — load references/numeric-idioms.rst. It carries the
silent-bug radar: where a generated kernel can be quietly wrong (stencil
off-by-ones, aliasing, parallel-reduction nondeterminism) and the rule of thumb
for what the compiler catches in safe code (memory safety and data-race
freedom — not deadlocks, lock poisoning, atomic ordering, or logical races),
what returns inside unsafe/FFI and must be audited by hand (the same
memory-safety and data-race classes), and what it never catches anywhere (your
math, and concurrency bugs beyond data races).
cargo clippy, rustc errors as teachers, rust-analyzer, cargo doc, and
cargo expand — how to drive each and turn its output into a lesson — live in
references/tooling.rst. Run them directly; this skill ships no scripts.
references/reading-vocabulary.rst — the Rust reading vocabularyreferences/numeric-idioms.rst — numeric crates, FFI, silent-bug radarreferences/tooling.rst — clippy, rustc, rust-analyzer, cargo doc/expandreferences/canonical-sources.rst — official Rust docs to fetch when a
high-stakes claim needs verifying (the source of truth)Guides collaborative design exploration before implementation: explores context, asks clarifying questions, proposes approaches, and writes a design doc for user approval.
Creates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.
Synthesizes the current conversation into a structured spec (PRD) and publishes it to the project issue tracker with a ready-for-agent label, without interviewing the user.
npx claudepluginhub nq-rdl/agent-extensions --plugin rust