legacy-code-safety

Installation
SKILL.md

Legacy Code Safety

Legacy code is code without a sufficient test safety net. The goal is not to make it beautiful first; the goal is to make it safe to change.

Principles

  • Capture current behavior before refactoring.
  • Treat current observable behavior as the contract until explicitly changed.
  • Search for seams before structural changes.
  • Break dependencies minimally to enable characterization tests.
  • Refactor incrementally in small, reversible steps.
  • Separate behavior-preserving refactor from functional change.
  • Validate after every step.
  • Protect public contracts.
  • Document rollback before implementation begins.

Legacy Code Change Algorithm

Every safe change to legacy code follows the same pipeline: (1) identify change points, (2) find test points, (3) break dependencies, (4) write characterization tests, (5) change and refactor. Plans over legacy code should make these five steps recognizable in their task ordering.

Installs
4
First Seen
Jul 12, 2026
legacy-code-safety — andresnator/agents-orchestrator