fp-pack skill
A skill bundled with fp-pack that teaches AI assistants to write TypeScript with pipe, SideEffect and currying.
- 112 ★ on the repository
- Last commit
- MIT
Minimal access
Why this level
- The skill consists of text rules and examples and runs nothing itself.
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add skills/fp-packDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewMinimal accessThe tool runs nothing and makes no network calls.
- The skill consists of text rules and examples and runs nothing itself.
This is third-party code. Review the repository files before installing.
What it does
fp-pack is a functional utility toolkit for JavaScript and TypeScript centered on `pipe` and `pipeAsync`. The package ships a skill for AI assistants: after copying the folder to `.claude/skills/fp-pack` or `~/.codex/skills/fp-pack`, the agent writes code in the fp-pack style automatically. The skill explains how to build pipelines of pure functions with `pipe` and `pipeAsync`, and to move to `pipeSideEffect` and `pipeAsyncSideEffect` when early exits and error handling are needed. Instead of try-catch it describes the `SideEffect` pattern, and for large datasets it recommends the `stream/*` functions. The skill activates only when fp-pack is installed in the project: it checks dependencies in `package.json`, the presence of `node_modules/fp-pack` and imports. The folder holds constraints, references on composition, currying and type inference, and examples. For agents with a system prompt there is a separate global add-on.
Who it is for. TypeScript developers on fp-pack who want Claude Code, Codex or Copilot to write code in the same functional style as the team.
Good fit when
- The project already uses fp-pack but the agent writes loops and try-catch instead of pipelines.
- You want to replace exceptions with the SideEffect pattern and early exits.
- A large dataset must be processed lazily through `stream/*`.
- The team is moving to pipe and wants common rules for all assistants.
Not a fit when
- The project has no fp-pack, so the skill by design does not activate.
- Code is written in an object-oriented style with classes and exceptions.
- You need to teach the agent another functional library, such as Ramda.
Example request
Rewrite this order-processing function with fp-pack pipeAsync, using SideEffect for errors and early exits.Limitations
The skill sits inside the built package: the path `node_modules/fp-pack/dist/skills/fp-pack/` appears after `npm install fp-pack`, and you must copy the folder into the skills directory by hand. The README has PowerShell commands for Windows. The rules apply only in projects with fp-pack, so the skill gives no general functional programming advice. The deprecated names with the Strict suffix remain aliases until 1.0, and the skill targets the current names from the 0.15 release.
How to disable. Delete the `fp-pack` folder from `.claude/skills` or `~/.codex/skills`. Remove the package itself with `npm uninstall fp-pack`.
FAQ
How do I install the fp-pack skill?
Run `npm install fp-pack`, then copy `node_modules/fp-pack/dist/skills/fp-pack/` into `.claude/skills/fp-pack`. For Codex the target is `~/.codex/skills/fp-pack`.
When does the skill activate?
Only when fp-pack is installed in the project: the agent looks for the dependency in `package.json`, the `node_modules/fp-pack` folder and imports from `fp-pack` or `fp-pack/stream`.
How does pipeSideEffect differ from pipe?
`pipe` composes pure transformations, while `pipeSideEffect` and `pipeAsyncSideEffect` are for pipelines that use SideEffect and must exit early.
Is there an option for agents without skills?
Yes. For agents with a system prompt, such as OpenCode, there is a global add-on `fp-pack-agent-addon.md` in `node_modules/fp-pack/dist/ai-addons/`.
What is inside the skill folder?
`SKILL.md`, a `constraints` directory with rules and common mistakes, `reference` on composition, currying and types, and `examples` with short samples.
Discussion
No questions or reviews yet.
Related
SkillsA mirror of Lauren Tan's pstack set from Cursor: over 50 skills, the poteto-mode with 23 playbooks and 24 principles for strict agent work on code
skills-npm links agent skills shipped in your dependencies in node_modules and listed in the skills field of package.json
55 skills for Claude Code, Codex, OpenCode and Pi: code review, security audit, feature development, frontend design and Hugging Face
Armin's personal toolkit for the Pi Coding Agent: 18 skills, extensions, commands and themes, with some skills portable to other agents
An Effect v4 skill for TypeScript: schemas, services and layers, config, retries, caches, streams, the HTTP client and tests with virtual time
skill-kit builds agent skills as typed TypeScript state machines with schema-checked answers and a build into a SKILL.md directory
README in short
A library without monads or wrapper ceremony: functions, pipe and currying plus the SideEffect pattern for error handling. The skill ships with the package, so rules and API versions match.
README badge
Original SKILL.md
---
name: fp-pack
description: Use when working in projects that use fp-pack; follow pipe, SideEffect, and curry guidelines.
metadata:
short-description: fp-pack workflow
version: {{version}}
---
# fp-pack AI Agent Skills
Document Version: {{version}}
Additional materials (optional):
- constraints/ (rules, mistakes, troubleshooting)
- reference/ (composition, currying, TypeScript inference)
- examples/ (quick examples)
## ⚠️ Activation Condition (Read First)
These guidelines apply **only when `fp-pack` is installed** in the current project.
Before following this document:
- Check `package.json` for `fp-pack` in dependencies/devDependencies
- Check `node_modules/fp-pack` exists
- Check existing code imports from `fp-pack` or `fp-pack/stream`
If `fp-pack` is **not** installed, use the project's existing conventions. Do **not** suggest adding fp-pack unless the user asks.
---
## Core Rules (Keep In Memory)
- Use `pipe`/`pipeAsync` for 2+ steps; for a single step, call the function directly.
- Every pipe checks each step; do not use the deprecated `*Strict` variants (`pipeStrict`, `pipeAsyncStrict`, `pipeSideEffectStrict`, `pipeAsyncSideEffectStrict`).
- Prefer value-first: `pipe(value, ...)` / `pipeAsync(value, ...)` runs immediately and improves inference (the input anchors types). Use functions-first only when you need a reusable pipeline.
- Let pipe infer intermediate parameters; do not add assertions to silence a broken chain. Contextual inference covers 32 steps after the first argument. Compose smaller pipelines beyond that limit; longer already typed chains remain checked.
- `pipeWithDeps` infers intermediate values and intersects dependency contracts. Default and deprecated variants have identical checks. Annotate the dependency contract where needed, not every value parameter.
- If the first arg is a function, it's treated as composition; wrap function values with `from()`.
- Keep pipeline functions **unary**; prefer data-last, curried helpers.
- `map`/`filter` are for arrays/iterables, not single values.
- Use `from()` only for constants or 0-arg pipelines (including function values you need to pass as data). Otherwise pass data as the first argument.
- Use `pipeSideEffect*` only when you need early exit; otherwise use `pipe`/`pipeAsync`.
- Never call `runPipeResult`/`matchSideEffect` inside pipelines; call at boundaries.
- Prefer `isSideEffect` for precise narrowing; `runPipeResult` for unwrapping (pipe results are precise; use generics only for values you widened yourself).
- `SideEffect` is an instance type: use `SideEffect<E>` (not `typeof SideEffect`).