Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计通过

nextjs-code-reviewerNext.js 代码 reviewer

Agent Skill

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

总安装

318

周安装

13

GitHub Stars

2

下载量

103
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/masanao-ohba/claude-manifests --skill nextjs-code-reviewer

简介

用于辅助前端页面、组件和样式开发。nextjs-code-reviewer 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

  • 适合生成或审查 React、Next.js 相关代码。
  • 需要结合项目现有设计系统和路由方式使用。
  • 避免生成孤立片段,涉及页面改动应配合预览检查。
  • 建议先确认构建方式和视觉效果再实施改动。

SKILL.md

Next.js Code Review Guidelines

App Router Structure

File Organization

Issues:

  • page.tsx missing in route directory (route won't work)
  • layout.tsx not at app root (required)
  • Client Component marked with 'use client' unnecessarily
  • API route in wrong location (should be in app/api/)
  • Special files (loading, error, not-found) in wrong location

Verify:

  • Root layout.tsx exists and returns <html> and <body>
  • Each route directory has page.tsx for that route
  • loading.tsx and error.tsx placed at appropriate levels
  • API routes follow app/api/* convention

Server vs Client

Critical Issues:

  • 'use client' on component that doesn't need it
  • Server Component trying to use hooks
  • Client Component doing data fetching (should be Server Component)
  • Sensitive data (API keys, secrets) in Client Components

Verify:

  • Default to Server Components
  • 'use client' only for: hooks, event handlers, browser APIs, Context
  • Data fetching in Server Components when possible
  • Client Components receive data as props

Data Fetching

Server Components

Issues:

  • Using useEffect for data fetching (should be async/await)
  • Not handling errors with try-catch
  • Fetching inside loops (N+1 problem)
  • Not using Promise.all for parallel fetches
  • Missing revalidation strategy

Verify:

  • Async functions for data fetching
  • Proper error handling
  • Parallel fetching with Promise.all when possible
  • Appropriate cache strategy (force-cache, no-store, revalidate)

Client Components

Issues:

  • Using fetch in useEffect instead of React Query
  • Not handling loading and error states
  • Race conditions in useEffect
  • Missing error boundaries

Verify:

  • React Query for client-side data fetching
  • Loading, error, and success states all handled
  • Proper query key structure
  • Error boundaries in place

Routing

Dynamic Routes

Issues:

  • Not validating params before use
  • Not handling missing data (404 cases)
  • Missing generateStaticParams for static export
  • Params not properly typed

Verify:

  • Params validated and typed correctly
  • notFound() called for missing resources
  • generateStaticParams implemented for SSG
  • Type safety: {params: {slug: string}}

Navigation

Issues:

  • Using <a> instead of <Link>
  • Using router.push with full URL (should be relative)
  • Not using prefetch for important links
  • Client-side navigation for external links

Verify:

  • <Link> component for internal navigation
  • Relative paths in navigation
  • prefetch={true} for critical routes
  • <a> with rel="noopener noreferrer" for external links

Loading States

Suspense

Issues:

  • No loading.tsx at route level
  • No fallback for Suspense boundaries
  • Loading state only shows after delay (missing instant feedback)
  • Suspense boundaries too coarse-grained

Verify:

  • loading.tsx provides meaningful loading UI
  • Suspense boundaries around async components
  • Instant loading feedback
  • Multiple Suspense boundaries for granular loading

Error Handling

Error Boundaries

Issues:

  • No error.tsx at route level
  • Error component not marked 'use client'
  • Error messages expose sensitive information
  • No retry mechanism in error UI
  • Not using error.digest for error tracking

Verify:

  • error.tsx in place for each route segment
  • 'use client' directive on error components
  • User-friendly error messages
  • Reset function provided to users
  • Error logging/tracking implemented

Not Found

Issues:

  • 404 errors not handled gracefully
  • notFound() not called for missing resources
  • Generic 404 page for all routes

Verify:

  • notFound() called when resource doesn't exist
  • Custom not-found.tsx at route level if needed
  • Clear messaging about what was not found

API Routes

Route Handlers

Issues:

  • Not validating request body
  • Missing error handling
  • Not using proper HTTP status codes
  • CORS not configured for cross-origin requests
  • No rate limiting for public endpoints

Verify:

  • Request validation with Zod or similar
  • Proper error responses with status codes
  • NextResponse.json() for responses
  • CORS headers if needed
  • Authentication checks before sensitive operations

Security

Critical Issues:

  • SQL injection vulnerabilities
  • No authentication on protected routes
  • API keys exposed in client code
  • CSRF vulnerabilities in mutations
  • No input sanitization

Verify:

  • Parameterized queries (no string concatenation)
  • Authentication middleware on protected routes
  • Environment variables for secrets
  • CSRF protection for mutations
  • Input validation and sanitization

Server Actions

Implementation

Issues:

  • 'use server' directive missing
  • Not revalidating cache after mutations
  • No error handling
  • Not returning serializable data
  • Complex logic in server action (should be in service layer)

Verify:

  • 'use server' at file or function level
  • revalidatePath() or revalidateTag() after data changes
  • Try-catch with user-friendly error messages
  • Returned data is JSON-serializable
  • Business logic in separate service functions

Metadata and SEO

Metadata

Issues:

  • No metadata exported
  • Missing Open Graph tags
  • No Twitter Card metadata
  • Dynamic pages missing generateMetadata
  • Duplicate titles across pages

Verify:

  • Metadata object or generateMetadata function present
  • Title, description, and OG tags complete
  • Dynamic metadata for dynamic routes
  • Unique, descriptive titles for each page
  • Appropriate meta tags for social sharing

Images

Issues:

  • Using <img> instead of <Image>
  • Missing alt text
  • Not specifying width and height
  • Not using priority for LCP images
  • Remote images not configured in next.config.js

Verify:

  • next/image for all images
  • Descriptive alt text (or empty string if decorative)
  • Width and height specified (or fill mode)
  • priority prop on above-the-fold images
  • Remote image domains configured

Performance

Bundle Size

Issues:

  • Heavy libraries imported in Client Components
  • No code splitting for large features
  • All components in single file
  • Not using dynamic imports for heavy components

Verify:

  • Heavy dependencies in Server Components when possible
  • Dynamic imports for large, conditional components
  • Components split into separate files
  • Bundle analysis done regularly

Caching

Issues:

  • No caching strategy defined
  • Using no-store for everything (too aggressive)
  • Not using revalidation for stale-while-revalidate
  • Not leveraging Next.js automatic request deduplication

Verify:

  • Appropriate cache strategy per request
  • force-cache for static data
  • revalidate for time-based freshness
  • no-store only for user-specific or sensitive data

Rendering

Issues:

  • Not using Static Site Generation (SSG) when possible
  • Generating all pages at build time (slow builds)
  • Not implementing Incremental Static Regeneration (ISR)

Verify:

  • generateStaticParams for known routes
  • ISR (revalidate) for frequently changing content
  • On-demand revalidation for critical updates

TypeScript

Type Safety

Issues:

  • Params and searchParams not typed
  • API route request/response not typed
  • Server action return values not typed
  • Using 'any' for Next.js types

Verify:

  • PageProps interface for params and searchParams
  • NextRequest and NextResponse properly typed
  • Server actions have return type annotations
  • Imported Next.js types used correctly

Middleware

Implementation

Issues:

  • Heavy logic in middleware (runs on every request)
  • Not returning NextResponse
  • Middleware running on static assets
  • No matcher config (runs on all routes)

Verify:

  • Lightweight logic only (auth checks, redirects)
  • NextResponse.next() or redirect returned
  • Matcher excludes _next/static and other assets
  • Matcher config specific to needed routes

Internationalization

next-intl

Issues:

  • Locale not validated in params
  • Messages not loaded for server components
  • Hardcoded strings instead of translations
  • Missing translations causing runtime errors

Verify:

  • Locale param validated against supported locales
  • getMessages() called in server components
  • All user-facing text uses t() function
  • Fallback locale configured

Code Quality

Best Practices

Issues:

  • Mixing Server and Client code in same file
  • Deep nesting of route groups
  • No consistent naming convention
  • Component files > 500 lines

Verify:

  • Clear separation of Server and Client code
  • Reasonable route group nesting (< 3 levels)
  • Consistent file naming (kebab-case or PascalCase)
  • Components split appropriately

Review Checklist

Critical

  • Server/Client component separation correct
  • No security vulnerabilities (auth, input validation)
  • Error handling comprehensive
  • Type safety maintained

High Priority

  • Loading states implemented
  • SEO metadata complete
  • Images optimized
  • Caching strategy appropriate

Medium Priority

  • Code organization clean
  • No console.logs left in
  • Consistent code style
  • Performance optimizations justified

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.51%
按下载量换算39

Claude

27.72%
按下载量换算29

Cursor

17.79%
按下载量换算18

Gemini CLI

10.32%
按下载量换算11

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

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

来源信息

继续浏览同类 Skills