Refactor an oversized function

Smaller functions preserving the existing result.

Jump to the prompt
THE RESULT

Smaller functions preserving the existing result.

READY-TO-USE PROMPT
Refactor [FUNCTION] in [FILE] within [REPO]. First identify inputs, outputs and side effects. Extract clear stages without changing the public interface and run relevant tests. Explain the refactor's scope and the behavior verified.

Paste into a conversation with LocalCommander. Replace bracketed fields with your own paths, files or URLs.

THE WORKFLOW

From your material to a result.

  1. 01

    Prepare the inputs: File, function and existing tests.

  2. 02

    Replace square-bracket placeholders with the actual names, paths or URL. Paste the prompt into a chat with LocalCommander connected.

  3. 03

    Verify the result: Smaller functions preserving the existing result. Ask for the saved file location or the evidence behind the findings.