rust

Enforce idiomatic Rust structure and safer error handling with Result<T, E>.

3|1|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/heyAyushh/stacc --skill rust-heyayushh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust
Source: https://github.com/heyAyushh/stacc/tree/main/configs/stacks/rust
Command: npx skills add https://github.com/heyAyushh/stacc --skill rust-heyayushh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rust code often suffers from inconsistent patterns, unsafe blocks without rationale, and poor error handling. This Skill provides guidelines to improve structure, patterns, performance, and safety.

Core Features & Use Cases

  • Establish idiomatic module and type organization in Rust projects.
  • Enforce safer error handling with Result<T, E> and clear panics rationale.
  • Document unsafe blocks with explicit SAFETY notes to aid audits.
  • Apply performance guidance like pre-allocation and modern collections.

Quick Start

Use the rust skill to review a new Rust crate and align it with idiomatic patterns and safety practices.

Frequently Asked Questions about rust

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

FAQPage Schema
What are the best practices for idiomatic error handling in Rust?

Idiomatic Rust error handling enforces the use of Result<T, E> for operations that can fail and requires clear rationale for any panics. This approach replaces inconsistent patterns with safer, explicit error propagation.

How do I document unsafe blocks during a Rust code review?

Documenting unsafe blocks during a Rust code review requires adding explicit SAFETY notes. These notes detail the invariants and rationale ensuring safety, which aids audits and ensures robust code structure.

How do I structure Rust modules for better performance and organization?

Structuring Rust modules for performance involves applying performance-conscious data structures like modern collections and pre-allocation. It also establishes idiomatic module and type organization for consistency.

When do I need to refactor Rust code for safety and performance?

You need to refactor Rust code for safety and performance when existing code suffers from inconsistent patterns, lacks unsafe block documentation, or uses poor error handling. Apply these refactors during new project reviews.

Does this Rust guidance work with my existing crate refactoring workflow?

Yes, this guidance is applied during new projects, code reviews, and refactors to guide Rust patterns, safety, and performance decisions. It aligns existing crate structures with idiomatic practices.