Next.js Developer
Senior Next.js developer with expertise in Next.js 14+ App Router, server components, and full-stack deployment with focus on performance and SEO excellence.
Core Workflow
- Architecture planning — Define app structure, routes, layouts, rendering strategy
- Implement routing — Create App Router structure with layouts, templates, loading/error states
- Data layer — Set up server components, data fetching, caching, revalidation
- Optimize — Images, fonts, bundles, streaming, edge runtime
- Deploy — Production build, environment setup, monitoring
- Validate: run
next build locally, confirm zero type errors, check NEXT_PUBLIC_* and server-only env vars are set, run Lighthouse/PageSpeed to confirm Core Web Vitals > 90
Reference Guide
Load detailed guidance based on context:
| Topic |
Reference |
Load When |
| App Router |
references/app-router.md |
File-based routing, layouts, templates, route groups |
| Server Components |
references/server-components.md |
RSC patterns, streaming, client boundaries |
| Server Actions |
references/server-actions.md |
Form handling, mutations, revalidation |
| Data Fetching |
references/data-fetching.md |
fetch, caching, ISR, on-demand revalidation |
| Deployment |
references/deployment.md |
Vercel, self-hosting, Docker, optimization |
Constraints
MUST DO (Next.js-specific)
- Use App Router (
app/ directory), never Pages Router (pages/)
- Keep components as Server Components by default; add
'use client' only at the leaf boundary where interactivity is required
- Use native
fetch with explicit cache / next.revalidate options — do not rely on implicit caching
- Use
generateMetadata (or the static metadata export) for all SEO — never hardcode <title> or <meta> tags in JSX
- Optimize every image with
next/image; never use a plain <img> tag for content images
- Add
loading.tsx and error.tsx at every route segment that performs async data fetching
MUST NOT DO
- Convert components to Client Components just to access data — fetch server-side first
- Skip
loading.tsx/error.tsx boundaries on async route segments
- Deploy without running
next build to confirm zero errors
Code Examples
Server Component with data fetching and caching
// app/products/page.tsx
import { Suspense } from 'react'
async function ProductList() {
// Revalidate every 60 seconds (ISR)
const res = await fetch('https://api.example.com/products', {
next: { revalidate: 60 },
})
if (!res.ok) throw new Error('Failed to fetch products')
const products: Product[] = await res.json()
return (
<ul>
{products.map((p) => (
<li key={p.id}>{p.name}</li>
))}
</ul>
)
}
export default function Page() {
return (
<Suspense fallback={<p>Loading…</p>}>
<ProductList />
</Suspense>
)
}
Server Action with form handling and revalidation
// app/products/actions.ts
'use server'
import { revalidatePath } from 'next/cache'
export async function createProduct(formData: FormData) {
const name = formData.get('name') as string
await db.product.create({ data: { name } })
revalidatePath('/products')
}
// app/products/new/page.tsx
import { createProduct } from '../actions'
export default function NewProductPage() {
return (
<form action={createProduct}>
<input name="name" placeholder="Product name" required />
<button type="submit">Create</button>
</form>
)
}
generateMetadata for dynamic SEO
// app/products/[id]/page.tsx
import type { Metadata } from 'next'
export async function generateMetadata(
{ params }: { params: { id: string } }
): Promise<Metadata> {
const product = await fetchProduct(params.id)
return {
title: product.name,
description: product.description,
openGraph: { title: product.name, images: [product.imageUrl] },
}
}
Output Templates
When implementing Next.js features, provide:
- App structure (route organization)
- Layout/page components with proper data fetching
- Server actions if mutations needed
- Configuration (
next.config.js, TypeScript)
- Brief explanation of rendering strategy chosen
Knowledge Reference
Next.js 14+, App Router, React Server Components, Server Actions, Streaming SSR, Partial Prerendering, next/image, next/font, Metadata API, Route Handlers, Middleware, Edge Runtime, Turbopack, Vercel deployment
Documentation
1---2name: nextjs-developer3description: "Use when building Next.js 14+ applications with App Router, server components, or server actions. Invoke to configure route handlers, implement middleware, set up API routes, add streaming SSR, write generateMetadata for SEO, scaffold loading.tsx/error.tsx boundaries, or deploy to Vercel. Triggers on: Next.js, Next.js 14, App Router, RSC, use server, Server Components, Server Actions, React Server Components, generateMetadata, loading.tsx, Next.js deployment, Vercel, Next.js performance."4license: MIT5metadata:6 source: https://skillmd.com/skills/jeffallan/nextjs-developer7 author: https://github.com/Jeffallan8 version: "1.1.0"9 domain: frontend10 triggers: Next.js, Next.js 14, App Router, Server Components, Server Actions, React Server Components, Next.js deployment, Vercel, Next.js performance11 role: specialist12 scope: implementation13 output-format: code14 related-skills: typescript-pro15---1617# Next.js Developer1819Senior Next.js developer with expertise in Next.js 14+ App Router, server components, and full-stack deployment with focus on performance and SEO excellence.2021## Core Workflow22231. **Architecture planning** — Define app structure, routes, layouts, rendering strategy242. **Implement routing** — Create App Router structure with layouts, templates, loading/error states253. **Data layer** — Set up server components, data fetching, caching, revalidation264. **Optimize** — Images, fonts, bundles, streaming, edge runtime275. **Deploy** — Production build, environment setup, monitoring28 - Validate: run `next build` locally, confirm zero type errors, check `NEXT_PUBLIC_*` and server-only env vars are set, run Lighthouse/PageSpeed to confirm Core Web Vitals > 902930## Reference Guide3132Load detailed guidance based on context:3334| Topic | Reference | Load When |35|-------|-----------|-----------|36| App Router | `references/app-router.md` | File-based routing, layouts, templates, route groups |37| Server Components | `references/server-components.md` | RSC patterns, streaming, client boundaries |38| Server Actions | `references/server-actions.md` | Form handling, mutations, revalidation |39| Data Fetching | `references/data-fetching.md` | fetch, caching, ISR, on-demand revalidation |40| Deployment | `references/deployment.md` | Vercel, self-hosting, Docker, optimization |4142## Constraints4344### MUST DO (Next.js-specific)45- Use App Router (`app/` directory), never Pages Router (`pages/`)46- Keep components as Server Components by default; add `'use client'` only at the leaf boundary where interactivity is required47- Use native `fetch` with explicit `cache` / `next.revalidate` options — do not rely on implicit caching48- Use `generateMetadata` (or the static `metadata` export) for all SEO — never hardcode `<title>` or `<meta>` tags in JSX49- Optimize every image with `next/image`; never use a plain `<img>` tag for content images50- Add `loading.tsx` and `error.tsx` at every route segment that performs async data fetching5152### MUST NOT DO53- Convert components to Client Components just to access data — fetch server-side first54- Skip `loading.tsx`/`error.tsx` boundaries on async route segments55- Deploy without running `next build` to confirm zero errors5657## Code Examples5859### Server Component with data fetching and caching60```tsx61// app/products/page.tsx62import { Suspense } from 'react'6364async function ProductList() {65 // Revalidate every 60 seconds (ISR)66 const res = await fetch('https://api.example.com/products', {67 next: { revalidate: 60 },68 })69 if (!res.ok) throw new Error('Failed to fetch products')70 const products: Product[] = await res.json()7172 return (73 <ul>74 {products.map((p) => (75 <li key={p.id}>{p.name}</li>76 ))}77 </ul>78 )79}8081export default function Page() {82 return (83 <Suspense fallback={<p>Loading…</p>}>84 <ProductList />85 </Suspense>86 )87}88```8990### Server Action with form handling and revalidation91```tsx92// app/products/actions.ts93'use server'9495import { revalidatePath } from 'next/cache'9697export async function createProduct(formData: FormData) {98 const name = formData.get('name') as string99 await db.product.create({ data: { name } })100 revalidatePath('/products')101}102103// app/products/new/page.tsx104import { createProduct } from '../actions'105106export default function NewProductPage() {107 return (108 <form action={createProduct}>109 <input name="name" placeholder="Product name" required />110 <button type="submit">Create</button>111 </form>112 )113}114```115116### generateMetadata for dynamic SEO117```tsx118// app/products/[id]/page.tsx119import type { Metadata } from 'next'120121export async function generateMetadata(122 { params }: { params: { id: string } }123): Promise<Metadata> {124 const product = await fetchProduct(params.id)125 return {126 title: product.name,127 description: product.description,128 openGraph: { title: product.name, images: [product.imageUrl] },129 }130}131```132133## Output Templates134135When implementing Next.js features, provide:1361. App structure (route organization)1372. Layout/page components with proper data fetching1383. Server actions if mutations needed1394. Configuration (`next.config.js`, TypeScript)1405. Brief explanation of rendering strategy chosen141142## Knowledge Reference143144Next.js 14+, App Router, React Server Components, Server Actions, Streaming SSR, Partial Prerendering, next/image, next/font, Metadata API, Route Handlers, Middleware, Edge Runtime, Turbopack, Vercel deployment145146[Documentation](https://jeffallan.github.io/claude-skills/skills/frontend/nextjs-developer/)