nextjs

Provides Next.js 15+ App Router patterns for Server Components, Streaming SSR, and Server Actions.

1|Updated Jul 4, 2023
One-click install
npx skills add https://github.com/alkalisummer/nextjs-keylog --skill nextjs-alkalisummer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs
Source: https://github.com/alkalisummer/nextjs-keylog/tree/main/.claude/skills/nextjs
Command: npx skills add https://github.com/alkalisummer/nextjs-keylog --skill nextjs-alkalisummer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides comprehensive patterns and best practices for building modern Next.js applications using the App Router, enabling efficient development of server-rendered and client-interactive features.

Core Features & Use Cases

  • Server & Client Components: Understand the default Server Component model and when to use 'use client'.
  • Streaming & Suspense: Implement efficient data loading with streaming Server-Side Rendering.
  • Data Fetching & Caching: Master various caching strategies and data fetching methods.
  • Server Actions: Securely handle data mutations directly from the client.
  • Routing Patterns: Utilize route groups, parallel routes, and intercepting routes for complex layouts.
  • Middleware & Error Handling: Implement authentication, error boundaries, and not-found pages.
  • File Structure: Adopt domain-driven or feature-based structures for maintainability.
  • Image Optimization & Metadata: Leverage Next.js Image component and dynamic metadata generation.

Quick Start

Use the nextjs skill to demonstrate how to implement Server Actions for form submissions with optimistic updates.

Frequently Asked Questions about nextjs

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

FAQPage Schema
How do I implement Server Actions for form submissions in Next.js App Router?

Next.js Server Actions handle data mutations directly from the client. You define them within Server Components or separate files to process form submissions securely without creating dedicated API endpoints.

When should I use 'use client' for client components in Next.js?

Use 'use client' in Next.js when you need interactivity, state, or browser APIs. The App Router defaults to Server Components for data fetching and rendering, adopting client components only where user interaction is required.

How does Streaming SSR with Suspense work in Next.js?

Streaming SSR in Next.js sends HTML chunks to the browser as they render. Wrapping components in Suspense allows the page to stream progressively, displaying fallback UI while waiting for slow data fetches to resolve.

What is the best way to structure Next.js App Router files for scalability?

Adopt domain-driven or feature-based structures for Next.js file maintainability. Grouping routing, Server Components, and data fetching logic by feature rather than file type ensures scalable application architecture.

Can I use parallel and intercepting routes for complex layouts in Next.js?

Next.js App Router supports parallel and intercepting routes for complex layouts. Parallel routes render multiple components simultaneously, while intercepting routes handle modals and nested navigation without unmounting active contexts.

Why does Next.js require specific data fetching and caching strategies?

Next.js caching strategies optimize performance by storing fetched data at various levels. Understanding request memoization and full route caching ensures efficient data fetching and prevents stale content in server-rendered applications.