Ask the user what to refactor. Then:
- Before changing, run
npm run typecheck && npm test && npm run buildto record the baseline - Perform the refactoring
- Run it again and verify it passes
- Tell the user what was changed
The user only needs to know the result, not take part in the process.