# CLAUDE.md This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. ## Project Overview This is a Svelte 5 + TypeScript + Vite single-page application for a Pokémon-style creature collection game called "Pictuary". It uses the latest Svelte 5 with runes syntax (`$state()`, `$derived()`, etc.). ### Main Features - **Monster Generation**: Upload images → AI generates unique creatures ("Piclets") with stats and abilities - **Battle System**: Turn-based combat between player and AI opponents - **Collection Management**: Roster of captured Piclets with detailed stats and move sets - **Creature Cards**: Trading card-style interface with type-based designs - **Image Processing**: AI-powered image captioning and creature concept generation ## Essential Commands ```bash # Install dependencies npm install # Development server with HMR npm run dev # Type checking npm run check # Production build (outputs to dist/) npm run build # Preview production build npm run preview # Run tests npm test # Run tests with UI npm run test:ui ``` ## Architecture ### Component Structure - Components use `.svelte` files with TypeScript support via `lang="ts"` in script tags - Main entry: `src/main.ts` → mounts `src/App.svelte` - Reusable components go in `src/lib/` - Uses Svelte 5 runes syntax (not Svelte 4 syntax) ### Key Components - **Pages**: `Scanner.svelte` (main), `Pictuary.svelte` (collection), `Battle.svelte` (combat) - **Monster Generation**: `MonsterGenerator.svelte`, `MonsterResult.svelte` (redesigned with PicletCard preview) - **Battle System**: `BattleField.svelte`, `ActionButtons.svelte`, turn-based combat logic - **Piclet Management**: `PicletCard.svelte`, `PicletDetail.svelte`, `AddToRosterDialog.svelte` - **Database**: IndexedDB with `schema.ts` defining PicletInstance, BattleMove, Monster types ### Key Patterns 1. **State Management**: Use `$state()` rune for reactive state 2. **TypeScript**: All components should use `