fp-types-ref – Other skill for AI agents
Quick reference for fp-ts types. Use when user asks which type to use, needs Option/Either/Task decision help, or wants fp-ts imports.
Install the fp-types-ref skill with one command
Pick the tool you use, copy the command and paste it in your terminal. The skill lands in that tool's skills folder and is ready in your next session.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/fp-types-ref-e1481.tgz | tar xz -C ~/.claude/skills
Call it in Claude Code: /fp-types-ref – then describe the task you want done.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/fp-types-ref-e1481.tgz | tar xz -C ~/.codex/skills
Call it in Codex: $fp-types-ref – then describe the task you want done.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/fp-types-ref-e1481.tgz | tar xz -C ~/.hermes/skills
Call it in Hermes Agent: /fp-types-ref – then describe the task you want done.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/fp-types-ref-e1481.tgz | tar xz -C ~/.deepcode/skills
Call it in DeepSeek: /fp-types-ref – then describe the task you want done.
SKILL.md content
fp-ts Quick Reference
When to Use
- You need help choosing between
Option,Either,Task,TaskEither, or related fp-ts types. - The task is about imports, decision guidance, or selecting the right abstraction for a TypeScript flow.
- You want a compact reference for common fp-ts type choices and patterns.
Which Type Should I Use?
Is the operation async?
├─ NO: Does it involve errors?
│ ├─ YES → Either<Error, Value>
│ └─ NO: Might value be missing?
│ ├─ YES → Option<Value>
│ └─ NO → Just use the value
└─ YES: Does it involve errors?
├─ YES → TaskEither<Error, Value>
└─ NO: Might value be missing?
├─ YES → TaskOption<Value>
└─ NO → Task<Value>Common Imports
// Core
import { pipe, flow } from 'fp-ts/function'
// Types
import * as O from 'fp-ts/Option' // Maybe exists
import * as E from 'fp-ts/Either' // Success or failure
import * as TE from 'fp-ts/TaskEither' // Async + failure
import * as T from 'fp-ts/Task' // Lazy async; no typed error channel
import * as A from 'fp-ts/Array' // Array utilitiesOne-Line Patterns
| Need | Code |
|------|------|
| Wrap nullable | O.fromNullable(value) |
| Default value | O.getOrElse(() => fallbackValue) |
| Transform if exists | O.map(fn) |
| Chain optionals | O.flatMap(fn) |
| Wrap try/catch | E.tryCatch(() => risky(), toError) |
| Wrap async | TE.tryCatch(() => fetch(url), toError) |
| Run pipe | pipe(value, fn1, fn2, fn3) |
Pattern Match
// Option
pipe(maybe, O.match(
() => 'nothing',
(val) => `got ${val}`
))
// Either
pipe(result, E.match(
(err) => `error: ${err}`,
(val) => `success: ${val}`
))Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Reference scope
These are fp-ts 2.x fragments. Supply application variables, types, validators and imports, and check the installed version. map does not catch thrown exceptions. Task has no typed error channel; an improperly wrapped promise can still reject. Use tryCatch at fallible boundaries.
Official API: [fp-ts modules](https://gcanti.github.io/fp-ts/modules/).
Related skills
- fxmacrodata – Query FXMacroData for official-source macro indicators, release calendars, central-bank…
- gamification-engine – Gamification points register: player and department, points balance and points earned…
- geminiignore-finops – Configure and optimize .geminiignore files for AI context window efficiency and token…
- geo-citability – AI citability scoring and optimization.
- geo-compare – Monthly delta tracking and progress reporting for GEO clients.
- geo-fundamentals – Generative Engine Optimization for AI search engines (ChatGPT, Claude, Perplexity).
- geo-keyword-expansion-tool – Geo Keyword Expansion Tool. Use when working with seed keyword and target locations.
- geo-prospect – CRM-lite for managing GEO agency prospects and clients.