nextjs

Installation
SKILL.md

Next.js Development Patterns

App Router vs Pages Router

The App Router (Next.js 13.4+) is recommended for new projects. The Pages Router remains supported.

Use App Router when: starting a new project, you need Server Components/streaming/Server Actions, nested layouts, or parallel routes. Use Pages Router when: maintaining an existing codebase, or depending on libraries without App Router support.

Both routers can coexist. Files in app/ use App Router; files in pages/ use Pages Router. Do not define the same route in both.

File-Based Routing (App Router)

app/
  layout.tsx        # Root layout (required, wraps all pages, must have <html> and <body>)
  page.tsx          # Home route (/)
  loading.tsx       # Suspense fallback (shown while page streams)
  error.tsx         # Error boundary (must be a Client Component)
Related skills

More from 1mangesh1/dev-skills-collection

Installs
1
GitHub Stars
3
First Seen
Apr 14, 2026