From kotlin-cross-cutting
Apply when creating, refactoring, changing, planning (plan mode) or reviewing any code that uses Arrow's Either type for error handling. This includes adding, modifying, or fixing Either return types, sealed error classes, either {} builders, .bind() calls, fold() mappings, or Left/Right handling in any part of the code.
How this skill is triggered — by the user, by Claude, or both
Slash command
/kotlin-cross-cutting:handling-errors-with-eitherThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use Arrow's `Either<Error, Success>` as an alternative to exceptions for domain error handling. Errors become explicit return values, making failure paths visible in function signatures and avoiding exception-based control flow.
Use Arrow's Either<Error, Success> as an alternative to exceptions for domain error handling. Errors become explicit return values, making failure paths visible in function signatures and avoiding exception-based control flow.
Either<DomainError, Result> instead of throwing exceptionseither {} builder with .bind() to compose operationsDO:
sealed interface CreateTeamError)either {} builder in application services to compose multiple Either-returning operations.bind() inside either {} to short-circuit on errors (replaces flatMap chains)CreateTeamError, AddMemberError), add enums/strings inside for more granular informationfold() or whenEither.Left for domain errors, Either.Right for successDON'T:
.map, .flatMap, .onRight - use either {} builder instead for readabilityEither.Left to appropriate HTTP error responsesGlobalExceptionHandler still handles infrastructure exceptionsPlease use always these examples as reference: examples.md
npx claudepluginhub allousas/claude-code-plugins --plugin kotlin-cross-cuttingQuick reference for fp-ts Either: create, transform, extract for typed error handling, validation, and fallible operations in TypeScript.
Implements type-safe error handling in Effect TypeScript apps using catchAll, catchTag, either, option, tagged unions for expected errors vs defects.
Provides FP patterns in Kotlin with Arrow, Raise DSL, coroutines for domain modeling, validation, error accumulation, and composition in backend/Android apps.