nextjs

Bootstrap and standardize Next.js v15+ applications with App Router architecture.

Updated Sep 16, 2023
One-click install
npx skills add https://github.com/paopp2/dotfiles --skill nextjs-paopp2
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: nextjs
Source: https://github.com/paopp2/dotfiles/tree/main/.claude/skills/nextjs
Command: npx skills add https://github.com/paopp2/dotfiles --skill nextjs-paopp2

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? This skill simplifies building performant, SEO-friendly, full-stack React applications by providing expert guidance on Next.js's modern features and best practices.

Core Features & Use Cases:

  • App Router & Server Components: Master the modern Next.js architecture for efficient data fetching and reduced client-side JavaScript.
  • Optimized Performance: Leverage built-in image, font, and code optimizations for faster load times and better user experience.
  • Full-Stack Development: Easily create API endpoints with Route Handlers and manage data fetching strategies for both server and client.

Quick Start: Use the nextjs skill to show me how to create a new Next.js project with TypeScript and App Router.

Frequently Asked Questions about nextjs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up a new Next.js project with App Router and TypeScript?▼

Create a new Next.js project with App Router by running `npx create-next-app@latest` and selecting TypeScript and App Router during setup. This initializes a modern Next.js application (v15+) with file-based routing under the `app/` directory, Server Components by default, and automatic optimization of images, fonts, and scripts for performance.

What's the difference between Pages Router and App Router in Next.js?▼

App Router is Next.js's modern architecture using the `app/` directory with Server Components by default, nested layouts, and Suspense support for better data fetching and reduced client-side JavaScript. Pages Router uses the older `pages/` directory structure. App Router provides superior performance optimization and full-stack capabilities for building React applications.

How do I implement server-side rendering and data fetching in Next.js?▼

Server-side rendering in Next.js happens automatically with Server Components in App Router. Fetch data directly in server components using async/await, or use Route Handlers for API endpoints. This reduces client-side JavaScript and improves performance by executing data fetching on the server before rendering.

Can I migrate an existing Next.js project from Pages Router to App Router?▼

Yes, you can migrate from Pages Router to App Router by gradually moving routes and components. Convert `pages/` files to `app/` directory structure, adopt Server Components by default, update data fetching patterns, and leverage nested layouts and API Route Handlers for your full-stack application.

What performance optimizations does Next.js provide automatically?▼

Next.js automatically optimizes images, fonts, and scripts to improve load times and user experience. Image optimization includes responsive sizing and lazy loading; font optimization reduces layout shift; and code splitting minimizes client-side JavaScript. These built-in optimizations work with App Router and Server Components for SEO-friendly, performant applications.

Do I need to configure routing manually in Next.js with App Router?▼

No, Next.js App Router uses file-based routing—routes are automatically created from your `app/` directory structure. Nested layouts organize related pages, and special files like `page.tsx` and `layout.tsx` define routes and shared UI. No manual routing configuration is required.