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-higher-order-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-higher-order-functions)<a href="https://agentmods.dev/skills/helmedeiros/clean-code-skills/fp-higher-order-functions"><img src="https://agentmods.dev/badge/skills/helmedeiros/clean-code-skills/fp-higher-order-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-higher-order-functions"><img src="https://agentmods.dev/badge/skills/helmedeiros/clean-code-skills/fp-higher-order-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.00050 | $0.00706 |
| Opus 5 | $0.00025 | $0.00353 |
| Sonnet 5 | $0.00010 | $0.00141 |
| Haiku 4.5 | $0.00005 | $0.00071 |
Grade A, and why
fp-higher-order-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 — 75 lines — stays where its author put it; the contents beside it link to each section on GitHub.
FP: Higher-Order Functions
Use functions that accept or return other functions to abstract common patterns, reduce duplication, and build composable operations.
When This Skill Applies
- Repetitive loop patterns differ only in the operation applied
- The user mentions map, filter, reduce, higher-order functions, or callbacks
- Functions share structure but vary in one specific behavior
- The user wants to reduce boilerplate in collection processing
- Custom event handlers, middleware, or plugin systems are being designed
Core Principle
A higher-order function (HOF) either takes a function as an argument or returns a function as its result. HOFs capture common patterns (iteration, transformation, filtering, composition) and parameterize the varying part. This eliminates structural duplication and creates reusable, composable building blocks.
Workflow
Step 1: Identify the Pattern
Find two or more code blocks that share the same structure but differ in one operation. The shared structure is the HOF; the varying operation becomes the function argument.
Step 2: Extract the Higher-Order Function
Create a function that takes the varying behavior as a parameter. Replace the duplicated code blocks with calls to the HOF, passing the specific behavior.
Step 3: Use Built-in HOFs Where Possible
Most languages provide map, filter, reduce, forEach, flatMap, find, some, every. Use these instead of writing manual loops.
Step 4: Compose HOFs
Chain HOFs to build complex operations from simple ones. Each step in the chain does one thing. The pipeline reads as a description of the transformation.
Step 5: Verify Readability
If the HOF chain is hard to read, extract intermediate steps into named variables or named functions. The goal is clarity, not cleverness.
Detection / Indicators
- For-loops that transform, filter, or accumulate — replace with
map,filter,reduce - Multiple functions with identical structure except for one operation
- Callback patterns that could be generalized
- Manual iteration where a declarative pipeline would be clearer
- Code that creates closures over configuration
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 · 75 lines · 50 tokens per session scan A 9e79906ad172
fp-higher-order-functions is a skill published in the GitHub repository helmedeiros/clean-code-skills (2 stars, last pushed 6mo ago), licensed MIT. It adds 50 tokens to every session and 706 once invoked, about $0.0003 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).