result-types

Enforce explicit Result<T, E> error handling in TypeScript workflows.

3|1|Updated Jan 4, 2026
One-click install
npx skills add https://github.com/jagreehal/jagreehal-claude-skills --skill result-types
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: result-types
Source: https://github.com/jagreehal/jagreehal-claude-skills/tree/main/skills/result-types
Command: npx skills add https://github.com/jagreehal/jagreehal-claude-skills --skill result-types

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Exceptions are invisible, bypass composition, and conflate different failures. Return Result<T, E> instead.

Core Features & Use Cases

  • Business functions return Results instead of throwing.
  • Compose steps with createWorkflow to build deterministic data flows.
  • Map Results to HTTP boundaries and exhaustive error handling.

Quick Start

Use the Result-types skill to wrap a domain function with ok()/err() and build a workflow example.

Frequently Asked Questions about result-types

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

FAQPage Schema
How do I handle errors in TypeScript without throwing exceptions?

To enforce explicit error handling in TypeScript, return Result<T, E> types from business functions instead of throwing exceptions. This prevents hidden failures from bypassing composition logic and makes expected errors visible.

What is the best way to compose deterministic workflows in TypeScript?

The best way to compose deterministic workflows is to chain steps using the createWorkflow function. This builds predictable data flows by passing Result types between steps, ensuring errors are mapped clearly rather than disrupting execution.

How do I map domain errors to HTTP responses in TypeScript?

To map domain errors to HTTP responses, translate your Result<T, E> types at the external boundary. This requires exhaustive error handling to ensure every expected failure maps cleanly to a specific HTTP response status.

Why should I use Result types instead of try-catch blocks for expected failures?

You should use Result types instead of try-catch blocks because exceptions are invisible, bypass composition, and conflate different failures. Result types enforce defensive programming by making expected errors an explicit part of the function signature.

Does the result-types workflow approach require a specific library?

Yes, this workflow approach targets TypeScript projects using the @jagreehal/workflow library. It relies on this library to compose deterministic workflows across steps and enforce explicit Result type handling.