Multi-File Refactor

Developer Toolscursor-vs-claude-codemodule_namecurrent_patterntarget_pattern

Both tools handle multi-file refactors but approach them differently. Cursor's Composer mode executes this as a planned sequence of edits. Claude Code runs it autonomously, reading files and making changes in a single session.

Prompt
Refactor the {{module_name}} module from {{current_pattern}} to {{target_pattern}}.

Scope:
- Files to change: all files in {{directory_path}} and their imports
- Preserve all existing functionality — no behavior changes
- Maintain backward compatibility for any exported public API

Steps:
1. List all files that will be affected before making changes
2. Create the new structure/pattern first
3. Migrate each file, updating imports as you go
4. Update all tests to match the new pattern
5. Run the existing test suite and fix any failures

Constraints:
- No temporary "bridge" code — do the full migration in one pass
- Update barrel exports (index.ts) if they exist
- Add JSDoc comments to any new public interfaces
- If a file exceeds 300 lines after refactoring, split it and explain the split

After completing, provide a summary: files changed, files created, files deleted, and any decisions you made.

Variables to customize

{{module_name}}{{current_pattern}}{{target_pattern}}{{directory_path}}

Why this prompt works

Both tools handle multi-file refactors but approach them differently. Cursor's Composer mode executes this as a planned sequence of edits. Claude Code runs it autonomously, reading files and making changes in a single session.

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.