RunPrompt Pro
cursor Vibe Coding Essential
β˜… 4.99 (7.890 uses)

Cursor AI (.cursorrules) for Next.js 15, React 19 & Tailwind CSS

Stops Cursor from writing outdated Next.js 13 patterns, Pages Router syntax, or deprecated React hooks. Enforces strict TypeScript, Server Actions, and modular clean architecture.

Verified for 2026 Engine Updates β€’ Last Updated: 2026-10-29

Parametric Customizer & Compiler Live Tool

Adjust the variables below. The prompt code and API payload update dynamically in real time.

7890 uses

Specifies how Cursor should generate class names and modal/dialog primitives.

Tells Cursor which state paradigm to follow.

Ensures Cursor writes typesafe queries matching your schema.

Ready-to-Run Compiled Prompt
0 words β€’ 0 tokens β€’ Est: <$0.0001
# CURSOR RULES FOR NEXT.JS 15 (APP ROUTER) & TAILWIND CSS

You are an expert Senior Fullstack Architect specialized in Next.js 15, React 19, TypeScript, and Tailwind CSS.

### TECH STACK REQUIREMENTS:
- Framework: Next.js 15 with App Router
- React: Version 19 (use Server Components by default; add 'use client' ONLY when state/effects are required)
- Styling: Tailwind CSS v3.4 + Radix UI (shadcn/ui primitives)
- State Management: URL SearchParams + React 19 useActionState & useOptimistic
- Database & ORM: Drizzle ORM with PostgreSQL (Supabase / Neon)
- Validation: Zod for schema and form inputs

### CORE CODING PRINCIPLES:
1. **Server vs. Client Separation**:
   - Default to React Server Components (RSC) for all pages, layouts, and data fetching components.
   - Isolate client interactivity (onClick, onChange, hooks) into small, focused leaf components.
   - Never import server-only secrets or ORM models into client components.

2. **Data Fetching & Mutations**:
   - Use Next.js 15 Server Actions (`'use server'`) for all form submissions and mutations.
   - Always validate incoming Server Action payloads with Zod schemas.
   - Use `revalidatePath` and `revalidateTag` for granular cache invalidation.

3. **Component Architecture**:
   - Follow standard feature-based or domain-driven modular structure.
   - Avoid monolithic files. Break UI into reusable primitives under `/components/ui`.
   - Use early returns and guard clauses for error handling.

4. **Accessibility & Clean UI**:
   - Enforce WCAG 2.1 AA contrast compliance.
   - Include responsive mobile-first Tailwind utility classes.
   - Do NOT emit deprecated `next/router` or Pages Router syntax.
Get Cursor Editor (Free Download)

The AI-first code editor built for lightning-fast pair programming.

⚑
Featured AI Partner Verified

Leonardo Phoenix & Flux: Generate photorealistic studio assets with 150 daily free credits. Zero setup required.

πŸ“Έ Real Sample Outputs & Verified Results

Visual evidence and benchmark responses generated using this exact prompt formula.

### How to apply this rule in Cursor: 1. In your project root, create a file named `.cursorrules`. 2. Paste this generated prompt into that file. 3. Whenever you hit `Cmd+K` or `Cmd+L`, Cursor automatically loads these constraints as a background system prompt.
Direct drop-in `.cursorrules` file for zero-hallucination Next.js 15 generation.

πŸ”¬ Prompt Engineering Anatomy

Why this prompt consistently delivers high-tier results: technical parameter breakdown.

1 Enforced React 19 Server Components Default

Cursor frequently inserts 'use client' at the top of every file out of habit from older training data. Explicitly forbidding 'use client' on data-fetching wrappers forces clean RSC architecture.

PRO TIP: Placing this in `.cursorrules` saves you up to 30 minutes of manual refactoring per feature.
2 Next.js 15 Server Action Validation with Zod

Guarantees that your AI coding assistant generates safe, sanitised backend endpoints rather than trusting raw client form data.

PRO TIP: Pair with `useActionState` for seamless pending states and optimistic UI updates.

πŸ’¬ Frequently Asked Questions

Troubleshooting common edge cases, model incompatibilities, and best practices.

Can I use this with Windsurf, Copilot, or Claude Dev (Cline)?

Yes! For Windsurf, place it in `.windsurfrules`. For Cline or Claude Dev, place it inside your workspace `.clinerules` or custom system prompt.

Does this work with Cursor Composer (Cmd+I)?

Yes, Cursor Composer fully respects project root `.cursorrules` across all generated files.

Explore Related AI Coding & Rulesets Prompts View all β†’

πŸš€ Community Showcase

Submit Your Proven AI Prompt

Share your best prompt formula. Approved prompts get featured on RunPrompt with a backlink to your profile or website!

Prompts & Generative Tools
flux Cyberpunk Tokyo Streetwear Character Portrait Generator
Character & Fashion Concepts
claude ATS-Proof Executive Resume & Metric-Driven CV Rewrite Prompt
Career & Executive Growth
deepseek DeepSeek R1 Architecture & Security Vulnerability Code Auditor
AI Coding & Rulesets
cursor Cursor AI (.cursorrules) for Next.js 15, React 19 & Tailwind CSS
AI Coding & Rulesets
midjourney Luxury Perfume Studio Product Photography Prompt Generator
E-Commerce & Product Mockups
chatgpt High-Converting B2B SaaS Landing Page Copy Mega-Prompt
Direct Response Copywriting
cursor FastAPI, PostgreSQL & Supabase Production (.cursorrules)
AI Coding & Rulesets
flux Cinematic AI Video Camera Movement & Motion Generator
AI Video & Camera Motion
midjourney Minimalist 3D Claymorphic iOS App Icon & Logo Generator
Logos & App Icons
claude Viral Twitter / X Long-Form Educational Thread Architect
Social Media & Viral Growth
midjourney Malibu Oceanfront Brutalist Luxury Villa Architectural Digest Render
Architecture & Interior Design
cursor React Native & Expo Router Mobile App Production (.cursorrules)
AI Coding & Rulesets
claude 2026 Google AI Overviews & Semantic Entity Cluster Architecture Mega-Prompt
Search Strategy & Semantic SEO
midjourney Amazon A+ Content & Shopify Lifestyle Product Mockup Generator
E-Commerce & Amazon A+
deepseek Solidity Smart Contract Reentrancy & Flash Loan Attack Auditor
Blockchain & Smart Contracts
claude Hyper-Personalized B2B Cold Email Sequence with 40%+ Open Rates
B2B Sales & Cold Outreach
flux Invisible Ghost Mannequin Apparel & Fashion Mockup Generator
Fashion & Ghost Mannequin
flux Surreal Seamless Morphing & Physics Transformation Video Prompt
AI Video & Camera Motion
↑ ↓ Navigate ↡ Select
RunPrompt Spotlight
πŸ•’

Recent Generations

Your last 10 customized prompts generated in this session. Saved privately in your browser.

No recent prompts yet. Customize and copy any prompt to see your history here!
0 items stored