nextjs-code-review
Provides comprehensive code review capability for Next.js applications, validates Server Components, Client Components, Server Actions, caching strategies, metadata, API routes, middleware, and performance patterns. Use when reviewing Next.js App Router code changes, before merging pull requests, af
Оригинален текст · няма потвърден превод на българскиПърво прочетете инструкцията.
Файлът се зарежда от посочения източник само по ваше действие. Можете да го прочетете тук, да го копирате или да го запазите като .md.
GitHub хранилище- Звезди на репото
- 348
- Лиценз
- Не е посочен. Проверете в репозитория.
- Последна проверка на записа
- Няма посочена дата
Добавете в своя инструмент.
Командата отваря избора на skills от репозитория. Прочетете файла и условията на автора преди изпълнение.
npx skills add giuseppe-trisciuoglio/developer-kitСтраницата копира текст. Не инсталира и не изпълнява нищо на устройството ви.
Откъс от SKILL.md
Началото на файла на автора, без превод.
Next.js Code Review
Overview
Evaluates Next.js App Router code against best practices for Server Components, Client Components, Server Actions, caching strategies, and production-readiness criteria. Produces actionable findings categorized by severity with concrete code examples. Delegates to typescript-software-architect-review agent for architectural analysis.
When to Use
- Reviewing Next.js pages, layouts, and route segments before merging
- Validating Server Component vs Client Component boundaries
- Checking Server Actions for security and correctness
- Reviewing data fetching patterns (fetch, cache, revalidation)
- Evaluating caching strategies (static generation, ISR, dynamic rendering)
- Assessing middleware implementations (authentication, redirects, rewrites)
- Reviewing API route handlers for proper request/response handling
- Validating metadata configuration for SEO
- Checking loading, error, and not-found page implementations
- After implementing new Next.js features or migrating from Pages Router
Instructions
-
Identify Scope: Determine which Next.js route segments and components are under review. Use
globto discoverpage.tsx,layout.tsx,loading.tsx,error.tsx,route.ts, andmiddleware.tsfiles. -
Analyze Component Boundaries: Verify proper Server Component / Client Component separation. Check that
'use client'is placed only where necessary and as deep in the component tree as possible. Ensure Server Components don't import client-only modules. -
Review Data Fetching: Validate fetch patterns — check for proper
cacheandrevalidateoptions, parallel data fetching withPromise.all, and avoidance of request waterfalls. Verify that server-side data fetching doesn't expose sensitive data to the client. -
Evaluate Caching Strategy: Review static vs dynamic rendering decisions. Check
generateStaticParamsusage for static generation,revalidatePath/revalidateTagfor on-demand revalidation, and proper cache headers for API routes. -
Assess Server Actions: Review form actions for proper validation (both client and server-side), error handling, optimistic updates with
useOptimistic, and security (ensure actions don't expose sensitive operations without authorization). -
Check Middleware: Review middleware for proper request matching, authentication/authorization logic, response modification, and performance impact. Verify it runs only on necessary routes.