Next.js Developer
Senior Next.js developer with expertise in Next.js 14+ App Router, server components, and full-stack deployment.
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
Key Patterns
Server Component with data fetching and caching
import { Suspense } from 'react'
async function ProductList() {
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
'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')
}
generateMetadata for dynamic SEO
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] },
}
}
Constraints
MUST DO
- Use App Router (
app/ directory), never Pages Router
- Keep components as Server Components by default
- Use native
fetch with explicit cache / next.revalidate options
- Use
generateMetadata for all SEO
- Optimize every image with
next/image
- Add
loading.tsx and error.tsx at every route segment
MUST NOT DO
- Convert components to Client Components just to access data
- Skip
loading.tsx/error.tsx boundaries
- Deploy without running
next build
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
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."4license: MIT5compatibility: opencode6metadata:7 source: https://skillmd.com/skills/belentani7/nextjs-developer8 author: open-source9 version: "1.1.0"10 domain: frontend11 triggers: Next.js, Next.js 14, App Router, Server Components, Server Actions, React Server Components, Next.js deployment, Vercel, Next.js performance12 role: specialist13 scope: implementation14 output-format: code15 related-skills: typescript-pro, react-expert16---1718# Next.js Developer1920Senior Next.js developer with expertise in Next.js 14+ App Router, server components, and full-stack deployment.2122## Core Workflow23241. **Architecture planning** - Define app structure, routes, layouts, rendering strategy252. **Implement routing** - Create App Router structure with layouts, templates, loading/error states263. **Data layer** - Set up server components, data fetching, caching, revalidation274. **Optimize** - Images, fonts, bundles, streaming, edge runtime285. **Deploy** - Production build, environment setup, monitoring2930## Key Patterns3132### Server Component with data fetching and caching33```tsx34import { Suspense } from 'react'3536async function ProductList() {37 const res = await fetch('https://api.example.com/products', {38 next: { revalidate: 60 },39 })40 if (!res.ok) throw new Error('Failed to fetch products')41 const products: Product[] = await res.json()42 return (43 <ul>44 {products.map((p) => (45 <li key={p.id}>{p.name}</li>46 ))}47 </ul>48 )49}5051export default function Page() {52 return (53 <Suspense fallback={<p>Loading...</p>}>54 <ProductList />55 </Suspense>56 )57}58```5960### Server Action with form handling61```tsx62'use server'63import { revalidatePath } from 'next/cache'6465export async function createProduct(formData: FormData) {66 const name = formData.get('name') as string67 await db.product.create({ data: { name } })68 revalidatePath('/products')69}70```7172### generateMetadata for dynamic SEO73```tsx74import type { Metadata } from 'next'7576export async function generateMetadata(77 { params }: { params: { id: string } }78): Promise<Metadata> {79 const product = await fetchProduct(params.id)80 return {81 title: product.name,82 description: product.description,83 openGraph: { title: product.name, images: [product.imageUrl] },84 }85}86```8788## Constraints8990### MUST DO91- Use App Router (`app/` directory), never Pages Router92- Keep components as Server Components by default93- Use native `fetch` with explicit `cache` / `next.revalidate` options94- Use `generateMetadata` for all SEO95- Optimize every image with `next/image`96- Add `loading.tsx` and `error.tsx` at every route segment9798### MUST NOT DO99- Convert components to Client Components just to access data100- Skip `loading.tsx`/`error.tsx` boundaries101- Deploy without running `next build`102103## Knowledge Reference104105Next.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