Showing 28 verified skills. 284 preview entries are hidden until we confirm a real source. Show preview skills · Why?
Guide Cursor to use App Router patterns correctly every time
curl -o .cursorrules https://skills.dev/rules/nextjsOpinionated Next.js rules covering App Router patterns, server/client component boundaries, route handlers, and optimal data fetching.
This is the actual SKILL.md file that powers this skill. Copy it to install.
---
name: cursor-nextjs-rules
description: |
Cursor rules for Next.js App Router projects. Always active when working in a
Next.js project with Cursor. Enforces server component defaults, proper data
fetching, and App Router patterns.
---
# Next.js App Router Rules for Cursor
## Core rules
1. **Server components by default.** Never add "use client" unless the component
uses hooks, event handlers, or browser APIs. When you must use client code,
extract it into the smallest possible client component.
2. **Data fetching in server components.** Use `async` server components with
direct database/API calls. Never use `useEffect` for data fetching.
3. **Route handlers over API routes.** Use `app/api/*/route.ts` with named
exports (GET, POST, PUT, DELETE). Never use `pages/api`.
4. **Metadata API for SEO.** Export `metadata` or `generateMetadata` from
layouts and pages. Never use `<Head>` from next/head.
5. **Server Actions for mutations.** Use `"use server"` functions for form
submissions and data mutations. Revalidate with `revalidatePath` or
`revalidateTag`.
## File conventions
- `layout.tsx` - Shared UI that wraps child routes
- `page.tsx` - Unique route UI
- `loading.tsx` - Loading UI (Suspense boundary)
- `error.tsx` - Error boundary (must be client component)
- `not-found.tsx` - 404 UI
## Example: server component with data fetching
```tsx
// app/posts/page.tsx - NO "use client"
import { db } from "@/lib/db";
export default async function PostsPage() {
const posts = await db.query.posts.findMany();
return (
<ul>
{posts.map(p => <li key={p.id}>{p.title}</li>)}
</ul>
);
}
```
## Requirements
- Next.js 14+ with App Router
- TypeScript recommended
mkdir -p ~/.claude/skills/cursor-nextjs-rules~/.claude/skills/cursor-nextjs-rules/SKILL.mdResulting file structure:
~/.claude/
skills/
cursor-nextjs-rules/
SKILL.md <-- skill definitionSkills are loaded automatically by Claude Code when you start a new session. The skill name and description in the frontmatter determine when Claude triggers it.
Recommended from shared domain, career, and tool overlap with Next.js Project Rules
Generate typed API clients and webhook handlers from specs
Both used by Software Engineer
Audit your UI for WCAG compliance and fix accessibility issues
Both used by Software Engineer
Generate Storybook stories with controls and interaction tests
Both used by Software Engineer
Generate comprehensive error handling with recovery strategies
Both used by Software Engineer
Build GraphQL schemas with resolvers and type-safe client generation
Both used by Software Engineer
Extract strings, manage translations, and validate i18n completeness
Both used by Software Engineer
Next.js Project Rules