Nextjs Server Client Components
Guide for choosing Server or Client Components in Next.js App Router, with cookies, headers, and searchParams handling.
- CCM score
- 43 of 100
- skills.sh installs
- 366
- GitHub stars
- 116
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers Server versus Client Component selection,
'use client'boundaries, and when each component type is appropriate - Includes patterns for
cookies()andheaders()fromnext/headers, plussearchParamsinpage.tsxfiles - Enforces no
'use client'on Server Components and noanytype, since@typescript-eslint/no-explicit-anyis enabled - Designed for Next.js App Router projects that need to avoid mixing server-only and client-only APIs
Install
$ npx -y skills add wsimmonds/claude-nextjs-skills --skill nextjs-server-client-components -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Next.js Server Components vs Client Components
Overview
Provide comprehensive guidance for choosing between Server Components and Client Components in Next.js App Router, including cookie/header access, searchParams handling, pathname routing, and React's 'use' API for promise unwrapping.
TypeScript: NEVER Use any Type
CRITICAL RULE: This codebase has @typescript-eslint/no-explicit-any enabled. Using any will cause build failures.
❌ WRONG:
function handleSubmit(e: any) { ... }
const data: any[] = [];
✅ CORRECT:
function handleSubmit(e: React.FormEvent<HTMLFormElement>) { ... }
const data: string[] = [];
Common Next.js Type Patterns
// Page props
function Page({ params }: { params: { slug: string } }) { ... }
function Page({ searchParams }: { searchParams: { [key: string]: string | string[] | undefined } }) { ... }
// Form events
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => { ... }
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => { ... }
// Server actions
async function myAction(formData: FormData) { ... }
When to Use This Skill
Details
- Repository
- github.com/wsimmonds/claude-nextjs-skills
- Category
- Frontend & UI Code
- First seen
- Jun 3, 2026
Questions
What does the nextjs-server-client-components skill do?
It is a guide for choosing between Server Components and Client Components in the Next.js App Router. It covers when to add the 'use client' directive, how to use useSearchParams with Suspense, navigation with Link, redirect and useRouter, and reading cookies and headers.
How do I install the nextjs-server-client-components skill?
Run npx -y skills add wsimmonds/claude-nextjs-skills --skill nextjs-server-client-components -y in your project. The skill then lets the agent apply Server versus Client Component rules when writing Next.js App Router code.
Which category does this skill belong to, and what are its neighbours?
It is listed in the Frontend & UI Code category on Claude Marketplaces, alongside vercel-react-best-practices, web-design-guidelines and vercel-composition-patterns. It focuses on the Server versus Client Component boundary and the server and client APIs that must not be mixed.
Who is this skill for?
It is for developers building Next.js apps with the App Router who need to decide where components run. It helps avoid mixing server-only APIs such as cookies and headers into Client Components, and client hooks such as useSearchParams into Server Components.
More from wsimmonds/claude-nextjs-skills
All 9Similar to Nextjs Server Client Components
More Frontend & UI Codenextjs-server-navigationwsimmonds/claude-nextjs-skills307 installsServer-side navigation in Next.js with Link and redirect(), without unnecessary 'use client' conversion.
nextjs-best-practicessickn33/agentic-awesome-skills7.6K installsNext.js App Router principles covering Server vs Client Components, data fetching, routing, caching, and Server Actions.
nextjs-app-router-patternswshobson/agents35.2K installsComprehensive App Router patterns for Next.js 14+ covering Server Components, streaming, and data fetching.
nextjs-developmentmanutej/luxor-claude-marketplace476 installsComprehensive Next.js guidance for App Router, Server Components, data fetching, routing, and middleware.
nextjs-app-routergiuseppe-trisciuoglio/developer-kit4.2K installsModern App Router guide for Next.js 16+ covering Server Components, Server Actions, caching, and routing conventions.
nextjs-advanced-routingwsimmonds/claude-nextjs-skills338 installsGuide to advanced App Router patterns: Route Handlers, parallel and intercepting routes, Server Actions, and Suspense streaming.