Agent skill

Nextjs

by einverne in einverne/dotfiles

Guide for implementing Next.js - a React framework for production with server-side rendering, static generation, and modern web features.

MITAuto-check: notesBackend & APIs

Install Nextjs

skills CLI
$ npx skills add einverne/dotfiles --skill nextjs -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install einverne/dotfiles nextjs --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/einverne/dotfiles.git skills-src && mkdir -p .claude/skills && cp -r skills-src/claude/skills/nextjs .claude/skills/nextjs && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
nextjs
GitHub stars
121
Token cost
~5.6k tokens
SKILL.md length
885 words
Files
1
Skills in repo
39
Repo updated
First seen
Licence
MIT

At a glance

Guide for implementing Next.js - a React framework for production with server-side rendering, static generation, and modern web features.

  • Works in 5 steps: Server Components by Default: Components… → File-based Routing: File system defines… → Nested Layouts: Share UI across routes… → …
  • Building Next.js applications
  • SKILL.md covers Reference, When to Use This Skill, Core Concepts and Installation & Setup, plus 5 more sections
  • Calls npm, npx and yarn; needs CUSTOM_KEY

What it does

Nextjs is an agent skill from einverne/dotfiles. Guide for implementing Next.js - a React framework for production with server-side rendering, static generation, and modern web features. Use when building Next.js applications, implementing App Router, working with server components, data fetching, routing, or optimizing performance.

Its SKILL.md is about 5.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering Backend development. It works with Next.js and React. The repository describes itself as: my personal dotfiles managed by dotbot, zinit. The licence is MIT.

When your agent uses it

  • Building Next.js applications
  • Implementing App Router
  • Working with server components
  • Optimizing performance

Example prompts

  • “/nextjs”

Requirements

  • Node.js

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Server Components by Default: Components in app/ are Server Components unless marked with 'use client'
  2. File-based Routing: File system defines application routes
  3. Nested Layouts: Share UI across routes with layouts
  4. Progressive Enhancement: Works without JavaScript when possible
  5. Automatic Optimization: Images, fonts, scripts auto-optimized

What it can do on your machine

Read from SKILL.md and the folder at commit c6c0686. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm
    • npx
    • yarn
    • pnpm
    • bun
    • vercel

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • nextjs.org
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • CUSTOM_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Nextjs loads about 5.6k tokens when it runs. Until then it costs about 73 tokens; SKILL.md has 885 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~73
When it runs · the whole SKILL.md, loaded when a task matches
~5.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:868
    # .env.local

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from einverne/dotfiles at commit c6c0686, republished under its MIT licence (© einverne). 885 words, ~5,598 tokens.

Download SKILL.mdSave it as .claude/skills/nextjs/SKILL.md (or your agent's skills folder).
name
nextjs
description
Guide for implementing Next.js - a React framework for production with server-side rendering, static generation, and modern web features. Use when building Next.js applications, implementing App Router, working with server components, data fetching, routing, or optimizing performance.
license
MIT
version
1.0.0

Next.js Skill

Next.js is a React framework for building full-stack web applications with server-side rendering, static generation, and powerful optimization features built-in.

Reference

https://nextjs.org/docs/llms.txt

When to Use This Skill

Use this skill when:

  • Building new Next.js applications (v15+)
  • Implementing App Router architecture
  • Working with Server Components and Client Components
  • Setting up routing, layouts, and navigation
  • Implementing data fetching patterns
  • Optimizing images, fonts, and performance
  • Configuring metadata and SEO
  • Setting up API routes and route handlers
  • Migrating from Pages Router to App Router
  • Deploying Next.js applications

Core Concepts

App Router vs Pages Router

App Router (Recommended for v13+):

  • Modern architecture with React Server Components
  • File-system based routing in app/ directory
  • Layouts, loading states, and error boundaries
  • Streaming and Suspense support
  • Nested routing with layouts

Pages Router (Legacy):

  • Traditional page-based routing in pages/ directory
  • Uses getStaticProps, getServerSideProps, getInitialProps
  • Still supported for existing projects
Key Architectural Principles
  1. Server Components by Default: Components in app/ are Server Components unless marked with 'use client'
  2. File-based Routing: File system defines application routes
  3. Nested Layouts: Share UI across routes with layouts
  4. Progressive Enhancement: Works without JavaScript when possible
  5. Automatic Optimization: Images, fonts, scripts auto-optimized

Installation & Setup

Create New Project
bash
npx create-next-app@latest my-app
# or
yarn create next-app my-app
# or
pnpm create next-app my-app
# or
bun create next-app my-app

Interactive Setup Prompts:

  • TypeScript? (Yes recommended)
  • ESLint? (Yes recommended)
  • Tailwind CSS? (Optional)
  • src/ directory? (Optional)
  • App Router? (Yes for new projects)
  • Import alias? (Default: @/*)
Manual Setup
bash
npm install next@latest react@latest react-dom@latest

package.json scripts:

json
{
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  }
}
Project Structure
my-app/
├── app/                    # App Router (v13+)
│   ├── layout.tsx         # Root layout
│   ├── page.tsx           # Home page
│   ├── loading.tsx        # Loading UI
│   ├── error.tsx          # Error UI
│   ├── not-found.tsx      # 404 page
│   ├── global.css         # Global styles
│   └── [folder]/          # Route segments
├── public/                # Static assets
├── components/            # React components
├── lib/                   # Utility functions
├── next.config.js         # Next.js configuration
├── package.json
└── tsconfig.json

Routing

File Conventions
  • page.tsx - Page UI for route
  • layout.tsx - Shared UI for segment and children
  • loading.tsx - Loading UI (wraps page in Suspense)
  • error.tsx - Error UI (wraps page in Error Boundary)
  • not-found.tsx - 404 UI
  • route.ts - API endpoint (Route Handler)
  • template.tsx - Re-rendered layout UI
  • default.tsx - Parallel route fallback
Basic Routing

Static Route:

app/
├── page.tsx              → /
├── about/
│   └── page.tsx         → /about
└── blog/
    └── page.tsx         → /blog

Dynamic Route:

tsx
// app/blog/[slug]/page.tsx
export default function BlogPost({ params }: { params: { slug: string } }) {
  return <h1>Post: {params.slug}</h1>
}

Catch-all Route:

tsx
// app/shop/[...slug]/page.tsx
export default function Shop({ params }: { params: { slug: string[] } }) {
  return <h1>Category: {params.slug.join('/')}</h1>
}

Optional Catch-all:

tsx
// app/docs/[[...slug]]/page.tsx
// Matches /docs, /docs/a, /docs/a/b, etc.
Route Groups

Organize routes without affecting URL:

app/
├── (marketing)/          # Group without URL segment
│   ├── about/page.tsx   → /about
│   └── blog/page.tsx    → /blog
└── (shop)/
    ├── products/page.tsx → /products
    └── cart/page.tsx     → /cart
Parallel Routes

Render multiple pages in same layout:

app/
├── @team/               # Slot
│   └── page.tsx
├── @analytics/          # Slot
│   └── page.tsx
└── layout.tsx           # Uses both slots
tsx
// app/layout.tsx
export default function Layout({
  children,
  team,
  analytics,
}: {
  children: React.ReactNode
  team: React.ReactNode
  analytics: React.ReactNode
}) {
  return (
    <>
      {children}
      {team}
      {analytics}
    </>
  )
}
Intercepting Routes

Intercept routes to show in modal:

app/
├── feed/
│   └── page.tsx
├── photo/
│   └── [id]/
│       └── page.tsx
└── (..)photo/           # Intercepts /photo/[id]
    └── [id]/
        └── page.tsx

Layouts

Root Layout (Required)
tsx
// app/layout.tsx
export default function RootLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return (
    <html lang="en">
      <body>{children}</body>
    </html>
  )
}
Nested Layouts
tsx
// app/dashboard/layout.tsx
export default function DashboardLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return (
    <section>
      <nav>Dashboard Nav</nav>
      {children}
    </section>
  )
}

Layouts are:

  • Shared across multiple pages
  • Preserve state on navigation
  • Do not re-render on navigation
  • Can fetch data

Server and Client Components

Server Components (Default)

Components in app/ are Server Components by default:

tsx
// app/page.tsx (Server Component)
async function getData() {
  const res = await fetch('https://api.example.com/data')
  return res.json()
}

export default async function Page() {
  const data = await getData()
  return <div>{data.title}</div>
}

Benefits:

  • Fetch data on server
  • Access backend resources directly
  • Keep sensitive data on server
  • Reduce client-side JavaScript
  • Improve initial page load

Limitations:

  • Cannot use hooks (useState, useEffect)
  • Cannot use browser APIs
  • Cannot add event listeners
Client Components

Mark components with 'use client' directive:

tsx
// components/counter.tsx
'use client'

import { useState } from 'react'

export function Counter() {
  const [count, setCount] = useState(0)

  return (
    <button onClick={() => setCount(count + 1)}>
      Count: {count}
    </button>
  )
}

Use Client Components for:

  • Interactive UI (onClick, onChange)
  • State management (useState, useReducer)
  • Effects (useEffect, useLayoutEffect)
  • Browser APIs (localStorage, navigator)
  • Custom hooks
  • React class components
Composition Pattern
tsx
// app/page.tsx (Server Component)
import { ClientComponent } from './client-component'

export default function Page() {
  return (
    <div>
      <h1>Server-rendered content</h1>
      <ClientComponent />
    </div>
  )
}

Data Fetching

Server Component Data Fetching
tsx
// app/posts/page.tsx
async function getPosts() {
  const res = await fetch('https://api.example.com/posts', {
    next: { revalidate: 3600 } // Revalidate every hour
  })

  if (!res.ok) throw new Error('Failed to fetch')

  return res.json()
}

export default async function PostsPage() {
  const posts = await getPosts()

  return (
    <ul>
      {posts.map(post => (
        <li key={post.id}>{post.title}</li>
      ))}
    </ul>
  )
}
Caching Strategies

Force Cache (Default):

tsx
fetch('https://api.example.com/data', { cache: 'force-cache' })

No Store (Dynamic):

tsx
fetch('https://api.example.com/data', { cache: 'no-store' })

Revalidate:

tsx
fetch('https://api.example.com/data', {
  next: { revalidate: 3600 } // Seconds
})

Tag-based Revalidation:

tsx
fetch('https://api.example.com/data', {
  next: { tags: ['posts'] }
})

// Revalidate elsewhere:
import { revalidateTag } from 'next/cache'
revalidateTag('posts')
Parallel Data Fetching
tsx
async function getData() {
  const [posts, users] = await Promise.all([
    fetch('https://api.example.com/posts').then(r => r.json()),
    fetch('https://api.example.com/users').then(r => r.json()),
  ])

  return { posts, users }
}
Sequential Data Fetching
tsx
async function getData() {
  const post = await fetch(`https://api.example.com/posts/${id}`).then(r => r.json())
  const author = await fetch(`https://api.example.com/users/${post.authorId}`).then(r => r.json())

  return { post, author }
}

Route Handlers (API Routes)

Basic Route Handler
tsx
// app/api/hello/route.ts
export async function GET(request: Request) {
  return Response.json({ message: 'Hello' })
}

export async function POST(request: Request) {
  const body = await request.json()
  return Response.json({ received: body })
}
Dynamic Route Handler
tsx
// app/api/posts/[id]/route.ts
export async function GET(
  request: Request,
  { params }: { params: { id: string } }
) {
  const post = await getPost(params.id)
  return Response.json(post)
}

export async function DELETE(
  request: Request,
  { params }: { params: { id: string } }
) {
  await deletePost(params.id)
  return new Response(null, { status: 204 })
}
Request Helpers
tsx
export async function GET(request: Request) {
  const { searchParams } = new URL(request.url)
  const id = searchParams.get('id')

  const cookies = request.headers.get('cookie')

  return Response.json({ id })
}
Response Types
tsx
// JSON
return Response.json({ data: 'value' })

// Text
return new Response('Hello', { headers: { 'Content-Type': 'text/plain' } })

// Redirect
return Response.redirect('https://example.com')

// Status codes
return new Response('Not Found', { status: 404 })

Navigation

tsx
import Link from 'next/link'

export default function Page() {
  return (
    <>
      <Link href="/about">About</Link>
      <Link href="/blog/post-1">Post 1</Link>
      <Link href={{ pathname: '/blog/[slug]', query: { slug: 'post-1' } }}>
        Post 1 (alternative)
      </Link>
    </>
  )
}
useRouter Hook (Client)
tsx
'use client'

import { useRouter } from 'next/navigation'

export function NavigateButton() {
  const router = useRouter()

  return (
    <button onClick={() => router.push('/dashboard')}>
      Dashboard
    </button>
  )
}

Router Methods:

  • router.push(href) - Navigate to route
  • router.replace(href) - Replace current history
  • router.refresh() - Refresh current route
  • router.back() - Navigate back
  • router.forward() - Navigate forward
  • router.prefetch(href) - Prefetch route
Programmatic Navigation (Server)
tsx
import { redirect } from 'next/navigation'

export default async function Page() {
  const session = await getSession()

  if (!session) {
    redirect('/login')
  }

  return <div>Protected content</div>
}

Metadata & SEO

Static Metadata
tsx
// app/page.tsx
import { Metadata } from 'next'

export const metadata: Metadata = {
  title: 'My Page',
  description: 'Page description',
  keywords: ['nextjs', 'react'],
  openGraph: {
    title: 'My Page',
    description: 'Page description',
    images: ['/og-image.jpg'],
  },
  twitter: {
    card: 'summary_large_image',
    title: 'My Page',
    description: 'Page description',
    images: ['/twitter-image.jpg'],
  },
}

export default function Page() {
  return <div>Content</div>
}
Dynamic Metadata
tsx
// app/blog/[slug]/page.tsx
export async function generateMetadata({ params }): Promise<Metadata> {
  const post = await getPost(params.slug)

  return {
    title: post.title,
    description: post.excerpt,
    openGraph: {
      title: post.title,
      description: post.excerpt,
      images: [post.coverImage],
    },
  }
}
Metadata Files
  • favicon.ico, icon.png, apple-icon.png - Favicons
  • opengraph-image.png, twitter-image.png - Social images
  • robots.txt - Robots file
  • sitemap.xml - Sitemap

Image Optimization

Image Component
tsx
import Image from 'next/image'

export default function Page() {
  return (
    <>
      {/* Local image */}
      <Image
        src="/profile.png"
        alt="Profile"
        width={500}
        height={500}
      />

      {/* Remote image */}
      <Image
        src="https://example.com/image.jpg"
        alt="Remote"
        width={500}
        height={500}
      />

      {/* Responsive fill */}
      <div style={{ position: 'relative', width: '100%', height: '400px' }}>
        <Image
          src="/hero.jpg"
          alt="Hero"
          fill
          style={{ objectFit: 'cover' }}
        />
      </div>

      {/* Priority loading */}
      <Image
        src="/hero.jpg"
        alt="Hero"
        width={1200}
        height={600}
        priority
      />
    </>
  )
}

Image Props:

  • src - Image path (local or URL)
  • alt - Alt text (required)
  • width, height - Dimensions (required unless fill)
  • fill - Fill parent container
  • sizes - Responsive sizes
  • quality - 1-100 (default 75)
  • priority - Preload image
  • placeholder - 'blur' | 'empty'
  • blurDataURL - Data URL for blur
Show full SKILL.md (337 more words)Show less
Remote Image Configuration
js
// next.config.js
module.exports = {
  images: {
    remotePatterns: [
      {
        protocol: 'https',
        hostname: 'example.com',
        pathname: '/images/**',
      },
    ],
  },
}

Font Optimization

Google Fonts
tsx
// app/layout.tsx
import { Inter, Roboto_Mono } from 'next/font/google'

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

const robotoMono = Roboto_Mono({
  subsets: ['latin'],
  display: 'swap',
  variable: '--font-roboto-mono',
})

export default function RootLayout({ children }) {
  return (
    <html lang="en" className={`${inter.className} ${robotoMono.variable}`}>
      <body>{children}</body>
    </html>
  )
}
Local Fonts
tsx
import localFont from 'next/font/local'

const myFont = localFont({
  src: './fonts/my-font.woff2',
  display: 'swap',
  variable: '--font-my-font',
})

Loading States

Loading File
tsx
// app/dashboard/loading.tsx
export default function Loading() {
  return <div>Loading dashboard...</div>
}
Streaming with Suspense
tsx
// app/page.tsx
import { Suspense } from 'react'

async function Posts() {
  const posts = await getPosts()
  return <ul>{posts.map(p => <li key={p.id}>{p.title}</li>)}</ul>
}

export default function Page() {
  return (
    <div>
      <h1>My Posts</h1>
      <Suspense fallback={<div>Loading posts...</div>}>
        <Posts />
      </Suspense>
    </div>
  )
}

Error Handling

Error File
tsx
// app/error.tsx
'use client'

export default function Error({
  error,
  reset,
}: {
  error: Error & { digest?: string }
  reset: () => void
}) {
  return (
    <div>
      <h2>Something went wrong!</h2>
      <p>{error.message}</p>
      <button onClick={() => reset()}>Try again</button>
    </div>
  )
}
Global Error
tsx
// app/global-error.tsx
'use client'

export default function GlobalError({
  error,
  reset,
}: {
  error: Error & { digest?: string }
  reset: () => void
}) {
  return (
    <html>
      <body>
        <h2>Something went wrong!</h2>
        <button onClick={() => reset()}>Try again</button>
      </body>
    </html>
  )
}
Not Found
tsx
// app/not-found.tsx
export default function NotFound() {
  return (
    <div>
      <h2>404 - Not Found</h2>
      <p>Could not find requested resource</p>
    </div>
  )
}

// Trigger programmatically
import { notFound } from 'next/navigation'

export default async function Page({ params }) {
  const post = await getPost(params.id)

  if (!post) {
    notFound()
  }

  return <div>{post.title}</div>
}

Middleware

tsx
// middleware.ts
import { NextResponse } from 'next/server'
import type { NextRequest } from 'next/server'

export function middleware(request: NextRequest) {
  // Authentication check
  const token = request.cookies.get('token')

  if (!token) {
    return NextResponse.redirect(new URL('/login', request.url))
  }

  // Add custom header
  const response = NextResponse.next()
  response.headers.set('x-custom-header', 'value')

  return response
}

export const config = {
  matcher: ['/dashboard/:path*', '/api/:path*'],
}

Environment Variables

env
# .env.local
DATABASE_URL=postgresql://...
NEXT_PUBLIC_API_URL=https://api.example.com
tsx
// Server-side only
const dbUrl = process.env.DATABASE_URL

// Client and server (NEXT_PUBLIC_ prefix)
const apiUrl = process.env.NEXT_PUBLIC_API_URL

Configuration

next.config.js
js
/** @type {import('next').NextConfig} */
const nextConfig = {
  // React strict mode
  reactStrictMode: true,

  // Image domains
  images: {
    remotePatterns: [
      { protocol: 'https', hostname: 'example.com' },
    ],
  },

  // Redirects
  async redirects() {
    return [
      {
        source: '/old-page',
        destination: '/new-page',
        permanent: true,
      },
    ]
  },

  // Rewrites
  async rewrites() {
    return [
      {
        source: '/api/:path*',
        destination: 'https://api.example.com/:path*',
      },
    ]
  },

  // Headers
  async headers() {
    return [
      {
        source: '/(.*)',
        headers: [
          { key: 'X-Frame-Options', value: 'DENY' },
        ],
      },
    ]
  },

  // Environment variables
  env: {
    CUSTOM_KEY: 'value',
  },
}

module.exports = nextConfig

Best Practices

  1. Use Server Components: Default to Server Components, use Client Components only when needed
  2. Optimize Images: Always use next/image for automatic optimization
  3. Metadata: Set proper metadata for SEO
  4. Loading States: Provide loading UI with Suspense
  5. Error Handling: Implement error boundaries
  6. Route Handlers: Use for API endpoints instead of separate backend
  7. Caching: Leverage built-in caching strategies
  8. Layouts: Use nested layouts to share UI
  9. TypeScript: Enable TypeScript for type safety
  10. Performance: Use priority for above-fold images, lazy load below-fold

Common Patterns

Protected Routes
tsx
// app/dashboard/layout.tsx
import { redirect } from 'next/navigation'
import { getSession } from '@/lib/auth'

export default async function DashboardLayout({ children }) {
  const session = await getSession()

  if (!session) {
    redirect('/login')
  }

  return <>{children}</>
}
Data Mutations (Server Actions)
tsx
// app/actions.ts
'use server'

import { revalidatePath } from 'next/cache'

export async function createPost(formData: FormData) {
  const title = formData.get('title')

  await db.post.create({ data: { title } })

  revalidatePath('/posts')
}

// app/posts/new/page.tsx
import { createPost } from '@/app/actions'

export default function NewPost() {
  return (
    <form action={createPost}>
      <input name="title" type="text" required />
      <button type="submit">Create</button>
    </form>
  )
}
Static Generation
tsx
// Generate static params for dynamic routes
export async function generateStaticParams() {
  const posts = await getPosts()

  return posts.map(post => ({
    slug: post.slug,
  }))
}

export default async function Post({ params }) {
  const post = await getPost(params.slug)
  return <article>{post.content}</article>
}

Deployment

bash
# Install Vercel CLI
npm i -g vercel

# Deploy
vercel
Self-Hosting
bash
# Build
npm run build

# Start production server
npm start

Requirements:

  • Node.js 18.17 or later
  • output: 'standalone' in next.config.js (optional, reduces size)
Docker
dockerfile
FROM node:18-alpine AS base

FROM base AS deps
WORKDIR /app
COPY package*.json ./
RUN npm ci

FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npm run build

FROM base AS runner
WORKDIR /app
ENV NODE_ENV production
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static

EXPOSE 3000
CMD ["node", "server.js"]

Troubleshooting

Common Issues
  1. Hydration errors

    • Ensure server and client render same content
    • Check for browser-only code in Server Components
    • Verify no conditional rendering based on browser APIs
  2. Images not loading

    • Add remote domains to next.config.js
    • Check image paths (use leading / for public)
    • Verify width/height provided
  3. API route 404

    • Check file is named route.ts/js not index.ts
    • Verify export named GET/POST not default export
    • Ensure in app/api/ directory
  4. "use client" errors

    • Add 'use client' to components using hooks
    • Import Client Components in Server Components, not vice versa
    • Check event handlers have 'use client'
  5. Metadata not updating

    • Clear browser cache
    • Check metadata export is named correctly
    • Verify async generateMetadata returns Promise<Metadata>

Resources

Implementation Checklist

When building with Next.js:

  • Create project with create-next-app
  • Configure TypeScript and ESLint
  • Set up root layout with metadata
  • Implement routing structure
  • Add loading and error states
  • Configure image optimization
  • Set up font optimization
  • Implement data fetching patterns
  • Add API routes as needed
  • Configure environment variables
  • Set up middleware if needed
  • Optimize for production build
  • Test in production mode
  • Configure deployment platform
  • Set up monitoring and analytics

© einverne, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in claude/skills/nextjs of einverne/dotfiles.

Open the folder on GitHubat commit c6c0686

Compare with similar skills

Nextjs next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Nextjs compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Nextjs this skilleinverne/dotfiles121—~5.6kAutomated safety check: NotesMIT
Rsc Data Optimizerjulianromli/opencode-template1441 repos~805Automated safety check: PassNone
Nextjs Ssrasmyshlyaev177/test-proxy-recorder112—~4.4kAutomated safety check: PassMIT
Portaljs Connect Ckandatopian/portaljs2.4k1 repos~1.5kAutomated safety check: PassMIT
Documentation LookupKaimingWan/oh-my-kiro107—~616Automated safety check: PassMIT
Fullstack DevHHU3637kr/skills1453 repos~8.6kAutomated safety check: NotesMIT

Similar skills

  • Rsc Data Optimizer

    julianromli/opencode-template

    Optimize Next.js App Router data fetching by converting slow client-side fetching to fast server-side fetching using React Server Components (RSC).

    144 GitHub starsUsed in 1 repo~805 tokens
    Backend & APIsAuto-check passed
  • Nextjs Ssr

    asmyshlyaev177/test-proxy-recorder

    Tag server-side fetches with the x-test-rcrd-id session header so SSR is recorded under the correct Playwright test session.

    112 GitHub stars~4.4k tokensUpdated today
    Backend & APIsAuto-check passed
  • Portaljs Connect Ckan

    datopian/portaljs

    Wire a scaffolded PortalJS portal to a CKAN backend over its API.

    2.4k GitHub starsUsed in 1 repo~1.5k tokens
    DevelopmentAuto-check passed
  • Documentation Lookup

    KaimingWan/oh-my-kiro

    Fetch current library/framework documentation via Context7. An agent skill from KaimingWan/oh-my-kiro.

    107 GitHub stars~616 tokensUpdated 6 mo ago
    Backend & APIsAuto-check passed
  • Fullstack Dev

    HHU3637kr/skills

    Full-stack backend architecture and frontend-backend integration guide.

    145 GitHub starsUsed in 3 repos~8.6k tokens
    Backend & APIsAuto-check: notes
  • Senior Fullstack

    alirezarezvani/claude-skills

    Fullstack development toolkit with project scaffolding for Next.js, FastAPI, MERN, and Django stacks, code quality analysis with security and complexity scoring, and stack selection guidance.

    28k GitHub starsUsed in 1 repo~3.7k tokens
    DevelopmentAuto-check: notes

More from einverne/dotfiles

All 39 skills in this repo
  • DOCX

    einverne/dotfiles

    Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction.

    121 GitHub starsUsed in 35 repos~2.5k tokens
    Auto-check: notes
  • Chrome Devtools

    einverne/dotfiles

    Browser automation, debugging, and performance analysis using Puppeteer CLI scripts.

    121 GitHub starsUsed in 1 repo~1.6k tokens
    Auto-check: notes
  • PDF

    einverne/dotfiles

    Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms.

    121 GitHub starsUsed in 47 repos~1.8k tokens
    Auto-check passed
  • Gemini Audio

    einverne/dotfiles

    Guide for implementing Google Gemini API audio capabilities - analyze audio with transcription, summarization, and understanding (up to 9.5 hours), plus generate speech with controllable TTS.

    121 GitHub stars~2k tokensUpdated 1 mo ago
    Auto-check: notes
  • Guide for implementing Google Gemini API document processing - analyze PDFs with native vision to extract text, images, diagrams, charts, and tables.

    121 GitHub stars~1.6k tokensUpdated 1 mo ago
    Auto-check: notes
  • PPTX

    einverne/dotfiles

    Presentation creation, editing, and analysis. An agent skill from einverne/dotfiles.

    121 GitHub starsUsed in 38 repos~6.4k tokens
    Auto-check: notes

Works with

Questions about Nextjs

What does Nextjs do?

Guide for implementing Next.js - a React framework for production with server-side rendering, static generation, and modern web features. Nextjs is an agent skill from einverne/dotfiles.js - a React framework for production with server-side rendering, static generation, and modern web features.

When should I use Nextjs?

Nextjs fits situations like: building Next.js applications; implementing App Router; working with server components; optimizing performance.

How do I install Nextjs in Claude Code?

Run `npx skills add einverne/dotfiles --skill nextjs -a claude-code`. Or copy the skill folder (claude/skills/nextjs in einverne/dotfiles) into .claude/skills/nextjs in your project. Claude Code loads it when a task matches its description.

How do I install Nextjs in Codex?

Run `npx skills add einverne/dotfiles --skill nextjs -a codex`. Or copy the skill folder (claude/skills/nextjs in einverne/dotfiles) into .agents/skills/nextjs in your project. Codex loads it when a task matches its description.

Can I use Nextjs in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add einverne/dotfiles --skill nextjs -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/nextjs, .gemini/skills/nextjs, .github/skills/nextjs and .opencode/skills/nextjs in your project.

What does Nextjs need to run?

Going by SKILL.md and its folder, Nextjs needs the command-line tools its instructions call (npm, npx, yarn, pnpm, bun and vercel) and credentials named CUSTOM_KEY. Our summary lists: Node.js.

Does Nextjs access the network?

SKILL.md names 2 domains. As links in the text: nextjs.org and github.com. This is read from the text; nothing was executed.

Is Nextjs safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Nextjs use?

Nextjs is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Nextjs use?

About 5.6k tokens (SKILL.md is roughly 22k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Nextjs?

Skills that share tags, products or a category with Nextjs: Rsc Data Optimizer (julianromli/opencode-template, 144 stars), Nextjs Ssr (asmyshlyaev177/test-proxy-recorder, 112 stars), Portaljs Connect Ckan (datopian/portaljs, 2.4k stars) and Documentation Lookup (KaimingWan/oh-my-kiro, 107 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Nextjs?

einverne (a GitHub user) maintains it in einverne/dotfiles, which has 121 GitHub stars. The repository holds 39 skills in this directory. The repository was last updated on September 9, 2026.

Source: einverne/dotfiles on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.