This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
IFMahouShoujo (魔法少女生成器) is a Magical Girl Generator - an AI-powered web application that creates personalized magical girl characters. Built with Next.js 15, React 19, Bun and TypeScript, it features a mobile-friendly design with a whimsical, magical theme.
bun run dev # Start development server with Turbopack
bun run build # Build for production
bun run start # Start production server
bun run lint # Run ESLint
Create a .env.local file based on env.example with:
NEXT_PUBLIC_AI_API_KEY: OpenAI API keyNEXT_PUBLIC_AI_BASE_URL: API endpoint (optional, defaults to OpenAI)NEXT_PUBLIC_AI_MODEL: AI model (optional, defaults to gpt-3.5-turbo)The project uses both pages/ (traditional) and app/ (App Router) directories:
pages/index.tsxapp/ for future migrationUses Vercel AI SDK with Zod schemas for type-safe responses:
// Schema defined with zod
const magicalGirlSchema = z.object({
magicalName: z.string(),
attributes: z.object({...}),
transformationSpell: z.string()
})
// AI generation with structured output
const { object } = await generateObject({
model: openai(config.model),
schema: magicalGirlSchema,
prompt: generatePrompt(name)
})
Character levels are deterministically generated based on name hash:
@ai-sdk/openai, ai, zodtailwindcss, lucide-react, class-variance-authorityhtml2canvasnext, react, typescript