Claude Code Plugins

Community-maintained marketplace

Feedback

ALWAYS use this skill BEFORE writing or modifying ANY Rust code (.rs files), even for simple Hello World programs. Enforces Microsoft Rust coding guidelines, applies M-CANONICAL-DOCS documentation, adds compliance comments, and validates against rust-guidelines.txt. This skill is MANDATORY for all Rust development.

Install Skill

1Download skill
2Enable skills in Claude

Open claude.ai/settings/capabilities and find the "Skills" section

3Upload to Claude

Click "Upload skill" and select the downloaded ZIP file

Note: Please verify skill by going through its instructions before using it.

SKILL.md

name ms-rust
description ALWAYS use this skill BEFORE writing or modifying ANY Rust code (.rs files), even for simple Hello World programs. Enforces Microsoft Rust coding guidelines, applies M-CANONICAL-DOCS documentation, adds compliance comments, and validates against rust-guidelines.txt. This skill is MANDATORY for all Rust development.

Rust Development

This skill automatically enforces Rust coding standards and best practices when creating or modifying Rust code.

Instructions

CRITICAL: This skill MUST be invoked for ANY Rust code operation, including:

  • Creating new .rs files (even simple examples like Hello World)
  • Modifying existing .rs files (any change, no matter how small)
  • Reviewing Rust code
  • Refactoring Rust code

Process:

  1. Read the rust-guidelines.txt to understand all compliance requirements
  2. Before writing/modifying ANY Rust code, ensure edits are conformant to the guidelines
  3. Apply proper M-CANONICAL-DOCS documentation format
  4. Add compliance comments
  5. Comments must ALWAYS be written in American English, unless the user explicitly requests 'write comments in French' or provides another clear instruction specifying a different comment language.
  6. If the file is fully compliant, add a comment: // Rust guideline compliant {date} where {date} is the guideline date/version

Key Guidelines to Apply:

Documentation (M-CANONICAL-DOCS)

/// Summary sentence < 15 words.
///
/// Extended documentation in free form.
///
/// # Examples
/// One or more examples that show API usage.
///
/// # Errors
/// If fn returns `Result`, list known error conditions
///
/// # Panics
/// If fn may panic, list when this may happen
///
/// # Safety
/// If fn is `unsafe`, list all conditions a caller must uphold.
pub fn foo() {}

Error Handling (M-ERRORS-CANONICAL-STRUCTS)

  • Use anyhow or eyre for applications
  • Use custom error structs with Backtrace for libraries
  • Implement Debug, Display, and std::error::Error

Performance (M-MIMALLOC-APPS)

  • Applications should use mimalloc as global allocator

Types (M-PUBLIC-DEBUG)

  • All public types must implement Debug
  • Sensitive types need custom Debug implementation

Safety (M-UNSOUND)

  • No unsound code ever
  • unsafe only for UB risk scenarios
  • Document all safety requirements

Services (M-SERVICES-CLONE)

  • Use Arc<Inner> pattern for heavyweight services
  • Implement Clone for shared ownership

No exceptions: Even for trivial code like "Hello World", guidelines must be followed.