Back to Skills

nextjs-routing-advanced

verified

Complete Next.js advanced routing system. PROACTIVELY activate for: (1) Dynamic routes with [slug], (2) Catch-all routes [...slug], (3) Route groups for organization, (4) Parallel routes with @slot, (5) Intercepting routes for modals, (6) Private folders with _prefix, (7) Route Handlers (API), (8) Search params handling, (9) Programmatic navigation. Provides: Dynamic routing patterns, parallel route slots, modal interception, API handlers. Ensures flexible routing with proper URL structure.

View on GitHub

Marketplace

claude-plugin-marketplace

JosiahSiegel/claude-plugin-marketplace

Plugin

nextjs-master

Repository

JosiahSiegel/claude-plugin-marketplace
7stars

plugins/nextjs-master/skills/nextjs-routing-advanced/SKILL.md

Last Verified

January 20, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/JosiahSiegel/claude-plugin-marketplace/blob/main/plugins/nextjs-master/skills/nextjs-routing-advanced/SKILL.md -a claude-code --skill nextjs-routing-advanced

Installation paths:

Claude
.claude/skills/nextjs-routing-advanced/
Powered by add-skill CLI

Instructions

## Quick Reference

| Route Type | Folder Pattern | URL Example |
|------------|----------------|-------------|
| Dynamic | `[slug]` | `/blog/hello` → `{ slug: 'hello' }` |
| Catch-all | `[...slug]` | `/docs/a/b` → `{ slug: ['a', 'b'] }` |
| Optional catch-all | `[[...slug]]` | `/shop` or `/shop/a/b` |
| Route group | `(name)` | No URL impact, layout grouping |
| Parallel route | `@slot` | Independent loading/error |
| Intercept same level | `(.)path` | Modal pattern |
| Private folder | `_folder` | Not a route |

| Navigation | Code | Use Case |
|------------|------|----------|
| Link | `<Link href="/path">` | Declarative nav |
| router.push | `router.push('/path')` | Programmatic nav |
| router.replace | `router.replace('/path')` | No history entry |
| redirect | `redirect('/path')` | Server redirect |

| Route Handler | Method | Pattern |
|---------------|--------|---------|
| `GET` | Read | `export async function GET() {}` |
| `POST` | Create | `export async function POST() {}` |
| `PUT` | Update | `export async function PUT() {}` |
| `DELETE` | Delete | `export async function DELETE() {}` |

## When to Use This Skill

Use for **advanced routing patterns**:
- Dynamic blog/product pages with slugs
- Documentation with catch-all routes
- Dashboard layouts with parallel routes
- Photo gallery modals with intercepting routes
- API endpoints with Route Handlers

**Related skills:**
- For App Router basics: see `nextjs-app-router`
- For middleware routing: see `nextjs-middleware`
- For data in routes: see `nextjs-data-fetching`

---

# Next.js Advanced Routing

## Dynamic Routes

### Single Dynamic Segment

```tsx
// app/blog/[slug]/page.tsx
interface PageProps {
  params: Promise<{ slug: string }>;
}

export default async function BlogPost({ params }: PageProps) {
  const { slug } = await params;
  const post = await getPost(slug);

  return <article>{post.content}</article>;
}

// /blog/hello-world → { slug: 'hello-world' }
```

### Multiple Dynamic Segments

```tsx

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
11800 chars