# Antonygiomarxdev Maverick Rust Best Practices

> Rust — best practices

- Skill: `tomevault-io/antonygiomarxdev-maverick-rust-best-practices` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/antonygiomarxdev-maverick-rust-best-practices`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/antonygiomarxdev-maverick-rust-best-practices/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/antonygiomarxdev-maverick-rust-best-practices

---


# Rust — best practices

## Idioms and tooling

- Treat **compiler + Clippy** as part of the review: new warnings or denies should be resolved, not accumulated.
- For **where** format and lint flags live (CI, aliases, allow policy), see [rust-linter-configuration/SKILL.md](../rust-linter-configuration/SKILL.md).
- Use **type-driven design**: let the type system encode states (e.g. builder, sealed traits, newtypes) instead of runtime checks alone.
- Prefer **explicit error types** at boundaries; map to domain errors inside the core rather than leaking `io::Error` everywhere.

## Checklist

- [ ] API takes the weakest ownership (`&`, `&mut`, `AsRef`) that still works?
- [ ] No `unwrap`/`expect` on paths that can fail in production?
- [ ] Every `unsafe` block has a `// SAFETY:` note and minimal scope?
- [ ] Async code does not hold `MutexGuard` or other non-`Send` state across `.await`?
- [ ] New `pub` items have a one-line doc when behavior is not obvious from the name?

## Async and concurrency

- Document or bound **spawn** sites with the same care as public functions (`Send`, `'static` where required).
- Prefer structured concurrency (scoped tasks, clear shutdown) over fire-and-forget where lifecycle matters.

## When in doubt

Prefer code that a mid-level Rust reader understands without reading three layers of macros.

---
> Source: [antonygiomarxdev/maverick](https://github.com/antonygiomarxdev/maverick) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-06-16 -->

