Agent skill · Code Review & Quality

fp-errors

Stop throwing everywhere - handle errors as values using Either and TaskEither for cleaner, more predictable code

Nick44,086★ · +407/wk · 1 repos on radarProfile →
claude-codecodexcursorMIT
Install
npx skills add sickn33/agentic-awesome-skills --skill fp-errors --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 22 KB
Bundled scripts: none
Version: 1.0.0
Declared author: kadu
Path: skills/fp-errors/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 44,414 · +328 this week
Language: Python
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

Review
written from the skill's own SKILL.md · Aug 5, 2026

What it does

The skill teaches turning errors into data by using fp-ts Either and TaskEither instead of exceptions. It shows how to replace try/catch spaghetti with functions that return Either, enabling explicit error handling and safer composition. It covers the core patterns for the Result type (Either), chaining operations, collecting multiple errors, and async operations via TaskEither. It also includes guidance on converting between patterns (Nullable, Throwing, Promise) and demonstrates practical scenarios like input parsing, form validation, and parallel async data fetching.

How it works

  • Introduces returning Either<E, A> from functions to signal failure or success, instead of throwing. Example functions return Left(error) or Right(value).
  • Demonstrates transforming and handling Either values with pattern matching, map, mapLeft, getOrElse, and fold to produce outputs based on success or failure.
  • Shows chaining with E.chain to propagate the first error in a sequence of dependent operations, including Do-notation style bindings for readability.
  • Explains collecting multiple errors using an Applicative Validation instance (E.getApplicativeValidation with NEA.getSemigroup) and sequenceS to accumulate errors from independent validations.
  • Covers asynchronous workflows using TaskEither for lazy, promise-based computations, including TE.tryCatch, TE.chain, and TE.fold for handling results.
  • Details converting from nullable, throwing, and promise patterns to fp-ts equivalents and back.

When to use it

  • Use Either or TaskEither to replace exception-heavy code
  • When tasks involve validation, domain errors, or clearer error contracts in TypeScript
  • When you want practical fp-ts error-handling guidance for real application code

What it can touch

  • Functions and code examples reference fp-ts: "fp-ts/Either", "fp-ts/TaskEither", and utility imports like pipe from "fp-ts/function".
  • Tools named exactly as in the skill: "E.right", "E.left", "TE.tryCatch", "TE.chain", "sequenceS", "pipe".

Caveats

  • The material emphasizes functional error handling patterns and may require familiarity with fp-ts concepts like Either, TaskEither, and NonEmptyArray for advanced validation scenarios.
  • It uses TypeScript-specific types and imports; correctness depends on fp-ts version compatibility as shown in examples.
From the SKILL.md

# Practical Error Handling with fp-ts This skill teaches you how to handle errors without try/catch spaghetti. No academic jargon - just practical patterns for real problems. The core idea: **Errors are just data**. Instead of throwing them into the void and hoping someone catches them, return them as values that TypeScript can track. ## When to Use - You need to replace exception-heavy code with `Either` or `TaskEither`. - The task involves validation, domain errors, or clearer error contracts in TypeScript. - You want pragmatic fp-ts error-handling guidance for real application code. --- ## 1. Stop Throwing Everywhere ### The Problem with Exceptions Exceptions are invisible in your types. They break the contract between functions. ```typescript // What this function signature promises: function getUser(id: string): User // What it actually does: function getUser(id: string): User { if (!id) throw new Error('ID required') const user = db.find(id) if (!user) throw new Error('User not found') return user } // The caller has no idea this can fail const user = getUser(id) // Might explode! ``` You end up with code like this: ```typescript // MESSY: try/catch everywhere function proces

What's inside
Steps it walks through
  1. When to Use
  2. 1. Stop Throwing Everywhere
  3. The Problem with Exceptions
  4. The Solution: Return Errors as Values
  5. 2. The Result Pattern (Either)
  6. Converting Throwing Code to Either
  7. Common Either Operations
  8. 3. Chaining Operations That Might Fail
  9. Before: Nested Try/Catch Hell
  10. After: Clean Chain with Either
  11. Different Error Types? Use chainW
  12. 4. Collecting Multiple Errors
  13. Before: Collecting Errors Manually
  14. After: Validation with Error Accumulation
More from agentic-awesome-skills
All skills →
About this skill
What does the fp-errors skill do?

Stop throwing everywhere - handle errors as values using Either and TaskEither for cleaner, more predictable code

How do I install it?

Run `npx skills add sickn33/agentic-awesome-skills --skill fp-errors --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From sickn33/agentic-awesome-skills, a repository with 44,414 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going