Skip to main content

rust-best-practices

スター1
フォーク0
更新日2026年4月26日 23:14

**ALWAYS USE** when working with Rust code. This skill contains 45 rules that prevent common bugs. Trigger on ANY of these: - Editing .rs files or Cargo.toml - Writing new Rust functions, structs, enums, or impl blocks - Reviewing Rust code before committing - Debugging Rust errors (borrow checker, Option/Result, lifetimes) - Working with: unwrap, expect, ?, Option, Result, Path, PathBuf - File I/O operations in Rust (read, write, atomic writes) - CLI development with clap - Error handling patterns - Functions returning Option or Result that might fail silently - Path operations (canonicalize, file_name, parent, extension) - Deserializing JSON/YAML/TOML from external sources Key rules to apply: - Rule 35: Log before returning None (prevent silent failures) - Rule 36: Return Err for invalid input, not empty collections - Rule 37: Canonicalize paths at system boundaries - Rule 39: Every public method needs tests - Rule 40: Validate untrusted data at point of use - Rule 41: Audit ergonomic error suppressors (.

インストール

Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。

ファイルエクスプローラー
9 ファイル
SKILL.md
readonly