Create React error boundaries with proper fallback UIs, error logging, and recovery mechanisms.
Create an error boundary component for [area]. Requirements: - Class component extending React.Component with componentDidCatch - TypeScript with proper generic types for error and errorInfo - Fallback UI with: - User-friendly error message (not raw stack traces) - "Try Again" button that resets the error state - Option to reload the page as last resort - Visual design matching the app's existing error/empty states - Log errors to your error tracking service (Sentry, etc.) - Include error context: component tree, user action, timestamp - Create a useErrorBoundary hook for functional component error throwing - Add a higher-order component (withErrorBoundary) wrapper - Handle different error types with different fallbacks - Don't catch errors in event handlers (those need try/catch) - Reset error state when navigation changes (if using React Router)
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.