How chongdashu/cc-skills-nanobananapro works
Purpose and Deliverables
This repository is both a distributable Claude Code skill collection and a Next.js demo application. The app demonstrates a Chinese New Year card workflow: accept a selfie, generate a two-panel festive image through Google Gemini, and present it as an interactive fold-out 3D card. The reusable skill definitions live under .claude/skills/; the staged build prompts are in prompts/.
Application Entry and UI Shell
Next.js App Router supplies the runtime boundary. app/layout.tsx defines the shared document/layout shell and app/globals.css provides global presentation. app/page.tsx is the primary client-facing entry page: it owns the user workflow and composes generation and preview UI.
• app/page.tsx
• app/layout.tsx
• app/globals.css
Image Generation Server Boundary
Generation is isolated behind a Next.js server action rather than exposing the Gemini credential to the browser. app/actions/generate.ts receives user-provided image/prompt inputs, calls Google’s Generative AI image-generation capability, and returns generation output or failure information to the page. The API key is supplied through the local environment, with .env.example documenting the required variable.
• app/actions/generate.ts
• .env.example
User Workflow and State Flow
The page coordinates the main control flow: selfie selection/upload, generation submission and loading/error state, receipt of the generated card image, preview rendering, and download. Generated image data crosses from the server action back into the browser, where it becomes both a conventional image/download asset and input to the 3D renderer.
• app/page.tsx
• app/actions/generate.ts
Interactive 3D Card Preview
Card3DPreview.tsx encapsulates the browser-only Three.js presentation layer. It maps the generated two-panel artwork onto a fold-out card scene and supports interactive viewing, keeping WebGL/scene lifecycle concerns separate from the page’s form and generation state. This is a client rendering boundary: Gemini produces a flat image; Three.js turns it into an inspectable card model.
• app/components/Card3DPreview.tsx
• app/page.tsx
Skill Package Architecture
The repository’s primary reusable product is the Claude Code skill package. Each skill is invoked by Claude Code and provides domain-specific implementation guidance rather than app runtime code. nano-banana-builder covers Gemini image application patterns; threejs-builder covers modern Three.js scene construction; frontend-design guides UI design. Supporting reference documents extend the first two skills.
• .claude/skills/nano-banana-builder/SKILL.md
• .claude/skills/threejs-builder/SKILL.md
• .claude/skills/frontend-design/SKILL.md
Build Provenance and Runtime Dependencies
The prompts document the intended evolution of the demo: image-generation MVP, 3D preview addition, then UI polish. The material runtime is Node.js with Next.js, TypeScript, React, Tailwind/PostCSS styling, Google Gemini APIs, and browser WebGL/Three.js. No persistence, authentication, or external storage layer is represented in the tree.
• prompts/01-nanobanana.txt
• prompts/02-threejs.txt
• prompts/03-frontend-design.txt
Main entry points: page.tsx Card workflow page · generate.ts Generate card action · Card3DPreview.tsx 3D card preview · layout.tsx App layout
Components 14
Next.js demo app
Chinese New Year card generation and preview workflow.
- Card workflow page · Owns upload, generation state, preview, and download.
app/page.tsx - App layout · Shared document shell.
app/layout.tsx - Global styles
app/globals.css - Generate card action · Keeps Gemini calls and credentials off the browser.
app/actions/generate.ts - API key environment · Documents the required Gemini API key.
.env.example - 3D card preview · Maps generated artwork onto an interactive fold-out card.
app/components/Card3DPreview.tsx
Claude Code skills
Reusable implementation guidance distributed with the repository.
- Nano Banana Builder · Guidance for Gemini image applications.
.claude/skills/nano-banana-builder/SKILL.md - Three.js Builder · Guidance for modern Three.js scenes.
.claude/skills/threejs-builder/SKILL.md - Frontend Design · Guidance for UI design.
.claude/skills/frontend-design/SKILL.md
Build prompts
Staged prompts documenting the demo's evolution.
- Image MVP prompt
prompts/01-nanobanana.txt - 3D preview prompt
prompts/02-threejs.txt - UI polish prompt
prompts/03-frontend-design.txt
Other components
- Google Gemini · Produces the two-panel festive artwork.
- Browser WebGL
Connections 14
- App layout → Card workflow page: hosts
- App layout → Global styles: applies
- Card workflow page → Generate card action: submits selfie and prompt
- Generate card action → Google Gemini: generates artwork
- API key environment → Generate card action: supplies API key
- Generate card action → Card workflow page: returns image or error
- Card workflow page → 3D card preview: passes generated image
- 3D card preview → Browser WebGL: renders scene with
- Image MVP prompt → Nano Banana Builder: informs
- 3D preview prompt → Three.js Builder: informs
- UI polish prompt → Frontend Design: informs
- Nano Banana Builder → Generate card action: guides implementation
- Three.js Builder → 3D card preview: guides implementation
- Frontend Design → Card workflow page: guides implementation