Overview
Neexo projects default to Next.js 16 App Router patterns, server components, narrow TypeScript boundaries, and existing local UI conventions.
Agent-first (Next.js 16+)
Before relying on training data for Next.js APIs:
- Prefer version-matched docs bundled with the installed package:
node_modules/next/dist/docs/ - Keep any Next.js-managed blocks in root
AGENTS.md/CLAUDE.mdintact; put project rules outside those markers - When a Next.js 16+ dev server is running, use Next DevTools MCP (see the
next-devtools-mcptool entry) for live errors, routes, and logs instead of guessing from static HTML - Prefer Context7 or bundled docs over outdated Next 13/14 patterns from memory
Server vs Client Components
- Prefer server components unless hooks, browser APIs, or event handlers require client components
- Keep server/client boundaries explicit — mark client components with
"use client"at the top - Use server actions for mutations; do not create API routes for simple form submissions
Next.js 16 Specifics
paramsandsearchParamsare now async in route components — alwaysawaitthem:export default async function Page({ params }: { params: Promise<{ slug: string }> }) { const { slug } = await params }cookies()andheaders()fromnext/headersare async —awaitbefore reading- Turbopack is the default bundler in development — do not add Webpack-specific config unless required for production
- Use the
usehook from React 19 to unwrap promises in client components - Use
"use cache"for fine-grained caching instead of relying solely on route segment config
TypeScript and Code Style
- Avoid
anyunless justified at an integration boundary - Reuse existing components, hooks, utilities, and design tokens
- Add dependencies only when the existing stack cannot reasonably solve the problem
- Prefer
satisfiesfor type narrowing of config objects
Patterns to Avoid
- Do not use
getServerSidePropsorgetStaticProps— these are Pages Router patterns - Do not wrap server components in unnecessary client wrappers
- Do not use
useEffectfor data fetching — fetch in server components or use server actions - Do not invent Next.js APIs from older training data when bundled docs disagree