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.
IMPORTANT: Always communicate in casual Japanese (タメ口). Do not use polite/formal Japanese (敬語).
IMPORTANT: Do NOT run npm commands (install, build, test, etc.) unless explicitly instructed by the user. Only execute npm commands when the user specifically requests them.
IMPORTANT: Always use double quotes (") for strings in TypeScript/JavaScript code. Do not use single quotes (').
Example:
// Good const message = "Hello"; import { Router } from "express"; // Bad const message = 'Hello'; import { Router } from 'express';
rui-keiba is a horse racing data analysis platform that migrates data from SQLite (netkeiba-scraper) to PostgreSQL and builds a full-stack TypeScript application for analysis.
Technology Stack:
# Start PostgreSQL and pgAdmin containers docker-compose up -d # View logs docker-compose logs -f # Stop containers docker-compose down # Restart containers (useful after schema changes) docker-compose restart postgres
PostgreSQL:
localhost:5432
rui_keibaruikeiba2025pgAdmin:
http://localhost:5050
[email protected]admin2025postgres (Docker container name)cd backend npm install # Install dependencies npm run dev # Start development server (port 3001) npm run build # Build for production npm start # Run production build
Environment Variables:
.env file in backend/ directoryDB_HOST, DB_PORT, DB_USER, DB_PASSWORD, DB_NAME, PORTAvailable API Endpoints:
GET /health - Health check with database connection statusGET /api/horses - Get latest 10 horsesGET /api/races - Get latest 10 racescd frontend npm install # Install dependencies npm run dev # Start development server (port 3000) npm run build # Build for production npm start # Run production build
Environment Variables:
.env.local file in frontend/ directoryNEXT_PUBLIC_API_URL - Backend API URL (default: http://localhost:3001)Tech Stack:
The database schema (database/schema.sql) is automatically initialized when the PostgreSQL container first starts. It defines a comprehensive horse racing data model:
Core Entities:
horse - Horse information (ID, name, gender, birthday, relationships to trainer/owner/breeder)jockey - Jockey master datatrainer - Trainer master dataowner - Owner master databreeder - Breeder master databirthplace - Horse birthplace/region dataRace Data:
race_info - Race metadata (name, surface, distance, weather, date, location, class)race_result - Individual horse results per race (position, time, odds, jockey weight, etc.)
horse, jockey, trainer, ownerpayoff - Betting payouts by ticket typecorner_position - Horse positions at each corner (1-10)lap_time - Furlong lap times per raceKey Relationships:
race_result links races to horses, jockeys, trainers, and ownersrace_info_id connects results, payoffs, corner positions, and lap times to racesrace_info remove all associated race dataSchema Features:
updated_at trigger on horse tableSource data comes from
../netkeiba-scraper/race.db (SQLite). The schema was converted from SQLite to PostgreSQL format. Migration scripts are planned but not yet implemented.
rui-keiba/ ├── docker-compose.yml # PostgreSQL + pgAdmin services ├── .env.example # Environment variable template ├── database/ │ └── schema.sql # PostgreSQL schema (auto-loaded on init) ├── backend/ # TypeScript + Express API server │ ├── src/ │ │ ├── index.ts # Main entry point │ │ ├── config/ │ │ │ └── database.ts # PostgreSQL connection pool │ │ ├── routes/ # API route handlers (planned) │ │ ├── controllers/ # Business logic (planned) │ │ └── services/ # Data access layer (planned) │ ├── .env # Environment variables (not committed) │ ├── package.json │ ├── tsconfig.json │ └── nodemon.json └── frontend/ # Next.js + TypeScript UI (bulletproof-react architecture) ├── app/ # Next.js App Router │ ├── page.tsx # Main dashboard page │ ├── layout.tsx # Root layout │ └── races/[id]/ # Race detail page ├── src/ # Application source code │ ├── components/ # Shared UI components │ │ └── ui/ # Basic UI components (Header, Footer, LoadingScreen) │ ├── features/ # Feature-based modules │ │ ├── races/ # Race feature │ │ │ ├── api/ # Race API hooks (races-api.ts) │ │ │ ├── components/ # Race components (RaceCard, RaceList, RaceDetailCard) │ │ │ └── types/ # Race type definitions (race.types.ts) │ │ └── health/ # Health check feature │ │ ├── api/ # Health API hooks (health-api.ts) │ │ ├── components/ # Health components (HealthStatus) │ │ └── types/ # Health type definitions (health.types.ts) │ ├── lib/ # Library configurations │ │ ├── api-client.ts # Axios instance configuration │ │ ├── providers.tsx # React Query & MUI providers │ │ └── theme.ts # MUI theme configuration │ └── utils/ # Utility functions │ └── date-utils.ts # Date formatting utilities ├── .env.local # Environment variables (not committed) ├── package.json ├── tsconfig.json # Path alias: @/* -> ./src/* ├── tailwind.config.ts └── next.config.ts
Frontend Architecture (bulletproof-react based):
src/components/ui/@/* maps to src/* for clean importsBackend (Express + TypeScript):
Frontend (Next.js 15):
Database:
/docker-entrypoint-initdb.d/01-schema.sql and runs only on first initializationdocker-compose down -v (WARNING: destroys all data)postgres_data Docker volume../netkeiba-scraper/race.dbDevelopment Workflow:
docker-compose up -dcd backend && npm run devcd frontend && npm run dev