Rust Development Patterns — portable workflow
Idiomatic Rust patterns, ownership, error handling, traits, concurrency, and best practices for building safe, performant applications. Use when writing or reviewing Rust code and ownership, error handling, traits, or concurrency is in question.
Use it only when the request supplies this domain, framework, data source or artifact; a shared keyword is not a match. Related skills, each for its own concern: bosskuai-go-development, bosskuai-kotlin-patterns, python-patterns.
Workflow
Read the source workflow first, then work through these sections in order:
- How It Works.
- Core Principles.
- Ownership and Borrowing.
- Use
Cow for Flexible Ownership.
- Error Handling.
- Use
Result and ? — Never unwrap() in Production.
- Resolve its
scripts/, references/, assets/ and template paths against references/upstream/, not the project root. Source skill names map through SOURCE.json (bossku skills show <id>). ECC slash commands, agent names and package-root paths are not installed: use what this host has, or say what is missing.
- Check the project's tool versions and the source prerequisites first:
rustc --version, cargo --version, the channel pinned in rust-toolchain.toml, and rust-version and edition in Cargo.toml. Check the latest stable Rust release on blog.rust-lang.org at work time. Use only APIs present in the installed version. A documented command is an example, not permission to install packages, add an account, expose secrets, upload private content or change an external service.
Done when
Apply the source “How It Works”, “Core Principles” guidance to the concrete request. Return the resulting rust development patterns artifact or diagnosis with source/command evidence for each conclusion.
If an input, provider, runtime or authorisation is missing, stop that step, carry on with read-only analysis, and say exactly what is missing. A generated plan alone is not completion.
- Money uses
checked_* arithmetic, and a None result is an error, never a capped value. Counts may use checked_* or saturating_*. Overflow panics in debug and wraps in release, so test in both.
- Money is integer cents or a decimal type such as
rust_decimal, never f64.
- No
MutexGuard is held across an .await, and no unsafe impl Send is added just to pass the compiler.
- Full quality bar, with version and type checks:
../../references/checklists/engineering-quality-bar.md.
Adapted from the locally reviewed affaan-m/ECC snapshot: provenance and hashes in SOURCE.json, the original text and resources in references/upstream/ under its MIT licence. Copyright (c) 2026 Affaan Mustafa.
1---2name: bosskuai-rust-patterns3description: "Use when the task explicitly concerns rust patterns. Idiomatic Rust patterns, ownership, error handling, traits, concurrency, and best practices for building safe, performant applications. Use when writing or reviewing Rust code and ownership, error handling, traits, or concurrency is in question."4metadata:5 source: https://skillmd.com/skills/wankimmy/bosskuai-rust-patterns6 origin: ECC-adaptation7---89# Rust Development Patterns — portable workflow1011Idiomatic Rust patterns, ownership, error handling, traits, concurrency, and best practices for building safe, performant applications. Use when writing or reviewing Rust code and ownership, error handling, traits, or concurrency is in question.1213Use it only when the request supplies this domain, framework, data source or artifact; a shared keyword is not a match. Related skills, each for its own concern: `bosskuai-go-development`, `bosskuai-kotlin-patterns`, `python-patterns`.1415## Workflow1617Read [the source workflow](references/upstream/SKILL.md) first, then work through these sections in order:18191. How It Works.202. Core Principles.213. 1. Ownership and Borrowing.224. Use `Cow` for Flexible Ownership.235. Error Handling.246. Use `Result` and `?` — Never `unwrap()` in Production.2526- Resolve its `scripts/`, `references/`, `assets/` and template paths against `references/upstream/`, not the project root. Source skill names map through [SOURCE.json](SOURCE.json) (`bossku skills show <id>`). ECC slash commands, agent names and package-root paths are not installed: use what this host has, or say what is missing.27- Check the project's tool versions and the source prerequisites first: `rustc --version`, `cargo --version`, the channel pinned in `rust-toolchain.toml`, and `rust-version` and `edition` in `Cargo.toml`. Check the latest stable Rust release on blog.rust-lang.org at work time. Use only APIs present in the installed version. A documented command is an example, not permission to install packages, add an account, expose secrets, upload private content or change an external service.2829## Done when3031Apply the source “How It Works”, “Core Principles” guidance to the concrete request. Return the resulting rust development patterns artifact or diagnosis with source/command evidence for each conclusion.3233If an input, provider, runtime or authorisation is missing, stop that step, carry on with read-only analysis, and say exactly what is missing. A generated plan alone is not completion.3435- Money uses `checked_*` arithmetic, and a `None` result is an error, never a capped value. Counts may use `checked_*` or `saturating_*`. Overflow panics in debug and wraps in release, so test in both.36- Money is integer cents or a decimal type such as `rust_decimal`, never `f64`.37- No `MutexGuard` is held across an `.await`, and no `unsafe impl Send` is added just to pass the compiler.38- Full quality bar, with version and type checks: `../../references/checklists/engineering-quality-bar.md`.3940Adapted from the locally reviewed `affaan-m/ECC` snapshot: provenance and hashes in [SOURCE.json](SOURCE.json), the original text and resources in [references/upstream/](references/upstream/SKILL.md) under its [MIT licence](references/upstream/LICENSE). Copyright (c) 2026 Affaan Mustafa.