Skip to content
Skills Library
Programming · Learning & explanation

rust-guide

/rust-guide

Use to explain Rust language characteristics and established practical patterns, and to apply that knowledge in Rust development. Covers ownership, borrowing, lifetimes, traits and API design, collections, memory allocation, error handling, async execution and CPU parallelism, synchronization, module and crate boundaries, Cargo workspaces and monorepos, library selection, performance and SIMD, WebAssembly, embedded/no_std, unsafe/FFI, compiler diagnostics, build configuration, and MSRV/edition compatibility. Use for questions about how Rust works, idiomatic ways to structure code, why a compil

Repository
skills ↗
Licence
MIT
Last repository change
22.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
39
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 22.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use to explain Rust language characteristics and established practical patterns, and to apply that knowledge in Rust development. Covers ownership, borrowing, lifetimes, traits and API design, collections, memory allocation, error handling, async execution and CPU parallelism, synchronization, module and crate boundaries, Cargo workspaces and monorepos, library selection, performance and SIMD, WebAssembly, embedded/no_std, unsafe/FFI, compiler diagnostics, build configuration, and MSRV/edition compatibility. Use for questions about how Rust works, idiomatic ways to structure code, why a compil

Original author description

Use to explain Rust language characteristics and established practical patterns, and to apply that knowledge in Rust development. Covers ownership, borrowing, lifetimes, traits and API design, collections, memory allocation, error handling, async execution and CPU parallelism, synchronization, module and crate boundaries, Cargo workspaces and monorepos, library selection, performance and SIMD, WebAssembly, embedded/no_std, unsafe/FFI, compiler diagnostics, build configuration, and MSRV/edition compatibility. Use for questions about how Rust works, idiomatic ways to structure code, why a compil

How it works

  1. Explain the Topic
  2. Account for the Environment
  3. Route by the Question
  4. Compatibility
Original SKILL.md headings · 60 lines, 832 words
SKILL.md preview
---
name: rust-guide
description: Use to explain Rust language characteristics and established practical patterns, and to apply that knowledge in Rust development. Covers ownership, borrowing, lifetimes, traits and API design, collections, memory allocation, error handling, async execution and CPU parallelism, synchronization, module and crate boundaries, Cargo workspaces and monorepos, library selection, performance and SIMD, WebAssembly, embedded/no_std, unsafe/FFI, compiler diagnostics, build configuration, and MSRV/edition compatibility. Use for questions about how Rust works, idiomatic ways to structure code, why a compiler constraint exists, when a pattern or library fits, and its costs and exceptions. Connects mechanisms to practical examples, including std/core approaches and curated ecosystem libraries. Uses stable Rust with explicit API, edition, and target requirements; explains relevant nightly alternatives separately.
license: MIT
---

# Rust Guide

Explain Rust's characteristics and established practical patterns by topic. Connect how the language and libraries work to recommended usage, applicable conditions, costs, pitfalls, and exceptions. Use examples that make these relationships concrete.

## Explain the Topic

Start with the concept needed to answer the question, then connect it to practice. For a substantial topic, cover **mechanism → practical pattern → applicable conditions → pitfalls and exceptions → example**. This is a way to develop the explanation, not a required response template. A narrow question may need only a paragraph or a small example.

- Explain why a pattern works: ownership and resource lifetime, type guarantees, execution and synchronization, memory representation, or compilation behavior.
- Develop the suitable std/core approach where it is useful. Explain what a dependency adds and what maintaining an equivalent implementation would cost; fewer dependencies alone do not justify writing a scheduler or unsafe allocator.
- Treat `clone`, `dyn Trait`, `Arc<Mutex<T>>`, allocation, and abstractions according to their semantics and costs. A useful default has conditions and exceptions.
- Use comparisons when the question involves alternatives. Classify their roles before comparing names, and use the [library selection policy](references/practices/library-selection.md) for new dependency recommendations.
- Relate examples to observable behavior: who owns a buffer, which failure a caller can handle, when a task ends, or which configuration reaches a target.

Match depth to the reader's question. Explain the underlying constraint when discussing a diagnostic; connect an established pattern to the supplied code when application is requested. Keep small examples focused, and explain any omitted runtime, device setup, dependency features, or failure handling that matters to their use.

## Account for the Environment

Bring in environmental facts when they change the explanation: `core`/`alloc`/`std`, host and target, OS threads or interrupts, runtime, MSRV and edition, dependency features, public API, and deployment CPU baseline. A general language question needs no repository inspection. Use supplied code and manifests for project-specific questions, and state assumptions where relevant facts are unavailable.

Distinguish workload costs such as I/O waiting, computation, contention, retained memory, startup, and build time. Explain the likely mechanism before suggesting a measurement; a performance hypothesis becomes a speedup claim only with comparable results.

## Route by the Question

Read the relevant section of the closest reference first. Long references have contents tables; expand to neighboring sections only when their concepts are needed. Follow cross-topic links for relationships such as ownership and allocation, async and cancellation, or workspace features and no_std.

| Task signal | Read |
|---|---|
| Ownership, borrowing, lifetimes, resource release | [Ownership and borrowing](references/practices/ownership-and-type-design.md#ownership-borrowing-and-resource-lifetimes), then [parameter and return types](references/practices/ownership-and-type-design.md#parameter-and-return-types) |
| Newtype, typestate, enum/generic/dyn, shared ownership | [Type patterns](references/practices/ownership-and-type-design.md#newtypes), [dispatch](references/practices/ownership-and-type-design.md#enum-trait-generic-or-dyn), or [shared ownership](references/practices/ownership-and-type-design.md#shared-ownership-and-cycles) |
| Lookup, ordering, queues, hashing, collection capacity | [Collection semantics and representation](references/practices/collections.md#semantics-representation-and-cost), then the relevant operation |
| Allocation, buffer reuse, arena/pool, allocator, retained memory | [Memory and allocation](references/practices/memory-and-allocation.md#storage-allocation-and-release) |
| Errors, std-only implementations, thiserror/anyhow, recovery/reporting | [The error model](references/practices/error-handling.md#values-propagation-and-error-information), [manual implementation](references/practices/error-handling.md#anatomy-of-a-library-error-type), or [reporting](references/practices/error-handling.md#application-errors-with-anyhow) |
| Function/module/crate separation, visibility, core and adapters | [Modules and crate boundaries](references/practices/modules-and-crate-boundaries.md) |
| Public API, traits, conversions, SemVer, documentation | [API and crate design](references/practices/api-and-crate-design.md) |
| Workspace, monorepo, feature unification, shared versions/releases | [Workspaces and monorepos](references/practices/workspaces-and-monorepos.md) |
| Crate comparisons, std versus dependencies, adoption/maintenance | [Library selection](references/practices/library-selection.md) |
| Future/task/thread, Tokio/smol, Rayon/Crossbeam, blocking and limits | [Execution model and patterns](references/practices/async-and-parallel-execution.md#futures-tasks-and-threads) |
| Async borrowing, Send, 'static, Pin/Unpin | [Task ownership](references/practices/async-and-parallel-execution.md#borrowing-and-task-ownership), [pinning](references/practices/async-and-parallel-execution.md#pin-and-unpin) |
| Cancellation, timeouts, shutdown | [Cancellation](references/practices/async-and-parallel-execution.md#cancellation-is-an-ownership-contract), [shutdown](references/practices/async-and-parallel-execution.md#channels-locks-and-shutdown) |
| Threads, locks, channels, atomics, Send/Sync, contention | [Concurrency](references/practices/concurrency.md#choosing-a-model); use its contents for the specific primitive |
| Profiling, algorithms, layout, runtime and build-time bottlenecks | [Performance](references/practices/performance.md) |
| Auto-vectorization, SIMD intrinsics, CPU detection, fallback | [SIMD](references/practices/simd.md) |
| Browser/WASI, JS boundary, Wasm memory, workers and size | [WebAssembly](references/practices/webassembly.md) |
| Firmware, no_std, no heap, interrupts, HAL, DMA, embedded async | [Embedded and no_std](references/practices/embedded-and-no-std.md) |
| Cargo profiles, LTO, symbols, panic, PGO, compiler flags | [Build configuration](references/practices/build-configuration.md) |
| Raw pointers, layout, aliasing, initialization, FFI | [Safety contracts](references/practices/unsafe-and-ffi.md#unsafe-fn-unsafe-blocks-and-safety-comments), then the relevant FFI or memory section |
| Compiler errors, Clippy diagnostics, lint configuration | [Compiler diagnostics and lints](references/practices/lints-and-diagnostics.md) |
| Edition 2024 migration | [Edition migration](references/versions/1.85.md) |
| Toolchain upgrade and release compatibility | [Versions index](references/versions/index.md), then the relevant release files |

## Compatibility

- Use the relevant topic's explanation, conditions, and examples to answer the question. Distinguish language/API guarantees, conditional practices, and measured outcomes.
- Match APIs and dependencies to the project's features, MSRV, target, and runtime. Explain relevant nightly alternatives separately from the stable approach.
- Release references cover Rust 1.80 onward. Each example has its own API requirements; edition 2024 requires Rust 1.85 even when its APIs are older. An older MSRV needs a supported edition and compatible APIs.
- Apply the library catalog's role and suitability conditions. Popularity narrows candidates; it does not establish correctness or a performance benefit.
- State assumptions and unresolved version or target constraints where they affect the answer. Describe compilation, target execution, and measured behavior only to the extent actually established.
Files in this package (39)
  • SKILL.md 9 KB
  • evals/README.md 2 KB
  • evals/evals.json 11 KB
  • references/practices/api-and-crate-design.md 23 KB
  • references/practices/async-and-parallel-execution.md 18 KB
  • references/practices/build-configuration.md 18 KB
  • references/practices/collections.md 22 KB
  • references/practices/concurrency.md 26 KB
  • references/practices/embedded-and-no-std.md 15 KB
  • references/practices/error-handling.md 31 KB
  • references/practices/library-selection.md 9 KB
  • references/practices/lints-and-diagnostics.md 27 KB
  • references/practices/memory-and-allocation.md 14 KB
  • references/practices/modules-and-crate-boundaries.md 9 KB
  • references/practices/ownership-and-type-design.md 34 KB
  • references/practices/performance.md 30 KB
  • references/practices/simd.md 15 KB
  • references/practices/unsafe-and-ffi.md 32 KB
  • references/practices/webassembly.md 15 KB
  • references/practices/workspaces-and-monorepos.md 12 KB
  • references/versions/1.80.md 2 KB
  • references/versions/1.81.md 2 KB
  • references/versions/1.82.md 2 KB
  • references/versions/1.84.md 1 KB
  • references/versions/1.85.md 9 KB
  • references/versions/1.86.md 1 KB
  • references/versions/1.87.md 1 KB
  • references/versions/1.88.md 2 KB
  • references/versions/1.89.md 2 KB
  • references/versions/1.90.md 1 KB
  • references/versions/1.91.md 3 KB
  • references/versions/1.92.md 1 KB
  • references/versions/1.96.md 1 KB
  • references/versions/1.97.md 1 KB
  • references/versions/index.md 5 KB
  • updates/2026-09-18-sources-and-verification.md 17 KB
  • updates/2026-09-21-guideline-redesign.md 11 KB
  • updates/2026-09-21-practice-depth.md 9 KB
  • updates/2026-09-21-reference-sources.md 13 KB

Versions

RepositoryScoreLicence
This page · buYoung/skills100MIT
ar4mirez/samuel100MIT

Database snapshot: 13.11.2026 · package version 1363f281ee33 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100rust-pro
    Modern Rust - ownership, async Tokio, traits, performance, unsafe, FFI. Use for Rust or Cargo work.
  • 90rust-code-expert
    Use when Rust-specific ownership, lifetimes, traits, Result flow, async/Tokio, unsafe, FFI, Cargo, or native-target design determines the solution.
  • 95rust-best-practices
    Write idiomatic, robust, maintainable Rust. Use this skill whenever you write, review, refactor, debug, or explain Rust code: new crates, modules, functions, structs, traits, error types, async code, unsafe or FFI code, Cargo.toml, tests, or rustdoc. Trigger on any mention of…
  • 95lang-rust
    Use this skill when the user says 'Rust', 'cargo', 'borrow checker', 'lifetimes', 'ownership', 'traits', 'generics Rust', 'Result and ?', 'thiserror', 'anyhow', 'tokio', 'async Rust', 'Send Sync', 'unsafe Rust', 'clippy', 'Rust 2024 edition'. Writes and reviews idiomatic Rust:…
  • 95rust-best-practices
    Write idiomatic, robust, maintainable Rust. Use this skill whenever you write, review, refactor, debug, or explain Rust code: new crates, modules, functions, structs, traits, error types, async code, unsafe or FFI code, Cargo.toml, tests, or rustdoc. Trigger on any mention of…
  • 100rust
    Guides Rust code across ownership, async cancellation, unsafe/FFI and Cargo features. Use when editing .rs or Cargo.toml, fixing borrow-checker or non-Send future errors, losing work inside select!, reviewing unsafe wrappers or FFI callbacks, or a crate builds only inside its workspace.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.