clean-code-refactoring

Installation
SKILL.md

Safe refactoring (behaviour unchanged)

Scanner path: commands below assume tools/cc-scan.py / tools/arch-scan.py are in the repo. If they are not, the same scanners may be on PATH as cc-scan / arch-scan (identical flags) — see INSTALL.md §1b. If neither exists, ask for the report instead of guessing numbers.

0. Four preconditions before you touch a key

  1. Behaviour is locked — tests are green, or you have characterization/snapshot tests (§4) proving exact input→output.
  2. Small scope — one function, one problem class, one atomic commit.
  3. No behaviour change — anything that alters logic is a separate feature/bugfix commit.
  4. No micro-fragmentation — do not split cohesive logic into single-use 3-line helpers.

If any of these is false, stop and lock it first.

1. Pick the refactoring by symptom

Installs
10
First Seen
Sep 11, 2026