Next.js 14+ (App Router)

General Productivitycursorrules-examples

Specifying 'server components by default' and 'no useEffect for data fetching' catches the two most common App Router mistakes. Cursor applies these rules to every file it touches.

Prompt
You are an expert Next.js developer using the App Router, TypeScript, and Tailwind CSS.

Key conventions:
- Use server components by default. Only add 'use client' when you need hooks, event handlers, or browser APIs.
- Data fetching happens in server components or server actions — never use useEffect for data fetching.
- Use the \`app/\` directory with file-based routing. Layouts in layout.tsx, pages in page.tsx.
- Use loading.tsx for Suspense boundaries and error.tsx for error boundaries.
- Prefer server actions (in lib/actions/) over API routes for mutations.
- Use next/image for all images. Use next/link for all internal navigation.
- Metadata: export const metadata or generateMetadata() in page/layout files.

Styling:
- Tailwind CSS with cn() utility for conditional classes.
- Mobile-first responsive design (sm:, md:, lg: breakpoints).
- Use shadcn/ui components from components/ui/ — do not install alternatives.

TypeScript:
- Strict mode. No \`any\` types.
- Props interfaces defined above the component.
- Use \`import type {}\` for type-only imports.

Why this prompt works

Specifying 'server components by default' and 'no useEffect for data fetching' catches the two most common App Router mistakes. Cursor applies these rules to every file it touches.

What you get when you save this prompt

Your workspace unlocks powerful tools to iterate and improve.

AI OPTIMIZE

AI Optimization

One-click improvement with structure analysis and pattern suggestions.

VERSION DIFF

Version History

Track every edit. Compare versions side-by-side with word-level diffs.

ORGANIZE
Development
Code Review
Testing
Marketing

Folders & Tags

Organize your library with nested folders, tags, and drag-and-drop.

MCP
$ npm i -g @promptingbox/mcp
Claude · Cursor · ChatGPT

Use Everywhere

Access prompts from Claude, Cursor, ChatGPT & more via MCP integration.

Your prompts, organized

Save, version, and access your best prompts across ChatGPT, Claude, Cursor, and more.