better-result-adopt

Solid

Adopt better-result in an existing TypeScript codebase. Use when replacing try/catch, Promise rejection handling, null sentinels, or thrown domain exceptions with typed Result workflows.

AI & Automation 17 stars 1 forks Updated 3 weeks ago Apache-2.0

Install

View on GitHub

Quality Score: 81/100

Stars 20%
42
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# better-result Adopt Adopt `better-result` incrementally in existing codebases without rewriting everything at once. ## When to Use Use this skill when the user wants to: - migrate from try/catch to `Result.try` or `Result.tryPromise` - replace nullable return values with typed `Result<T, E>` - define domain-specific `TaggedError` types - refactor nested error handling into `andThen` chains or `Result.gen` - standardize error handling across a service or module ## Reading Order | Task | Files to Read | | -------------------------------------- | ----------------------------- | | Adopt better-result in a module | This file | | Define or review error types | `references/tagged-errors.md` | | Inspect library implementation details | `opensrc/` if present | ## Prerequisites Before editing code: 1. Confirm `better-result` is already installed in the target project. 2. Check for an `opensrc/` directory. If present, read the package source there for current patterns. 3. Identify the migration scope first: one file, one module, or one boundary layer. ## Migration Strategy ### 1. Start at boundaries Begin with I/O boundaries and exception-heavy code: - HTTP clients - database access - file system operations - parsing and validation - framework adapters Do not convert the whole codebase at once. ### 2. Classify existing failures | Category | Examples ...

Details

Author
wordbricks
Repository
wordbricks/onequery
Created
4 months ago
Last Updated
3 weeks ago
Language
TypeScript
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category