# Fp Guide

> Use when writing functional-style code or reviewing for FP cleanliness. Triggers on prompts about pure functions, immutability, function composition, module-level functions, explicit context passing, avoiding inheritance, or stateless designs, even when the user doesn't say 'FP' or 'functional'.

- Skill: `xonovex/fp-guide` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add xonovex/fp-guide`
- Raw SKILL.md: https://api.skillmd.com/api/skills/xonovex/fp-guide/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: xonovex (https://skillmd.com/u/xonovex)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/xonovex/fp-guide

---


# General Functional Programming Guidelines

## Core principles

- Prefer module-level functions over classes; pass context explicitly; avoid inheritance.
- Favor immutable data and pure functions; no global or shared mutable state.
- Compose complex behavior from small, focused functions.

## Gotchas

- Closures over mutable state look pure but aren't: referential transparency requires both inputs and captured environment to be immutable
- Partial application order matters: `flip` exists because curry direction is opinionated, not arbitrary

