rust-idioms
Skill13 starsChanged 3 months agoApache-2.0View on GitHub
Everyday Rust engineering for Skill Doctor — errors, ownership, clippy, APIs, iterators. Use when writing or reviewing Rust that is not specifically about perf, unsafe, or YARA.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- irahardianto/awesome-agvtheir own version, first seen Aug 21, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- irahardianto/awesome-agv★ 157same 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 repository31 other files it gives its agents.
- AGENTS.mdAGENTS.md
- paper-writingSkill
- research-surveySkill
- brainstormingSkill
- ci-cdSkill
- cli-sarifSkill
- dispatching-parallel-agentsSkill
- executing-plansSkill
- finishing-a-development-branchSkill
- neutralize-sd11Skill
- project-contextSkill
- receiving-code-reviewSkill
- release-publishSkill
- requesting-code-reviewSkill
- review-botsSkill
- rust-best-practicesSkill
- rust-invariantsSkill
- rust-perfSkill
- rust-skillsSkill
- rust-testingSkill
- rust-workspaceSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- unsafe-sandboxSkill
- using-git-worktreesSkill
- using-superpowersSkill
- verification-before-completionSkill
- writing-plansSkill
- writing-skillsSkill
- yara-rulesSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Do not panic in L1 because a skill file is malformed.
- Very specific: line 17
Do not clone() to satisfy the borrow checker if a lifetime or Arc would do.
- Very specific: line 24
Prefer enum Severity { Low, Medium, High, Critical } over strings.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Rust idioms
Errors
- Libraries:
thiserrorenums. Nounwrap/expecton recoverable paths. - Binary:
anyhowatmainonly. Map to exit codes in one place. - Do not
panicin L1 because a skill file is malformed. Malformed input is a finding or a skipped file with coverage reduced.
Ownership
- Hot path: borrow (
&[u8],&str,&Path). Own only when storing in aFinding. - Do not
clone()to satisfy the borrow checker if a lifetime orArcwould do. Clippyclone_on_copy/ needless clones must stay clean. PathBufwalks: collect sortedVec<PathBuf>once, then iterate. Do notread_dirtwice.
APIs
- Public core API is small:
scan_bundle(&[u8] | &Path) -> Result<Report>. - Rule IDs and SD class IDs are
&'static stror newtypes, not free-formStringinvented at runtime. - Prefer
enum Severity { Low, Medium, High, Critical }over strings.
Clippy / fmt
cargo fmt --allis not optional.clippy --all-targets -- -D warningsis the style guide. Do not fight clippy with#[allow]unless the allow cites an invariant.unsafeis not an idiom. Loadunsafe-sandboxinstead.
Concurrency
- L1 fan-out:
rayon. Notokioin core. - MCP / optional L4:
tokio. - Shared state:
std::sync/arc_swap/OnceLock. Do not add a new runtime.
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.

