refactorlisted
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