What problem does it solve?
Many JavaScript and TypeScript codebases mix try/catch, thrown exceptions, and Promise rejections which lead to untyped, hard-to-reason-about error flows and brittle call chains; this Skill provides a clear migration path to typed Result-based error handling to improve reliability and composability.
Core Features & Use Cases
- Boundary-first migration: Start at I/O boundaries such as API calls, database queries, and file operations to contain error handling changes and reduce blast radius.
- Typed errors and matching: Define TaggedError classes for domain and infrastructure failures so error types are explicit and exhaustively matchable.
- Async and Promise conversion: Replace async/await and Promise rejections with Result.tryPromise and Result.gen patterns to enable railway-oriented composition and safer propagation.
- Use Case: Migrate a data access layer that currently throws errors into a Result-returning API so callers can compose operations and handle errors declaratively.
Quick Start
Migrate a target module by wrapping its I/O calls with Result.try or Result.tryPromise, create TaggedError classes for domain errors, and update caller signatures to propagate Result types.