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 an LLM conversation system that enables multiple AI participants to have natural conversations with each other. The system manages speaking turns, conversation history, and participant personas.
The system uses two architectural approaches:
generateObject from AI SDKConversationSystem and SpeakingRightManager classes, better error handling, and conversation state managementDefault to using Bun instead of Node.js.
bun <file> instead of node <file> or ts-node <file>bun test instead of jest or vitestbun build <file.html|file.ts|file.css> instead of webpack or esbuildbun install instead of npm install or yarn install or pnpm installbun run <script> instead of npm run <script> or yarn run <script> or pnpm run <script>Bun.serve() supports WebSockets, HTTPS, and routes. Don't use express.bun:sqlite for SQLite. Don't use better-sqlite3.Bun.redis for Redis. Don't use ioredis.Bun.sql for Postgres. Don't use pg or postgres.js.WebSocket is built-in. Don't use ws.Bun.file over node:fs's readFile/writeFilels instead of execa.Use
bun test to run tests.
import { test, expect } from "bun:test"; test("hello world", () => { expect(1).toBe(1); });
Use HTML imports with
Bun.serve(). Don't use vite. HTML imports fully support React, CSS, Tailwind.
Server:
import index from "./index.html" Bun.serve({ routes: { "/": index, "/api/users/:id": { GET: (req) => { return new Response(JSON.stringify({ id: req.params.id })); }, }, }, // optional websocket support websocket: { open: (ws) => { ws.send("Hello, world!"); }, message: (ws, message) => { ws.send(message); }, close: (ws) => { // handle close } }, development: { hmr: true, console: true, } })
HTML files can import .tsx, .jsx or .js files directly and Bun's bundler will transpile & bundle automatically.
<link> tags can point to stylesheets and Bun's CSS bundler will bundle.
<html> <body> <h1>Hello, world!</h1> <script type="module" src="./frontend.tsx"></script> </body> </html>
With the following
frontend.tsx:
import React from "react"; // import .css files directly and it works import './index.css'; import { createRoot } from "react-dom/client"; const root = createRoot(document.body); export default function Frontend() { return <h1>Hello, world!</h1>; } root.render(<Frontend />);
Then, run index.ts
bun --hot ./index.ts
For more information, read the Bun API docs in
node_modules/bun-types/docs/**.md.
# Install dependencies bun install # Run the main conversation system bun run index.ts # Run with hot reload during development bun --hot index.ts # Run tests (when available) bun test
Each participant has:
id: Unique identifiername: Display name (must match SpeakerName enum in schemas.ts)persona: Character description that influences responsesmodel: OpenRouter model identifier (e.g., "google/gemini-2.5-pro")Requires
OPENROUTER_API_KEY environment variable. Bun automatically loads .env files.
generateObject with structured Zod schemas for consistent response parsing. Implements infinite conversation loop with structured turn management.generateText with manual response parsing. Provides more granular control over conversation state through class-based architecture.ConversationResponseSchema for type-safe responsessetSpeaker() methodWhen adding participants, ensure:
name matches one of the values in SpeakerName enum in schemas.tsmodel uses valid OpenRouter model identifierspersona provides clear character instructions for consistent behavior