AGENTS.md — Next.js
Project shape
- Next.js 15+/16 with the App Router. No Pages Router.
- TypeScript with
strict: trueandnoUncheckedIndexedAccess: true. - Tailwind CSS for styling. Optional shadcn/ui-style component primitives.
Commands
pnpm dev # local dev (webpack-based to avoid Turbopack persistent-cache flakes)
pnpm build # production build
pnpm typecheck # tsc --noEmit
pnpm lint # biome / eslint
pnpm test # unit + integration tests
House rules
- Server Components by default. Add
"use client"only when you need state, refs, browser APIs, or event handlers. params/searchParams/cookies()/headers()are Promises in Next 16 — always await.- No
getServerSideProps/getStaticProps. - Fetch on the server when possible; pass minimal props to client components.
- Don't import server-only modules from client components.
Code review checklist
- No
any. Narrow with guards onunknown. - No client-only API touched from server code (and vice versa).
- All async pages await
params/searchParams. - New routes have a
loading.tsxwhere the data fetch is slow. - Tailwind classes used directly; no string concatenation.