.agents/skills/effect-and-errors/SKILL.md
Composing Effect programs, domain errors, HttpError, repository error types, or error propagation at HTTP boundaries.
npx skillsauth add latitude-dev/latitude-llm effect-and-errorsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
When to use: Composing Effect programs, domain errors, HttpError, repository error types, or error propagation at HTTP boundaries.
Effect.gen for sequential effect compositionEffect.tryPromise and typed errorsData.TaggedError for domain-specific error typesEffect.repeat with Schedule for polling/recurring tasksFiber for lifecycle management of long-running effectsData.TaggedError) instead of raw Error at domain/platform boundariesEffect.either for operations that may fail but shouldn't stop executionHttpError interface (httpStatus and httpMessage), even when the error is not yet surfaced over HTTP—that may change. Use a readonly field for static messages and a getter for messages computed from error fields.@domain/issues)Use packages/domain/issues/src/errors.ts as the gold standard for organizing domain-specific errors:
src/errors.ts; use-cases import from ../errors.ts.@domain/shared errors for generic infrastructure shapes (RepositoryError, generic NotFoundError, etc.).CheckEligibilityError) so Effect error channels stay explicit.docs/issues.md under Domain errors (@domain/issues reference pattern) and in AGENTS.md (domain schema conventions).All domain errors implement the HttpError interface from @repo/utils:
interface HttpError {
readonly _tag: string
readonly httpStatus: number
readonly httpMessage: string
}
Implementation rules:
httpStatus, httpMessage)NotFoundError) instead of nullapp.onError(honoErrorHandler) in server.tsExample domain errors:
// Static message
export class QueuePublishError extends Data.TaggedError("QueuePublishError")<{
readonly cause: unknown
readonly queue: QueueName
}> {
readonly httpStatus = 502
readonly httpMessage = "Queue publish failed"
}
// Dynamic message computed from fields
export class NotFoundError extends Data.TaggedError("NotFoundError")<{
readonly entity: string
readonly id: string
}> {
readonly httpStatus = 404
get httpMessage() {
return `${this.entity} not found`
}
}
Example repository method:
findById(id: OrganizationId): Effect.Effect<Organization, NotFoundError | RepositoryError>
data-ai
Continuous Agentation annotation handling. Use when the user says "watch mode", asks you to watch for Agentation annotations, process feedback as it arrives, or keep fixing annotation-driven changes until told to stop or a timeout is reached.
development
apps/web UI — routes, @repo/ui, TanStack Start server functions and collections, forms, Tailwind layout rules, design-system updates, and useEffect / useMountEffect policy.
tools
Installing dependencies, running dev/build/test/lint, filtering packages, single-test runs, git hooks, preparing a clone (.env.development / .env.test), or Docker-backed local services and dev servers.
tools
Writing or debugging tests, choosing unit vs integration style, Postgres/ClickHouse tests, regenerating ClickHouse test schema, or exporting test helpers from packages without pulling test code into production bundles.