diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..946a51f --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,76 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Commands + +```bash +bun run dev # local dev server +bun run build # Next.js build +bun run preview # OpenNext Cloudflare build + local preview +bun run deploy # OpenNext Cloudflare build + deploy to Workers +bun run prepare # regenerate PandaCSS styled-system/ (run after panda.config.ts changes) +bun run cf-typegen # regenerate cloudflare-env.d.ts bindings +``` + +No test suite is configured. + +## Environment + +Copy `.env.local.example` to `.env.local` and set: + +``` +CMS_API_KEY= +``` + +The microCMS service domain is hard-coded as `nknighta-github` in `src/utils/cms.ts`. + +## Architecture + +**Stack**: Next.js 16 (Pages Router) · React 19 · TypeScript · PandaCSS · microCMS · GSAP · Framer Motion · deployed to **Cloudflare Workers** via `@opennextjs/cloudflare`. + +### Styling — PandaCSS + +All styles use the `css()` utility imported from `../../styled-system/css` (a codegen artifact). This is **not** Tailwind. The `styled-system/` directory is generated — never edit it by hand; run `bun run prepare` to regenerate after config changes. + +### CMS — microCMS + +`src/utils/cms.ts` exports a singleton client and typed helpers (`getBlogs`, `getBlog`, `getCategories`). Content endpoints used across the site: + +| Endpoint | Used by | +|---|---| +| `blogs` | `/blog`, `/blog/[id]`, `/blog/category/[id]`, `/blog/page/[p]` | +| `categories` | `/blog` | +| `projects` | `/dev`, `/dev/[id]` | +| `scraps` | `/scraps`, `/scraps/[id]` | + +CMS content bodies are rendered as raw HTML via `dangerouslySetInnerHTML`. An inline `