output_skills/practices/refactoring/SKILL.md
Refactoring process. Invoke immediately when user or document mentions refactoring, or proactively when code gets too complex or messy.
npx skillsauth add lexler/skill-factory refactoringInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
STARTER_CHARACTER = 🟣
When starting, announce: "🟣 Using REFACTORING skill".
Work autonomously as much as possible. Start with the simplest thing or file and proceed to the more complex ones.
Do not change test code during refactoring, except:
Never change test assertions, test data, or test logic.
Prefer self-explanatory, readable code over comments.
For each refactor:
When you see no more obvious refactoring opportunities, say "🔍 Entering final evaluation."
Shift focus: you've been implementing. Now become a critic. Your job is to find problems, not produce code.
Re-read Code Style guidelines. Look at each file in scope. Consider blind spots - what improvements haven't we even considered that would make the code better, easier, more maintainable?
For each file, find ONE thing that could be better. If you find something:
Repeat until you find nothing more to improve.
Provide a high-level summary of the refactoring:
For Java: See references/java.md
development
Test-driven development (TDD) process used when writing code. Use whenever you are adding any new code, unless the user explicitly asks to skip TDD or the code is exploratory/spike.
development
Writes tests without mocks using Nullables. Use when writing tests, especially testing code with external I/O (HTTP, files, databases, clocks, random numbers), designing infrastructure wrappers or replacing mocking libraries.
testing
Scannable BDD tests written in domain language. Use when doing BDD.
development
Writes approval tests (snapshot/golden master testing) for Python, JavaScript/TypeScript, or Java. Use when verifying complex output, characterization testing legacy code, testing combinations, or working with .approved/.received files.