Refactor by removing backward compatibility and legacy layers. Use when modernizing APIs, cleaning up migration debt, removing compat shims, or eliminating stale feature flags.
name: refactor-break-bw-compat
description: "Refactor by removing backward compatibility and legacy layers. Use when modernizing APIs, cleaning up migration debt, removing compat shims, or eliminating stale feature flags."
Breaking Refactors — Freedom Through Structure
Compatibility layers are coupling debt with interest. Every compat shim is a decision deferred, not a decision avoided. Break cleanly, break once, break with evidence.
Principles
No half-measures. A partial migration is worse than no migration — it doubles the surface area and confuses every reader.
One migration direction. Old-to-new only. Never add new-to-old adapters; that entrenches the old path.
Blast radius awareness. Map every consumer before removing anything. Surprise breakage is a planning failure, not a courage signal.
Dead code is a lie. "Just in case" code is not dead — it actively misleads readers about what the system does.
Compat shims are temporary. If a shim has no removal date, it is permanent. If it is permanent, it is architecture. Decide which.
Reconnaissance Checklist
Before breaking anything, find and catalog:
@deprecated / #[deprecated] / warnings.warn markers — especially ones without removal versions