nextjsmastery

A NextjsMastery specialized skill that helps an AI Agent efficiently complete tasks related to Next.js.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "nextjsmastery" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-7b71feb492064e7ab3cddbc6b55214d8ca5e7bb6628e55cddeb4dda25437d6de. Verify the upstream source and version against https://skillhub.cn/skills/user_3c6cb52e/nextjs-mastery-exs9 before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

A NextjsMastery specialized skill that helps an AI Agent efficiently complete tasks related to Next.js.

0 Downloads

Introduction source: third_party · user_3c6cb52e · 1.0.0 Reference

SkillPi interpretation

Tasks
Route groups `(name)` organize code without affecting URLs. Parallel routes `@slot` render multiple pages simultaneously.
Audience
Not specified in the source documentation.
Inputs and outputs
Not specified in the source documentation.
Software, accounts and paid services
Not specified in the source documentation.
Limits and differences
Not specified in the source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: Nextjsmastery
slug: nextjs-mastery
version: 1.0.0
displayName: Nextjsmastery
description: >
  NextjsMastery专用技能,帮助AI Agent高效完成相关任务。
summary: "NextjsMastery专用技能,帮助AI Agent高效完成相关任务。"
license: MIT
category: 开发者工具
framework:
  - Claude Code
  - Codex
  - Hermes Agent
  - OpenClaw
  - QClaw
  - WorkBuddy
platform: multi-platform
homepage: "https://github.com/1991513ccie-png"
repository: "https://github.com/1991513ccie-png"

Next.js Mastery

App Router Structure

app/
  layout.tsx              # Root layout (wraps all pages)
  page.tsx                # Home route /
  loading.tsx             # Route-level Suspense fallback
  error.tsx               # Route-level error boundary
  not-found.tsx           # Custom 404
  (marketing)/
    about/page.tsx        # /about (grouped without URL segment)
  dashboard/
    layout.tsx            # Nested layout for /dashboard/*
    page.tsx              # /dashboard
    @analytics/page.tsx   # Parallel route slot
    @activity/page.tsx    # Parallel route slot
    settings/
      page.tsx            # /dashboard/settings
  api/
    webhooks/route.ts     # Route handler (POST /api/webhooks)

Route groups (name) organize code without affecting URLs. Parallel routes @slot render multiple pages simultaneously.

Server Components and Data Fetching

async function ProductPage({ params }: { params: Promise<{ id: string }> }) {
  const { id } = await params;
  const product = await db.product.findUnique({ where: { id } });

  if (!product) notFound();

  return (
    <div>
      <h1>{product.name}</h1>
      <p>{product.description}</p>
      <Suspense fallback={<ReviewsSkeleton />}>
        <Reviews productId={id} />
      </Suspense>
    </div>
  );
}

async function Reviews({ productId }: { productId: string }) {
  const reviews = await db.review.findMany({ where: { productId } });
  return (
    <ul>
      {reviews.map(r => <li key={r.id}>{r.text} - {r.rating}/5</li>)}
    </ul>
  );
}

Server Components are the default. They run on the server, can access databases directly, and send zero JavaScript to the client.

ISR and Caching

export const revalidate = 3600;

async function BlogPage() {
  const posts = await fetch("https://api.example.com/posts", {
    next: { revalidate: 3600, tags: ["posts"] },
  }).then(r => r.json());

  return <PostList posts={posts} />;
}
import { revalidateTag, revalidatePath } from "next/cache";

export async function createPost(formData: FormData) {
  "use server";
  await db.post.create({ data: { title: formData.get("title") as string } });
  revalidateTag("posts");
  revalidatePath("/blog");
}

Middleware

import { NextResponse } from "next/server";
import type { NextRequest } from "next/server";

export function middleware(request: NextRequest) {
  const token = request.cookies.get("session")?.value;

  if (request.nextUrl.pathname.startsWith("/dashboard") && !token) {
    return NextResponse.redirect(new URL("/login", request.url));
  }

  const response = NextResponse.next();
  response.headers.set("x-request-id", crypto.randomUUID());
  return response;
}

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

Middleware runs at the edge before every matched request. Keep it lightweight.

Server Actions

"use server";

import { z } from "zod";
import { revalidatePath } from "next/cache";

const schema = z.object({
  email: z.string().email(),
  name: z.string().min(2).max(100),
});

export async function updateProfile(prevState: any, formData: FormData) {
  const parsed = schema.safeParse(Object.fromEntries(formData));
  if (!parsed.success) {
    return { errors: parsed.error.flatten().fieldErrors };
  }

  await db.user.update({
    where: { email: parsed.data.email },
    data: { name: parsed.data.name },
  });

  revalidatePath("/profile");
  return { success: true };
}

Anti-Patterns

  • Adding 'use client' to top-level layout or page components
  • Fetching data on the client when it can be done in a Server Component
  • Using useEffect for data fetching instead of Server Components or use()
  • Not wrapping slow async components with <Suspense>
  • Putting heavy logic in middleware (it runs on every matched request)
  • Ignoring loading.tsx and error.tsx conventions

Checklist

  • [ ] Server Components used by default; 'use client' only on interactive leaves
  • [ ] Data fetching happens in Server Components with proper caching
  • [ ] <Suspense> boundaries wrap independent async sections
  • [ ] loading.tsx and error.tsx exist for key routes
  • [ ] Middleware is lightweight and only handles auth/redirects/headers
  • [ ] Server Actions validate input with Zod before database writes
  • [ ] revalidateTag or revalidatePath called after mutations
  • [ ] Route groups and parallel routes used to organize complex layouts

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value78/100

Highlights

  • 提供 Next.js 开发的完整知识体系,涵盖 App Router、Server Components、ISR、Middleware 等核心概念
  • 面向开发者群体,具有明确的实用价值和广泛的应用场景
Trigger Precision65/100

Areas to improve

  • 触发词描述不完整 Reported severity: Minor

    description 仅说明是 NextjsMastery 专用技能,但缺乏具体的触发关键词描述

    Recommendation: 建议补充具体的触发词,如 'nextjs'、'next.js'、'app router' 等,以便用户准确触发

Highlights

  • description 明确了技能的专业领域和目标用户
Structure and Standards75/100

Areas to improve

  • 缺少 When to Use 章节 Reported severity: Minor

    文档缺少明确的使用场景说明章节

    Recommendation: 建议添加 When to Use 章节,说明在什么情况下用户应该使用此技能

  • 缺少端到端使用示例 Reported severity: Minor

    虽然有代码片段,但缺少完整的使用流程示例

    Recommendation: 建议添加一个完整的使用示例,展示用户如何从触发到获得帮助的全过程

Highlights

  • 文档结构清晰,代码示例丰富且格式规范
  • frontmatter 完整,包含必要的元数据信息
Execution Reliability85/100

Highlights

  • 内容为知识性文档,信息准确可靠
  • 提供了最佳实践和反模式,有助于用户避免常见错误
Evidence Verifiability (mean of the first four)76/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • api.example.com
  • github.com

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Not specified in the source documentation.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.