Skip to main content
Refactors are safest when broken into checkpoints.

Checkpoint plan

  1. Plan: map target modules and constraints.
  2. Structural: move/rename/reorganize with minimal behavior changes.
  3. Behavior parity: ensure outputs remain equivalent.
  4. Cleanup: remove leftovers and simplify.

Prompt pattern

Refactor <scope>.
Checkpoint 1: produce the structural change only.
Do not change behavior yet.
Summarize changed files and expected next checkpoint.
After each checkpoint, review diff and either:
  • approve next checkpoint
  • request correction before continuing

Signals to pause immediately

  • large unrelated edits
  • unclear validation
  • changes that mix structure + behavior without explanation