← ClaudeAtlas

functional-designlisted

EXECUTES refactors of TypeScript business logic in the main app toward pure functions, immutability, and data-flow pipelines -- edits files directly via Edit. NOT for planning-only refactors with no code changes (use refactor-plan). NOT for cloud service config, I/O-heavy route handlers, or Python/firmware paths in the device/edge repo (project.json → device).
atretyak1985/swarmery · ★ 3 · Data & Documents · score 65
Install: claude install-skill atretyak1985/swarmery
# Purpose Refactor business logic to follow functional programming principles -- immutability, pure functions, composition, and data-flow pipelines. Targets TypeScript code in the main app's `src/lib/` services where pure transformations live (see `.claude/project.json` → `mainApp`). This skill writes to files via Edit; every change produces a before/after diff shown to the caller. This skill targets TypeScript only; it does not apply to Python code in the device/edge repo. Success criteria: every refactored function is a pure function (no side effects, same input produces same output), all interface properties use `readonly` where immutability was applied, and `npm run typecheck` passes after changes. # When to use - Refactoring a service function in `src/lib/` that mutates its input parameters - Replacing imperative loops with `.filter()/.map()/.reduce()` chains in business logic - Extracting pure calculation functions from route handlers (Read the handler, Edit only in `src/lib/`) - Converting a class with mutable state into functions and data interfaces # When NOT to use - Route handlers and server actions themselves -- keep them thin, put pure logic in `src/lib/` (use `code-standards` instead) - Any Python code in the device/edge repo (use `api-integration` for hardware code or `code-standards` for Python refactoring -- this skill targets TypeScript only) - Prisma query builders -- they use a fluent mutable API by design - React component state management with `use