Cursor·Prompt

Cursor Prompt: Refactor and Clean Up a Codebase

When to Use This Prompt

Use this after your initial MVP is working but the code is messy. Best applied to one directory at a time rather than the entire codebase.

The Prompt

Refactor the following aspects of this codebase:

1. Extract repeated logic into shared utility functions
2. Replace any `any` types with proper TypeScript types
3. Move inline styles to Tailwind CSS classes
4. Split large components (>200 lines) into smaller, focused components
5. Add error boundaries and loading states where missing
6. Ensure consistent naming conventions (camelCase for functions, PascalCase for components)

Do NOT change any business logic or user-facing behavior. Only improve code organization and type safety.

What to Customize

Adjust the specific refactoring targets based on your codebase's issues. Add or remove items from the list depending on your priorities.

Expected Output

Cursor will systematically go through files, extracting shared logic, fixing types, and splitting components. Expect cleaner imports, better type coverage, and smaller files.