@alexandru/arrow-typed-errors
BModels Kotlin logical failures with Arrow's context-parameter Raise DSL and wrappers such as Either, nullable, Option, and Ior. Use when implementing or simplifying typed-error flows, translating error types, replacing verbose Either handling, validating input with accumulation, or selecting an error wrapper.
Install
agr install @alexandru/arrow-typed-errors --target claudeWrites 1 file into .claude/skills/, pinned to git-0b2a1905.
- .claude/skills/arrow-typed-errors/SKILL.md
Document
name: arrow-typed-errors description: Models Kotlin logical failures with Arrow's context-parameter Raise DSL and wrappers such as Either, nullable, Option, and Ior. Use when implementing or simplifying typed-error flows, translating error types, replacing verbose Either handling, validating input with accumulation, or selecting an error wrapper.
Arrow Typed Errors
Quick start
- Distinguish expected domain failures from exceptional faults before selecting an API.
- For new code, prefer context-parameter computations (
context(_: Raise<E>)) and run them into a wrapper at a boundary witheither { ... },nullable { ... },option { ... }, orior(...) { ... }. - Use
Eitheroperators for routine propagation and transformation; do not pattern match only to reconstructLeftorRight. - Use
whenwhen the domain genuinely branches by case or when matching a multi-state wrapper directly communicates intent.
Workflow
- Model domain failures as focused sealed types.
- Choose fail-fast composition or independent validation accumulation.
- Implement internal logic in a
Raise<E>context and expose an appropriate wrapper at the public boundary. - Bind nested typed computations and translate their errors at the layer boundary.
- Convert only expected, recoverable exceptions into typed failures.
- Inspect the result with a combinator or intentional case analysis at the consumer boundary.
- Type-check examples when introducing a less familiar Arrow API or upgrading Arrow/Kotlin.
- When changing examples, update and run the bundled
scripts/verify-examples.ktcheck.
References
- Load references/typed-errors.md for context-parameter API examples, imports, validation, wrapper usage, and the checked sample location.
- Load references/best-practices.md when designing or reviewing code, especially to simplify verbose
Eitherhandling without turningwheninto a blanket prohibition.
Trustgrade B
- passBody integrity
Whether the stored document is plausibly the kind of file the artifact declares, rather than something fetched by mistake.
- passType matchnot applicable to this artifact type
Whether the artifact is really the kind of thing its metadata claims it is.
- passFreshness
How long since the source repository was last pushed to.
- passPrompt injection
Scans the artifact's own text for instructions aimed at your agent rather than at you.
- warnLicenseno SPDX license detected
Whether the source repository declares an SPDX license permissive enough to redistribute.
How the grade is calculated
Each check contributes 0 points when it passes, 1 when it warns, and 2 when it fails. The total maps to a letter:
- Aevery check passed
- Bone warning
- Ctwo warnings
- Dprompt injection or body integrity failed, or three warnings
- Fone of those failed, and something else is wrong
These are automated hygiene checks, not a security audit, and not a dependency or vulnerability scan. A grade of A means nothing was flagged — not that the artifact is safe.
Versions
git-0b2a19053d582026-07-31