···11+# CLAUDE.md
22+33+This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
44+55+## Development Commands
66+77+```bash
88+# Start development server
99+npm run dev
1010+1111+# Build static site for production
1212+npm run build
1313+1414+# Start production server (after build)
1515+npm start
1616+1717+# Lint the codebase
1818+npm run lint
1919+2020+# Apply patches after dependency changes
2121+npm run postinstall
2222+```
2323+2424+## Architecture Overview
2525+2626+**Static Blog with Next.js App Router**: This is Dan Abramov's personal blog built as a static site using Next.js 15 with the App Router and React 19. The site exports to static files (`output: "export"`).
2727+2828+**Blog Post Structure**: Posts are stored as markdown files in `/public/[slug]/index.md` with frontmatter containing metadata (title, date, spoiler, youtube). Each post directory can contain:
2929+- `index.md` - The main post content
3030+- `components.js` - Post-specific React components and optional `Wrapper` component
3131+- Asset files (images, etc.)
3232+3333+**Content Processing Pipeline**:
3434+1. `app/posts.js` reads all post directories from `/public/`
3535+2. Uses `gray-matter` to parse frontmatter from markdown files
3636+3. Posts are sorted by date (newest first)
3737+4. Individual posts are rendered via `app/[slug]/page.js` using `next-mdx-remote-client`
3838+3939+**MDX Processing**: Posts support advanced MDX features:
4040+- JavaScript code blocks with `eval` meta execute and render inline (see `app/[slug]/mdx.js`)
4141+- Post-specific components can be imported from `components.js` files
4242+- Syntax highlighting via Shiki with "Overnight Slumber" theme
4343+- Auto-linking headings, GFM support, smart quotes
4444+4545+**Routing**:
4646+- `/` - Home page listing all posts (`app/page.js`)
4747+- `/[slug]/` - Individual post pages (`app/[slug]/page.js`)
4848+- `/atom.xml` and `/rss.xml` - Generated feeds (`app/atom.xml/route.js`, `app/rss.xml/route.js`)
4949+5050+**Styling**: Uses Tailwind CSS with custom CSS variables for theming (`--bg`, `--text`, `--title`, etc.). Post titles have dynamic color-coding based on post age using `colorjs.io`.
5151+5252+**Static Generation**: All pages are pre-generated at build time. Post pages use `generateStaticParams()` to create routes for all post directories.
5353+5454+## Key Files
5555+5656+- `app/posts.js` - Core post discovery and feed generation logic
5757+- `app/[slug]/page.js` - Individual post rendering with MDX processing
5858+- `app/[slug]/mdx.js` - Custom remark plugin for executable code blocks
5959+- `next.config.js` - Static export configuration
6060+- `public/[slug]/index.md` - Post content files with frontmatter
6161+- `public/[slug]/components.js` - Optional post-specific React components