monad-result
Installation
SKILL.md
Result Monad
Installation: If not already installed, add the package with pnpm add @efesto-cloud/result.
Use this skill to keep Result<T, E> usage consistent across the project.
Core Rules
- Create success with
Result.ok(value). - Create failure with
Result.err(error). - Check outcome with
result.isFailure()orresult.isSuccess(). - Throw only when explicitly desired with
result.unwrapOrThrow(). - For fallback values, use
result.else(() => fallback).
Common Mistakes To Avoid
- Do not use
isErr(). - Do not use
unwrap(). - Do not use
getOr().