askill
nextjs

nextjsSafety 95Repository

Next.js 16.1+ App Router patterns including Server Components, Client Components, Server Actions, Route Handlers, Turbopack, MCP integration, and modern React patterns. Use when building pages, layouts, data fetching, or API routes. Triggers on Next.js, App Router, RSC, or Server Actions questions.

0 stars
1.2k downloads
Updated 1/5/2026

Package Files

Loading files...
SKILL.md

Next.js App Router

Expert knowledge for building modern web applications with Next.js App Router.

Next.js 16.1.1 highlights

  • Turbopack improvements: faster next dev restarts (project-dependent)
  • Bundle Analyzer (experimental): next experimental-analyze
  • Easier Debugging: next dev --inspect
  • Upgrade Command: next upgrade
  • MCP Server: Built-in /_next/mcp endpoint for coding agents

MCP Server (Coding Agents)

Next.js 16+ includes MCP support for AI coding agents via next-devtools-mcp:

Setup

// .mcp.json at project root
{
  "mcpServers": {
    "next-devtools": {
      "command": "npx",
      "args": ["-y", "next-devtools-mcp@latest"]
    }
  }
}

Available Tools

ToolPurpose
get_errorsBuild errors, runtime errors, and type errors
get_logsDev log file path (browser console, server output)
get_page_metadataRoutes, components, rendering info
get_project_metadataProject structure, config, dev server URL
get_server_action_by_idLookup Server Actions by ID

Capabilities

  • Error Detection: Real-time build/runtime/type errors
  • Live State Queries: Access application state and runtime info
  • Page Metadata: Query routes, components, rendering details
  • Server Actions: Inspect Server Actions and component hierarchies
  • Knowledge Base: Query Next.js documentation
  • Migration Tools: Automated upgrade helpers with codemods
  • Playwright Integration: Browser testing via Playwright MCP

Core Concepts

Server Components (Default)

All components in the app/ directory are Server Components by default:

// app/posts/page.tsx - Server Component
export default async function PostsPage() {
  const posts = await db.post.findMany();

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

Client Components

Use 'use client' directive for interactivity:

'use client';

import { useState } from 'react';

export function Counter() {
  const [count, setCount] = useState(0);
  return <button onClick={() => setCount((c) => c + 1)}>{count}</button>;
}

Server Actions

Use 'use server' for mutations:

'use server';

import { revalidatePath } from 'next/cache';

export async function createPost(formData: FormData) {
  await db.post.create({ data: { title: formData.get('title') } });
  revalidatePath('/posts');
}

File Conventions

FilePurpose
page.tsxUnique UI for route
layout.tsxShared UI wrapper
loading.tsxLoading UI (Suspense)
error.tsxError boundary
not-found.tsx404 UI
route.tsAPI endpoint

References

Assets

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

78/100Analyzed 2/23/2026

Comprehensive Next.js 16.1.1 skill covering App Router patterns, Server/Client Components, Server Actions, and MCP integration. Well-structured with good code examples and clear triggers. Slight penalty for heavy reliance on external reference files not included in the skill itself. Generic enough to be reusable across projects despite the .github path."

95
85
80
65
80

Metadata

Licenseunknown
Version-
Updated1/5/2026
PublisherFractionEstate

Tags

apici-cdgithub