agentleFS
kaynetikkaynetik/skills/ultimate-rust/SKILL.md

ultimate-rust

Skill1 starsChanged 8 months agoMITView on GitHub

Comprehensive Rust language skill covering ownership, borrowing, lifetimes, smart pointers, mutability, generics, traits, type-driven design, error handling, concurrency, async, domain modeling, performance, ecosystem integration, resource lifecycle, domain errors, unsafe code, and coding guidelines. Routes queries through a layered meta-cognition framework. Use for all Rust questions including compile errors (E0382, E0597, E0277, E0308, E0499, E0502, E0596, E0038, E0433), design decisions, code review, anti-patterns, and best practices. Triggers on: Rust, cargo, rustc, Cargo.toml, .rs files, crate, borrow checker, lifetime, trait bound, async, tokio, Send, Sync.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before answering, identify the cognitive layer:

    line 11
  2. Very specific:

    When creating new Rust projects or Cargo.toml files:

    line 97
  3. Distinctive:

    When domain keywords appear alongside an error or design question, read both the relevant L1/L2 module and the domain skill:

    line 114
  4. Distinctive:

    Read the entry module

    line 127
  5. Distinctive:

    If domain context present, load domain skill

    line 128

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Rust -- Hub

Meta-Cognition Framework

Before answering, identify the cognitive layer:

Layer 3: Domain Constraints (WHY)
  Business rules, regulatory requirements
  "Why is it designed this way?"

Layer 2: Design Choices (WHAT)
  Architecture patterns, DDD, error strategy
  "What pattern should I use?"

Layer 1: Language Mechanics (HOW)
  Ownership, borrowing, lifetimes, traits
  "How do I implement this in Rust?"
User SignalEntry LayerDirection
E0xxx error codeL1Trace UP
Compile errorL1Trace UP
"How to design..."L2Check L3, then DOWN
"Building [domain] app"L3Trace DOWN
"Best practice..."L2Both directions
Performance issueL1 then L2UP then DOWN

Routing

Match the query to the right module, then Read it. For cross-cutting queries, read multiple modules.

Error Code Routing

ErrorModuleCause
E0382modules/ownership.mdUse of moved value
E0597modules/ownership.mdLifetime too short
E0506modules/ownership.mdCannot assign to borrowed
E0507modules/ownership.mdCannot move out of borrowed
E0515modules/ownership.mdReturn local reference
E0716modules/ownership.mdTemporary value dropped
E0106modules/ownership.mdMissing lifetime specifier
E0596modules/mutability.mdCannot borrow as mutable
E0499modules/mutability.mdMultiple mutable borrows
E0502modules/mutability.mdBorrow conflict
E0277modules/zero-cost.md or modules/concurrency.mdTrait bound not satisfied
E0308modules/zero-cost.mdType mismatch
E0599modules/zero-cost.mdNo method found
E0038modules/zero-cost.mdTrait not object-safe
E0433modules/ecosystem.mdCannot find crate/module

Keyword Routing

KeywordsModule
move, borrow, lifetime, 'a, 'static, clone, Copymodules/ownership.md
Box, Rc, Arc, Weak, RefCell, Cell, smart pointermodules/resource.md
mut, &mut, interior mutabilitymodules/mutability.md
generic, trait, impl, dyn, where, monomorphization, dispatchmodules/zero-cost.md
type state, PhantomData, newtype, marker trait, builder, sealedmodules/type-driven.md
Result, Option, Error, ?, unwrap, expect, panic, anyhow, thiserrormodules/error-handling.md
Send, Sync, thread, async, await, Future, tokio, channel, Mutexmodules/concurrency.md
domain model, DDD, entity, value object, aggregate, repositorymodules/domain.md
performance, benchmark, profiling, flamegraph, criterion, allocationmodules/performance.md
crate, cargo, dependency, feature flag, workspace, FFI, interopmodules/ecosystem.md
RAII, Drop, resource lifecycle, pool, OnceLock, LazyLock, guardmodules/lifecycle.md
domain error, retry, fallback, circuit breaker, recovery, resiliencemodules/domain-error.md
mental model, how to think, analogy, coming from Java/Python/C++modules/mental-model.md
anti-pattern, code smell, pitfall, common mistake, idiomaticmodules/anti-patterns.md
unsafe, raw pointer, FFI, extern, transmute, *mut, *const, UBmodules/unsafe.md
naming, formatting, clippy, rustfmt, lint, code style, commentmodules/coding-guidelines.md

Keyword Conflicts

KeywordResolution
unsafemodules/unsafe.md (not ecosystem)
errormodules/error-handling.md for general; modules/domain-error.md for recovery strategy
RAIImodules/lifecycle.md for design; modules/ownership.md for implementation
cratemodules/ecosystem.md for integration; delegate to rust-learner for version lookup
tokiomodules/concurrency.md for concepts; delegate to docs-researcher for API specifics

Negotiation Protocol

For comparative queries ("X vs Y", "best practice for..."), cross-domain questions, or ambiguous scope -- read patterns/negotiation.md and follow the structured analysis format.

Default Project Settings

When creating new Rust projects or Cargo.toml files:

[package]
edition = "2024"
rust-version = "1.85"

[lints.rust]
unsafe_code = "warn"

[lints.clippy]
all = "warn"
pedantic = "warn"

Domain Dual-Loading

When domain keywords appear alongside an error or design question, read both the relevant L1/L2 module and the domain skill:

Domain KeywordsL1/L2 ModuleDomain Skill
Web API, HTTP, axum, handlermodules/concurrency.mddomain-web (external)
trading, payment, fintechmodules/ownership.mddomain-fintech (external)
CLI, terminal, clapmodules/concurrency.mddomain-cli (external)
embedded, no_std, MCUmodules/resource.mddomain-embedded (external)
kubernetes, grpc, microservicemodules/concurrency.mddomain-cloud-native (external)

Priority Order

  1. Identify cognitive layer (L1/L2/L3)
  2. Read the entry module
  3. If domain context present, load domain skill
  4. Answer with reasoning chain from layer analysis

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.