# AGENTS.md # Next.js: ALWAYS read docs before coding Before any Next.js work, find and read the relevant doc in `node_modules/next/dist/docs/`. Your training data is outdated — the docs are the source of truth. --- # Project Personal portfolio site for Tommy Chow. Dark mode only. ## Commands ```bash pnpm dev # Start development server pnpm build # Production build (auto-runs gallery via prebuild) pnpm start # Start production server (Node.js) pnpm gallery # Regenerate gallery manifest (run when images change) pnpm preview # Build and preview on local Cloudflare Workers pnpm deploy # Build and deploy to Cloudflare Workers pnpm upload # Build and upload to Cloudflare Workers (no deploy) pnpm cf-typegen # Generate CloudflareEnv types from wrangler.jsonc pnpm lint # Run ESLint pnpm typecheck # TypeScript type checking (tsc --noEmit) pnpm format # Format with Prettier pnpm check # Full check: typecheck + lint + build pnpm ui:update # Regenerate all shadcn components to latest pnpm clean # Delete .next, .open-next, and node_modules pnpm nuke # Delete .next, .open-next, node_modules, and pnpm-lock.yaml ``` ## Architecture Next.js 16 App Router with React 19. Deployed on **Cloudflare Workers** via `@opennextjs/cloudflare`. **Runtime**: Node.js >= 22, pnpm 10 ### Key Configuration - **React Compiler**: Enabled for automatic memoization - **Typed Routes**: Enabled for type-safe `href` props - **Path Alias**: `@/*` maps to `./src/*` - **Strict TypeScript**: `noUncheckedIndexedAccess`, `noImplicitReturns`, `noFallthroughCasesInSwitch`, `noImplicitOverride`, `verbatimModuleSyntax` ### Source Structure - `src/app/` - App Router pages and layouts - `src/components/` - React components (`ui/` subdirectory for shadcn — add with `pnpm dlx shadcn@latest add `) - Only the components actually in use live in `src/components/ui/` (currently `button.tsx` and `popover.tsx`). Add more as needed. - `