- Next.js App Router lives in
app/(layout.tsx,page.tsx,providers.tsx) for global frame and providers. - UI blocks sit in
components/(common/ExternalLink.tsx,components/page/*for homepage sections); styling helpers such asstyles/components/layout.module.cssback shared layout rules. - Shared logic/constants are in
lib/(constants.ts,validation.ts,test-utils.tsx), shared types intypes/, static assets inpublic/. - Tooling configs live at the repo root (
biome.json,vitest.config.mts,tsconfig*.json); build artifacts output to.next/orout/(ignored).
- Use Node
24.13.0(see.node-version); install pnpm withnpm install -g pnpm@10.28.0, then runpnpm install. pnpm devboots the local Next.js server.pnpm buildcreates the production bundle;pnpm startserves it.pnpm lint/pnpm formatauto-fix with Biome;pnpm format:checkfor CI-safe validation.pnpm checkorpnpm fixruns Biome check + fix; prefer before commits.pnpm testruns Vitest once with jsdom; during development,pnpm exec vitestgives watch mode.
- TypeScript throughout; prefer function components with hooks. Add
"use client"where a component needs the client runtime. - Use PascalCase for React components and file names under
components/; camelCase for variables/functions; UPPER_SNAKE_CASE for constants inlib/constants.ts. - Keep modules small and colocate UI pieces with their CSS modules when styling is component-specific.
- Let Biome handle formatting (2-space indent, sorted imports); avoid manual tweaks that fight the linter.
- Vitest + @testing-library/* with jsdom. Add
*.test.tsx|tsnext to the code under test. - Use
lib/test-utils.tsxfor Chakra-aware renders; preferscreenqueries and user-facing selectors. - Cover layout or validation changes with targeted assertions; favor meaningful expectations over snapshots.
- Run
pnpm testand at leastpnpm lintbefore pushing.
- Follow Conventional Commits seen in history (
feat:,fix:,chore(deps-...):,refactor:). Keep scopes short and lowercase. - PRs should include a concise summary, linked issue/PR, and before/after screenshots for UI tweaks.
- State which commands you ran (lint, test, build). Keep diffs focused; split unrelated changes into separate PRs.