Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
wshobson avatar

Nextjs App Router Patterns

  • 25.6k installs
  • 38.3k repo stars
  • Updated July 22, 2026
  • wshobson/agents

wshobson/agents is a multi-harness agentic plugin marketplace with 92 plugins, 199 agents, and 162 skills.

About

A production-ready agentic plugin marketplace with 92 plugins spanning architecture, languages, security, data, and infrastructure. It generates idiomatic artifacts for six different agent harnesses (Claude Code, Codex, Cursor, OpenCode, Gemini, Copilot) from a single Markdown source. Each plugin is isolated and composable; installing a plugin loads only its components (agents, commands, skills) into context.

  • Massive agentic plugin marketplace: 92 plugins, 199 agents, 162 skills, 106 commands for multi-harness use
  • Multi-harness native generation: Claude Code, Codex CLI, Cursor, OpenCode, Gemini CLI, Copilot - each gets idiomatic art
  • Domain-expert agents for architecture, languages (Python, JS, Rust, Go, Java), infra, security, data, ML, docs, business

Nextjs App Router Patterns by the numbers

  • 25,631 all-time installs (skills.sh)
  • +764 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #24 of 2,277 Frontend Development skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

nextjs-app-router-patterns capabilities & compatibility

Use cases
api development · debugging · refactoring
npx skills add https://github.com/wshobson/agents --skill nextjs-app-router-patterns

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs25.6k
repo stars38.3k
Security audit3 / 3 scanners passed
Last updatedJuly 22, 2026
Repositorywshobson/agents

How do you structure Next.js App Router data fetching correctly?

Domain-expert plugins and multi-agent coordination for full-stack, security, ML, and DevOps workflows across six agent harnesses.

Who is it for?

Frontend developers building Next.js App Router pages who need proven Server Component, Suspense, and data-fetching patterns with worked TypeScript examples.

Skip if: Developers on Next.js Pages Router, plain React SPAs, or teams that only need deployment or CI configuration guidance.

When should I use this skill?

The user is implementing Next.js App Router pages with Server Components, streaming, Suspense, or searchParams-based data fetching.

What you get

TypeScript page and component patterns for Server Components, Suspense boundaries, and searchParams-driven revalidation.

  • Server Component page patterns
  • Suspense streaming layouts
  • searchParams data-fetching examples

By the numbers

  • Includes worked TypeScript patterns for app/products/page.tsx with Suspense and searchParams

Files

SKILL.mdMarkdownGitHub ↗

Next.js App Router Patterns

Comprehensive patterns for Next.js 14+ App Router architecture, Server Components, and modern full-stack React development.

When to Use This Skill

  • Building new Next.js applications with App Router
  • Migrating from Pages Router to App Router
  • Implementing Server Components and streaming
  • Setting up parallel and intercepting routes
  • Optimizing data fetching and caching
  • Building full-stack features with Server Actions

Core Concepts

1. Rendering Modes

ModeWhereWhen to Use
Server ComponentsServer onlyData fetching, heavy computation, secrets
Client ComponentsBrowserInteractivity, hooks, browser APIs
StaticBuild timeContent that rarely changes
DynamicRequest timePersonalized or real-time data
StreamingProgressiveLarge pages, slow data sources

2. File Conventions

app/
├── layout.tsx       # Shared UI wrapper
├── page.tsx         # Route UI
├── loading.tsx      # Loading UI (Suspense)
├── error.tsx        # Error boundary
├── not-found.tsx    # 404 UI
├── route.ts         # API endpoint
├── template.tsx     # Re-mounted layout
├── default.tsx      # Parallel route fallback
└── opengraph-image.tsx  # OG image generation

Quick Start

// app/layout.tsx
import { Inter } from 'next/font/google'
import { Providers } from './providers'

const inter = Inter({ subsets: ['latin'] })

export const metadata = {
  title: { default: 'My App', template: '%s | My App' },
  description: 'Built with Next.js App Router',
}

export default function RootLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return (
    <html lang="en" suppressHydrationWarning>
      <body className={inter.className}>
        <Providers>{children}</Providers>
      </body>
    </html>
  )
}

// app/page.tsx - Server Component by default
async function getProducts() {
  const res = await fetch('https://api.example.com/products', {
    next: { revalidate: 3600 }, // ISR: revalidate every hour
  })
  return res.json()
}

export default async function HomePage() {
  const products = await getProducts()

  return (
    <main>
      <h1>Products</h1>
      <ProductGrid products={products} />
    </main>
  )
}

Detailed patterns and worked examples

Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.

Best Practices

Do's

  • Start with Server Components - Add 'use client' only when needed
  • Colocate data fetching - Fetch data where it's used
  • Use Suspense boundaries - Enable streaming for slow data
  • Leverage parallel routes - Independent loading states
  • Use Server Actions - For mutations with progressive enhancement

Don'ts

  • Don't pass serializable data - Server → Client boundary limitations
  • Don't use hooks in Server Components - No useState, useEffect
  • Don't fetch in Client Components - Use Server Components or React Query
  • Don't over-nest layouts - Each layout adds to the component tree
  • Don't ignore loading states - Always provide loading.tsx or Suspense

Related skills

How it compares

Use nextjs-app-router-patterns for file-level App Router composition examples; use Next.js official docs for exhaustive API reference.

FAQ

What patterns does nextjs-app-router-patterns cover?

nextjs-app-router-patterns documents Server Components with data fetching, Suspense streaming with skeleton fallbacks, and searchParams-driven page revalidation. Examples use TypeScript in app/ directory routes such as app/products/page.tsx.

Who should use nextjs-app-router-patterns?

nextjs-app-router-patterns targets developers implementing Next.js App Router frontends who need battle-tested Server Component and Suspense compositions. The skill provides worked code, not deployment or testing configuration.

Is Nextjs App Router Patterns safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

Frontend Developmentfrontendbackenddevops

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.