rust-best-practices

Apply idiomatic Rust patterns for ownership, error handling, and performance.

1|Updated Feb 8, 2026
One-click install
npx skills add https://github.com/gihwan-dev/claude-code-gui --skill rust-best-practices-gihwan-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-best-practices
Source: https://github.com/gihwan-dev/claude-code-gui/tree/main/.agents/skills/rust-best-practices
Command: npx skills add https://github.com/gihwan-dev/claude-code-gui --skill rust-best-practices-gihwan-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook. Use this skill when: (1) writing new Rust code or functions, (2) reviewing or refactoring existing Rust code, (3) deciding between borrowing vs cloning or ownership patterns, (4) implementing error handling with Result types, (5) optimizing Rust code for performance, (6) writing tests or documentation for Rust projects.

Core Features & Use Cases

  • Comprehensive guidelines on ownership, borrowing, Copy trait, and lifetime considerations.
  • Error handling, linting guidance (clippy), and testing/documentation practices.
  • Real-world scenarios: code review, refactoring, API design decisions, and performance tuning.

Quick Start

Provide a Rust code snippet and a review plan that applies idiomatic Rust practices per Apollo GraphQL handbook.

Frequently Asked Questions about rust-best-practices

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

FAQPage Schema
How do I apply idiomatic Rust patterns for ownership and borrowing in code reviews?

Idiomatic Rust code reviews apply ownership, borrowing, and lifetime guidelines to improve code quality. You provide a Rust snippet and a review plan to enforce Copy trait usage and borrowing vs cloning decisions based on Apollo GraphQL's best practices handbook.

What is the best way to implement error handling with Result types in Rust?

Error handling in Rust uses Result types to manage failures explicitly. Implementing idiomatic patterns involves applying linting guidance with clippy and following documentation practices to ensure robust API design and proper error propagation.

Can I use these Rust best practices for performance tuning and API design?

Yes, these Rust best practices support performance tuning and API design. They enforce front-matter driven metadata and compatibility with Rust 1.70+ and Cargo, aligning refactoring and optimization decisions with real-world scenarios.

When do I need to consider Copy trait and lifetime implications in Rust refactoring?

You need Copy trait and lifetime considerations in Rust refactoring when deciding between borrowing vs cloning or optimizing ownership patterns. Applying these idiomatic patterns during refactors prevents common memory management pitfalls and improves code quality.

Does this Rust best practices skill work with Cargo and clippy linting workflows?

Yes, this Rust best practices skill works with Cargo and clippy linting workflows. It enforces compatibility with Rust 1.70+ and Cargo, providing linting guidance and testing documentation practices aligned with the Apollo GraphQL handbook.