Generate thorough unit test suites with edge cases, mocking, and coverage for any function or module.
Write a comprehensive test suite for [function/module]. Requirements: - Test the happy path with typical inputs - Test edge cases: empty inputs, null/undefined, boundary values - Test error conditions: invalid inputs, network failures, timeouts - Mock external dependencies (API calls, database, file system) - Use descriptive test names that explain the expected behavior - Group related tests with describe blocks - Add setup/teardown (beforeEach/afterEach) where needed - Test async operations with proper await/Promise handling - Verify error messages and error types, not just that errors are thrown - Include snapshot tests only if output is complex and stable - Aim for branch coverage, not just line coverage - Add comments explaining WHY edge cases matter - Follow AAA pattern: Arrange, Act, Assert
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.