Agent skill · Code Review & Quality

fp-ts-errors

Handle errors as values using fp-ts Either and TaskEither for cleaner, more predictable TypeScript code. Use when implementing error handling patterns with fp-ts.

Nick44,086★ · +407/wk · 1 repos on radarProfile →
claude-codecodexcursorMIT
Install
npx skills add sickn33/agentic-awesome-skills --skill fp-ts-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
Path: skills/fp-ts-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

Teach concrete patterns for handling errors as data using fp-ts Either and TaskEither. Demonstrates turning exceptions into typed error values, and provides examples for common tasks like validation, chaining, and async operations.

How it works

  • Describes using Either to represent error or success with Left as error and Right as value.
  • Shows creating values via E.right and E.left, and inspecting via E.fold or pipe patterns.
  • Demonstrates converting throwing code to Either using E.tryCatch and E.tryCatchK.
  • Illustrates chaining with E.chain, E.map, and Do notation for accessing intermediate values.
  • Presents error accumulation via E.getApplicativeValidation and NonEmptyArray to collect multiple errors.
  • Covers async operations with TaskEither, including TE.tryCatch, TE.chain, TE.map, and parallel data gathering with sequenceS.
  • Includes conversions between patterns: fromNullable, fromOption, fromPromise to TaskEither, and back to Promise.

When to use it

  • When you want type-safe error handling in TypeScript
  • When replacing try/catch with Either and TaskEither patterns
  • When building APIs or services that need explicit error types
  • When accumulating multiple validation errors

What it can touch

  • Code examples import modules: * as E from 'fp-ts/Either', * as TE from 'fp-ts/TaskEither', * as NEA from 'fp-ts/NonEmptyArray', sequenceS from 'fp-ts/Apply', pipe from 'fp-ts/function'.
  • It uses file names and commands as shown in the examples, e.g., E.tryCatch, TE.tryCatch, TE.chain, TE.map, sequenceS, Do notation, and various helper functions.

Caveats

  • The guidance relies on fp-ts APIs like Either and TaskEither; behavior depends on library semantics.
  • Examples show patterns rather than guaranteeing runtime outcomes; actual success depends on user code and environment.
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. ## When to Use This Skill - When you want type-safe error handling in TypeScript - When replacing try/catch with Either and TaskEither patterns - When building APIs or services that need explicit error types - When accumulating multiple validation errors 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. --- ## 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 process

What's inside
Steps it walks through
  1. When to Use This Skill
  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-ts-errors skill do?

Handle errors as values using fp-ts Either and TaskEither for cleaner, more predictable TypeScript code. Use when implementing error handling patterns with fp-ts.

How do I install it?

Run `npx skills add sickn33/agentic-awesome-skills --skill fp-ts-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