Better-Result Migration Tool
Migrates codebase error handling from try/catch blocks and Promise rejections to typed Result-based patterns using the better-result library.
This skill facilitates the transition to Railway-Oriented Programming by refactoring traditional JavaScript and TypeScript error handling into type-safe Result objects. It provides structured guidance for identifying error categories, defining TaggedErrors, and wrapping I/O boundaries with Result.try and Result.tryPromise logic. By automating the conversion of imperative error checks and callback chains into generator-based compositions, this skill helps developers build more resilient, predictable, and type-safe applications while minimizing the manual effort of architectural migration.
Key Features
010 GitHub stars
02Guidance on boundary-first migration strategies to maintain codebase stability
03Implementation of TaggedError classes for structured domain error handling
04Automated conversion of try/catch blocks to Result.try patterns
05Refactoring of imperative null/error checks into fluent Result chains
06Transformation of async/await Promise rejections into Result.tryPromise
Use Cases
01Replacing generic exceptions with domain-specific TaggedErrors for improved observability
02Modernizing legacy codebases to use typed, functional error handling patterns
03Implementing Railway-Oriented Programming in TypeScript-based backend services