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 atretyak1985/swarmery --skill functional-designgit clone --depth 1 https://github.com/atretyak1985/swarmeryWrote 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/atretyak1985/swarmery/functional-design)<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.
<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>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.00902 |
| Opus 5.5 | $0.00020 | $0.00361 |
| Sonnet 5.5 | $0.00010 | $0.00180 |
| Haiku 4.5 | $0.00005 | $0.00090 |
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 1mo 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 — 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)
- TypeScript only — never apply this to Python.
- Edit only under
src/lib/; a route handler gets at most one import-only Edit, never a refactor of its I/O. - Never wrap async I/O in a synchronous composition chain —
await, then pipe the result through pure code. - Never introduce a new dependency (immer, ramda, lodash-fp) or an undeclared
pipe(); chain methods or use sequentialconstassignments. - Verify every type by reading it — never guess a parameter shape.
- Maximum 3 Edits per invocation, one per function, each with a shown diff.
Resources
- Read
resources/refactor-procedure.mdbefore 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
forloop 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.
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.
- 1mo ago First seen · 90 lines · 49 tokens per session scan A 2e9e7cd48585
functional-design is a skill published in the GitHub repository atretyak1985/swarmery (7 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.
Other skills, from other repositories
effect-v4
Write, review, or upgrade Effect v4 code in the Composio CLI, cli-keyring, and json-schema-to-effect-schema packages, all pinned exactly to [email protected] — Context.Service and explicit layers, Schema.TaggedError and typed recovery, the effect/cli command surface, and the vendored effect source oracle. Use when writing…
azure-identity-ts
Authenticate to Azure services using Azure Identity library for JavaScript (@azure/identity). Use when configuring authentication with DefaultAzureCredential, managed identity, service principals, or interactive browser login.
typescript
TypeScript coding conventions, best practices, and patterns for writing clean, maintainable code.
agents-sdk-typescript-debugging
Use when troubleshooting an agent built with the Microsoft Agents SDK (@microsoft/agents-hosting and related packages). Trigger on any of these symptoms: build or TypeScript errors, crashes on startup, 401 or auth errors on incoming requests, the bot not responding to messages, .env configuration problems, Azure AD…
chat-sdk
Build multi-platform chat bots with Chat SDK (chat npm package). Use when developers want to (1) Build a Slack, Teams, Google Chat, Discord, Telegram, GitHub, Linear, or WhatsApp bot, (2) Use Chat SDK to handle mentions, direct messages, subscribed threads, reactions, slash commands, cards, modals, files, or AI…
better-auth
Skill for integrating Better Auth - comprehensive TypeScript authentication framework for Cloudflare D1, Next.js, Nuxt, and 15+ frameworks. Use when adding auth, encountering D1 adapter errors, or implementing OAuth/2FA/RBAC features.