Nano Banana Pro
Agent skill for nano-banana-pro
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Sign in to like and favorite skills
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Next.js 15-based interactive quiz application for Latin-Dutch vocabulary learning. The application is entirely client-side with an emphasis on extreme performance optimization.
Key characteristics:
# Install dependencies npm install # Start development server (with hot reload) npm run dev # Access at http://localhost:3000 # Create production build npm run build # Start production server npm start # Lint code npm run lint # Analyze bundle size npm run analyze
# TypeScript type checking (no emit) npx tsc --noEmit
The app uses Next.js 15 App Router with a single-page client component architecture:
app/ ├── layout.tsx # Root layout with metadata ├── page.tsx # Entry point (renders Quiz component) └── globals.css # Global styles
Main orchestrator:
components/quiz.tsx
require() to load state-specific components only when neededState-specific components (all wrapped with React.memo):
quiz-start.tsx - Start screen, loaded only in "not-started" statequiz-question.tsx - Question display, loaded only in "in-progress" statequiz-results.tsx - Results screen, loaded only in "finished" stateUI components:
components/ui/
Vocabulary:
data/vocabulary.ts
VOCAB object mapping Latin → Dutch translationscachedVocabularyItems computed once at loadQuiz logic:
lib/quiz-utils.ts
normalizeAnswer(): Lowercase, strip whitespace, remove "(be)" prefixesgetNormalizedTranslations(): Map-based cache for normalized translations (99.5% faster on cache hits)generateHint(): Returns first ~1/3 of shortest translationcalculateGrade(): Converts score to 1-10 scalecalculatePercentage(): Calculates percentage with 1 decimal precisionTypes:
types/quiz.ts
This codebase is heavily optimized. Important patterns to maintain:
Data caching:
vocabulary.ts (cachedVocabularyItems)quiz-utils.ts (translationCache)React optimizations:
useMemo for derived state (currentItem, progress, totalVocabItems)useCallback for event handlers (startQuiz, handleSubmit, moveToNext)React.memo on all state-specific componentsrequire() instead of next/dynamic (avoids extra wrapper)Code splitting:
next.config.jsBundle optimization:
next.config.js uses optimizePackageImports for UI librariesSee
PERFORMANCE.md for detailed metrics and analysis.
The quiz accepts flexible user input:
Multiple valid translations per word are supported (e.g., "salutare" accepts "begroeten", "groeten", or "(be)groeten").
All user-facing text, comments, and variable names are in Dutch. The application is for Dutch-speaking students learning Latin vocabulary.
next.config.js)reactStrictMode: true - Catches bugs in developmentoptimizePackageImports - Optimizes imports from @/components/ui and lucide-reactcompress: true - Production compressionpoweredByHeader: false - Security header removaltailwind.config.ts)No backend needed: This is a purely client-side application. Don't add API routes unless explicitly required for a new feature.
Performance is critical: Before making changes, understand the existing optimizations in
PERFORMANCE.md. Maintain caching strategies and memoization patterns.
State management: All quiz state lives in
components/quiz.tsx. Don't split this into separate stores or context unless the component becomes unmaintainable.
Lazy loading pattern: Use
require() for state-based component loading (not next/dynamic), as demonstrated in quiz.tsx.
No test infrastructure: Project doesn't currently have tests. If adding tests, use Jest + React Testing Library.
Deployment: Application can be deployed to Vercel (
.vercel/ directory exists) or any static hosting.