rust-best-practices SKILL.md skillA
rust-best-practices from morganlinton/beautifulrust is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add morganlinton/beautifulrust/rust-best-practices@git:20261030.3385ca7Pins git:20261030.3385ca7 in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 17 of 17 checks passed
- Kind
- SKILL.md skill
- Repository
- morganlinton/beautifulrust
- Path
skills/rust-best-practices/SKILL.md- Versions recorded
- 8
- Latest version
- git:20261030.3385ca7, committed Oct 30, 2026
- First version recorded
- Oct 22, 2026
- Size
- 29,732 bytes
- Repository stars
- 1,637
- License
- MIT
Write idiomatic, robust, maintainable Rust. Use this skill whenever you write, review, refactor, debug, or explain Rust code: new crates, modules, functions, structs, traits, error types, async code, unsafe or FFI code, Cargo.toml, tests, or rustdoc. Trigger on any mention of Rust, cargo, crates, .rs files, the borrow checker, lifetimes, traits, clippy, or rustfmt, even when the user does not ask for "best practices" or "idiomatic" code. Synthesized from the Google Rust Style Guide, the Rust…
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# Rust best practices Distilled from five Rust style and design guides, with a digest of each in `references/`. Where they disagree, this file says which to follow and why. ## 1. Mindset - **Write Rust-shaped code.** Don't port C++, Java, C#, or Python constructs one-to-one. Model errors with `Result`, resources with ownership and `Drop`, polymorphism with traits and enums, and nullability with `Option`. Inheritance-flavored tricks (`Deref` to a "base" struct, `Manager`/`Factory` types, `throw_if_null` helpers) are smells. - **Make invalid states unrepresentable.** Push invariants into types: enums instead of bool flags and "must be X if Y" comments, newtypes for units and IDs, fallible constructors that validate once. Then the compiler enforces what a comment only requests. - **Application code is not library code.** Library code (anything with external users) follows the API-design rules below strictly. Application code should favor simplicity and directness: concrete types, `String` or `&str` rather than `impl Into<String>` parameters, `anyhow`-style errors, `Vec` return values, no speculative generality. …
Read the whole file at its exact version.
How to install
mdr add morganlinton/beautifulrust/rust-best-practices@sha256:f9446430549a64d9The line at the top of this page pins the label git:20261030.3385ca7, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_tukr24o4ah4a5elk)
1 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 8 versions of this file, between Oct 22, 2026 and Oct 30, 2026, about one every day.
| version | committed | commit | size | audit | |
|---|---|---|---|---|---|
| git:20261030.3385ca7 latest | 2026-10-30 | 3385ca7 | 29,732 B | A | view · diff |
| git:20261028.9d48ef1 | 2026-10-28 | 9d48ef1 | 29,634 B | A | view · diff |
| git:20261027.58757ee | 2026-10-27 | 58757ee | 29,638 B | A | view · diff |
| git:20261027.e20db6f | 2026-10-27 | e20db6f | 29,502 B | A | view · diff |
| git:20261026.a2b2268 | 2026-10-26 | a2b2268 | 29,506 B | A | view · diff |
| git:20261025.ca5f149 | 2026-10-25 | ca5f149 | 29,948 B | A | view · diff |
| git:20261024.6b3a96c | 2026-10-24 | 6b3a96c | 29,767 B | A | view · diff |
| git:20261022.681bc2e | 2026-10-22 | 681bc2e | 28,617 B | A | view |
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (29732 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
morganlinton/beautifulrust · 1,637 stars · license MIT · pushed 2026-10-30 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_tukr24o4ah4a5elk GET https://markdownregistry.com/api/v1/resolve?ref=morganlinton/beautifulrust/rust-best-practices GET https://markdownregistry.com/api/v1/blob/f9446430549a64d9fb2d480c875c4920b1d98c2540b937bd41448200b2639f6a
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.
More from morganlinton/beautifulrust
Every file in morganlinton/beautifulrust