tagged-error

Generate Effect Data.TaggedError types with contextual payloads and unions.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generate Effect Data.TaggedError types for error handling.

Core Features & Use Cases

  • Basic Error Template: Create standard TaggedError types with payload data.
  • Contextual Errors: Examples with IDs and related entities to provide diagnostics.
  • Error Union Types: Group related errors into unions for clean dispatch.

Quick Start

Define a new error class like SpellNotFound with payload including unitId and spellId.

Frequently Asked Questions about tagged-error

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create TaggedError types for error handling in TypeScript?

TaggedError types are Effect's pattern for structured error handling. Create a subclass with a tag matching the class name, add payload fields for context like IDs and entities, and use it in Effect function signatures. This enforces consistent error structure across your application.

What's the difference between TaggedError and standard Error classes?

TaggedError provides typed, discriminated error unions with contextual payloads, enabling pattern matching and type-safe error dispatch. Standard errors lack structure; TaggedError enforces a tag identifier and typed data fields for better error propagation and handling.

How do I group related errors into unions with TaggedError?

Combine multiple TaggedError subclasses into a union type. Each error has its own class with a unique tag and relevant payload fields. Union types enable clean error dispatch in Effect handlers, allowing you to match specific error combinations.

Can I use TaggedError patterns within the Wowlab Core project?

Yes. TaggedError is designed for Wowlab Core projects. Define one subclass per error, ensure the tag matches the class name, populate payload with diagnostic fields like IDs and entities, and update function signatures to propagate errors through Effects.

What contextual data should I include in TaggedError payloads?

Include identifiers and related entities needed for diagnostics—such as unitId, spellId, or resource references. Payload fields provide context to downstream error handlers and enable meaningful error messages and recovery logic.

Do I need existing error handling code to adopt TaggedError patterns?

No prior setup is required. Start by defining new TaggedError subclasses for errors you encounter. Gradually integrate them into function signatures and Effect chains; you can adopt TaggedError incrementally alongside existing error handling.