clean-code
Installation
SKILL.md
Clean Code
Make existing code easier to read, change, and test. Every edit is behavior-preserving unless the request changes behavior: public APIs, side effects, errors and their messages, performance, edge cases, and data shapes all stay put. Code with no test net goes through safe-incremental-coding first.
Act or assess: a review request gets findings ordered by severity with file:line, and no edits.
Classify the work
- Local cleanup: names, constants, simple extraction, control-flow clarity.
- Refactor: behavior-preserving structural change.
- Bug fix plus cleanup: only when a behavior change is allowed or the requested bug is clear.
- Redesign is out of scope unless requested. If the safe path needs redesign, new dependencies, or behavior change beyond the request, stop and report that option.
Keep the change to the smallest coherent shape on the requested path, one logical improvement at a time.
Smell catalogue
Diagnose by name. Name the smell before you change anything; the name picks the fix and keeps the change honest. Use the term of art, never a paraphrase.