Refactoring / safe structural change

Refactoring rules for AI agents.

Guidance for improving structure without changing observable behavior: small transformations, test protection, smell diagnosis, and stopping before cleanup turns into redesign.

refactoringcode smellstestsbehavior preservation

Use when

The task is cleanup, migration prep, review follow-up, or reducing complexity without feature changes.

Default version

Use mini for refactoring passes. Keep full as reference for deeper audit sessions.