typescript-fp

Enforce strict typing and functional patterns in TypeScript with fp-ts.

1|Updated Nov 18, 2025
One-click install
npx skills add https://github.com/manutej/crush-mcp-server --skill typescript-fp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-fp
Source: https://github.com/manutej/crush-mcp-server/tree/main/.claude/skills/typescript-fp
Command: npx skills add https://github.com/manutej/crush-mcp-server --skill typescript-fp

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill teaches type-safe functional programming in TypeScript, including discriminated unions, pipe/flow composition, monadic patterns, and integration with functional libraries like fp-ts.

Core Features & Use Cases

  • Type-Safe Pipelines: Compose functions with pipe/flow while preserving types.
  • Monadic Patterns: Use Option/Either-like patterns for safer error handling.
  • Advanced Types: Leverage TypeScript’s type system for reliable, maintainable code.

Quick Start

Install TypeScript tools, create small FP utilities with pipe/flow, and run a small example to demonstrate type-safe composition.

Frequently Asked Questions about typescript-fp

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write type-safe functional code in TypeScript?

Type-safe functional programming in TypeScript enforces strict typing and functional patterns using tools like fp-ts, discriminated unions, and pipe/flow composition. Configure strict tsconfig.json settings, apply ESLint rules for functional style, and use advanced type utilities like DeepReadonly to ensure pure, immutable code with explicit error handling.

What are monadic patterns and how do I use them in TypeScript?

Monadic patterns like Option and Either provide safer error handling by encoding success and failure cases in the type system. In TypeScript, they let you chain operations with pipe composition while preserving type safety, avoiding null checks and unhandled exceptions through explicit, composable error paths.

How do I compose functions with pipe and flow while maintaining types?

Pipe and flow composition in TypeScript chains functions left-to-right while preserving type signatures at each step. Use fp-ts or similar functional libraries to ensure the output type of each function matches the input type of the next, preventing runtime type errors and enabling IDE autocomplete.

Can I use discriminated unions with functional programming patterns?

Discriminated unions work with functional patterns to create exhaustive, type-safe case handling. Combined with monadic composition and pipe utilities, they enable you to model domain logic as tagged variants that the type system enforces, eliminating invalid state combinations.

What advanced TypeScript types support functional programming?

Advanced type utilities like ReturnTypeOf, Union-to-Intersection, and DeepReadonly enable functional programming patterns by extracting types from functions, combining union members, and enforcing immutability. These utilities integrate with fp-ts and strict tsconfig settings to deliver compile-time guarantees.