coding-guidelines
Use when asking about Rust code style or best practices. Keywords: naming, formatting, comment, clippy, rustfmt, lint, code style, best practice, P.NAM, G.FMT, code review, naming convention, variable naming, function naming, type naming, 命名规范, 代码风格, 格式化, 最佳实践, 代码审查, 怎么命名
Security Assessment
About coding-guidelines
This skill is a condensed Rust code-style and best-practices reference distilled into roughly 50 core rules. It solves a narrow but common problem: when writing or reviewing Rust, it is easy to miss the non-obvious, Rust-specific conventions (naming, ownership-flavored conversions, iterator naming, error propagation) that separate idiomatic code from code that merely compiles. The skill surfaces those rules on demand so an assistant can apply them during code review or authoring.
The content is organized as compact reference tables covering naming (no `get_` prefix, `iter`/`iter_mut`/`into_iter`, `as_`/`to_`/`into_` conversion prefixes), data types and newtypes, string handling, error handling (`?` propagation, `expect` over `unwrap`), memory and lifetimes, concurrency and lock ordering, async guidance, and macros. It also includes a deprecated-to-preferred migration table (for example `lazy_static!` toward `OnceLock`, `try!()` toward the `?` operator) and a Clippy-lint-to-fix mapping. It points to an upstream source (the Chinese-language Rust Coding Guidelines site) for the full 500+ rule set, so it is intentionally a curated subset rather than an exhaustive linter.
It is aimed at Rust developers, reviewers, and AI coding assistants performing code review or style enforcement, including bilingual (English/Chinese) users given the keyword coverage. Typical use is answering "how should I name this?" or "what is the idiomatic pattern here?" during everyday Rust work. It does no code execution and simply provides guidance.
FAQ
What does this skill actually provide?
A curated set of about 50 Rust-specific style and best-practice rules across naming, types, strings, error handling, memory, concurrency, async, and macros, plus a Clippy-lint-to-fix mapping and a deprecated-to-preferred migration table.
Is this the complete Rust guidelines set?
No. It is a core subset. The SKILL.md and rules index explicitly point to the upstream Rust Coding Guidelines site (rust-coding-guidelines.github.io) for the full 500+ rules.
Does it run any tools or modify my code?
No. It is a read-only reference. It references tools like rustfmt and Clippy conceptually but does not execute them or change files.
Does it support non-English users?
Yes. The description includes Chinese keywords (命名规范, 代码风格, 格式化, 最佳实践, 代码审查), so it triggers on both English and Chinese style questions.
Who benefits most from it?
Rust developers and reviewers who want quick reminders of the non-obvious, Rust-specific conventions that a general knowledge of the language might miss.
Install coding-guidelines
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
actionbook/rust-skills