rust-skills
БесплатноБез исполняемых скриптовНе проверенRust rules for writing, reviewing, and refactoring Rust code. Use when editing .rs files or Cargo.toml, fixing borrow-checker, lifetime, or Send errors…
от leonardomso★ 783 звезды на GitHubОб этом скилле
Rust Skills
268 rules across 26 categories for idiomatic, safe, and fast Rust. Current for Rust 1.100 (2024 edition). This file is the index; each rule lives in rules/<id>.md next to it.
How to use
- Find the task in the table below. It names the categories to scan. A task that spans several rows uses all of them.
- In the index, read the summaries in those categories. Open the rule file for every rule that bears on the code in front of you.
- Apply the rules. When two rules pull in different directions, the higher-impact category wins: CRITICAL > HIGH > MEDIUM > LOW.
- When reviewing, report each finding with its rule id (for example
own-slice-over-vec) and the fix.
Done when every rule you opened is either applied or skipped for a stated reason.
If rules/ is not next to this file (a single-file install), fetch a rule from https://raw.githubusercontent.com/leonardomso/rust-skills/master/rules/<id>.md.
Task → categories
| Task | Categories |
|---|---|
| New function | own-, err-, name-, pat- |
| New struct or public API | api-, type-, trait-, conv-, doc- |
| Error handling | err-, api-, pat- |
| Borrow-checker or lifetime errors | own-, closure- |
| Async code | async-, own- |
| Threads, locks, atomics | conc-, own-, async- |
| Unsafe code or FFI | unsafe-, type-, test- |
| Conversions and parsing | conv-, api- |
| Serialization (serde) | serde-, type-, api- |
| Numeric / arithmetic | num-, type- |
| Macros / code generation | macro- |
| Closures / callbacks | closure-, type- |
| Collections | coll-, mem-, perf- |
| Logging / observability | obs-, err- |
| Tests and benchmarks | test-, perf- |
| Memory use | mem-, own-, perf- |
| Performance tuning | perf-, opt-, mem- |
| Cargo.toml, workspace, CI setup | proj-, lint-, opt-, perf-release-profile |
| Code review | every category the code touches, then anti- |
Index
1. Ownership & Borrowing (CRITICAL)
own-borrow-over-clone- Borrow with&Tand clone only to store, send across threads, or share viaArcown-slice-over-vec- Take&[T],&str, and&Pathin parameters, not&Vec<T>,&String, or&PathBufown-cow-conditional- UseCow<'a, T>for conditional ownershipown-arc-shared- UseArc<T>for thread-safe shared ownershipown-rc-single-thread- UseRc<T>for shared ownership in single-threaded contextsown-refcell-interior- UseRefCell<T>for interior mutability in single-threaded codeown-mutex-interior- UseMutex<T>for interior mutability across threadsown-rwlock-readers- UseRwLock<T>when reads significantly outnumber writesown-copy-small- ImplementCopyfor small, simple typesown-clone-explicit- Use explicitClonefor types where copying has meaningful costown-move-large- Move large types instead of copying; useBoxif moves are expensiveown-lifetime-elision- Rely on lifetime elision rules; add explicit lifetimes only when required
2. Error Handling (CRITICAL)
err-thiserror-lib- Usethiserrorfor library error typeserr-anyhow-app- Useanyhowfor application error handlingerr-result-over-panic- ReturnResult<T, E>for recoverable errors; panic only for bugs and unrecoverable stateerr-context-chain- Add context with.context()or.with_context()err-no-unwrap-prod- Propagate errors with?orexpecta documented invariant; keepunwrap()out of production pathserr-expect-bugs-only- Reserveexpect()for violated invariants that indicate bugs; returnResultfor user input, I/O, network, and database failureserr-question-mark- Use?operator for clean propagationerr-from-impl- ImplementFrom<E>for error conversions to enable?operatorerr-source-chain- Preserve error chains with#[source]orsource()methoderr-lowercase-msg- Start error messages lowercase, no trailing punctuationerr-custom-type- Define custom error types for domain-specific failures
3. Memory Optimization (CRITICAL)
mem-with-capacity- Usewith_capacity()when size is knownmem-smallvec- UseSmallVecfor
Установить rust-skills в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл rust-skills?
Rust rules for writing, reviewing, and refactoring Rust code. Use when editing .rs files or Cargo.toml, fixing borrow-checker, lifetime, or Send errors, designing a crate's public API, writing async or unsafe code, or tuning performance.
Как установить скилл rust-skills?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл rust-skills запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic