nextjs-mastery-sh-plbuw1
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 "nextjs-mastery-sh-plbuw1" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-2f98a4e54d297655fa834035da9f429bb7cbb7d618b6da391943fad421ab0ce3. Verify the upstream source and version against https://skillhub.cn/skills/user_3c6cb52e/nextjs-mastery-sh-plbuw1 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 dedicated skill for Nextjsmastery to help an AI agent efficiently perform tasks related to Nextjsmastery.
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
Frontmatter
name: Nextjsmastery
slug: nextjs-mastery
version: 1.0.0
displayName: Nextjsmastery
description: >
Nextjsmastery专用技能,帮助AI Agent高效完成相关任务。
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
useEffectfor data fetching instead of Server Components oruse() - Not wrapping slow async components with
<Suspense> - Putting heavy logic in middleware (it runs on every matched request)
- Ignoring
loading.tsxanderror.tsxconventions
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.tsxanderror.tsxexist for key routes - [ ] Middleware is lightweight and only handles auth/redirects/headers
- [ ] Server Actions validate input with Zod before database writes
- [ ]
revalidateTagorrevalidatePathcalled after mutations - [ ] Route groups and parallel routes used to organize complex layouts
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供 Next.js App Router、Server Components、ISR、Middleware、Server Actions 等核心开发知识的系统性指南
- 包含反模式提醒和检查清单,有助于开发者规避常见错误
Areas to improve
-
description内容截断 Reported severity: Major
description 字段内容重复且模糊,仅写“Nextjsmastery专用技能,帮助AI Agent高效完成相关任务”,未明确说明具体触发场景或用户意图,缺乏精准触发词,容易导致误触或漏触。
Recommendation: 建议重写 description,明确说明 Skill 的具体用途,例如“当用户需要了解 Next.js App Router 结构、Server Components 数据获取、ISR 缓存策略、Middleware 配置或 Server Actions 实现时触发”。
Areas to improve
-
缺少When to Use/示例章节 Reported severity: Minor
文档结构良好,但未提供明确的 When to Use 章节和端到端使用示例,用户可能不清楚在何种具体场景下使用此 Skill。
Recommendation: 建议在文档开头添加 When to Use 章节,说明典型使用场景,例如“当开发者需要快速查阅 Next.js 最佳实践、项目结构规范或性能优化策略时使用”。
Highlights
- 文档结构清晰,分章节讲解 Next.js 核心概念,包含代码示例和反模式
Highlights
- 内容为知识性文档,信息准确,覆盖 Next.js 最新特性和最佳实践
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
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.
User discussion
No verified reviews yet.