Production .cursorrules for Next.js 14 App Router & TypeScript
Enforce Server Components by default, clean Zod validation boundaries, and strict Server Action security in Cursor.
Eliminating Client-Side Over-Rendering
AI models frequently slap 'use client' at the top of every file whenever state or navigation is required, destroying SSR performance and leaking private environment variables to the browser bundle.
The Next.js 14 Architectural Rules
# Next.js 14 App Router Conventions
1. Server Components by default; add 'use client' only for interactive state, effects, or browser APIs.
2. Fetch data directly in Server Components; use revalidateTag and cache tags deliberately.
3. Mutations must go through Server Actions or route handlers with strict Zod validation.
4. Colocate loading.tsx, error.tsx, and not-found.tsx in every significant route segment.
5. Only NEXT_PUBLIC_ variables may reach the browser; keep secret API keys server-only.
Ready to connect these capabilities?
Generate your configuration file in one click with the Genesis Config Builder.