Plan a safe, step-by-step refactor — diagnoses the structural problems, recommends a strategy, and sequences the changes so the code stays working at every step. Free template — copy and paste into ChatGPT, Claude, or Copilot.