functional

Functional programming patterns with immutable data. Use when writing logic or data transformations.

Skill for Claude CodeCodex

Install

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.

agentmods
npx agentmods add skills/christopher-buss/bedrock/functional-programming
Any agent
npx skills add christopher-buss/bedrock --skill functional-programming
Clone the repo
git clone --depth 1 https://github.com/christopher-buss/bedrock

Made for: Claude Code, Codex.

Per session 17 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,320 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin unknown No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00017 $0.04320
Opus 5 $0.00009 $0.02160
Sonnet 5 $0.00003 $0.00864
Haiku 4.5 $0.00002 $0.00432

Measured today against content hash 4982f2b7089a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

functional 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 today.

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.

.claude/skills/functional-programming/SKILL.md · 834 lines

How it starts

The opening of the file, as written. The whole thing — 834 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Functional Patterns

Core Principles

  • No data mutation - immutable structures only
  • Pure functions wherever possible
  • Composition over inheritance
  • No comments - code should be self-documenting
  • Array methods over loops
  • Options objects over positional parameters

Why Immutability Matters

Immutable data is the foundation of functional programming. Understanding WHY helps you embrace it:

  • Predictable: Same input always produces same output (no hidden state changes)
  • Debuggable: State doesn't change unexpectedly - easier to trace bugs
  • Testable: No hidden mutable state makes tests straightforward
  • React-friendly: React's reconciliation and memoization optimizations work correctly
  • Concurrency-safe: No race conditions when data can't change

Example of the problem:

// ❌ WRONG - Mutation creates unpredictable behavior
const user = { name: "Alice", permissions: ["read"] };
grantPermission(user, "write"); // Mutates user.permissions internally
console.log(user.permissions); // ['read', 'write'] - SURPRISE! user changed
// ✅ CORRECT - Immutable approach is predictable
const user = { name: "Alice", permissions: ["read"] };
const updatedUser = grantPermission(user, "write"); // Returns new object
console.log(user.permissions); // ['read'] - original unchanged
console.log(updatedUser.permissions); // ['read', 'write'] - new version

Functional Light

We follow "Functional Light" principles - practical functional patterns without heavy abstractions:

What we DO:

  • Pure functions and immutable data
  • Composition and declarative code
  • Array methods over loops
  • Type safety and readonly

What we DON'T do:

  • Category theory or monads
  • Heavy FP libraries (fp-ts, Ramda)
  • Over-engineering with abstractions
  • Functional for the sake of functional

Why: The goal is maintainable, testable code - not academic purity. If a functional pattern makes code harder to understand, don't use it.

Read the full file on GitHub · 834 lines

Changes

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.

  1. today First seen · 834 lines · 17 tokens per session scan A 4982f2b7089a

Subscribe to this mod's changes

functional is a skill published in the GitHub repository christopher-buss/bedrock (13 stars, last pushed yesterday), licensed MIT. It adds 17 tokens to every session and 4,320 once invoked, about $0.0001 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-09-01.

Related

Other skills, from other repositories

pulumi-component

Guide for authoring Pulumi ComponentResource classes. Use when creating reusable infrastructure components, designing component interfaces, setting up multi-language support, or distributing component packages.

pulumi/agent-skills · 36 tokens

pulumi-migrate-from-discovered-stack

Migrate a CloudFormation or ARM stack into a Pulumi stack, sourced from a stack that Pulumi Cloud's Discovery feature has already found and exposed via the discovered-stacks API. Load this skill when the user has a discovered stack in Pulumi Cloud and wants to bring its resources under Pulumi management. Do NOT load…

pulumi/agent-skills · 115 tokens

pulumi-overview

Use this skill for any task that creates, modifies, inspects, or destroys cloud infrastructure or SaaS configuration, from one-off CLI operations to full multi-resource projects, across providers in the Pulumi ecosystem. A typical project spans many providers (AWS or Azure or GCP, Kubernetes, Cloudflare, Auth0…

pulumi/agent-skills · 210 tokens

provider-upgrade

Upgrade any Pulumi provider to a newer version and reconcile the resulting diff. Use when users want to upgrade or update a provider (including editing package.json, requirements.txt, pyproject.toml, go.mod, or Pulumi.yaml to bump a provider SDK), check for breaking changes before or during an upgrade, fix resources…

pulumi/agent-skills · 159 tokens

pulumi-best-practices

Load when the user is writing, reviewing, or debugging Pulumi TypeScript/Python programs; asks about Output or apply() usage; wants to create ComponentResource classes; needs to refactor resources without destroying them (aliases); is setting up secrets or config; or is configuring a pulumi preview/up CI workflow.…

pulumi/agent-skills · 92 tokens

pulumi-cdk-to-pulumi

Load this skill when a user wants to migrate, convert, port, translate, or move an AWS CDK application (including CDK stacks, constructs, or CloudFormation-synthesized templates) to Pulumi. Phrases such as "convert CDK to Pulumi", "migrate CDK app", "port CDK stacks", "replace CDK with Pulumi", "stop using CDK". Do…

pulumi/agent-skills · 118 tokens