/skillry-frontend-web-design:next-app-router-rsc-reviewfrom skillry-frontend-web-design
Audits Next.js 15 App Router projects for Server/Client Component boundary issues: 'use client'/'use server' misuse, unserializable props, secret exposure, missing validation, caching errors, and broken Suspense boundaries.
Ships in skillry-frontend-web-design. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Skillry 3.0.0 folded the skills below into this one. When a request names one of them or matches its topic, open the listed reference and follow it; the rest of this file stays the default procedure.
| Old skill name | Reference | Use it for |
|---|---|---|
nextjs-app-router-patterns | references/nextjs-app-router-patterns.md | building with the App Router: Server Components, streaming and Suspense, parallel and intercepting routes, Server Actions, data fetching and caching patterns |
Audit a Next.js 15 App Router project for correctness at the Server/Client Component boundary: detect "use client" / "use server" misuse, unserializable prop passing, accidental server-secret exposure in client bundles, missing Server Action validation, incorrect fetch caching, and broken Suspense/error-boundary wiring. Surface every finding with the exact file and line — never infer from project structure alone.
app/ directory.NEXT_PUBLIC_ variable being used for a secret, or a server import in a client file.next build produces a large client bundle or a missing-server-component warning.pages/ directory) — use a legacy Next.js review instead.# Count "use client" directives
grep -rn '"use client"' app/ --include="*.tsx" --include="*.ts" | wc -l
grep -rn '"use client"' app/ --include="*.tsx" --include="*.ts" | head -30
# Count "use server" directives (Server Actions and server-only files)
grep -rn '"use server"' app/ --include="*.tsx" --include="*.ts" | wc -l
# Find components that have BOTH directives (always wrong)
grep -rln '"use client"' app/ | xargs grep -l '"use server"' 2>/dev/null
# Find "use client" at file level vs. inside a function (wrong position)
grep -n '"use client"' app/**/*.tsx | grep -v "^.*:1:" | head -20
# Server Component passing a function prop to a client component — not serializable
grep -rn --include="*.tsx" \
'onClick={[^}]*}>\|onSubmit={[^}]*}>' \
app/ | grep -v '"use client"' | head -20
# Class instance, Map, Set, Date props — detect suspicious patterns
grep -rn --include="*.tsx" \
'new Date()\|new Map()\|new Set()' \
app/ | head -20
# "use client" files that import from server-only modules
grep -rln '"use client"' app/ | xargs grep -l \
"server-only\|@/lib/db\|prisma\|supabase.*service_role\|process\.env\.[^N]" 2>/dev/null
# NEXT_PUBLIC_ misuse: secret stored as NEXT_PUBLIC_ (exposed to browser)
grep -rn "NEXT_PUBLIC_" .env* 2>/dev/null | grep -iE "secret|key|token|password|private" | head -20
# Server-only env var referenced inside a "use client" file
grep -rn 'process\.env\.' app/ --include="*.tsx" \
| grep -v "NEXT_PUBLIC_" > /tmp/server-env-refs.txt
# Cross-reference with "use client" files
grep -rln '"use client"' app/ | xargs grep -ln 'process\.env\.' 2>/dev/null
# Ensure server-only is imported at the top of server utility files
grep -rn "server-only" lib/ utils/ --include="*.ts" | head -20
# Find all Server Actions (files or functions with "use server")
grep -rn '"use server"' app/ --include="*.ts" --include="*.tsx" -l
# Check for input validation (zod schema) in each action file
for f in $(grep -rln '"use server"' app/); do
if ! grep -q "z\.\|zod\|schema\.parse\|safeParse" "$f"; then
echo "NO VALIDATION: $f"
fi
done
# Check for auth guard in server actions (session/user check before mutation)
grep -rn '"use server"' app/ -l | xargs grep -L \
"getServerSession\|auth()\|currentUser\|session\." 2>/dev/null | head -10
# Confirm revalidatePath/revalidateTag is called after mutations
grep -rn "revalidatePath\|revalidateTag" app/ --include="*.ts" --include="*.tsx"
# Find fetch calls without explicit cache option (Next.js 15 default: no-store)
grep -rn "fetch(" app/ --include="*.tsx" --include="*.ts" \
| grep -v "cache:\|next:" | head -30
# Find stale force-cache on dynamic data
grep -rn "force-cache" app/ --include="*.tsx" --include="*.ts" | head -20
# Find unstable_cache / React cache usage
grep -rn "unstable_cache\|import.*cache.*from.*react" app/ --include="*.ts" --include="*.tsx"
# Find generateStaticParams for dynamic routes
find app -name "page.tsx" | xargs grep -l "\[" 2>/dev/null \
| xargs grep -L "generateStaticParams" 2>/dev/null | head -10
# Pages/layouts missing metadata export
find app -name "page.tsx" | xargs grep -L "export const metadata\|generateMetadata" | head -20
# Suspense boundaries wrapping async components
grep -rn "<Suspense" app/ --include="*.tsx" | wc -l
# error.tsx and loading.tsx presence per route segment
find app -type d | while read d; do
has_page=$(ls "$d/page.tsx" 2>/dev/null)
has_error=$(ls "$d/error.tsx" 2>/dev/null)
has_loading=$(ls "$d/loading.tsx" 2>/dev/null)
[ -n "$has_page" ] && [ -z "$has_error" ] && echo "NO error.tsx: $d"
done
# Confirm await fetch / await db calls are at RSC level (not inside useEffect)
grep -rn "useEffect.*fetch\|useEffect.*await" app/ --include="*.tsx" | head -20
# Client-side data fetch that should be RSC fetch
grep -rn "useEffect\|useState" app/ --include="*.tsx" \
| grep -v '"use client"' > /tmp/hooks-without-use-client.txt
wc -l /tmp/hooks-without-use-client.txt
# Prisma or DB client imported outside server context
grep -rn "prisma\|PrismaClient" app/ --include="*.tsx" --include="*.ts" \
| grep -v "\.server\." | head -20
useState, useEffect, useRef, etc.) has "use client" at line 1."use client" file imports server-only, prisma, or any module that transitively imports Node-only APIs.NEXT_PUBLIC_ variable holds a secret, API key, or private token.process.env.DATABASE_URL, process.env.SECRET_*) are never referenced in "use client" files.parse/safeParse on incoming FormData or arguments.revalidatePath or revalidateTag is called after each Server Action that mutates cached data.fetch() calls in RSC have an explicit cache: or next: { revalidate } option — no accidental over-caching.generateStaticParams is exported from every dynamic-segment page that should be statically generated.<Suspense fallback={...}> boundary.error.tsx files are present for every route segment with meaningful data-fetching.loading.tsx is present for route segments with slow data dependencies.export const dynamic = 'force-dynamic' is used intentionally, not as a catch-all fix for caching issues.client-only package is imported in any file that must never run on the server.# Summary: boundary violation candidates
echo "=== 'use client' files with server imports ==="
grep -rln '"use client"' app/ | xargs grep -l \
"prisma\|server-only\|process\.env\.[^N]" 2>/dev/null
echo "=== Server Actions without zod validation ==="
for f in $(grep -rln '"use server"' app/); do
grep -q "safeParse\|schema\.parse\|z\." "$f" || echo " $f"
done
echo "=== Pages missing metadata ==="
find app -name "page.tsx" | xargs grep -rL "metadata\|generateMetadata" | head -20
echo "=== fetch() without cache option ==="
grep -rn 'fetch(' app/ --include="*.ts" --include="*.tsx" \
| grep -v "cache:\|next:\|//\|test" | wc -l
Produce a structured report with:
"use client" file that imports server-only modules; severity Critical if it leaks secrets.NEXT_PUBLIC_ secret or server env ref in client files; severity Critical.generateStaticParams gaps.error.tsx, loading.tsx, <Suspense>, or metadata export..env* files during review..gitignore update instead.Done means: all "use client" / "use server" files are checked for boundary correctness, secret leakage paths are enumerated, every Server Action has a validation/auth status, fetch caching strategy is assessed for each RSC data-fetch, and Suspense/error boundary coverage is documented. Every finding has file:line + severity + a concrete fix.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
nextjs, app-router, server-components, client-components, code-review, react
6 skills in this plugin
/web-design-reviewReview built UI: hierarchy, consistency, polish, responsive layout, dashboards, design-system drift, prototypes./accessibility-auditAudit accessibility to WCAG 2.2: semantic HTML, keyboard, focus, contrast, labels, screen readers./landing-page-conversion-reviewConversion: landing pages, offer clarity, trust, CRO, forms, signup and onboarding activation, page copy./i18n-locale-parity-reviewLocalization: locale parity, missing keys, i18n setup, hreflang and multilingual SEO, cultural adaptation./design-captureCapture live reference motion, adapt UI components under source license rules, generate fresh exclusive media, and run unslop checks. Use when sourcing or adapting reference site designs.npx claudepluginhub fluxonlab/skillry --plugin skillry-frontend-web-designOther plugins' skills for the same job