write-idiomatic-rust

Implements, reviews, and refactors idiomatic Rust code using vendored API guidelines and strict Clippy checks.

Updated Jul 11, 2026
One-click install
npx skills add https://github.com/azishio/coding-skills --skill write-idiomatic-rust-azishio
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: write-idiomatic-rust
Source: https://github.com/azishio/coding-skills/tree/main/skills/write-idiomatic-rust
Command: npx skills add https://github.com/azishio/coding-skills --skill write-idiomatic-rust-azishio

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve? Writing Rust that is readable, maintainable, and consistent across public APIs and internal code requires juggling many guidelines, lint configurations, and dependency decisions. This Skill routes each concrete design decision to the right authoritative reference and enforces a strict Clippy profile so Rust changes meet a uniform quality bar. ## Core Features & Use Cases - Decision-based reference routing: Maps each design question (naming, ownership, error design, builders, FFI, async, performance) to one primary guide drawn from the Rust API Guidelines, Microsoft Pragmatic Rust Guidelines, and Rust Design Patterns. - Strict Clippy validation: Ships a strict-clippy.sh runner with curated lint levels and clippy.toml thresholds, plus a policy for fixing, expecting, or suppressing findings. - Dependency selection guidance: Evaluates crates by total maintenance cost with categorized candidate tables for common code, data, async, procedural macros, and tests. - Use Case: When refactoring a Rust crate's error handling, the Skill routes the error-type contract to the API guidelines, checks whether thiserror fits, implements the change, and validates it with the strict Clippy runner. ## Quick Start Use the write-idiomatic-rust skill to review and refactor the error handling in my Rust crate and run the strict Clippy check.

Frequently Asked Questions about write-idiomatic-rust

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

FAQPage Schema
How do I write idiomatic Rust code with AI assistance?▼

Activate the skill when implementing, fixing, reviewing, or refactoring Rust. It inspects your Cargo.toml and code, routes each design decision to the appropriate Rust guideline reference, and validates changes with a strict Clippy runner.

How to run strict Clippy lints on a Rust project?▼

Run scripts/strict-clippy.sh from the project root with your package, target, and feature options. It applies a curated deny-level lint list and clippy.toml thresholds; add --publishable for crates intended for publication.

What Rust design guidelines does this skill reference?▼

It vendors three sources: the Rust API Guidelines for type and callable contracts, the Microsoft Pragmatic Rust Guidelines for architecture and operations, and Rust Design Patterns for implementation idioms and anti-patterns.

Should I use thiserror or anyhow for Rust error handling?▼

Use thiserror for typed errors in library APIs where domain distinctions and public error contracts matter. Use anyhow at application boundaries for error context and propagation, keeping typed errors in library surfaces.

When should I add a dependency versus writing a utility in Rust?▼

Check the standard library and existing dependencies first, then investigate maintained crates before rebuilding general-purpose infrastructure. Optimize total maintenance cost rather than dependency count; small domain-specific logic can stay local.

When should I not add tests for Rust dependency behavior?▼

Do not add tests that merely confirm a dependency's documented macros, derives, or type-state APIs work. Add tests only for project-owned logic, integration contracts, configuration, or known regressions at the project boundary.