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.
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.
npx skills add dmmulroy/better-result --skill migrate-better-result-3git clone --depth 1 https://github.com/dmmulroy/better-resultWrote 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.
[](https://agentmods.dev/skills/dmmulroy/better-result/migrate-better-result-3)<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.
<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>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once 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 |
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.
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.
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.
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.
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.
- 10d ago First seen · 84 lines · 52 tokens per session scan A c080884047f7
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.
Other skills, from other repositories
build-audit-logs
Build or review audit trails in TypeScript/JavaScript apps using evlog (pipelines, typed actions, denials, retention, compliance-style reviews). For application code, not for extending the evlog package.
nestjs-error-handling
Implement Global Exception Filters and standard error formats in NestJS. Use when implementing global exception filters or standardizing error responses in NestJS.
fp-ts-async-practical
Practical async patterns using TaskEither - clean pipelines instead of try/catch hell, with real API examples.
Function Composition - Building from Small Pieces
Practical patterns for composing functions in TypeScript using pipe, flow, and functional design principles.
fp-ts-task-either
Functional async patterns using TaskEither for type-safe error handling in TypeScript.
fp-ts Pipe and Flow Composition
Master function composition in fp-ts using pipe and flow for building elegant, type-safe data transformation pipelines.