fp-ts-react

fp-ts-react is a skill for Claude Code, Codex from beel-collab/presets.dev. It costs 44 tokens per session (5,081 once invoked), scanned A, a copy of fp-react, MIT.

A collection of patterns for using fp-ts, a TypeScript library for functional programming, in React applications. It covers hooks, application state, forms, data fetching, and handling loading or error states.

In plain words
What is it for?
Use it when building React or Next.js interfaces with fp-ts, especially for type-safe state, form validation, API calls, and loading, success, or error displays.
Why use it?
It helps make missing values, failed operations, and asynchronous results explicit instead of spreading null checks and ad hoc error handling through a React app.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when building React or Next.js interfaces with fp-ts, especially for type-safe state, form validation, API calls, and loading, success, or error displays.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/beel-collab/presets.dev/fp-ts-react
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add beel-collab/presets.dev --skill fp-ts-react
Clone the repo
git clone --depth 1 https://github.com/beel-collab/presets.dev

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for fp-ts-react

README.md
[![agentmods](https://agentmods.dev/badge/skills/beel-collab/presets.dev/fp-ts-react.svg)](https://agentmods.dev/skills/beel-collab/presets.dev/fp-ts-react)
Your own site
<a href="https://agentmods.dev/skills/beel-collab/presets.dev/fp-ts-react"><img src="https://agentmods.dev/badge/skills/beel-collab/presets.dev/fp-ts-react.svg" alt="Measured on agentmods" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,081 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin 88% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00044 $0.05081
Opus 5 $0.00022 $0.02540
Sonnet 5 $0.00009 $0.01016
Haiku 4.5 $0.00004 $0.00508

Measured 4d ago against content hash b103849afa67, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

fp-ts-react scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

const res = await fetch(url)
Origin

This is a copy

88% identical to fp-react — 22 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

claude/skills/development/fp-ts-react/SKILL.md · 804 lines

How it starts

The opening of the file, as written. The whole thing — 804 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Functional Programming in React

Practical patterns for React apps. No jargon, just code that works.

When to Use This Skill

  • When building React apps with fp-ts for type-safe state management
  • When handling loading/error/success states in data fetching
  • When implementing form validation with error accumulation
  • When using React 18/19 or Next.js 14/15 with functional patterns

Quick Reference

Pattern Use When
Option Value might be missing (user not loaded yet)
Either Operation might fail (form validation)
TaskEither Async operation might fail (API calls)
RemoteData Need to show loading/error/success states
pipe Chaining multiple transformations

1. State with Option (Maybe It's There, Maybe Not)

Use Option instead of null | undefined for clearer intent.

Basic Pattern

import { useState } from 'react'
import * as O from 'fp-ts/Option'
import { pipe } from 'fp-ts/function'

interface User {
  id: string
  name: string
  email: string
}

function UserProfile() {
  // Option says "this might not exist yet"
  const [user, setUser] = useState<O.Option<User>>(O.none)

  const handleLogin = (userData: User) => {
    setUser(O.some(userData))
  }

  const handleLogout = () => {
    setUser(O.none)
  }

  return pipe(
    user,
    O.match(
      // When there's no user
      () => <button onClick={() => handleLogin({ id: '1', name: 'Alice', email: '[email protected]' })}>
        Log In
      </button>,
      // When there's a user
      (u) => (
        <div>
          <p>Welcome, {u.name}!</p>
          <button onClick={handleLogout}>Log Out</button>
        </div>
      )
    )
  )
}

Chaining Optional Values

import * as O from 'fp-ts/Option'
import { pipe } from 'fp-ts/function'

interface Profile {
  user: O.Option<{
    name: string
    settings: O.Option<{
      theme: string
    }>
  }>
}

function getTheme(profile: Profile): string {
  return pipe(
    profile.user,
    O.flatMap(u => u.settings),
    O.map(s => s.theme),
    O.getOrElse(() => 'light') // default
  )
}

Read the full file on GitHub · 804 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 804 lines · 44 tokens per session scan A b103849afa67

Subscribe to this mod's changes

fp-ts-react is a skill published in the GitHub repository beel-collab/presets.dev (2 stars, last pushed 4mo ago), licensed MIT. It adds 44 tokens to every session and 5,081 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). It is 88% identical to fp-react, differing in 22 lines, and is treated as a copy.