Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add helmedeiros/clean-code-skills --skill fp-pure-functionsgit clone --depth 1 https://github.com/helmedeiros/clean-code-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/helmedeiros/clean-code-skills/fp-pure-functions)<a href="https://agentmods.dev/skills/helmedeiros/clean-code-skills/fp-pure-functions"><img src="https://agentmods.dev/badge/skills/helmedeiros/clean-code-skills/fp-pure-functions/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/helmedeiros/clean-code-skills/fp-pure-functions"><img src="https://agentmods.dev/badge/skills/helmedeiros/clean-code-skills/fp-pure-functions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00049 | $0.00781 |
| Opus 5 | $0.00024 | $0.00391 |
| Sonnet 5 | $0.00010 | $0.00156 |
| Haiku 4.5 | $0.00005 | $0.00078 |
Grade A, and why
fp-pure-functions scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 79 lines — stays where its author put it; the contents beside it link to each section on GitHub.
FP: Pure Functions and Immutability
Write functions that depend only on their inputs and produce no side effects, combined with immutable data structures, to create predictable, testable, and composable code.
When This Skill Applies
- Functions modify external state (global variables, databases, files)
- Functions produce different results for the same inputs
- The user mentions pure functions, immutability, or side effects
- Testing requires complex setup due to hidden dependencies
- Debugging is hard because state changes are scattered
Core Principle
A pure function has two properties: (1) given the same inputs, it always returns the same output, and (2) it produces no side effects. Combined with immutable data (data that cannot be changed after creation), pure functions make programs easier to reason about, test, and parallelize. Push side effects to the edges of the system and keep the core logic pure.
Workflow
Step 1: Identify Impurities
Find functions that read or modify external state: global variables, instance fields, database, filesystem, network, current time, random numbers. These are side effects.
Step 2: Separate Pure Logic from Side Effects
Extract the pure computation into its own function. The impure function becomes a thin shell that gathers inputs, calls the pure function, and applies the outputs.
Step 3: Make Data Immutable
Replace mutation (obj.field = value) with creation of new objects ({ ...obj, field: value }). Use const instead of let. Return new collections instead of modifying existing ones.
Step 4: Pass Dependencies as Arguments
Replace hidden dependencies (global config, singletons, current time) with explicit function parameters. The caller provides the values.
Step 5: Verify Purity
A function is pure if you can replace the call with its return value (referential transparency). Run the test suite — pure functions need only input/output assertions, no mocks.
Detection / Indicators
- Function reads from or writes to global variables
- Function calls
Date.now(),Math.random(), or reads environment variables - Function modifies its input parameters
- Function result changes depending on when or how often it is called
- Testing requires mocking side-effecting dependencies
- Variables declared with
letand mutated throughout a function
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 9d ago First seen · 79 lines · 49 tokens per session scan A 7c723f0bed61
fp-pure-functions is a skill published in the GitHub repository helmedeiros/clean-code-skills (2 stars, last pushed 6mo ago), licensed MIT. It adds 49 tokens to every session and 781 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
re0-git
Rewrite a finished commit's message into a clean, handoff-ready form in your own log style, so git log alone tells the story. User-invoked: run it after a commit.
debloat
Compress an artifact that has accreted into bloat — padding, over-qualification, fused sentences, walls of enumeration, adjacent restatement — down to its load-bearing density, meaning preserved. Use when prose is correct and current but has grown verbose or patched-over and you want it tight without a full rewrite.
prism
Split one artifact — a claim, plan, or file — across 2 to 5 independent lenses, one per genuinely distinct failure mode (correctness, security, readability, cost, adversarial-user), and return their convergence: where they agree, where they disagree, and the single next question that resolves the disagreement. Use…
codex-setup
Initialize sd0x-dev-flow infrastructure for Codex CLI and other non-Claude agents. Generates AGENTS.md, installs the commit-msg hook, copies runner scripts. The pre-push gate is opt-in via --with-push-gate. Use when setting up a new project or after updating skills.
recap-doc
Post-development recap document generator. Use when: AI/Codex has implemented a feature and the user needs a guided walkthrough of what changed and why, with blind-spot detection and anticipated questions. Not for: Q&A follow-up (use /recap-ask), technical share-out for teammates (use /tech-brief), or generic code…
runbook
Generate and update feature release runbooks from existing docs and codebase. Use when: creating operational runbook, release handbook, deployment checklist, pre-release preparation. Not for: incident response (v2), code review (use codex-code-review), architecture design (use architecture).