clean-code-refactoring
Installation
SKILL.md
Safe refactoring (behaviour unchanged)
Scanner path: commands below assume
tools/cc-scan.py/tools/arch-scan.pyare in the repo. If they are not, the same scanners may be onPATHascc-scan/arch-scan(identical flags) — seeINSTALL.md§1b. If neither exists, ask for the report instead of guessing numbers.
0. Four preconditions before you touch a key
- Behaviour is locked — tests are green, or you have characterization/snapshot tests (§4) proving exact input→output.
- Small scope — one function, one problem class, one atomic commit.
- No behaviour change — anything that alters logic is a separate feature/bugfix commit.
- 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.