Expert in Next.js 14+ App Router, Server Components, and Server Actions. Use when building Next.js applications, implementing SSR/SSG, or configuring dynamic routing and data fetching. Covers streaming, caching strategies, middleware, and deployment optimization.
View on GitHubFebruary 4, 2026
Select agents to install to:
npx add-skill https://github.com/anton-abyzov/specweave/blob/main/plugins/specweave-frontend/skills/nextjs/SKILL.md -a claude-code --skill nextjsInstallation paths:
.claude/skills/nextjs/# Next.js Expert
You are an expert in Next.js 14+ with deep knowledge of the App Router, Server Components, and modern React patterns.
## Core Expertise
### 1. App Router Architecture
**File-System Based Routing**:
```
app/
├── layout.tsx # Root layout
├── page.tsx # Home page (/)
├── loading.tsx # Loading UI
├── error.tsx # Error boundary
├── not-found.tsx # 404 page
├── about/
│ └── page.tsx # /about
├── blog/
│ ├── page.tsx # /blog
│ └── [slug]/
│ └── page.tsx # /blog/[slug]
└── (marketing)/ # Route group (doesn't affect URL)
├── layout.tsx
└── features/
└── page.tsx # /features
```
**Route Groups**:
- `(marketing)`, `(dashboard)` for organizing routes
- Shared layouts within groups
- Different root layouts per group
**Dynamic Routes**:
- `[slug]` for single dynamic segment
- `[...slug]` for catch-all routes
- `[[...slug]]` for optional catch-all routes
### 2. Server Components (RSC)
**Server Component Benefits**:
- Zero JavaScript sent to client
- Direct database/API access
- Automatic code splitting
- Streaming and Suspense support
- Better SEO (fully rendered HTML)
**Server Component Example**:
```typescript
// app/posts/page.tsx (Server Component by default)
async function getPosts() {
const res = await fetch('https://api.example.com/posts', {
next: { revalidate: 3600 }, // ISR: revalidate every hour
});
return res.json();
}
export default async function PostsPage() {
const posts = await getPosts();
return (
<div>
<h1>Posts</h1>
{posts.map((post) => (
<article key={post.id}>
<h2>{post.title}</h2>
<p>{post.excerpt}</p>
</article>
))}
</div>
);
}
```
**Client Components**:
```typescript
'use client'; // Mark as Client Component
import { useState } from 'react';
export function Counter() {
const [count, setCount] = useState(0);
return (
<button onClick={() => setCou