Skip to content
Hidden Logic Lab

Rename the module and keep the tests green

Cursor renames a module across imports and tells you which tests prove the rename is behavior-neutral.

·Coding·25 min·Working

A rename diff, the tests to run, and a list of strings it refused to touch.

  1. 1

    Pick a collision-free name

    Search the new name first. A rename onto an existing export is a different task.

  2. 2

    Read the refusal list

    The names it refused to touch are where a sloppy rename would have gone wrong.

  3. 3

    Run the tests

    Green is the point of the case. A rename without the test run stays local.

The prompt to paste

Rename [old module or symbol] to [new name] across this repository.

Rules:
- Update imports and references that point at the old name.
- Do not change behavior, copy, or tests except where the name itself appears.
- Do not rename similar words that are not this symbol. List the ones you refused.
- Do not reformat unrelated files.
- Finish with the test command that should stay green, and run it if you can.

If the new name collides with an existing export, stop and tell me.

String literals and event names often should not move. Check the refusal list before you force them.

Sample case written by Hidden Logic Lab. Not affiliated with Cursor.

More in Coding

Get new cases in your inbox

Weekly notes on new use cases and agent workflows. No product pitches.

Occasional notes on new cases. No product pitches in the first note.