Skip to content
wsimmonds avatar

Nextjs Server Navigation

Server-side navigation in Next.js with Link and redirect(), without unnecessary 'use client' conversion.

CCM score
41 of 100
skills.sh installs
307
GitHub stars
116
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers server-side navigation in Next.js Server Components using the Link component and the redirect() function
  • Explains the difference between server and client navigation methods, including which hooks such as useRouter() are unavailable on the server
  • Enforces keeping components free of 'use client' when they only need links or redirects, preserving async data fetching
  • Designed for Next.js App Router projects that add links, conditional redirects, or navigation logic to server-rendered pages

Install

$ npx -y skills add wsimmonds/claude-nextjs-skills --skill nextjs-server-navigation -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Next.js: Server Component Navigation Pattern

⚠️ CRITICAL RULE

Server Components use DIFFERENT navigation methods than Client Components!

When requirements call for server-rendered navigation—for example, linking to other pages, redirecting after a check, or demonstrating routing patterns—prefer <Link> and redirect() within Server Components. You still avoid 'use client' unless a client-only API is involved.

The Pattern

Scenario: build a server component that demonstrates proper navigation patterns

✅ CORRECT Solution:

// app/page.tsx (Server Component - NO 'use client'!)
import Link from 'next/link';

export default async function Page() {
  return (
    <div>
      <h1>Home</h1>
      <Link href="/dashboard">Go to Dashboard</Link>
      <Link href="/profile">View Profile</Link>
    </div>
  );
}

❌ WRONG Solution:

// app/page.tsx
'use client';  // ❌ NO! Server components don't need this for navigation!

import { useRouter } from 'next/navigation';  // ❌ Wrong for server components

export default function Page() {
  const router = useRouter();  // ❌ This is client-side navigation
  // ...
}

Details

Repository
github.com/wsimmonds/claude-nextjs-skills
Category
Frontend & UI Code
First seen
Jun 3, 2026

Questions

What does the nextjs-server-navigation skill do?

The nextjs-server-navigation skill guides an agent to add links and redirects inside Next.js Server Components using the Link component and redirect() function. It covers how server navigation differs from client navigation, so components stay server-rendered without a needless 'use client' directive.

How do I install the nextjs-server-navigation skill?

Run npx -y skills add wsimmonds/claude-nextjs-skills --skill nextjs-server-navigation -y in your project. Once installed, nextjs-server-navigation lets the agent write Link and redirect() navigation in your server components.

Which skills does nextjs-server-navigation sit beside in Frontend & UI Code?

nextjs-server-navigation is listed in the Frontend & UI Code category alongside vercel-react-best-practices, web-design-guidelines, design-taste-frontend, vercel-composition-patterns and lark-apps. Its focus is narrower, covering only navigation choices in Next.js server components.

When should I use nextjs-server-navigation instead of useRouter?

Use nextjs-server-navigation when your navigation lives in a Server Component, since it steers the agent toward Link and redirect() rather than useRouter(), which only works in client components. It also warns against converting a component to client-side just to add a link.

More from wsimmonds/claude-nextjs-skills

All 9

Similar to Nextjs Server Navigation

More Frontend & UI Code