LR

leonardomso/rust-skills

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

653 stars Качество 68 Тренд 33MIT

leonardomso/rust-skills — это кандидат на навыки агента, импортированный из https://github.com/leonardomso/rust-skills.

Обзор

leonardomso/rust-skills — это кандидат на навыки агента, импортированный из https://github.com/leonardomso/rust-skills.

Обзор (машинный перевод)

Правила 265 Rust, которые ваш AI-агент может использовать для написания лучшего кода. Актуальное для Rust 1.96 (издание 2024 года).

Работает с Claude Code, Cursor, Windsurf, Copilot, Codex, Aider, Zed, Amp, Cline и практически с любым другим агентом, который поддерживает навыки.

Почему

Из коробки кодирующие агенты пишут средний Rust — они клонируют, чтобы уклоняться от проверки заимствований, .unwrap() всё и тянутся к Box , когда это сделано impl Trait. Эти правила кодируют то, как на самом деле выглядит экспертный Rust: идиоматический, быстрый и безопасный. Каждое правило мало и сфокусировано, поэтому агент вводит только то, что релевантно к коду перед ним.

Установка

Вот и всё. CLI определяет, какие у тебя агенты, и устанавливает навык в нужное место.

Как им пользоваться

После установки просто спросите у вашего агента:

Агент загружает соответствующие правила и применяет их к вашему коду.

Увидь это в действии

Попросите агента ознакомиться с такой функцией:

С загруженными этими правилами он знает, что нужно взять &str вместо &String, убрать Ненужный clone() и распределение, и вернуть Option вместо паники:

Что здесь

265 правил, разделённых на 26 категорий:

Категория Правила Что она охватывает

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

Показан фрагмент оригинального README. Открыть оригинал.

Rust Skills

265 Rust rules your AI coding agent can use to write better code. Current for Rust 1.96 (2024 edition).

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

Why

Out of the box, coding agents write average Rust — they clone to dodge the borrow checker, .unwrap() everything, and reach for Box when impl Trait would do. These rules encode what expert Rust actually looks like: idiomatic, fast, and safe. Each rule is small and focused, so the agent pulls in only what’s relevant to the code in front of it.

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
/rust-skills is this unsafe block sound?

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

See it in action

Ask the agent to review a function like this:

// before
fn first_word(s: &String) -> String {
    s.clone().split_whitespace().next().unwrap().to_string()
}

With these rules loaded, it knows to take &str instead of &String, drop the needless clone() and allocation, and return an Option instead of panicking:

// after — applies own-slice-over-vec, own-borrow-over-clone, anti-unwrap-abuse
fn first_word(s: &str) -> Option {
    s.split_whitespace().next()
}

What’s in here

265 rules split into 26 categories:

Category Rules What it covers
Ownership & Borrowing 12 When to borrow vs clone, Arc/Rc, lifetimes
Error Handling 12 thiserror for libs, anyhow for apps, the ? operator
Memory 17 SmallVec, arenas, avoiding allocations, mem::take, drop order
Unsafe Code 7 SAFETY: comments, Miri, MaybeUninit, 2024-edition unsafe
API Design 17 Builder pattern, newtypes, sealed traits, FromIterator
Async 18 Tokio patterns, channels, async fn in traits, cancel safety
Concurrency 4 rayon, scoped threads, atomic ordering, thread-locals
Optimization 12 LTO, inlining, PGO, SIMD
Numeric & Arithmetic 5 Overflow handling, as vs TryFrom, float compare, NonZero
Type Safety 13 Newtypes, parse don’t validate, Deref, Display/Debug
Trait & Generics Design 6 dyn vs generic, associated types, blanket impls, object safety, orphan rule
Открыть полный README на GitHub

Рекомендуемые инструменты

Попробуйте другой запрос или уберите фильтр.

Установка

npx skillfish add leonardomso/rust-skills
Новичок в MCP? Начните с руководства на mcpskill.org →