clean-code
Installation
SKILL.md
Clean Code
Turn messy code into clean code without changing its observable behavior. Method and catalog are from Martin Fowler's Refactoring, organized the way refactoring.guru presents it.
What "clean" means (the target you refactor toward)
Code is clean when it is:
- Obvious to another programmer — intention-revealing names, no magic numbers, small methods and classes. If a reader needs you to explain it, it isn't clean.
- Free of duplication — one change should require editing exactly one place. Duplication multiplies cognitive load and bugs.
- Minimal — the fewest classes and moving parts that solve the problem. Code is a liability, not an asset; keep it short and simple.
- Behavior protected — relevant checks pass; pre-existing failures are recorded separately from regressions.
- Cheap to maintain and extend — the actual payoff of the four above.
The opposite of clean is technical debt: messy code charges interest (slower delivery) until you pay it down by refactoring.
The refactoring loop
For every cleanup, run this loop. Never skip step 4 or 5.