define-errors

Installation
SKILL.md

defineErrors

Related Skills: See error-handling for trySync/tryAsync usage and toast-on-error patterns. See services-layer for service architecture and namespace exports.

When to Apply This Skill

Use this pattern when you need to:

  • Define or refactor domain error variants using defineErrors.
  • Add error variants that include structured fields and cause: unknown.
  • Centralize extractErrorMessage(cause) inside variant factories.
  • Infer union and single-variant types via InferErrors/InferError.
  • Replace old createTaggedError and split Err-pair patterns.

Import

Installs
11
GitHub Stars
4.6K
First Seen
Mar 11, 2026
define-errors — epicenterhq/epicenter