improve
Installation
SKILL.md
Improve
Make code easier to understand without changing what it does. Reduce the layers a reader must trace and the hidden state they must remember.
Process
- Identify the target from the request, current diff, or recently changed code.
- Read the target, its tests, and relevant surrounding code. State the behavior that must not change.
- If that behavior lacks tests, add focused coverage and run it against the unchanged code. Commit the passing test-only change before refactoring. If automated tests cannot exercise the behavior, explain why and give other evidence.
- Find unnecessary complexity, duplication, dead code, weak names, awkward boundaries, and abstractions that cost more than they help. Ask of each important value: can a new reader say where it comes from and what can change it?
- Delete first: remove dead code and redundant checks before you reshape what is left. Then make focused improvements by deduplicating, renaming, simplifying, extracting, or inlining.
- Preserve public interfaces, data shapes, errors, and user-visible behavior unless the user explicitly asks to change them.
- Run tests and checks that cover behavior the refactor can affect. Report what improved, what behavior was preserved, and the evidence.
Return
State what became simpler, what behavior stayed the same, and which checks prove it. Name any behavior that remains unverified.