rust-errors
Skill0 starsChanged 4 days agoApache-2.0View on GitHub
Failure semantics. Use when defining Rust errors, failure mappings, exit codes, degradation, or fallible completion.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- rewrite-rs/skillstheir own version, first seen Nov 29, 2026
- gurinderu/crafttheir own version, first seen Nov 29, 2026
- Dankosik/rust-cli-skillstheir own version, first seen Sep 8, 2026
- dawidpereira/rust-skillstheir own version, first seen Mar 22, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- rewrite-rs/skills★ 32same name
- gurinderu/craft★ 1same name
- Dankosik/rust-cli-skills★ 0same name
- dawidpereira/rust-skills★ 0same 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 repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- rust-coderSkill
- rust-debuggingSkill
- rust-dependenciesSkill
- rust-idiomaticSkill
- rust-performanceSkill
- rust-securitySkill
- rust-structural-qualitySkill
- rust-testingSkill
- rust-verificationSkill
- thermo-nuclear-code-quality-reviewSkill
- rust-modern-guidelinesSkill
The file
Files
Rust Errors
Failure semantics. Trace failure from the operation that observes it to the consumer that acts on it, separating rejected inputs, partial effects, uncertain outcomes, and post-commit cleanup failures so each boundary can stop, degrade, retry, or continue accurately.
Consumer-driven types. Expose typed variants where callers branch on recovery, while letting report-and-exit boundaries use contextual errors. Implement std::error::Error, Display, and Debug (via thiserror) on public library error types, preserving upstream #[source] causes and adding variants only for real consumers.
Context and redaction. Attach safe resource identifiers or input positions at the failing operation, verify what the boundary renderer actually emits from the source() chain, keep messages lowercase and free of trailing punctuation, redact secrets across every nested cause, and preserve failure precedence and all-or-nothing guarantees.
Conversions and retries. Implement From for context-free canonical conversions and use map_err where operation context disambiguates the failure; match structured variants rather than formatted strings. Require safe effect and idempotency identity before retrying timeouts or broken connections, log ignored cleanup failures only under an explicit best-effort policy, and represent help or early clean exits as normal Ok outcomes.
Fallible completion and panics. Expose an explicit observed close or flush method whenever resource completion can fail or await, reserving Drop for infallible non-blocking release and keeping primary outcomes distinct from cleanup errors. Use catch_unwind solely as task-boundary defense in depth, observe spawned-task failures via their supervisor, and re-establish or quarantine any multi-step invariant a panic could leave partial before exposing shared state.
Project boundaries. Keep per-file parser or detector failures (including panics caught by the scan worker's catch_unwind) contained to that file and accounted in the run summary rather than aborting the workspace scan; keep --fix transactional so a failed cargo check rolls edits back; and map outcomes to process exit status only in crates/cargo-modernize/src/main.rs, where --check findings and real errors stay distinguishable. Test these mappings behaviorally rather than boilerplate variants.
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.

