Skip to content
Agentmart
Submit a tool

rust-best-practices

Write, review, refactor, or optimize Rust, including ownership, errors, Tokio, traits, tests, benchmarks, Clippy, and documentation.

Skill by Pedro Nauck

IndexedMIT★ 641
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/pedronauck-rust-best-practices

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Write, review, refactor, or optimize Rust, including ownership, errors, Tokio, traits, tests, benchmarks, Clippy, and documentation. Excludes other languages and architecture unrelated to Rust idioms.

Use cases: writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/rust-best-practices

Tools it pre-approves 9

From allowed-tools in SKILL.md: the agent may use these without asking you each time.

  • Bash(cargo:*)
  • Bash(rustc:*)
  • Bash(rustfmt:*)
  • Bash(clippy:*)
  • Read
  • Write
  • Edit
  • Glob
  • Grep

What's inside

Skill name
rust-best-practices
Description
Write, review, refactor, or optimize Rust, including ownership, errors, Tokio, traits, tests, benchmarks, Clippy, and documentation. Excludes other languages and architecture unrelated to Rust idioms.
License
MIT
Compatibility
Cargo; honor the repository edition, pinned toolchain, and minimum supported Rust version
Allowed tools
Bash(cargo:*), Bash(rustc:*), Bash(rustfmt:*), Bash(clippy:*), Read, Write, Edit, Glob, Grep
Metadata
author: Pedro Nauck · domain: language · github: https://github.com/pedronauck · version: 2.1.0 · triggers: Rust, Cargo, ownership, borrowing, lifetimes, async Rust, tokio, zero-cost abstractions, memory safety, systems programming, traits, generics, error handling, thiserror, anyhow, clippy, rustfmt, testing, benchmarks · repository: https://github.com/pedronauck/skills
Instructions
29 lines in SKILL.md · view on GitHub

Before installing

  • Pre-approves some shell commands

Files (11)

  • SKILL.md
  • async-and-concurrency.md · references/
  • clippy-and-linting.md · references/
  • coding-style.md · references/
  • concurrency-sync.md · references/
  • documentation.md · references/
  • error-handling.md · references/
  • ownership-and-pointers.md · references/
  • performance.md · references/
  • testing.md · references/
  • traits-and-generics.md · references/

SKILL.md (first lines)

# Rust Best Practices

Use the existing crate design, edition, `rust-toolchain.toml`, and `Cargo.toml` `rust-version` (MSRV). Reference examples may use newer features: confirm support before adopting them; do not upgrade the toolchain or add a crate just to follow an example.

Read the reference for the Rust concern being changed. A local edit does not require every category, a new test framework, or a workspace-wide audit.

| Topic | Reference | Load When |
|-------|-----------|-----------|
| Coding Style | `references/coding-style.md` | Naming, imports, iterators, comments, string handling, macros |
| Error Handling | `references/error-handling.md` | Result, Option, ?, thiserror, anyhow, custom errors, async errors |
| Ownership & Pointers | `references/ownership-and-pointers.md` | Lifetimes, borrowing, smart pointers, Pin, Cow, interior mutability |
| Traits & Generics | `references/traits-and-generics.md` | Trait design, dispatch, GATs, sealed traits, type state pattern |
| Async & Concurrency | `references/async-and-concurrency.md` | Tokio, channels, streams, shutdown, runtime config, async traits |
| Sync Concurrency | `references/concurrency-sync.md` | Atomics, Mutex, RwLock, lock ordering, Send/Sync, memory ordering |
| Testing | `references/testing.md` | Unit/integration/doc tests, snapshot, proptest, mockall, benchmarks, fuzz |
| Performance | `references/performance.md` | Profiling, flamegraph, cloning, stack vs heap, iterators, allocation |
| Clippy & Linting | `references/clippy-and-linting.md` | Clippy config, key lints, workspace setup, #[expect] vs #[allow] |
| Documentation | `references/documentation.md` | Doc comments, rustdoc, doc lints, coverage checklist |

## Engineering floor

- Borrow or transfer ownership deliberately; clone when independent ownership is needed. Prefer clear ownership over numeric size rules or avoiding every allocation.
- Handle fallible operations with `Result` and preserve useful error context. Reserve panic/assertions for violated programmer invariants; validate external input with recoverable errors.
- Match error types, dispatch, and dependencies to the existing public contract. `thiserror`, `anyhow`, Tokio, and third-party synchronization crates are options, not mandatory additions.
- Keep lock lifetimes short, maintain lock order, and reason about cancellation, shutdown, and spawned-task ownership. Do not hold a synchronous lock across `.await`.
- Treat `Send`/`Sync` bounds and atomic orderings as correctness properties. Choose weaker ordering only with a valid synchronization argument; benchmark before performance-driven rewrites.
- Put behavior tests in the suite that owns the invariant. Add type-level, property, fuzz, snapshot, or benchmark tests when that contract or risk warrants them.
- Run the repository's required scoped format, lint, and test commands; reuse valid evidence. Full workspace/all-feature runs and documentation coverage rules follow project policy. Check feature combinations actually supported by the crate.

From pedronauck/skills, MIT.

More from pedronauck/skills

Compare and alternatives

    Featured in

    Signals

    Stars
    641
    Forks
    91
    Open issues
    0
    Last commit (this folder)
    Sep 5, 2026 (1 month ago)

    From GitHub (fetched Oct 24, 2026).

    Details

    Version
    2.1.0
    License
    MIT
    First seen
    Oct 24, 2026
    Last checked
    Oct 24, 2026

    Same skill elsewhere

    Copies of this SKILL.md published by others; search shows only one of them.

    More from Pedro Nauck

    Cite this page

    rust-best-practices skill. Agent Mart. https://agentmart.dev/skills/pedronauck-rust-best-practices (last updated 2026-10-24)