migrate-better-result-3

migrate-better-result-3 is a skill for Claude Code, Codex from dmmulroy/better-result. It costs 52 tokens per session (1,339 once invoked), scanned A, original, MIT.

A migration guide for upgrading a TypeScript project from better-result version 2 to version 3. TypeScript is a programming language and better-result is a library for representing successful and failed operations.

In plain words
What is it for?
Use it when upgrading better-result, updating error-handling code, resolving API changes, and checking related tests.
Why use it?
It shows where the library’s changed APIs affect production code and tests, so compiler errors can be handled systematically. It also highlights changes involving tagged errors and recovery behavior.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when upgrading better-result, updating error-handling code, resolving API changes, and checking related tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dmmulroy/better-result/migrate-better-result-3
About the project

better-result is a TypeScript library that represents either a successful value or an expected failure as a typed Result, allowing multi-step workflows to stop when an operation fails. TypeScript developers use it to make recoverable errors explicit while keeping unexpected exceptions as thrown defects. The catalogue skills and instruction support working with the library.

dmmulroy/better-result · 1,957 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add dmmulroy/better-result --skill migrate-better-result-3
Clone the repo
git clone --depth 1 https://github.com/dmmulroy/better-result

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for migrate-better-result-3

README.md
[![agentmods](https://agentmods.dev/badge/skills/dmmulroy/better-result/migrate-better-result-3/github.svg)](https://agentmods.dev/skills/dmmulroy/better-result/migrate-better-result-3)
Your own site
<a href="https://agentmods.dev/skills/dmmulroy/better-result/migrate-better-result-3"><img src="https://agentmods.dev/badge/skills/dmmulroy/better-result/migrate-better-result-3/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for migrate-better-result-3

Your own site · 80×15
<a href="https://agentmods.dev/skills/dmmulroy/better-result/migrate-better-result-3"><img src="https://agentmods.dev/badge/skills/dmmulroy/better-result/migrate-better-result-3.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,339 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00052 $0.01339
Opus 5 $0.00026 $0.00669
Sonnet 5 $0.00010 $0.00268
Haiku 4.5 $0.00005 $0.00134

Measured 10d ago against content hash c080884047f7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

migrate-better-result-3 scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/migrate-tagged-error-v3.mjs), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/migrate-better-result-3/SKILL.md · 84 lines

How it starts

The opening of the file, as written. The whole thing — 84 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Migrate better-result to 3.0

Treat the compiler as the migration ledger: inventory first, make mechanical changes, then resolve each remaining error by API branch.

1. Establish the migration surface

Read repository instructions, package manifests, lockfiles, TypeScript configuration, and validation commands. Verify that the source version is better-result 2.x and inspect the installed 3.0 declarations when available; package source outranks remembered APIs.

Search production code and tests for:

rg -n --glob '*.{ts,tsx,mts,cts}' \
  'TaggedError|Result\.(serialize|deserialize|hydrate|tryRecover|tryRecoverAsync|tryPromise|partition|gen)|matchError(Partial)?|TaggedErrorClass|Serialized(Result|Ok|Err)'

Classify every hit under the audited API changes in references/v3-api-diff.md. Include tests that structurally compare a Result containing a tagged error; tagged errors become iterable in v3 even though the Result.gen signature is unchanged. Record generated or vendored hits separately rather than editing them.

Complete when: the installed source version, target 3.0 API, validation commands, every matching production/test site, and every tagged-error Result assertion are accounted for by file and migration branch.

2. Apply the TaggedError codemod

List safe trailing-call edits:

node <skill-dir>/scripts/migrate-tagged-error-v3.mjs . --list

Review the listed class heritage expressions, then apply them:

node <skill-dir>/scripts/migrate-tagged-error-v3.mjs . --write
node <skill-dir>/scripts/migrate-tagged-error-v3.mjs . --check

The transform changes only the v2 class heritage shape:

class NotFoundError extends TaggedError("NotFoundError")<{ id: string }>() {}
// becomes
class NotFoundError extends TaggedError("NotFoundError")<{ id: string }> {}

It preserves constructors, properties, formatting, and call sites. Manually update exported TaggedErrorClass<Tag, Props> annotations to the v3 class type TaggedErrorClass<Tag>; move payload typing to the subclass application shown above.

Read the full file on GitHub · 84 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 84 lines · 52 tokens per session scan A c080884047f7

Subscribe to this mod's changes

migrate-better-result-3 is a skill published in the GitHub repository dmmulroy/better-result (1,957 stars, last pushed 18d ago), licensed MIT. It adds 52 tokens to every session and 1,339 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.