bundles/frontend/skills/nextjs-validator/SKILL.md
Validate Next.js 16 configuration and detect/prevent deprecated patterns. Ensures proxy.ts usage, Turbopack, Cache Components, and App Router best practices. Use before any Next.js work or when auditing existing projects.
npx skillsauth add shipshitdev/library nextjs-validatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Validates Next.js 16 configuration and prevents deprecated Next.js 14/15 patterns.
python3 scripts/validate.py --root .
python3 scripts/validate.py --root . --strict
// GOOD: v16+
"next": "^16.0.0"
// BAD: v15 or earlier
"next": "^15.0.0"
GOOD - Next.js 16:
// proxy.ts (Node.js runtime - REQUIRED)
import { createProxy } from 'next/proxy';
export const proxy = createProxy();
BAD - Deprecated:
// middleware.ts (Edge runtime - DEPRECATED)
export function middleware() { }
GOOD:
app/
├── layout.tsx # Root layout
├── page.tsx # Home page
├── (routes)/ # Route groups
│ ├── dashboard/
│ │ └── page.tsx
│ └── settings/
│ └── page.tsx
└── api/ # API routes (optional)
BAD - Pages Router (deprecated):
pages/
├── _app.tsx
├── index.tsx
└── api/
use cacheGOOD - Next.js 16:
// app/dashboard/page.tsx
'use cache';
export default async function Dashboard() {
const data = await fetch('/api/data');
return <DashboardView data={data} />;
}
GOOD:
// app/actions.ts
'use server';
export async function createItem(formData: FormData) {
// Server-side logic
}
GOOD - Default in Next.js 16:
// next.config.ts (Turbopack is default, no config needed)
BAD - Disabling Turbopack:
// Don't disable unless absolutely necessary
experimental: {
turbo: false // BAD
}
GOOD - TypeScript config:
// next.config.ts
import type { NextConfig } from 'next';
const config: NextConfig = {
// ...
};
export default config;
BAD - JavaScript config:
// next.config.js - Prefer .ts
module.exports = { }
| Deprecated (v15-) | Replacement (v16+) |
|-------------------|-------------------|
| middleware.ts | proxy.ts |
| getServerSideProps | Server Components + use cache |
| getStaticProps | Server Components + use cache |
| getStaticPaths | generateStaticParams |
| _app.tsx | app/layout.tsx |
| _document.tsx | app/layout.tsx |
| pages/ directory | app/ directory |
| next/router | next/navigation |
| useRouter() (pages) | useRouter() from next/navigation |
'use cache';
// Entire component cached
export default async function CachedPage() {
const data = await fetchData();
return <View data={data} />;
}
// next.config.ts
const config: NextConfig = {
experimental: {
ppr: true,
},
};
AI-assisted debugging with contextual insight:
// Enable in development
// Works with MCP-compatible agent tools
app/
├── @modal/
│ └── login/
│ └── page.tsx
├── @sidebar/
│ └── default.tsx
└── layout.tsx
See references/full-guide.md (§ Intercepting Routes Example) for the directory layout.
See references/full-guide.md (§ Validation Output Example) for a sample report.
See references/full-guide.md (§ Migration Guide) for before/after examples of migrating middleware.ts → proxy.ts and getServerSideProps → Server Components.
# .github/workflows/validate.yml
- name: Validate Next.js 16
run: |
python3 scripts/validate.py \
--root . \
--strict \
--ci
tailwind-validator - Validate Tailwind v4 configbiome-validator - Validate Biome 2.3+ configclerk-validator - Validate Clerk auth setupdevelopment
TypeScript refactoring and modernization guidelines from a principal specialist perspective. This skill should be used when refactoring, reviewing, or modernizing TypeScript code to ensure type safety, compiler performance, and idiomatic patterns. Triggers on tasks involving TypeScript type architecture, narrowing, generics, error handling, or migration to modern TypeScript features.
tools
Resolves TypeScript and JavaScript problems across type-level programming, performance, monorepo management, migration, and modern tooling. Invoke when diagnosing "type instantiation excessively deep" errors, migrating JS to TS, configuring strict tsconfig, debugging module resolution, or choosing between Biome/ESLint/Turborepo/Nx.
tools
Turborepo monorepo build system guidance. Triggers on: `turbo.json`, task pipelines, `dependsOn`, caching, remote cache, the `turbo` CLI, `--filter`, `--affected`, CI optimization, environment variables, internal packages, monorepo structure, and package boundaries. Use when the user configures tasks or workflows, creates packages, sets up a monorepo, shares code between apps, runs changed packages, debugs cache behavior, or works in an `apps/` plus `packages/` workspace.
tools
Provides Tailwind CSS v4 performance optimization and best practices guidelines. Triggers when writing, reviewing, or refactoring Tailwind CSS v4 code; when working with Tailwind configuration, @theme directive, utility classes, responsive design, dark mode, container queries, or CSS generation optimization.