Skip to content

Rust Coding Patterns

Guides the agent to write idiomatic, safe Rust: ownership, error handling, enums, traits and concurrency.

Repository
affaan-m/ECC
Stars
295,127
Licence
MIT
Files
1 file

What it does

When installed, the agent follows a set of Rust best-practice guidelines while writing or reviewing Rust code. It favors borrowing over cloning, uses Result and the ? operator instead of unwrap() for errors, applies thiserror for library errors and anyhow for applications, models states as enums with exhaustive matching, and organizes concurrency with Arc<Mutex<T>>, channels and async/await. It contains only written guidance and code examples; it runs no scripts and contacts no external services.

Great for

  • Developers learning idiomatic Rust conventions
  • Teams wanting a consistent style when reviewing or refactoring Rust code
  • Anyone designing crate structure and module layout in Rust

Skip it if

  • Non-Rust projects, since the guidance only covers Rust (wrong language, little value)
  • Experts who already know these patterns and need novel, project-specific architecture advice (the content is general and brief)
  • Cases where the guidance is followed blindly: some rules such as 'never unwrap()' or 'no catch-all match' are opinions that may not fit every codebase

Try asking

  • “Review this Rust module and point out places where I should use Result and ? instead of unwrap()”
  • “Refactor this struct-heavy code to use the builder pattern and newtypes for IDs”
  • “Help me model these connection states as a Rust enum with exhaustive matching”
  • “Suggest whether my error types should use thiserror or anyhow”
Step-by-step guide: how to use Rust Coding PatternsInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 1 original files, the MIT licence and an attribution note.

    rust-patterns.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip rust-patterns.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip rust-patterns.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Name the crate type (library or application) so the agent picks thiserror or anyhow correctly
  • Check the agent's suggestions against your project's own lint and clippy settings, since the skill's rules are general
  • Paste the specific code you want reviewed rather than asking for a general Rust overview

What's inside

  • SKILL.md

Redistributed unmodified from affaan-m/ECC under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.