Token导航 LogoToken导航

Agent Skill · 前端设计

nextjs-app-router-expert(Next.js 应用 router expert)

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

nextjs-app-router-expert 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 7,174。

总安装 412周安装 17GitHub Stars 98下载 135核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:nextjs-app-router-expert(Next.js 应用 router expert)
来源仓库:https://github.com/curiositech/some_claude_skills
仓库路径:skills/nextjs-app-router-expert
安装命令:
npx skills add https://github.com/curiositech/some_claude_skills --skill nextjs-app-router-expert
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/curiositech/some_claude_skills --skill nextjs-app-router-expert

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

用于辅助前端页面、组件和样式开发。nextjs-app-router-expert 属于前端设计类 Skill,可作为该场景下的辅助能力补充。适合生成或审查 React、Next.js 相关代码。需要结合项目现有设计系统和路由方式使用。避免生成孤立片段,涉及页面改动应配合预览检查。

建议先确认构建方式和视觉效果再实施改动。

来源仓库内路径:skills/nextjs-app-router-expert

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/curiositech/some_claude_skills --skill nextjs-…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

nextjs-app-router-expert 怎么安装?

在终端执行 npx skills add https://github.com/curiositech/some_claude_skills --skill nextjs-app-router…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

nextjs-app-router-expert 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

nextjs-app-router-expert 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

nextjs-app-router-expert 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

nextjs-app-router-expert 用的人多吗?

公开数据是累计安装 412 次,近一周安装 17 次,下载 135 次,GitHub 98 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

nextjs-app-router-expert 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
nextjs-app-router-expert

Next.js 应用 router expert · 本页

41298需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Next.js App Router Expert

Overview

Expert in Next.js 14/15 App Router architecture, React Server Components (RSC), Server Actions, and modern full-stack React development. Specializes in routing patterns, data fetching strategies, caching, streaming, and deployment optimization.

When to Use

  • Starting a new Next.js project with App Router
  • Migrating from Pages Router to App Router
  • Implementing complex routing patterns (parallel, intercepting routes)
  • Optimizing data fetching with RSC and caching
  • Setting up Server Actions for mutations
  • Configuring middleware for auth/redirects
  • Debugging hydration errors or RSC issues
  • Deploying to Vercel, Cloudflare, or self-hosted

Capabilities

Routing Architecture

  • File-based routing with app/ directory
  • Dynamic routes ([slug], [...catchAll], [[...optional]])
  • Route groups (group) for organization
  • Parallel routes @modal, @sidebar
  • Intercepting routes (.), (..), (..)(..)
  • Loading and error boundaries per route segment

React Server Components

  • Server vs Client component boundaries
  • 'use client' directive placement
  • Composition patterns (server wrapping client)
  • Streaming with Suspense boundaries
  • Progressive rendering strategies

Data Fetching

  • fetch() with automatic deduplication
  • Caching strategies (force-cache, no-store, revalidate)
  • generateStaticParams() for static generation
  • Incremental Static Regeneration (ISR)
  • On-demand revalidation with revalidatePath() / revalidateTag()

Server Actions

  • Form mutations with 'use server'
  • Optimistic updates with useOptimistic
  • Progressive enhancement (works without JS)
  • Error handling and validation
  • Redirect after mutation

Middleware & Edge

  • middleware.ts for auth, redirects, rewrites
  • Edge Runtime vs Node.js Runtime
  • Geolocation and conditional routing
  • A/B testing and feature flags

Performance Optimization

  • Image optimization with next/image
  • Font optimization with next/font
  • Script loading strategies
  • Bundle analysis and code splitting
  • Partial prerendering (PPR)

Dependencies

Works well with:

  • react-performance-optimizer - React-specific performance patterns
  • vercel-deployment - Vercel deployment configuration
  • cloudflare-worker-dev - Edge deployment patterns
  • postgresql-optimization - Database queries for RSC

Examples

Basic Route Structure

app/
├── layout.tsx          # Root layout (required)
├── page.tsx            # Home page (/)
├── loading.tsx         # Loading UI
├── error.tsx           # Error boundary
├── not-found.tsx       # 404 page
├── blog/
│   ├── page.tsx        # /blog
│   └── [slug]/
│       ├── page.tsx    # /blog/:slug
│       └── loading.tsx # Per-route loading
└── (auth)/             # Route group (no URL impact)
    ├── login/
    │   └── page.tsx    # /login
    └── register/
        └── page.tsx    # /register

Server Component with Data Fetching

// app/posts/page.tsx
import { Suspense } from 'react';

async function getPosts() {
  const res = await fetch('https://api.example.com/posts', {
    next: { revalidate: 3600 }, // ISR: revalidate every hour
  });
  return res.json();
}

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

  return (
    <main>
      <h1>Blog Posts</h1>
      <Suspense fallback={<PostsSkeleton />}>
        <PostList posts={posts} />
      </Suspense>
    </main>
  );
}

Server Action Form

// app/contact/page.tsx
import { redirect } from 'next/navigation';
import { revalidatePath } from 'next/cache';

async function submitContact(formData: FormData) {
  'use server';

  const email = formData.get('email') as string;
  const message = formData.get('message') as string;

  // Validate
  if (!email || !message) {
    throw new Error('Email and message required');
  }

  // Save to database
  await db.contacts.create({ email, message });

  // Revalidate and redirect
  revalidatePath('/contact');
  redirect('/contact/success');
}

export default function ContactPage() {
  return (
    <form action={submitContact}>
      <input name="email" type="email" required />
      <textarea name="message" required />
      <button type="submit">Send</button>
    </form>
  );
}

Parallel Routes (Modal Pattern)

app/
├── layout.tsx
├── page.tsx
├── @modal/
│   ├── default.tsx     # Empty state when no modal
│   └── (.)photo/[id]/
│       └── page.tsx    # Intercept /photo/[id] as modal
└── photo/[id]/
    └── page.tsx        # Full page when direct navigation
// app/layout.tsx
export default function Layout({
  children,
  modal,
}: {
  children: React.ReactNode;
  modal: React.ReactNode;
}) {
  return (
    <>
      {children}
      {modal}
    </>
  );
}

Middleware for Auth

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

export function middleware(request: NextRequest) {
  const token = request.cookies.get('auth-token');
  const isAuthPage = request.nextUrl.pathname.startsWith('/login');
  const isProtectedPage = request.nextUrl.pathname.startsWith('/dashboard');

  // Redirect authenticated users away from login
  if (isAuthPage && token) {
    return NextResponse.redirect(new URL('/dashboard', request.url));
  }

  // Redirect unauthenticated users to login
  if (isProtectedPage && !token) {
    return NextResponse.redirect(new URL('/login', request.url));
  }

  return NextResponse.next();
}

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

Static Generation with Dynamic Params

// app/blog/[slug]/page.tsx
import { notFound } from 'next/navigation';

export async function generateStaticParams() {
  const posts = await fetch('https://api.example.com/posts').then(r => r.json());

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

export async function generateMetadata({ params }: { params: { slug: string } }) {
  const post = await getPost(params.slug);

  return {
    title: post?.title ?? 'Post Not Found',
    description: post?.excerpt,
  };
}

export default async function PostPage({ params }: { params: { slug: string } }) {
  const post = await getPost(params.slug);

  if (!post) {
    notFound();
  }

  return (
    <article>
      <h1>{post.title}</h1>
      {/* NOTE: Always sanitize HTML content with DOMPurify before rendering */}
      <div>{post.content}</div>
    </article>
  );
}

Streaming with Suspense

// app/dashboard/page.tsx
import { Suspense } from 'react';

export default function DashboardPage() {
  return (
    <div className="grid grid-cols-2 gap-4">
      {/* These load in parallel and stream in as ready */}
      <Suspense fallback={<CardSkeleton />}>
        <RevenueCard />
      </Suspense>
      <Suspense fallback={<CardSkeleton />}>
        <UsersCard />
      </Suspense>
      <Suspense fallback={<TableSkeleton />}>
        <RecentOrders />
      </Suspense>
    </div>
  );
}

// Each component fetches its own data
async function RevenueCard() {
  const revenue = await getRevenue(); // Server-side fetch
  return <Card title="Revenue" value={revenue} />;
}

Best Practices

  1. Server Components by default - Only add 'use client' when needed for interactivity
  2. Colocate data fetching - Fetch data in the component that needs it
  3. Use Suspense boundaries - Wrap async components for streaming
  4. Leverage caching - Use revalidate and tags for efficient caching
  5. Progressive enhancement - Server Actions work without JavaScript
  6. Route groups for organization - Use (folder) to organize without affecting URLs
  7. Error boundaries per segment - Add error.tsx to critical routes
  8. Metadata API - Use generateMetadata for dynamic SEO
  9. Sanitize user content - Always use DOMPurify or similar when rendering HTML

Common Pitfalls

  • Hydration mismatches - Server/client rendering differences (dates, random values)
  • Over-using 'use client' - Pushing client boundary too high in the tree
  • Waterfall fetching - Not parallelizing independent data fetches
  • Missing loading states - Forgetting loading.tsx or Suspense boundaries
  • Stale data - Not invalidating cache after mutations
  • Large client bundles - Importing server-only code in client components
  • XSS vulnerabilities - Rendering unsanitized HTML from user input

平台分布

Codex

36.27%
按下载量换算49

Claude

28.13%
按下载量换算38

Cursor

18.98%
按下载量换算26

Gemini CLI

9.35%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills