error-handling

Generate typed error types and wrap fallible operations in Result monads.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/site-bender/sitebender --skill error-handling
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-handling
Source: https://github.com/site-bender/sitebender/tree/main/.claude/skills/error-handling
Command: npx skills add https://github.com/site-bender/sitebender --skill error-handling

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill eliminates the unpredictability and complexity of traditional exception handling by treating all errors as explicit values. It ensures robust, predictable error management, reducing runtime crashes and simplifying debugging, so your applications are more reliable.

Core Features & Use Cases

  • Result & Validation Monads: Standardizes error representation using Result<T,E> for single failures and Validation<T,E> for collecting multiple errors.
  • Discriminated Unions for Error Types: Guides the design of clear, type-safe error structures, making error identification and handling explicit.
  • Automated Error Type Generation: Provides a script to scaffold new error types, including constructors and type guards.
  • Use Case: When building an API endpoint, use this skill to define a UserCreationError as a discriminated union. Then, wrap all fallible operations (e.g., database writes, external API calls) in Result monads, ensuring that your function always returns a predictable Ok or Error value, never throwing an unexpected exception.

Quick Start

Generate a new error type named 'NetworkError' with variants 'Timeout' and 'Disconnected'.