error-conversion-guide
Convert Rust Errors Idiomatically
Rust error conversions can become repetitive and confusing across application layers. This skill guides Claude, Codex, and Claude Code toward idiomatic From, map_err, anyhow, and thiserror patterns.
Install with my Agent
Copy this request to your Agent. It includes the canonical Skill page and manifest.
Review the Skillstore skill "error-conversion-guide" from https://skillstore.io/skills/emillindfors-error-conversion-guide.md and its manifest at https://skillstore.io/api/skills/emillindfors-error-conversion-guide/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.Your Agent should still show its plan and request any confirmation required by the security policy.
Agent-readable resources
Use these links when an AI agent, crawler, or script needs clean context instead of reading the full page.
Test it
Using "error-conversion-guide". A parser reads a file, parses an integer, and uses repeated map_err calls for both failures.
Expected outcome:
The skill recommends a single application error type with automatic conversions for file and parse errors, then explains when map_err is no longer needed.
Using "error-conversion-guide". A service function combines repository, validation, and API client errors behind one result type.
Expected outcome:
The skill suggests a unified service error and explains how each lower-level error converts at the call site with the ? operator.
Using "error-conversion-guide". An enum has two variants that both try automatic conversion from the same source error type.
Expected outcome:
The skill explains why the conversion conflicts and recommends source-preserving variants with manual construction where context differs.
Security Audit
SafeAll 44 static findings are false positives caused by Markdown backticks, Rust code examples, a sample fetch method name, and an error message. No evidence was found for prompt injection, executable scripts, network exfiltration, or system reconnaissance in SKILL.md.
Risk Factors
โ๏ธ External commands (42)
๐ Network access (1)
Share & cite this report
Share the versioned assessment report, neutral badge, embed card, and citations. Skillstore reports evidence without deciding whether this Skill is safe.
Copy report link
https://skillstore.io/skills/emillindfors-error-conversion-guide/audits/4?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown badge
[](https://skillstore.io/skills/emillindfors-error-conversion-guide?utm_source=security_passport_badge)HTML badge
<a href="https://skillstore.io/skills/emillindfors-error-conversion-guide?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/emillindfors-error-conversion-guide/security.svg" alt="Skillstore security assessment" loading="lazy"></a>Embed card
<iframe src="https://skillstore.io/embed/skills/emillindfors-error-conversion-guide.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>Academic citations (APA ยท BibTeX ยท CFF)
APA citation
EmilLindfors. (2026). error-conversion-guide security audit report (audit version 4) [Author version 1.0.0]. Skillstore. https://skillstore.io/skills/emillindfors-error-conversion-guide/audits/4BibTeX citation
@techreport{emillindfors-emillindfors-error-conversion-guide-2026,
author = {EmilLindfors},
title = {error-conversion-guide security audit report (audit version 4)},
institution = {Skillstore},
year = {2026},
number = {4},
url = {https://skillstore.io/skills/emillindfors-error-conversion-guide/audits/4},
note = {Author version 1.0.0}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "error-conversion-guide security audit report (audit version 4)"
version: "1.0.0"
type: report
authors:
- name: "EmilLindfors"
date-released: "2026-07-06"
url: "https://skillstore.io/skills/emillindfors-error-conversion-guide/audits/4"
identifiers:
- type: other
value: "skillstore:emillindfors-error-conversion-guide:audit:4"
description: "Skillstore immutable audit report identifier"
Skillstore Score
Why this score Evidence Confidence: HighWhat You Can Build
Replace Repetitive Conversions
Convert repeated map_err calls into cleaner automatic conversions when source errors map directly to application errors.
Design Public Error Types
Choose between thiserror, anyhow, boxed errors, and type aliases for library and application boundaries.
Review Layered Services
Map infrastructure, domain, and service errors without leaking low-level details across boundaries.
Try These Prompts
Review this Rust function and suggest a clearer error conversion pattern. Explain whether From, map_err, or anyhow fits best.
I get a Rust error when using the ? operator with two error types. Explain the missing conversion and suggest the smallest fix.
Design an idiomatic Rust error enum for these operations and dependencies. Include guidance on automatic and manual conversions.
Analyze these infrastructure, domain, and application errors. Propose a layered conversion strategy that preserves context and clear ownership.
Best Practices
- Use automatic conversion when one source error clearly maps to one variant.
- Preserve original error sources when callers need diagnostics or chaining.
- Convert errors at architecture boundaries where terminology changes.
Avoid
- Do not convert every error to a string before returning it.
- Do not add multiple automatic conversions from the same source type.
- Do not expose infrastructure errors directly from domain interfaces.
Frequently Asked Questions
Does this skill execute Rust code?
When should I use thiserror?
When should I use anyhow?
Can it help with the ? operator?
Does it replace project error policies?
Is it suitable for Claude, Codex, and Claude Code?
Developer Details
Author
EmilLindforsLicense
MIT
Author version
v1.0.0
Skillstore revision
r1
Ref
a06681402992ceae98ba04d54cfd4ab004862696
Maintenance freshness
7/18/2026
Usage
4 downloads ยท 156 views
File structure
๐ SKILL.md