define-errors
Installation
SKILL.md
defineErrors
Related Skills: See
error-handlingfor trySync/tryAsync usage and toast-on-error patterns. Seeservices-layerfor 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
createTaggedErrorand split Err-pair patterns.