Refactor Improve code shape without changing behavior. Use this when the user asks to refactor, simplify, tidy, clean up, reduce duplication, improve design, or make code easier to maintain. Workflow 1. Understand - Use , specified files, , staged changes, or the latest commit. - If staged changes exist, review ; otherwise review . - If there are no Git changes, review the most recently modified files named by the user or touched in the current task. - Read the target code, surrounding patterns, tests, contracts, invariants, and verification commands. - Identify what behavior must stay the sa…