diff --git a/CLAUDE.md b/CLAUDE.md index 38939fb..00d3107 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,168 +1,211 @@ -# CLAUDE.md +# Agents Guide (Single Source of Truth) -This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. +This document is the canonical reference for humans and `Agents` working in this repository. It standardizes stack, structure, workflows, and guardrails so contributions stay consistent and safe. -## Project Overview +## 1) Scope and goals -Biohazard VFX is a modern Next.js 15 website for a visual effects studio, deployed to Cloudflare Workers using OpenNext. The site showcases portfolio work, services, and provides a multi-step contact form for client intake. +* Make onboarding fast with a single place to look +* Define conventions so changes are predictable +* Provide exact commands that `Agents` can run without guesswork +* Prevent accidental regressions in routing, theming, SEO, and deployment -**Tech Stack:** -- Next.js 15.5.4 with App Router -- TypeScript (strict mode) -- React 19.1.0 -- Tailwind CSS 4 -- shadcn/ui (New York style) -- Framer Motion for animations -- Cloudflare Workers deployment via OpenNext +## 2) Tech stack -## Development Commands +* **Framework**: Next.js 15.5.4, React 19, TypeScript +* **Styling**: Tailwind CSS 4, shadcn/ui +* **Animation**: Framer Motion +* **Forms**: react-hook-form + Zod +* **Platform**: Cloudflare Workers via OpenNext +* **Package manager**: npm +* **Node**: LTS 20 or 22 -```bash -# Development -npm run dev # Start dev server with Turbopack -npm run type-check # Run TypeScript compiler (no emit) -npm run lint # Run ESLint +## 3) Project layout -# Building -npm run build # Standard Next.js build -npm run build:open-next # Build for Cloudflare Workers (runs next build + open-next build) - -# Production -npm start # Start Next.js production server (not used for Cloudflare deployment) +``` +root +├─ src/ +│ ├─ app/ # App Router pages and layouts +│ │ ├─ (marketing)/ # Example route groups +│ │ ├─ api/ # Route handlers +│ │ └─ layout.tsx # Root layout, see rules below +│ ├─ components/ # Reusable UI +│ ├─ data/ # JSON or TS data objects consumed by pages +│ ├─ lib/ # Utilities, hooks, server actions +│ ├─ styles/ # globals.css, tailwind utilities if applicable +│ └─ types/ # Shared types +├─ public/ # Static assets +├─ next.config.ts +├─ tailwind.config.ts +├─ wrangler.toml # Cloudflare deploy config +└─ package.json ``` -## Deployment (Cloudflare Workers) +### Import aliases -The site deploys to Cloudflare Workers, not Vercel. Critical deployment files: +* Prefer absolute imports using `@` mapped to `src` via `tsconfig.json` paths. -- **`wrangler.toml`**: Cloudflare Workers configuration with routes for biohazardvfx.com -- **`open-next.config.ts`**: OpenNext adapter configuration for Cloudflare -- **`next.config.ts`**: Ignores lint/TypeScript errors during build (required for deployment) +## 4) Authoritative UI system -**Deploy commands:** -```bash -npx opennextjs-cloudflare build # Build for Cloudflare -npx wrangler deploy # Deploy to Cloudflare Workers +* **Theme**: dark mode is the default. Do not introduce light-first designs without approval. +* **Typography**: default to Geist and Geist Mono via CSS variables. If adding a new font, add it as a variable and document it here before use. +* **Components**: use shadcn/ui primitives. Extend with local wrappers placed in `src/components/ui/`. +* **Spacing and rhythm**: follow Tailwind 4 defaults. Prefer utility classes over custom CSS unless componentized. +* **Animation**: keep motion subtle. Framer Motion only for meaningful transitions. + +## 5) Routing and layout rules + +* The **root layout** owns global providers, theme class, `