HA

handling-rust-errors

Standardizes Rust error handling using the error-stack crate and provides guidance on contextual error reporting.

Install

mkdir -p .claude/skills/handling-rust-errors && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/2724" && unzip -o skill.zip -d .claude/skills/handling-rust-errors && rm skill.zip

Installs to .claude/skills/handling-rust-errors

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

HASH error handling patterns using error-stack crate. Use when working with Result types, Report types, defining custom errors, propagating errors with change_context, adding context with attach, implementing Error trait, or documenting error conditions in Rust code.
267 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • →Uses Report<MyError> for consistent error propagation
  • →Attaches contextual info to results using the attach method
  • →Standardizes error definition without using standard library error types
  • →Enforces usage of derive_more instead of thiserror

How it works

Applies a set of rigid imports and trait-method rules to wrap and propagate errors according to project coding standards.

Inputs & outputs

You give it
Result type or error definition
You get back
Error-stack compliant error implementation

When to use handling-rust-errors

  • →Implementing error propagation
  • →Attaching context to Rust Result types
  • →Defining custom error traits
  • →Refactoring error handling code

About handling-rust-errors

Standardizes error handling through the `error-stack` crate. Guides developers in using `Report<MyError>`, custom error definitions, and contextual attaching to ensure consistent observability.

HASH error handling patterns using error-stack crate. Use when working with Result types, Report types, defining custom errors, propagating errors with change_context, adding context with attach, implementing Error trait, or documenting error conditions in Rust code.

When not to use it

  • →In the HashQL compiler module where diagnostics are required
  • →When prototyping simple CLI tools where anyhow suffices

Prerequisites

Rust toolchainError-stack crate

Limitations

  • →Requires explicit import management of Error traits
  • →Not compatible with standard diagnostic-heavy compiler code

How it compares

It enforces a HASH-specific standard by banning common Rust error crates like anyhow and thiserror.

Compared to similar skills

handling-rust-errors side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
handling-rust-errors (this skill)44moNo flagsIntermediate
debug-cli110moReviewIntermediate
fix-clippy37moNo flagsBeginner
search-code26moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry