rust-code-style
Skill972 starsChanged 3 months agoMITView on GitHub
Write idiomatic, well-structured Rust for Wassette — single-responsibility design, anyhow error handling, Arc/Mutex for shared state, and the required formatting and linting with cargo +nightly fmt, cargo clippy, and cargo machete. Use when adding or refactoring Rust code in this repository.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- DetachHead/rebasedtheir own version, first seen Nov 8, 2026
- jeffer1312/hangartheir own version, first seen Nov 8, 2026
- JetBrains/intellij-communitytheir own version, first seen Nov 7, 2026
- po4yka/rust-skillstheir own version, first seen Nov 2, 2026
- owenlamont/skillstheir own version, first seen Oct 20, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- JetBrains/intellij-community★ 21ksame name
- DetachHead/rebased★ 6.5ksame name
- jeffer1312/hangar★ 14same name
- po4yka/rust-skills★ 5same name
- owenlamont/skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- build-and-testSkill
- copyright-headersSkill
- documentationSkill
- mcp-inspector-testingSkill
- pull-requestSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 3 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Keep it simple: prefer straightforward solutions over clever complexity.
- Very specific: line 20
Error handling: use anyhow to add context and stack traces.
- Distinctive: line 21
Traits and generics: use traits for shared behavior and generics for reusable, type-safe, extensible APIs.
- Very specific: line 23
Thread safety: use stdlib primitives like Arc and Mutex for shared state.
- Distinctive: line 30
Always run before committing:
- Very specific: line 38
Write code that passes cargo clippy without warnings.
- Very specific: line 42
Every .rs file must start with the Microsoft copyright header.
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
rust-code-style skill
Apply Wassette's Rust conventions when writing or refactoring .rs files.
Best practices
- Single responsibility: each function and struct has one clear purpose.
- DRY: extract shared logic into reusable functions or modules.
- Descriptive naming: name functions, variables, and types for readability.
- Unit tests: cover every public function and its edge cases.
- Keep it simple: prefer straightforward solutions over clever complexity.
- Dependencies: manage them carefully in
Cargo.toml; avoid unnecessary ones that bloat the project. - Error handling: use
anyhowto add context and stack traces. - Traits and generics: use traits for shared behavior and generics for reusable, type-safe, extensible APIs.
- Thread safety: use stdlib primitives like
ArcandMutexfor shared state. - Performance: choose appropriate data types, e.g.
&stroverStringwhen possible.
Formatting and linting
Always run before committing:
cargo +nightly fmt # Format (nightly toolchain required)
cargo clippy --workspace # Lint; resolve every warning
cargo machete # Check for unused dependenciesWrite code that passes cargo clippy without warnings.
Copyright headers
Every .rs file must start with the Microsoft copyright header. See the
copyright-headers skill for the exact format and the automated script.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

