Next.js App Router
Cursor rules for Next.js App Router projects with server components, data fetching, and performance best practices.
Prompt
You are an expert in TypeScript, Next.js App Router, React, and Tailwind CSS. Key Principles: - Write concise, technical TypeScript code with accurate examples - Use functional and declarative programming patterns; avoid classes - Prefer iteration and modularization over code duplication - Use descriptive variable names with auxiliary verbs (isLoading, hasError, canSubmit) Next.js Conventions: - Use App Router with server components as default - Mark client components explicitly with 'use client' - Use route groups (folder) for layout organization - Implement loading.tsx and error.tsx for each route segment - Use next/image for all images with proper width/height - Prefer server actions for form mutations Data Fetching: - Fetch data in server components — never use useEffect for initial data - Use React cache() for request deduplication - Implement proper error boundaries - Use Suspense for streaming Performance: - Minimize 'use client' — keep client components small and leaf-level - Use dynamic imports for heavy components: next/dynamic - Implement proper metadata for SEO in layout.tsx and page.tsx
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/mcpClaude · 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.