rust-guidelines

Provide pragmatic Rust guidelines for AI-assisted coding and API design.

2|Updated Nov 11, 2025
One-click install
npx skills add https://github.com/lambdamechanic/sk --skill rust-guidelines
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-guidelines
Source: https://github.com/lambdamechanic/sk/tree/main/skills/rust-guidelines
Command: npx skills add https://github.com/lambdamechanic/sk --skill rust-guidelines

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses the challenge of maintaining consistent, high-quality, and performant Rust code across a project. It provides a comprehensive set of pragmatic conventions to guide developers and AI agents, preventing common pitfalls and ensuring a unified codebase.

Core Features & Use Cases

  • Code Quality & Readability: Enforces idiomatic Rust patterns, thorough documentation, clear naming conventions, and static verification tools.
  • Performance Optimization: Guides on identifying and optimizing hot paths, leveraging efficient allocators like Mimalloc, and designing for high throughput.
  • Safety & Resilience: Establishes strict rules for unsafe code usage, robust error handling with canonical structs, and predictable panic behavior.
  • Use Case: A developer or AI agent is reviewing a new Rust module and needs to ensure it adheres to project standards. This skill can be activated to provide immediate guidance on documentation, error handling, performance, and safety, ensuring the code meets all quality gates.

Quick Start

Review the attached Rust code for adherence to the project's pragmatic Rust guidelines, focusing on documentation, error handling, and performance best practices.

Frequently Asked Questions about rust-guidelines

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

FAQPage Schema
How do I ensure my Rust code meets project quality and performance standards?

Rust guidelines provide pragmatic conventions covering idiomatic patterns, thorough documentation, strong typing, error handling, and performance optimization. They help developers and AI agents maintain consistent, high-quality code across libraries and applications while adhering to canonical standards for safety and API design.

What's the best way to structure error handling in Rust applications?

Use canonical error struct patterns as outlined in guidelines to establish robust, predictable error handling. This ensures errors are properly typed, well-documented, and can be reliably handled by both developers and AI agents throughout your codebase.

How can I optimize Rust code for high performance?

Performance guidelines cover identifying hot paths, leveraging efficient allocators like Mimalloc in applications, and designing APIs for high throughput. These optimizations ensure your Rust project achieves maximum efficiency without sacrificing code clarity.

Why is thorough documentation important for Rust APIs?

Documentation enables AI agents and developers to understand and correctly use your APIs. Rust guidelines require comprehensive docs to ensure AI-friendly API design, making your code more maintainable and enabling effective automated code assistance.

How do I review Rust code for adherence to project standards?

Use guidelines to audit new modules for documentation completeness, error handling patterns, unsafe code usage, and performance best practices. This provides immediate feedback on whether code meets quality gates and follows canonical conventions across your project.

Can I apply these guidelines to both Rust libraries and applications?

Yes. Guidelines cover both libraries and applications, addressing documentation, strong types, testing, and performance for each context. They ensure consistent code quality standards across different project types in your Rust ecosystem.