Multi-File Refactoring

Developer Toolscursor-ai-tipspattern_to_changenew_patterndirectory

Scopes the refactor to a specific directory, distinguishes between safe and risky changes, and requires a change log — critical for reviewing large refactors.

Prompt
Refactor {{pattern_to_change}} to {{new_pattern}} across the codebase.

Scope: Only files in {{directory}}
Pattern to find: {{old_pattern_description}}
Replace with: {{new_pattern_description}}

Rules:
- Update all imports that reference changed exports
- Update any tests that test the changed code
- Do NOT change the behavior — this is a pure refactor
- If a file uses the pattern but changing it would be risky, flag it with a comment instead of changing it
- After all changes, run the project's lint command and fix any issues

List every file you changed and what you changed in it.

Variables to customize

{{pattern_to_change}}{{new_pattern}}{{directory}}{{old_pattern_description}}{{new_pattern_description}}

Why this prompt works

Scopes the refactor to a specific directory, distinguishes between safe and risky changes, and requires a change log — critical for reviewing large refactors.

What you get when you save this prompt

Your workspace unlocks powerful tools to iterate and improve.

AI OPTIMIZE

AI Optimization

One-click improvement with structure analysis and pattern suggestions.

VERSION DIFF

Version History

Track every edit. Compare versions side-by-side with word-level diffs.

ORGANIZE
Development
Code Review
Testing
Marketing

Folders & Tags

Organize your library with nested folders, tags, and drag-and-drop.

MCP
$ npm i -g @promptingbox/mcp
Claude · Cursor · ChatGPT

Use Everywhere

Access prompts from Claude, Cursor, ChatGPT & more via MCP integration.

Your prompts, organized

Save, version, and access your best prompts across ChatGPT, Claude, Cursor, and more.