1---2name: antonygiomarxdev-maverick-rust-best-practices3description: Rust — best practices4---56# Rust — best practices78## Idioms and tooling910- Treat **compiler + Clippy** as part of the review: new warnings or denies should be resolved, not accumulated.11- For **where** format and lint flags live (CI, aliases, allow policy), see [rust-linter-configuration/SKILL.md](../rust-linter-configuration/SKILL.md).12- Use **type-driven design**: let the type system encode states (e.g. builder, sealed traits, newtypes) instead of runtime checks alone.13- Prefer **explicit error types** at boundaries; map to domain errors inside the core rather than leaking `io::Error` everywhere.1415## Checklist1617- [ ] API takes the weakest ownership (`&`, `&mut`, `AsRef`) that still works?18- [ ] No `unwrap`/`expect` on paths that can fail in production?19- [ ] Every `unsafe` block has a `// SAFETY:` note and minimal scope?20- [ ] Async code does not hold `MutexGuard` or other non-`Send` state across `.await`?21- [ ] New `pub` items have a one-line doc when behavior is not obvious from the name?2223## Async and concurrency2425- Document or bound **spawn** sites with the same care as public functions (`Send`, `'static` where required).26- Prefer structured concurrency (scoped tasks, clear shutdown) over fire-and-forget where lifecycle matters.2728## When in doubt2930Prefer code that a mid-level Rust reader understands without reading three layers of macros.3132---33> Source: [antonygiomarxdev/maverick](https://github.com/antonygiomarxdev/maverick) — distributed by [TomeVault](https://tomevault.io).34<!-- tomevault:4.0:skill_md:2026-06-16 -->
Run npx skillmds@latest add tomevault-io/antonygiomarxdev-maverick-rust-best-practices in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Rust — best practices It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
tomevault-io (@tomevault-io) published this skill. Their other Agent Skills are listed on their SkillMD profile.