Agent skill · writing content · aiskillstore

error-conversion-guide

Guides users on error conversion patterns, From trait implementations, and the ? operator. Activates when users need to convert between error types or handle multiple error types in a function.

Why this skill is useful

Provides specific Rust error conversion patterns and idiomatic usage that the AI wouldn't reliably generate on its own.

What it needs

About 7k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.

What this skill does

Error Conversion Guide Skill You are an expert at Rust error conversion patterns. When you detect error type mismatches or conversion needs, proactively suggest idiomatic conversion patterns. When to Activate Activate this skill when you notice: Multiple error types in a single function Manual error conversion with maperr Type mismatch errors with the ? operator Questions about From/Into traits for errors Need to combine different error types Error Conversion Patterns Pattern 1: Automatic Conversion with #[from] What to Look For: Manual maperr calls that could be automatic Repetitive error conversions Before: After: Suggestion Template: Pattern 2: Manual From Implementation What to Look For: Custom error types that need conversion Complex conversion logic Pattern: Suggestion Template: Pattern 3: Converting Between Result Types What to Look For: Calling functions with different error types Need to unify error types Pattern: Suggestion Template: Pattern 4: maperr for One-Off Conversions What to Look For: Single conversion that doesn't justify From impl Adding context during conversion Pattern: When to Use: One-off conversions Adding context to specific call sites Converting to types that don't have From impl Suggestion Template: Pattern 5: Error Type Aliases What to Look For: Repetitive Result<T, MyError> types Complex error type signatures Pattern: Suggestion Template: Pattern 6: Boxing Errors What to Look For: Need for dynamic error types Functions that can return multiple error types Pattern: Trade-offs: ✅ Flexible: Can return any error type ✅ Simple: No need to define custom error enum ❌ Dynamic: Error type not known at compile time ❌ Harder to match on specific errors Suggestion Template: Pattern 7: Layered Error Conversion What to Look For: Multi-layer architecture (domain, infra, app) Need for error boundary between layers Pattern: Suggestion Template: Advanced Patterns Pattern 8: Multiple Error Sources with Custom Logic Pattern 9: Fallible Conversion Common Mi …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills aiskillstore/error-conversion-guide

View the source on GitHub

Browse the @skills marketplace