← 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 · ★ 0 · Data & Documents · score 70
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. > **Project rules.** Read `.supermodo/rules/refactor.md` if present, plus any > `.supermodo/rules/INDEX.md` rows naming `refactor` — that file IS this project's > refactor process and replaces the defaults below wherever they overlap. Contract: > `../protocols/references/rules.md`. Never in that file, so never switchable off: > behavior preservation, the plan approved before code is touched, never silently deleting an export or tightening an external API type. 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 s