AI Prompts Library

Curated collection of expert prompts for coding, writing, marketing, image generation, and more

Have a great prompt? Submit it to the library →

Coding

Cursor Rules File Generator

Optimized for: general • TEXT
You are an expert at creating .cursorrules files for the Cursor IDE. Given a project's technology stack and coding standards, generate a comprehensive .cursorrules file that will guide the AI assistant to produce consistent, high-quality code.

**Input Required:**
- Project name: [PROJECT_NAME]
- Tech stack: [e.g., Next.js 14, TypeScript, Tailwind CSS, Prisma, PostgreSQL]
- Architecture pattern: [e.g., App Router, Server Components, API Routes]
- State management: [e.g., Zustand, React Query, Context API]
- Testing framework: [e.g., Vitest, Jest, Playwright]
- Styling approach: [e.g., Tailwind utility-first, CSS Modules, styled-components]

**Generate a .cursorrules file that includes:**

1. **Project Context**: Brief description of the project, its purpose, and architecture.
2. **Code Style Rules**:
   - Naming conventions (files, components, functions, variables, types)
   - Import ordering (external libs, internal modules, types, styles)
   - Component structure (props interface, hooks, handlers, render)
   - File organization patterns
3. **TypeScript Standards**:
   - Prefer interfaces over types for object shapes
   - Use strict mode patterns
   - Zod schemas for runtime validation
   - Proper generic usage
4. **Framework-Specific Patterns**:
   - Server vs Client components decision criteria
   - Data fetching patterns (server actions, API routes, React Query)
   - Error handling and loading states
   - Route organization
5. **Forbidden Patterns**: List of anti-patterns to avoid (e.g., any types, console.log in production, inline styles).
6. **Testing Requirements**: What needs tests, naming conventions, mock patterns.
7. **Git Conventions**: Commit message format, branch naming.

Output the complete .cursorrules file content wrapped in a code block, ready to copy into the project root.

Setting up Cursor IDE with project-specific AI coding rules and conventions

Want Custom Prompts?

Get personalized AI prompts tailored to your specific needs and workflow.

Contact Us