Windsurf Prompt: Refactor with Cascade
When to Use This Prompt
Use this when your codebase has grown messy and needs systematic cleanup. Cascade handles multi-step refactoring well.
The Prompt
Use Cascade to refactor this codebase: Step 1: Identify all files with duplicated logic and list them. Step 2: Extract shared utilities into a /lib/utils folder. Step 3: Replace all instances of duplicated code with imports from the new utilities. Step 4: Add TypeScript types to any untyped functions. Step 5: Update all imports to use path aliases (@/) instead of relative paths. Step 6: Run the build to verify nothing is broken. Rules: - Do NOT change any functionality or user-facing behavior - Keep all existing tests passing - Add JSDoc comments to extracted utility functions - Create a CHANGELOG.md entry summarizing changes
What to Customize
Add specific files or patterns you want Cascade to focus on. Adjust the refactoring rules for your coding standards.
Expected Output
Cleaner codebase with extracted utilities, consistent imports, and TypeScript types. Multiple files modified systematically.