From rnd-framework
Use alongside KISS practices to guide agents toward functional programming patterns — pure functions, data transformations, composition, command-query separation, and immutability
How this skill is triggered — by the user, by Claude, or both
Slash command
/rnd-framework:fp-practicesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Concrete rules for writing code in a functional style. These complement KISS practices — KISS prevents over-engineering, FP practices guide _how_ to structure the code that remains.
Concrete rules for writing code in a functional style. These complement KISS practices — KISS prevents over-engineering, FP practices guide how to structure the code that remains.
Core principle: Separate what you compute from what you do. Pure logic in, effects out.
During Phase 0 (Discovery):
${CLAUDE_SKILL_DIR}/elixir.md, ${CLAUDE_SKILL_DIR}/javascript.md)Language detection heuristics:
| Files present | Load |
|---|---|
*.sh, *.bash, Makefile | ${CLAUDE_SKILL_DIR}/bash.md |
*.ex, *.exs, mix.exs | ${CLAUDE_SKILL_DIR}/elixir.md |
*.js, *.ts, *.jsx, *.tsx, *.css, *.html | ${CLAUDE_SKILL_DIR}/javascript.md |
*.py, pyproject.toml, requirements.txt | ${CLAUDE_SKILL_DIR}/python.md |
*.lean, lakefile.lean | ${CLAUDE_SKILL_DIR}/lean.md |
*.svelte, svelte.config.* | ${CLAUDE_SKILL_DIR}/svelte.md |
*.kk, koka.json | ${CLAUDE_SKILL_DIR}/koka.md |
mix.exs with :postgrex or :ecto, or *.sql files | ${CLAUDE_SKILL_DIR}/postgresql.md |
DuckDB usage, *.duckdb files, or analytical/data tasks | ${CLAUDE_SKILL_DIR}/duckdb.md |
Overriding: Projects can ship their own fp-practices skill in .claude/skills/fp-practices/SKILL.md to override these defaults with project-specific rules.
A pure function takes inputs and returns outputs. It does not read globals, write files, call APIs, or mutate arguments.
Do:
Don't:
Date.now(), Math.random(), or other non-deterministic calls inside pure logic — inject them as argumentsExpress logic as a pipeline of transformations on data, not a sequence of mutations on state.
Do:
input |> validate |> transform |> formatDon't:
let result = []; for (...) { result.push(...) } when items.map(...) worksBuild behavior by combining small, focused functions — not by extending class hierarchies.
Do:
const process = compose(validate, transform, save)Don't:
extends or super when a function parameter achieves the same thingA function either returns data (query) or causes an effect (command). Never both.
Do:
Don't:
getOrCreate functions that both query and mutate — split into find + createDeclare bindings as immutable unless mutation is specifically needed.
Do:
const (JS/TS), val (Kotlin), let (Swift/Rust), or the immutable equivalent in your language{...user, name: newName}readonly types in TypeScript for function parametersDon't:
let/var when the value is assigned once and never changedpush, splice) when map/filter/concat worksDo:
verb_noun or noun_verb as the language dictates — don't mix computeTotal/total_compute styles within the same codebaseuser_* functions together, order_* together; alphabetical grouping hides cohesionDon't:
These rules have legitimate exceptions:
npx claudepluginhub oleksify/rnd-framework --plugin rnd-frameworkProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.