Simplify the code. Preserve its behavior.

Split an overloaded module, remove duplication or prepare for a feature. Keep the change small enough for your team to review with confidence.

Establish the contract

Before editing, identify inputs, outputs, side effects and call sites. Extracting an API client, for example, must preserve error handling, retries and response formats.

Follow a clear change plan

Choose one module and set constraints: preserve the public interface, add no dependencies and avoid reformatting the whole project. Ask for an explanation of each responsibility moved.

Compare behavior before and after

Use existing tests and fill meaningful gaps. Review the diff, call-site compatibility and execution results. A shorter file is useful when the behavior remains correct.

Start with your team's project

Download Desktop, connect your project and start with a task whose result you can verify.