better-result-adopt — community better-result-adopt, better-result, community, ide skills

v1.0.0

About this Skill

Perfect for TypeScript Agents needing advanced error handling and typed Result-based composition. Migrate codebase from try/catch or Promise-based error handling to better-result. Use when adopting Result types, converting thrown exceptions to typed errors, or refactoring existing error handling t

dmmulroy dmmulroy
[0]
[0]
Updated: 3/12/2026

Killer-Skills Review

Decision support comes first. Repository text comes second.

Reference-Only Page Review Score: 7/11

This page remains useful for operators, but Killer-Skills treats it as reference material instead of a primary organic landing page.

Original recommendation layer Concrete use-case guidance Explicit limitations and caution Locale and body language aligned
Review Score
7/11
Quality Score
48
Canonical Locale
en
Detected Body Locale
en

Perfect for TypeScript Agents needing advanced error handling and typed Result-based composition. Migrate codebase from try/catch or Promise-based error handling to better-result. Use when adopting Result types, converting thrown exceptions to typed errors, or refactoring existing error handling t

Core Value

Empowers agents to migrate existing error handling to typed Result-based error handling with better-result, utilizing generator-based composition and railway-oriented programming patterns, and supporting Result.tryPromise for Promise-based code migration.

Ideal Agent Persona

Perfect for TypeScript Agents needing advanced error handling and typed Result-based composition.

Capabilities Granted for better-result-adopt

Migrating try/catch blocks to Result types
Replacing thrown exceptions with typed errors
Converting Promise rejections to Result-based error handling
Introducing railway-oriented programming patterns in existing codebases

! Prerequisites & Limits

  • Requires TypeScript environment
  • Limited to error handling and Result-based composition use cases

Why this page is reference-only

  • - The underlying skill quality score is below the review floor.

Source Boundary

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

After The Review

Decide The Next Action Before You Keep Reading Repository Material

Killer-Skills should not stop at opening repository instructions. It should help you decide whether to install this skill, when to cross-check against trusted collections, and when to move into workflow rollout.

Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is better-result-adopt?

Perfect for TypeScript Agents needing advanced error handling and typed Result-based composition. Migrate codebase from try/catch or Promise-based error handling to better-result. Use when adopting Result types, converting thrown exceptions to typed errors, or refactoring existing error handling t

How do I install better-result-adopt?

Run the command: npx killer-skills add dmmulroy/better-result/better-result-adopt. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for better-result-adopt?

Key use cases include: Migrating try/catch blocks to Result types, Replacing thrown exceptions with typed errors, Converting Promise rejections to Result-based error handling, Introducing railway-oriented programming patterns in existing codebases.

Which IDEs are compatible with better-result-adopt?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for better-result-adopt?

Requires TypeScript environment. Limited to error handling and Result-based composition use cases.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add dmmulroy/better-result/better-result-adopt. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use better-result-adopt immediately in the current project.

! Reference-Only Mode

This page remains useful for installation and reference, but Killer-Skills no longer treats it as a primary indexable landing page. Read the review above before relying on the upstream repository instructions.

Upstream Repository Material

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

Upstream Source

better-result-adopt

Install better-result-adopt, an AI agent skill for AI agent workflows and automation. Review the use cases, limitations, and setup path before rollout.

SKILL.md
Readonly
Upstream Repository Material
The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.
Supporting Evidence

better-result Adoption

Migrate existing error handling (try/catch, Promise rejections, thrown exceptions) to typed Result-based error handling with better-result.

When to Use

  • Adopting better-result in existing codebase
  • Converting try/catch blocks to Result types
  • Replacing thrown exceptions with typed errors
  • Migrating Promise-based code to Result.tryPromise
  • Introducing railway-oriented programming patterns

Migration Strategy

1. Start at Boundaries

Begin migration at I/O boundaries (API calls, DB queries, file ops) and work inward. Don't attempt full-codebase migration at once.

2. Identify Error Categories

Before migrating, categorize errors in target code:

CategoryExampleMigration Target
Domain errorsNotFound, ValidationTaggedError + Result.err
InfrastructureNetwork, DB connectionResult.tryPromise + TaggedError
Bugs/defectsnull deref, type errorLet throw (becomes Panic if in Result callback)

3. Migration Order

  1. Define TaggedError classes for domain errors
  2. Wrap throwing functions with Result.try/tryPromise
  3. Convert imperative error checks to Result chains
  4. Refactor callbacks to generator composition

Pattern Transformations

Try/Catch to Result.try

typescript
1// BEFORE 2function parseConfig(json: string): Config { 3 try { 4 return JSON.parse(json); 5 } catch (e) { 6 throw new ParseError(e); 7 } 8} 9 10// AFTER 11function parseConfig(json: string): Result<Config, ParseError> { 12 return Result.try({ 13 try: () => JSON.parse(json) as Config, 14 catch: (e) => new ParseError({ cause: e, message: `Parse failed: ${e}` }), 15 }); 16}

Async/Await to Result.tryPromise

typescript
1// BEFORE 2async function fetchUser(id: string): Promise<User> { 3 const res = await fetch(`/api/users/${id}`); 4 if (!res.ok) throw new ApiError(res.status); 5 return res.json(); 6} 7 8// AFTER 9async function fetchUser(id: string): Promise<Result<User, ApiError | UnhandledException>> { 10 return Result.tryPromise({ 11 try: async () => { 12 const res = await fetch(`/api/users/${id}`); 13 if (!res.ok) throw new ApiError({ status: res.status, message: `API ${res.status}` }); 14 return res.json() as Promise<User>; 15 }, 16 catch: (e) => (e instanceof ApiError ? e : new UnhandledException({ cause: e })), 17 }); 18}

Null Checks to Result

typescript
1// BEFORE 2function findUser(id: string): User | null { 3 return users.find((u) => u.id === id) ?? null; 4} 5// Caller must check: if (user === null) ... 6 7// AFTER 8function findUser(id: string): Result<User, NotFoundError> { 9 const user = users.find((u) => u.id === id); 10 return user 11 ? Result.ok(user) 12 : Result.err(new NotFoundError({ id, message: `User ${id} not found` })); 13} 14// Caller: yield* findUser(id) in Result.gen, or .match()

Callback Hell to Generator

typescript
1// BEFORE 2async function processOrder(orderId: string) { 3 try { 4 const order = await fetchOrder(orderId); 5 if (!order) throw new NotFoundError(orderId); 6 const validated = validateOrder(order); 7 if (!validated.ok) throw new ValidationError(validated.errors); 8 const result = await submitOrder(validated.data); 9 return result; 10 } catch (e) { 11 if (e instanceof NotFoundError) return { error: "not_found" }; 12 if (e instanceof ValidationError) return { error: "invalid" }; 13 throw e; 14 } 15} 16 17// AFTER 18async function processOrder(orderId: string): Promise<Result<OrderResult, OrderError>> { 19 return Result.gen(async function* () { 20 const order = yield* Result.await(fetchOrder(orderId)); 21 const validated = yield* validateOrder(order); 22 const result = yield* Result.await(submitOrder(validated)); 23 return Result.ok(result); 24 }); 25} 26// Error type is union of all yielded errors

Defining TaggedErrors

See references/tagged-errors.md for TaggedError patterns.

Workflow

  1. Check for source reference: Look for opensrc/ directory - if present, read the better-result source code for implementation details and patterns
  2. Audit: Find try/catch, Promise.catch, thrown errors in target module
  3. Define errors: Create TaggedError classes for domain errors
  4. Wrap boundaries: Use Result.try/tryPromise at I/O points
  5. Chain operations: Convert if/else error checks to .andThen or Result.gen
  6. Update signatures: Change return types to Result<T, E>
  7. Update callers: Propagate Result handling up call stack
  8. Test: Verify error paths with .match or type narrowing

Common Pitfalls

  • Over-wrapping: Don't wrap every function. Start at boundaries, propagate inward.
  • Losing error info: Always include cause/context in TaggedError constructors.
  • Mixing paradigms: Once a module returns Result, callers should too (or explicitly .unwrap).
  • Ignoring Panic: Callbacks that throw become Panic. Fix the bug, don't catch Panic.

References

  • TaggedError Patterns - Defining and matching typed errors
  • opensrc/ directory (if present) - Full better-result source code for deeper context

Related Skills

Looking for an alternative to better-result-adopt or another community skill for your workflow? Explore these related open-source skills.

View All

openclaw-release-maintainer

Logo of openclaw
openclaw

Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞

333.8k
0
AI

widget-generator

Logo of f
f

Generate customizable widget plugins for the prompts.chat feed system

149.6k
0
AI

flags

Logo of vercel
vercel

The React Framework

138.4k
0
Browser

pr-review

Logo of pytorch
pytorch

Tensors and Dynamic neural networks in Python with strong GPU acceleration

98.6k
0
Developer