rust-conventions

Apply Rust coding conventions to error handling, RAII, naming, and editions.

Updated Feb 26, 2026
One-click install
npx skills add https://github.com/heikopanjas/agent-skills --skill rust-conventions-heikopanjas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-conventions
Source: https://github.com/heikopanjas/agent-skills/tree/main/rust-conventions
Command: npx skills add https://github.com/heikopanjas/agent-skills --skill rust-conventions-heikopanjas

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rust coding conventions and best practices for idiomatic Rust development. Use when writing, reviewing, or refactoring Rust code to ensure consistency with error handling, RAII principles, naming conventions, and Rust edition best practices.

Core Features & Use Cases

  • Idiomatic Coding: Follow Rust's preferred patterns to improve readability and maintainability.
  • Error Handling Guidance: Use Result<T, E> and avoid panics in library code.
  • Code Quality Practices: Apply RAII, proper ownership, and naming consistency; adopt rustfmt and clippy for formatting and linting.
  • Use Case: A team revises a large Rust codebase to align with a standard style guide, improving code quality and onboarding speed.

Quick Start

Review your Rust project and apply the conventions for idiomatic error handling, RAII, naming, and edition; update code accordingly.

Frequently Asked Questions about rust-conventions

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

FAQPage Schema
What are idiomatic Rust conventions for error handling and RAII?

Idiomatic Rust conventions require using Result<T, E> for error handling to avoid panics in library code, while applying RAII principles for proper ownership and resource management to ensure safe, clean code.

How do I enforce a consistent Rust coding standard across my projects?

Enforce a consistent Rust coding standard by applying conventions for naming and edition practices, and integrating static checks using rustfmt for formatting and clippy for linting within team workflows.

Does this Rust conventions guidance work for refactoring existing codebases?

Yes, you can use these Rust conventions when writing, reviewing, or refactoring Rust code to align a large codebase with a standard style guide, improving code quality and reducing onboarding time.

What's the best way to use clippy and rustfmt for Rust code quality?

The best way to use clippy and rustfmt is to integrate them as static checks in your team workflow, ensuring automated enforcement of formatting and linting rules for idiomatic Rust code.

Why should I avoid panics in Rust library code?

You should avoid panics in Rust library code to follow idiomatic error handling conventions, preferring Result<T, E> to safely propagate errors to the caller instead of crashing the application.