← ClaudeAtlas

refactorlisted

Deep functional refactoring of TypeScript code for purity, testability, and modularity. Use when the user says /refactor, asks to clean up or restructure code, mentions large files, god functions, mixed concerns, poor testability, or when code grew unwieldy after feature iterations. Also triggers on "this file is too big", "split this", "make this more functional", "extract", "decompose", or any mention of code smells like let, try/catch in business logic, for loops, or files over 300 lines. If the user describes messy, tangled, or overgrown code that needs structural improvement, this is the right skill — even without the word "refactor."
supermodo/skills · ★ 1 · Data & Documents · score 74
Install: claude install-skill supermodo/skills
# Refactor > **Requires:** the sibling `protocols` skill (shared protocol masters); uses `skills.config.json` when present. Missing protocols → tell the user to install the full supermodo package. A systematic, phase-gated refactoring process that transforms accumulated code into small, pure, well-tested functional modules. The skill analyzes before touching code, plans before executing, tests before changing, and verifies after each step. ## Invocation ``` /refactor <path> # file, directory, module, or "project" /refactor src/queries/ # all files in a directory /refactor . # current working directory ``` When scope is large, analyze the full scope, build a dependency-ordered plan, and chunk work into verifiable steps. ## Core Principles These shape every decision. Understand the reasoning — they enable judgment calls in edge cases. ### Never Assume When uncertain about intent, impact, or correctness — ask the user. Never silently delete exports (they may exist for future use), never silently tighten external API types, never assume a function is "dead" just because you can't find callers in this repo. Use AskUserQuestion for any decision that could be wrong. ### Pure Core, Impure Shell Separate I/O from logic. Transform functions are pure (output depends only on input). I/O lives at the edges — in thin orchestrators wiring pure functions together. This makes code testable without mocks and composable with pipe/chain. ### Small Units Functi