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.
> **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