Our review
Assists in building production-grade React applications with Next.js using the App Router, Server Components, and Server Actions.
Strengths
- Enforces Next.js best practices like co-locating data fetching and image optimization.
- Guides the use of Server Components and Server Actions to minimize client-side JavaScript.
- Helps choose appropriate rendering strategies (ISR, SSG, SSR) per page.
- Includes workflows for authentication, middleware, and deployment.
Limitations
- Requires a solid understanding of Next.js 14+ to avoid misinterpretation of generated code.
- May generate boilerplate that needs manual tuning for unique business logic.
- Does not cover migration from older Next.js versions.
Use this skill when building or maintaining a Next.js application with the App Router and modern features.
Avoid it for simple React projects without Next.js, or if you are using the Pages Router with no plans to upgrade.
Security analysis
SafeThe skill provides educational guidance on using Next.js, with no instructions to execute system commands, access sensitive data, or perform any destructive or exfiltrating actions. It is purely informational and instructional.
No concerns found
Examples
Create a Next.js dashboard with server-side data fetching and streaming using Server Components, including route groups and loading states.Implement login and signup using Server Actions with form validation, session cookies, and middleware to protect dashboard routes.Help me set up ISR for my product pages with revalidation every 60 seconds, and use generateStaticParams for the blog archive.name: nextjs description: >- Assists with building production-grade React applications using Next.js. Use when working with the App Router, Server Components, Server Actions, Middleware, or deploying to Vercel or self-hosted environments. Trigger words: nextjs, next.js, app router, server components, server actions, react framework, ssr, isr. license: Apache-2.0 compatibility: "Requires Node.js 18+" metadata: author: terminal-skills version: "1.0.0" category: development tags: nextjs,react,full-stack,ssr,server-components
Next.js
Overview
Next.js is a full-stack React framework featuring the App Router with Server Components, Server Actions for mutations, and multiple rendering strategies (SSG, SSR, ISR, PPR). It provides automatic code splitting, image optimization, and deployment options from Vercel to self-hosted Docker.
Instructions
- When creating routes, use file-based routing in the
app/directory withpage.tsxfor pages,layout.tsxfor persistent layouts,loading.tsxfor streaming, anderror.tsxfor error boundaries. - When building components, default to Server Components (no directive needed) for zero client-side JavaScript, and add
"use client"only for components needing event handlers, hooks, or browser APIs. - When fetching data, query databases directly in Server Components with
async/await, usefetch()with caching options (revalidate,force-cache), and co-locate data fetching with the component that needs it. - When handling mutations, use Server Actions with
"use server"directive and<form action={...}>for progressive enhancement, then callrevalidatePath()orrevalidateTag()after mutations. - When choosing rendering, default to ISR with
revalidatefor most pages, usegenerateStaticParams()for fully static pages, anddynamic = "force-dynamic"only when fresh data is required on every request. - When adding middleware, use
middleware.tsat the project root for auth redirects, geolocation, and A/B testing with matcher config to scope it to specific routes. - When optimizing, use
next/imagefor all images (WebP/AVIF, lazy loading),next/fontfor zero layout shift fonts, andgenerateMetadata()for dynamic SEO.
Examples
Example 1: Build a dashboard with Server Components
User request: "Create a Next.js dashboard with server-side data fetching and streaming"
Actions:
- Create dashboard layout with
layout.tsxand parallel routes for widgets - Fetch data directly in async Server Components with database queries
- Add
loading.tsxfor Suspense-based streaming of slow components - Use
revalidatefor ISR to balance freshness and performance
Output: A fast dashboard that streams data progressively with zero client-side JavaScript for data fetching.
Example 2: Add authentication with Server Actions
User request: "Implement login/signup with Server Actions and middleware protection"
Actions:
- Create login form with
<form action={loginAction}>using Server Actions - Implement session management with encrypted cookies
- Add middleware to redirect unauthenticated users from
/dashboard/* - Use
useOptimistic()for instant form feedback
Output: A progressively enhanced auth system with server-side validation and route protection.
Guidelines
- Default to Server Components; add
"use client"only for interactivity (event handlers, hooks, browser APIs). - Use Server Actions for mutations instead of API routes; they are simpler and support progressive enhancement.
- Co-locate data fetching with components: fetch in the Server Component that needs the data, not in a parent.
- Use
loading.tsxat route boundaries for streaming; do not block the entire page on a slow query. - Use
generateMetadata()for dynamic pages; staticmetadataexport for fixed pages. - Set
revalidateon fetch calls or at page level: ISR is almost always better than full SSR. - Use
next/imagefor all images; the optimization is significant (WebP/AVIF, lazy loading, responsive).
Next.js App Router Expert
Development
A skill that turns Claude into a Next.js App Router expert.
README Generator
Development
Creates professional and comprehensive README.md files for your projects.
API Documentation Writer
Development
Generates comprehensive API documentation in OpenAPI/Swagger format.