Legacy code / safe change rules

Working Effectively with Legacy Code rules for AI agents.

Rules for safely changing difficult, poorly tested code through characterization tests, dependency breaking, incremental isolation, sprout method, and wrap method.

legacy codecharacterization testsdependency breaking

Use when

The first goal is regaining control before changing behavior in poorly tested or hard-to-understand code.

Default version

Use mini for legacy-safe changes and review.

Good companions

Pair with Refactoring after tests or characterization are in place.