๐Ÿ“ฆ leonardomso / rust-skills

A collection of 179 rules that AI coding agents can use when writing Rust.

โ˜… 1 stars โ‘‚ 0 forks ๐Ÿ‘ 1 watching โš–๏ธ MIT License
agent-skillsai-codingbest-practicesclaude-codecode-qualitycodexcoding-guidelinescopilotllmopencoderustrust-langrust-language
๐Ÿ“ฅ Clone https://github.com/leonardomso/rust-skills.git
HTTPS git clone https://github.com/leonardomso/rust-skills.git
SSH git clone git@github.com:leonardomso/rust-skills.git
CLI gh repo clone leonardomso/rust-skills
Leonardo Maldonado Leonardo Maldonado Simplify README language 0373001 22 hours ago ๐Ÿ“ History
๐Ÿ“‚ master View all commits โ†’
๐Ÿ“ rules
๐Ÿ“„ AGENTS.md
๐Ÿ“„ CLAUDE.md
๐Ÿ“„ LICENSE
๐Ÿ“„ README.md
๐Ÿ“„ SKILL.md
๐Ÿ“„ README.md

Rust Skills

179 Rust rules your AI coding agent can use to write better code.

Works with Claude Code, Cursor, Windsurf, Copilot, Codex, Aider, Zed, Amp, Cline, and pretty much any other agent that supports skills.

Install

npx add-skill leonardomso/rust-skills

That's it. The CLI figures out which agents you have and installs the skill to the right place.

How to use it

After installing, just ask your agent:

/rust-skills review this function

/rust-skills is my error handling idiomatic?

/rust-skills check for memory issues

The agent loads the relevant rules and applies them to your code.

What's in here

179 rules split into 14 categories:

CategoryRulesWhat it covers
Ownership & Borrowing12When to borrow vs clone, Arc/Rc, lifetimes
Error Handling12thiserror for libs, anyhow for apps, the ? operator
Memory15SmallVec, arenas, avoiding allocations
API Design15Builder pattern, newtypes, sealed traits
Async15Tokio patterns, channels, spawn_blocking
Optimization12LTO, inlining, PGO, SIMD
Naming16Following Rust API Guidelines
Type Safety10Newtypes, parse don't validate
Testing13Proptest, mockall, criterion
Docs11Doc examples, intra-doc links
Performance11Iterators, entry API, collect patterns
Project Structure11Workspaces, module layout
Linting11Clippy config, CI setup
Anti-patterns15Common mistakes and how to fix them
Each rule has:
  • Why it matters
  • Bad code example
  • Good code example
  • Links to official docs when relevant

Manual install

If add-skill doesn't work for your setup, here's how to install manually:

Claude Code

Global (applies to all projects):

git clone https://github.com/leonardomso/rust-skills.git ~/.claude/skills/rust-skills

Or just for one project:

git clone https://github.com/leonardomso/rust-skills.git .claude/skills/rust-skills

OpenCode

git clone https://github.com/leonardomso/rust-skills.git .opencode/skills/rust-skills

Cursor

git clone https://github.com/leonardomso/rust-skills.git .cursor/skills/rust-skills

Or just grab the skill file:

curl -o .cursorrules https://raw.githubusercontent.com/leonardomso/rust-skills/master/SKILL.md

Windsurf

mkdir -p .windsurf/rules
curl -o .windsurf/rules/rust-skills.md https://raw.githubusercontent.com/leonardomso/rust-skills/master/SKILL.md

OpenAI Codex

git clone https://github.com/leonardomso/rust-skills.git .codex/skills/rust-skills

Or use the AGENTS.md standard:

curl -o AGENTS.md https://raw.githubusercontent.com/leonardomso/rust-skills/master/SKILL.md

GitHub Copilot

mkdir -p .github
curl -o .github/copilot-instructions.md https://raw.githubusercontent.com/leonardomso/rust-skills/master/SKILL.md

Aider

Add to .aider.conf.yml:

read: path/to/rust-skills/SKILL.md

Or pass it directly:

aider --read path/to/rust-skills/SKILL.md

Zed

curl -o AGENTS.md https://raw.githubusercontent.com/leonardomso/rust-skills/master/SKILL.md

Amp

git clone https://github.com/leonardomso/rust-skills.git .agents/skills/rust-skills

Cline / Roo Code

mkdir -p .clinerules
curl -o .clinerules/rust-skills.md https://raw.githubusercontent.com/leonardomso/rust-skills/master/SKILL.md

Other agents (AGENTS.md)

If your agent supports the AGENTS.md standard:

curl -o AGENTS.md https://raw.githubusercontent.com/leonardomso/rust-skills/master/SKILL.md

All rules

See SKILL.md for the full list with links to each rule file.

Where these rules come from

Contributing

PRs welcome. Just follow the format of existing rules.

License

MIT