functional-design

functional-design is a skill for Claude Code from atretyak1985/swarmery. It costs 49 tokens per session (902 once invoked), scanned A, original, Apache-2.0.

A TypeScript refactoring workflow that changes business logic into pure functions, immutable data, and array pipelines.

In plain words
What is it for?
It is for rewriting functions in TypeScript application services while keeping input data unchanged.
Why use it?
It reduces accidental changes to shared data and makes logic easier to type-check and reason about.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the core plugin — 37 skills, 9 commands, 13 agents shipped together

Good fit It is for rewriting functions in TypeScript application services while keeping input data unchanged.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/atretyak1985/swarmery/functional-design
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.

Any agent
npx skills add atretyak1985/swarmery --skill functional-design
Clone the repo
git clone --depth 1 https://github.com/atretyak1985/swarmery

Made for: Claude Code.

Or install core, the plugin that ships this one along with the rest of its 37 skills, 9 commands, 13 agents.

Wrote 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.

agentmods badge for functional-design

README.md
[![agentmods](https://agentmods.dev/badge/skills/atretyak1985/swarmery/functional-design/github.svg)](https://agentmods.dev/skills/atretyak1985/swarmery/functional-design)
Your own site
<a href="https://agentmods.dev/skills/atretyak1985/swarmery/functional-design"><img src="https://agentmods.dev/badge/skills/atretyak1985/swarmery/functional-design/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.

agentmods 80×15 button for functional-design

Your own site · 80×15
<a href="https://agentmods.dev/skills/atretyak1985/swarmery/functional-design"><img src="https://agentmods.dev/badge/skills/atretyak1985/swarmery/functional-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 902 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original 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.1 $0.00049 $0.00902
Opus 5.5 $0.00020 $0.00361
Sonnet 5.5 $0.00010 $0.00180
Haiku 4.5 $0.00005 $0.00090

Measured 3mo ago against content hash 2e9e7cd48585, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

functional-design 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 3mo 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.

plugins/core/skills/functional-design/SKILL.md · 90 lines

How it starts

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

Purpose

Rewrite TypeScript business logic so it stops mutating its inputs: mutating functions become functions that return new values, hand-written loops become .filter()/.map()/.reduce() chains over named predicates, and interface properties gain readonly. Targets the main app's src/lib/ services. This skill edits files and shows a before/after snippet per change.

Done means: every refactored function is pure, immutable shapes carry readonly, and npm run typecheck passes.

Rules (never violate)

  1. TypeScript only — never apply this to Python.
  2. Edit only under src/lib/; a route handler gets at most one import-only Edit, never a refactor of its I/O.
  3. Never wrap async I/O in a synchronous composition chain — await, then pipe the result through pure code.
  4. Never introduce a new dependency (immer, ramda, lodash-fp) or an undeclared pipe(); chain methods or use sequential const assignments.
  5. Verify every type by reading it — never guess a parameter shape.
  6. Maximum 3 Edits per invocation, one per function, each with a shown diff.

Resources

  • Read resources/refactor-procedure.md before editing: the 7-step procedure, the route-handler boundary rule, the self-check, common mistakes, escalation triggers, two worked examples, and the failure-mode table.

How to use

What it does

Turns mutating, imperative business logic into pure functions over immutable data, applies the edits itself, and reports each change with the principle behind it and a short before/after snippet.

When to use it

  • A src/lib/ service function mutates the object handed to it.
  • A for loop with nested conditionals would read better as named predicates.
  • A route handler tangles calculation with I/O and the calculation should move out.
  • A class holds mutable state that could be plain data plus functions.

Not for: a plan without edits (refactor-plan); Python, naming, or framework conventions (code-standards); a handler's own I/O, an ORM fluent builder, or React useState/useReducer — each has its own contract; or hot per-tick telemetry paths, where spread copies cost more than they buy.

Read the full file on GitHub · 90 lines

Files

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.

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. 3mo ago First seen · 90 lines · 49 tokens per session scan A 2e9e7cd48585

Subscribe to this mod's changes

functional-design is a skill published in the GitHub repository atretyak1985/swarmery (9 stars, last pushed today), licensed Apache-2.0. It adds 49 tokens to every session and 902 once invoked, about $0.0002 per session on Opus 5.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-03.

Related

functional-design compared with skills from other repositories

functional-design next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
functional-designatretyak1985/swarmerySkill9todayApache-2.0A49Claude Code
effect-developmentpingdotgg/t3codeSkill90ktodayMITA29Claude Code, Codex
effect-v4ComposioHQ/composioSkill31ktodayMITA159Claude Code, Codex
chat-sdkvercel-labs/open-agentsSkill5.9k3d agoMITA191Claude Code, Codex
typescriptgenkit-ai/genkitSkill6.7ktodayApache-2.0A20Claude Code, Codex
agents-sdk-typescript-debuggingmicrosoft/AgentsSkill1.1ktodayMITA125Claude Code
teams-sdk-to-agents-sdk-typescript-migrationmicrosoft/AgentsSkill1.1ktodayMITA62Claude Code