Skip to content
wsimmonds avatar

Nextjs Dynamic Routes Params

Guide for Next.js App Router dynamic routes that defaults to the simplest route structure.

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

Own this skill? Claim it

What it does

  • Covers params handling in Server Components, Client Components, and Route Handlers, including the Next.js 15+ awaited Promise form
  • Includes route-structure decision guidance and common patterns for ID-based, slug-based, and catch-all segments
  • Enforces top-level app/[id] routing by default, adding nested prefixes only when the URL spec requires them
  • Designed for building pages whose data depends on URL segments such as IDs, slugs, or nested paths

Install

$ npx -y skills add wsimmonds/claude-nextjs-skills --skill nextjs-dynamic-routes-params -y

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

Files

Next.js Dynamic Routes and Pathname Parameters

When to Use This Skill

Use this skill when:

  • Creating dynamic route segments (e.g., blog/[slug], users/[id])
  • Accessing URL pathname parameters in Server or Client Components
  • Building pages that fetch data based on route parameters
  • Implementing catch-all or optional catch-all routes
  • Working with the params prop in page.tsx, layout.tsx, or route.ts

⚠️ RECOGNIZING WHEN YOU NEED DYNAMIC ROUTES

Look for requirements that tie data to the URL path.

Create a dynamic segment ([param]) whenever the UI depends on part of the pathname. Typical signals include:

  • Details pages that reference “the item’s ID/slug from the URL”
  • Copy that calls out path segments (e.g., /products/{id}, /blog/{slug})
  • Requirements to fetch data “based on whichever resource is being visited”
  • Navigation flows where one page links to /something/{identifier}

✅ Dynamic route response

Requirement: display product information based on whichever ID appears in the URL
Implementation: app/[id]/page.tsx
Access parameter with: const { id } = await params;

Details

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

Questions

What does the nextjs-dynamic-routes-params skill do?

nextjs-dynamic-routes-params guides Next.js App Router dynamic routes and pathname parameters. It helps build pages that depend on URL segments such as IDs, slugs and nested paths, and shows how to read the params prop in page, layout and route files.

How do I install the nextjs-dynamic-routes-params skill?

Run npx -y skills add wsimmonds/claude-nextjs-skills --skill nextjs-dynamic-routes-params -y in a project to install nextjs-dynamic-routes-params. Once installed, the agent can choose route folders such as app/[id]/page.tsx and access params correctly for Next.js 15 and later.

Which route structure does the nextjs-dynamic-routes-params skill recommend?

nextjs-dynamic-routes-params defaults to the simplest route structure, such as app/[id]/page.tsx, instead of nesting under a resource name like app/products/[id]. It only adds a nested prefix when the URL is explicitly specified in the requirements.

How does nextjs-dynamic-routes-params handle params in Client Components?

nextjs-dynamic-routes-params explains that Client Components cannot read params directly. It shows using the useParams hook, or passing the value down from a Server Component as a prop.

More from wsimmonds/claude-nextjs-skills

All 9

Similar to Nextjs Dynamic Routes Params

More Frontend & UI Code