better-result-adopt

Migrate legacy error handling to typed Result-based flows with TaggedError.

4|Updated Feb 12, 2026
One-click install
npx skills add https://github.com/rbaumier/skills --skill better-result-adopt-rbaumier
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: better-result-adopt
Source: https://github.com/rbaumier/skills/tree/main/better-result-adopt
Command: npx skills add https://github.com/rbaumier/skills --skill better-result-adopt-rbaumier

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Migrating legacy error handling to a typed Result-based flow to ensure predictable error paths and easier maintenance.

Core Features & Use Cases

  • Adopt better-result at boundaries (IO) and progressively migrate domain and infrastructure errors.
  • Convert thrown exceptions to TaggedError and wrap IO operations with Result.try/tryPromise.
  • Use Result.gen to compose multiple dependent steps with yield* for clean, auditable error flows.

Quick Start

Migrate one module at a time by wrapping IO boundaries with Result.try/tryPromise and introducing TaggedError-based domain errors.

Frequently Asked Questions about better-result-adopt

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

FAQPage Schema
How do I migrate legacy error handling to a typed Result pattern in TypeScript?

To migrate legacy error handling to a typed Result pattern, convert thrown exceptions into TaggedError classes and wrap I/O boundaries using Result.try or tryPromise to ensure predictable error paths across your modules.

What is the best way to handle multiple dependent steps in a Result-based workflow?

The best way to handle multiple dependent steps in a Result-based workflow is using Result.gen with yield* to compose operations, creating clean and auditable error flows for your progressively migrated domain logic.

How does railway oriented programming improve TypeScript error handling?

Railway oriented programming improves TypeScript error handling by replacing unpredictable thrown exceptions with typed Result objects, forcing explicit error path management and making domain and infrastructure failures predictable and auditable.

Can I progressively migrate exceptions to TaggedError types without rewriting my entire codebase?

Yes, you can progressively migrate exceptions to TaggedError types by tackling one module at a time, wrapping IO operations first, and then expanding the typed Result-based flow into domain and infrastructure layers.

What are the limitations of using generator patterns for Result composition in TypeScript?

Using generator patterns for Result composition requires strict adherence to TypeScript typing rules for yield* and Result.gen, meaning any improperly wrapped IO points or unconverted thrown exceptions will break the predictable typed error flow.