← ClaudeAtlas

refactorlisted

Refactor code at method, file, or project scope. Assesses first and stops when the code is already clean, routes architecture problems elsewhere, and gates edits on test coverage. Language-agnostic.
svyatov/agent-toolkit · ★ 0 · AI & Automation · score 75
Install: claude install-skill svyatov/agent-toolkit
# Refactor Improve code structure without changing behavior. Works at three scopes: **project**, **file**, or **method**. Starts by assessing whether refactoring is even warranted — if the code is already clean, say so and stop. **Refactoring vs Architecture:** This skill handles code-level improvements — complexity, duplication, naming, dead code, method extraction. If the assessment reveals that the real problem is module boundaries, coupling between packages, or shallow modules that need deepening, say so — that's an architecture problem this skill won't fix (suggest the `improve-architecture` skill if installed). ## Philosophy These principles calibrate what "good enough" means and guide every step below: - **Measure the end state, not the effort.** Writing 50 lines that delete 200 is a win. - **Simple over easy.** Simple means one concept, not intertwined. Easy means familiar. Choose simple. - **Separate, don't combine.** Good design is taking things apart — removing dependencies, not adding abstractions. - **Data over abstractions.** 100 functions on one data structure beat 10 functions on 10 custom types. - **Less total code.** If "better organized" means more lines, it's more entropy, not less. - **When in doubt, leave it alone.** The default verdict is Clean. Don't invent work. Read a reference only when the assessment actually turns on it: - `references/simplicity-vs-easy.md`: when the choice is between a familiar approach and a simpler one - `references/data