Skip to content
wsimmonds avatar

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
View on GitHub

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() and headers() from next/headers, plus searchParams in page.tsx files
  • Enforces no 'use client' on Server Components and no any type, since @typescript-eslint/no-explicit-any is 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 -y

Installs 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 9

Similar to Nextjs Server Client Components

More Frontend & UI Code