rust-best-practices

Review Rust code for idiomatic patterns and safe practices.

Updated Feb 22, 2026
One-click install
npx skills add https://github.com/kkingsbe/tempest --skill rust-best-practices-kkingsbe
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-best-practices
Source: https://github.com/kkingsbe/tempest/tree/main/skills/rust-best-practices
Command: npx skills add https://github.com/kkingsbe/tempest --skill rust-best-practices-kkingsbe

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

The Rust best-practices guide helps developers write idiomatic, safe, and maintainable Rust code by standardizing ownership, borrowing, error handling, and testing practices.

Core Features & Use Cases

  • Borrowing vs cloning guidance to reduce unnecessary allocations.
  • Error handling patterns with Result, thiserror, and conventional tests/docs.
  • Performance and testing/documentation guidance to improve code quality across projects.

Quick Start

Review your Rust project and implement idiomatic patterns across ownership, borrowing, error handling, and testing.

Frequently Asked Questions about rust-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write idiomatic Rust code when deciding between borrowing and cloning?

Idiomatic Rust borrowing reduces unnecessary allocations by enforcing borrowing vs ownership decisions. Prefer references over cloning unless ownership is explicitly required, minimizing memory allocations while maintaining safe concurrency patterns.

What is the best way to handle errors in Rust using Result?

Error handling in Rust uses Result types with thiserror to enforce safe practices. You return Result variants instead of panicking, propagating errors conventionally with proper documentation and tests to improve code maintainability.

Can I use clippy linting guidance to review existing Rust projects?

Yes, clippy linting guidance automates code review across existing Cargo projects. It evaluates idiomatic patterns, identifies ownership and error handling issues, and aligns code with established Rust references during refactoring.

Does this Rust best-practices guide work for setting up new Cargo projects?

Yes, the guide applies to writing new Rust code in Cargo projects. It standardizes ownership, borrowing, error handling, and testing practices from the start, ensuring safe and maintainable code generation.

Why does my Rust code review fail idiomatic pattern checks?

Rust code reviews fail idiomatic checks when ownership decisions, Result error handling, or clippy lints are misaligned. Enforcing proper borrowing over unnecessary cloning and adding conventional tests resolves these pattern violations.