avoiding-nextjs-app-router-anti-patterns

Identify and fix Next.js App Router anti-patterns in code reviews.

Updated Apr 14, 2026
One-click install
npx skills add https://github.com/somachak/claude-code-skills-db --skill avoiding-nextjs-app-router-anti-patterns
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: avoiding-nextjs-app-router-anti-patterns
Source: https://github.com/somachak/claude-code-skills-db/tree/main/skills/frontend/avoiding-nextjs-app-router-anti-patterns
Command: npx skills add https://github.com/somachak/claude-code-skills-db --skill avoiding-nextjs-app-router-anti-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Identifies and fixes common Next.js App Router anti-patterns that cause hydration mismatches, wasted client-side state, and migration difficulties.

Core Features & Use Cases

  • Detect misuse of useEffect for data fetching or browser detection that can break SSR or hydration.
  • Identify improper Server/Client component boundaries and propose correct separation.
  • Guide migration from the Pages Router to the App Router and enforce serializable props rules.
  • Enforce TypeScript strict mode and proper handling of async params / searchParams in Next.js 15+.

Quick Start

Run a targeted code review of your Next.js project to identify App Router anti-patterns and generate a prioritized remediation plan.

Frequently Asked Questions about avoiding-nextjs-app-router-anti-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix Next.js App Router hydration mismatches?▼

Next.js App Router hydration mismatches are often caused by misusing useEffect for data fetching or browser detection. Identifying improper Server/Client component boundaries and enforcing serializable props rules resolves these sync errors.

How do I migrate from Next.js Pages Router to App Router without breaking SSR?▼

Migrating from Next.js Pages Router to App Router requires enforcing proper Server and Client component separation. Ensuring serializable props rules and safe data fetching strategies prevents wasted client-side state and migration headaches.

How do you handle async params and searchParams in Next.js 15 with TypeScript strict mode?▼

Handling async params and searchParams in Next.js 15 requires enforcing TypeScript strict mode and proper async handling. This ensures type safety and prevents common App Router data fetching anti-patterns.

Why does my Next.js App Router component break when passing non-serializable props?▼

Next.js App Router components break because Server and Client boundaries require serializable props. Identifying improper component boundaries and enforcing serializable props rules fixes wasted client-side state and runtime errors.

What is the best way to structure Server and Client component boundaries in Next.js 14?▼

The best way to structure Server and Client component boundaries in Next.js 14 is to separate data fetching logic from interactive UI. This prevents hydration mismatches and enforces safe server/client boundaries.

Can I use useEffect for data fetching in Next.js App Router without causing hydration issues?▼

Using useEffect for data fetching in Next.js App Router can break SSR and cause hydration mismatches. Identifying this anti-pattern and applying correct server-side data fetching strategies resolves the issue.