Nano Banana Pro
Agent skill for nano-banana-pro
This file provides guidance to AI coding agents when working with code in this repository.
Sign in to like and favorite skills
This file provides guidance to AI coding agents when working with code in this repository.
Next.js 16 application featuring AI-powered chat and image generation capabilities using Vercel AI SDK. Built with React 19, TypeScript, and shadcn/ui components with Tailwind CSS v4. Supports multiple AI providers (Google Gemini, OpenAI) with streaming responses.
npm run dev # Start dev server on localhost:3000 npm run build # Production build npm run lint # Run ESLint npm start # Start production server
ai-sdk-template/ ├── app/ │ ├── api/ │ │ ├── chat/route.ts # Chat streaming endpoint │ │ └── image/route.ts # Image generation endpoint │ ├── chat/page.tsx # Chat interface page │ ├── image/page.tsx # Image generation page │ ├── page.tsx # Landing page │ ├── layout.tsx # Root layout with theme provider │ └── globals.css # Global styles ├── components/ │ ├── ui/ # shadcn/ui components │ │ ├── button.tsx │ │ ├── input.tsx │ │ ├── textarea.tsx │ │ ├── dropdown-menu.tsx │ │ ├── navigation-menu.tsx │ │ ├── label.tsx │ │ └── dropzone.tsx │ ├── chat.tsx # Main chat component with useChat hook │ ├── image-generator.tsx # Image generation/editing component │ ├── response.tsx # Markdown response renderer (Streamdown) │ ├── header.tsx # Navigation header │ ├── container.tsx # Layout container │ ├── mode-toggle.tsx # Dark/light mode toggle │ └── theme-provider.tsx # next-themes provider ├── lib/ │ └── utils.ts # Utility functions (cn for class merging) ├── public/ # Static assets └── ai-chatbot-example/ # Example/reference code
Framework: Next.js 16 with React 19 and TypeScript 5 AI SDK: Vercel AI SDK v5 (
ai, @ai-sdk/react, @ai-sdk/google, @ai-sdk/openai)
UI Components: shadcn/ui with Radix UI primitives
Styling: Tailwind CSS v4 with @tailwindcss/typography
Theme: next-themes with system preference support
Animation: Framer Motion
Icons: Lucide React
Markdown: Streamdown for streaming markdown rendering
Validation: Zod v4
File Upload: react-dropzone
API Route (
app/api/chat/route.ts):
streamText() for streaming responsesconvertToModelMessages() for message format conversiontoUIMessageStreamResponse() for client-compatible streamingClient Component (
components/chat.tsx):
useChat() hook from @ai-sdk/react.parts array with type-based rendering (currently only 'text' type)Response componentAPI Route (
app/api/image/route.ts):
result.filesClient Component (
components/image-generator.tsx):
Response Component (
components/response.tsx):
shadcn/ui Configuration:
npx shadcn@latest add [component-name]Theme System:
system, light, dark modesNavigation:
Typography:
next/font/googleUses
@/* for root-level imports (configured in tsconfig.json):
import { Chat } from '@/components/chat' import { cn } from '@/lib/utils' import { Button } from '@/components/ui/button'
Requires
.env.local with:
OPENAI_API_KEY= # OpenAI API key (if using OpenAI provider) GOOGLE_GENERATIVE_AI_API_KEY= # Google AI API key (required for current setup)
Reference
.env.example for template.
Current Setup: Google Gemini models
gemini-2.5-flash-litegemini-2.5-flash-image-previewSwitching Providers: To use OpenAI instead:
// In app/api/chat/route.ts import { openai } from '@ai-sdk/openai' // Change model to: model: openai('gpt-4o')
All AI SDK providers follow the same pattern:
import { provider } from '@ai-sdk/{provider}'model: provider('model-name')dark: prefixsm:, md:, lg:, xl: breakpointsclass-variance-authoritycn() utility (uses clsx + tailwind-merge)@/* → ./*Component Structure:
'use client' directive at topmemo() for performance-critical components (see Response)Form Handling:
e.preventDefault() for form submissionsAsync Operations:
fetch() for API callsAnimation:
Message Streaming:
const { messages, sendMessage, status } = useChat()
Image Generation:
const result = await generateText({ model: google('gemini-2.5-flash-image-preview'), prompt: 'your prompt' }) const imageUrl = `data:${file.mediaType};base64,${file.base64}`
Markdown Rendering:
<Response>{markdownText}</Response>
Theme Toggle:
<ThemeProvider attribute="class" defaultTheme="system">
Before completing tasks:
npm run lint to check for ESLint errorsnpm run build to verify production buildhttp://localhost:3000export const maxDuration = 30 for streaming@/* path aliasCurrent branch:
main (default branch)
Modified files: components/image-generator.tsx
Always commit with descriptive messages and include co-authorship for factory-droid contributions.