rust-style

Enforce idiomatic Rust coding style with control flow and type safety rules.

Updated Jul 10, 2025
One-click install
npx skills add https://github.com/nubiv/my-nome --skill rust-style-nubiv
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-style
Source: https://github.com/nubiv/my-nome/tree/main/nix-darwin/config/claude/skills/rust-style
Command: npx skills add https://github.com/nubiv/my-nome --skill rust-style-nubiv

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enforces a consistent and idiomatic Rust coding style, improving code readability, maintainability, and reducing potential bugs by adhering to best practices.

Core Features & Use Cases

  • Enforces idiomatic Rust: Promotes the use of for loops, let...else, shadowing, newtypes, and explicit pattern matching.
  • Discourages anti-patterns: Eliminates unnecessary comments, if let for simple value extraction, wildcard matches, and the matches! macro.
  • Use Case: Ensure all new Rust code contributions adhere to established style guidelines, making code reviews faster and more effective.

Quick Start

Apply the rust-style skill to the current Rust codebase to enforce coding standards.

Frequently Asked Questions about rust-style

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

FAQPage Schema
How do I enforce idiomatic Rust coding style in my codebase?

You enforce idiomatic Rust coding style by applying rules for preferred control flow, variable shadowing, type safety with newtypes, and explicit pattern matching. This improves code clarity and maintainability by discouraging common anti-patterns.

What are common Rust anti-patterns to avoid for better code quality?

Common Rust anti-patterns include excessive comments, using if let for simple value extraction, wildcard matches, and the matches! macro. Avoiding these improves code readability and reduces potential bugs.

What is the best way to use control flow structures in Rust?

The best way to use control flow structures in Rust is by favoring for loops, let...else statements, and early returns. These idiomatic structures help enforce consistent coding style and improve overall code clarity.

Does this Rust style enforcement require specific linter dependencies?

No specific linter dependencies are required to enforce these Rust style guidelines. The skill operates independently to analyze adherence to rules for loops, early returns, and destructuring without external components.

When should I use newtypes and enums for type safety in Rust?

You should use newtypes and enums for type safety in Rust when you need explicit pattern matching and clear code structures. This approach discourages anti-patterns and ensures adherence to established style guidelines.