Refactor complex functions into clean, testable, well-named smaller functions following SOLID principles.
Refactor this code following these principles: 1. Extract functions that do more than one thing into single-responsibility functions 2. Replace magic numbers and strings with named constants 3. Simplify nested conditionals (use early returns, guard clauses) 4. Extract repeated logic into shared utility functions 5. Use descriptive variable names that explain intent, not implementation 6. Replace imperative loops with declarative array methods where clearer 7. Add TypeScript types to any untyped parameters or returns 8. Remove dead code and unused imports 9. Preserve ALL existing behavior — this is refactoring, not feature work 10. Add brief comments only where the WHY is non-obvious Do NOT: - Change the public API/interface - Add new dependencies - Rename exported functions/classes (would break consumers) - Gold-plate or over-engineer
Generate optimized .cursorrules files tailored to your project's tech stack, conventions, and team preferences. Covers TypeScript, Python, Rust, Go, and more.
Leverage Cursor's Agent mode to build complete features end-to-end. Handles file creation, terminal commands, dependency installation, and multi-file edits in one flow.
Generate complete React components with TypeScript types, props interface, stories, and unit tests in one prompt.
Generate robust Next.js API routes with Zod validation, error handling, rate limiting, and TypeScript types.
Design database tables with proper types, constraints, indexes, and migration files for PostgreSQL/Supabase.
Generate FastAPI endpoints with Pydantic request/response models, dependency injection, and async database operations.