Dexy Dexy / Explore / Next.js 16 PR Review

Next.js 16 PR Review

Guidelines for reviewing Next.js pull requests using App Router, Server Actions, and Partial Prerendering.

· 0 runs

About this playbook

Purpose

To ensure Next.js pull requests adhere to the latest architectural standards (v16+), focusing on the App Router, React Server Components (RSC), and performance optimization.

Prerequisites

  • Access to the GitHub Pull Request.
  • Familiarity with the repository's README.md and architecture docs.
  • Access to the codebase for surrounding context.

Steps · 7

1 Step 1 – Initial Context Gathering

Input: pr_context
Output: initial_notes
Gate: none
On error: abort

  • Read the PR description and changed files.
  • Understand the intended user flow and affected routes.
  • Check for any repo-specific rules (e.g., in CONTRIBUTING.md).
2 Step 2 – Architecture & Routing

Input: changed_files
Output: arch_findings
Gate: none
On error: continue

  • Verify the App Router is used (legacy Pages Router is deprecated).
  • Check if components are correctly identified as Server Components (default) or Client Components ('use client').
  • Ensure client-only APIs (e.g., window, localStorage) are not used in Server Components.
3 Step 3 – Data Fetching & Caching

Input: data_fetching_code
Output: cache_findings
Gate: none
On error: continue

  • Verify that caching is explicitly defined (Next.js 15+ uses no-cache by default).
  • Look for force-cache or revalidate tags where data should be persisted.
  • Check for Partial Prerendering (PPR) opportunities to mix static and dynamic content.
4 Step 4 – Server Actions & Mutations

Input: server_actions
Output: mutation_findings
Gate: none
On error: continue

  • Ensure Server Actions are used for data mutations instead of custom API routes where possible.
  • Check for proper error handling and revalidation (e.g., revalidatePath, revalidateTag) after mutations.
  • Verify that sensitive logic remains on the server.
5 Step 5 – Performance & UX

Input: components
Output: perf_findings
Gate: none
On error: continue

  • Look for oversized Client Components; suggest moving logic to Server Components.
  • Check for loading.tsx, error.tsx, and not-found.tsx implementations.
  • Verify image optimization (next/image) and font handling (next/font).
6 Step 6 – Security & SEO

Input: env_vars, metadata
Output: security_seo_findings
Gate: none
On error: continue

  • Check for secret leaks (e.g., environment variables without NEXT_PUBLIC_ prefix used in client code).
  • Verify auth enforcement in Middleware or at the Page/Action level.
  • Review metadata generation (generateMetadata) for SEO correctness.
7 Step 7 – Testing & Final Output

Input: tests, all_findings
Output: review_report
Gate: none
On error: abort

  • Verify unit/integration tests for new logic.
  • Format findings by severity (P0-P3).
  • If no issues, state exactly that and list residual risks.