rust-best-practices

Apply Apollo GraphQL's Rust Best Practices Handbook to improve code quality.

3|Updated Apr 6, 2026
One-click install
npx skills add https://github.com/AlvaroG13191704/stock-agent --skill rust-best-practices-alvarog13191704
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-best-practices
Source: https://github.com/AlvaroG13191704/stock-agent/tree/main/.agents/skills/rust-best-practices
Command: npx skills add https://github.com/AlvaroG13191704/stock-agent --skill rust-best-practices-alvarog13191704

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill helps Rust developers write idiomatic, safe, and maintainable Rust code by applying Apollo GraphQL's Rust Best Practices Handbook guidelines.

Core Features & Use Cases

  • Borrowing vs cloning guidance to reduce unnecessary allocations and ownership issues.
  • Error handling patterns using Result types and practical error propagation strategies.
  • Performance-minded coding, iterators, and zero-cost abstractions.
  • Documentation and testing practices, including rustdoc and unit/integration tests.

Use Case: You are refactoring a Rust module to align with best practices and ensure code is robust, readable, and scalable across teams.

Quick Start

Review a Rust project and apply the handbook's guidelines to improve code quality, consistency, and maintainability.

Frequently Asked Questions about rust-best-practices

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

FAQPage Schema
What are the best practices for borrowing vs cloning in Rust to avoid unnecessary allocations?

Rust borrowing best practices prioritize passing references over cloning data to reduce unnecessary allocations and ownership issues. You should clone only when explicit ownership is required, ensuring safe and maintainable code across diverse Rust projects.

How do I handle errors in Rust using Result types for proper error propagation?

Rust error handling best practices use Result types for robust error propagation. You should return Result instead of panicking, ensuring safe and maintainable code by explicitly managing recoverable errors across your modules.

How do I use iterators and zero-cost abstractions to optimize Rust performance?

Rust performance optimizations prefer iterators and zero-cost abstractions to write idiomatic code. You should leverage these patterns instead of manual loops to ensure code is robust, readable, and scalable across teams.

What is the best way to document public APIs in Rust using rustdoc?

Documenting public APIs in Rust requires using rustdoc to ensure code is robust, readable, and scalable. You should apply documentation guidelines to public functions and structures, improving overall code quality and consistency across teams.

Does this Rust best practices approach work for refactoring existing modules?

Yes, applying Rust best practices works for refactoring existing modules. You can review a Rust project and apply guidelines like using Result for errors and preferring iterators to improve code quality, consistency, and maintainability.

Why should I use clippy and idiomatic Rust patterns in my project?

Idiomatic Rust patterns, often enforced by clippy, help write safe and maintainable code. You should apply proven handbook guidelines to ensure code is robust, readable, and scalable across teams, avoiding common anti-patterns.