plugins/rust-expert/skills/rust-core-language/SKILL.md
Use when writing or reviewing idiomatic Rust — edition 2024 features, ownership/borrowing design, and correcting the pitfalls that show up in LLM-generated Rust (clone tax, unwrap infestation, String vs &str, indexed loops, over-annotated lifetimes). Do NOT use for error-type design (use rust-error-handling), async runtimes, or SOLID/file-layout rules (use fuse-solid:solid-rust).
npx skillsauth add fusengine/agents rust-core-languageInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Idiomatic Rust for stable 1.96.1, edition 2024. This skill covers what the compiler will not catch for you: ownership design that avoids gratuitous cloning, and the recurring failure modes of machine-generated Rust.
edition in Cargo.toml
and its existing ownership conventions before adding code.cargo clippy.Never state a stabilization version from memory — verify against
doc.rust-lang.org/releases.html.
| Topic | When | |-------|------| | Edition 2024 features | Setting up a crate, using let chains / async closures | | Ownership & borrowing | Designing function signatures and data flow | | LLM pitfalls | Reviewing or repairing generated Rust before merge |
&T / &str / &[T] in parameters unless the
function must keep the value. See ownership-borrowing.md..clone() needs a reason. A clone to silence a borrow-checker error is a
design smell (the "clone tax"). Redesign ownership first; clone only when a
second owner genuinely exists..unwrap() / .expect() on fallible values without a written justification.
Grep for them before merge. Prefer ?, match, or a documented invariant.Arc::clone(&x) over x.clone() for reference-counted handles — it makes the
cheap pointer-copy explicit and distinguishes it from a deep clone.iter()/map()/filter()/collect() to
for i in 0..len { v[i] } — no bounds-check noise, no off-by-one.if let A = x && let B = y && cond) stabilized in 1.88.0
(2025-06-26), edition 2024 only — depends on the if let temporary-scope change.async || { .. }) stabilized in 1.85.0.gen blocks are UNSTABLE — feature gate #![feature(gen_blocks)], tracking
issue rust-lang/rust#117078, RFC #3513. Do NOT use on stable; the returned
iterators are not yet fused and the syntax may still change.| Topic | Reference | Load when |
|-------|-----------|-----------|
| Edition 2024 | edition-2024.md | Configuring edition, using let chains / async closures, checking feature stability |
| Ownership & borrowing | ownership-borrowing.md | Choosing owned vs borrowed params, designing lifetimes, sharing with Rc/Arc |
| LLM pitfalls | llm-pitfalls.md | Reviewing generated Rust for clone tax, unwrap infestation, String/&str, indexed loops |
| Template | Load when | |----------|-----------| | idiomatic-code.md | Need copy-paste examples of borrow-first signatures, iterator chains, and let chains |
Cargo.toml declares edition = "2024" if edition-2024 features are used.clone() added purely to satisfy the borrow checker.unwrap()/.expect() has a justifying comment or is provably infalliblecargo clippy clean, sniper passedtesting
Copy self-audit and ban-lists — filler verbs/hype adjectives, slop placeholder names, fake-precise numbers, Title Case headlines, humor in error copy ('Oops!'), em-dash crutch, one copy register per page.
development
Logged-in web apps — dashboards, auth flows, settings, onboarding, data tables, command palettes, modals, toasts. Register `product`: density and glance-speed over marketing polish, no hero/CTA-tricks, every data surface covers empty/loading/error explicitly, tables and dataviz follow preattentive-processing rules.
development
Marketing sites, landing pages, campaign pages — register `brand` (design IS the product). Structure comes from the register's POV + a macrostructure pick, never from copying an inspiration site's section flow. Hero discipline, deviated section order, asymmetric grids, and a silhouette lookalike-test gate before ship.
development
Token-strategy core — OKLCH color rules, neutral tinting, accent-commitment levels, type scale, 8pt spacing grid, touch targets, and the canonical output format of design-system.md (the file the harness gates on). This is routing step 1 of design-method/SKILL.md — read it before design-web/design-webapp/design-ios/design-android, before picking or auditing a single color/type/spacing value.