home / skills / buildatscale-tv / claude-code-plugins / generate

generate skill

/plugins/nano-banana-pro/skills/generate

This skill generates custom images using Gemini 2.5 Flash for frontend designs, illustrations, icons, or hero images from user prompts.

npx playbooks add skill buildatscale-tv/claude-code-plugins --skill generate

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
5.0 KB
---
name: generate
description: Nano Banana Pro (nano-banana-pro) image generation skill. Use this skill when the user asks to "generate an image", "generate images", "create an image", "make an image", uses "nano banana", or requests multiple images like "generate 5 images". Generates images using Google's Gemini 2.5 Flash for any purpose - frontend designs, web projects, illustrations, graphics, hero images, icons, backgrounds, or standalone artwork. Invoke this skill for ANY image generation request.
---

# Nano Banana Pro - Gemini Image Generation

Generate custom images using Google's Gemini models for integration into frontend designs.

## Prerequisites

Set the `GEMINI_API_KEY` environment variable with your Google AI API key.

## Available Models

| Model | ID | Best For | Max Resolution |
|-------|-----|----------|----------------|
| **Flash** | `gemini-2.5-flash-image` | Speed, high-volume tasks | 1024px |
| **Pro** | `gemini-3-pro-image-preview` | Professional quality, complex scenes | Up to 4K |

## Image Generation Workflow

### Step 1: Generate the Image

Use `scripts/image.py` with uv. The script is located in the skill directory at `skills/generate/scripts/image.py`:

```bash
uv run "${SKILL_DIR}/scripts/image.py" \
  --prompt "Your image description" \
  --output "/path/to/output.png"
```

Where `${SKILL_DIR}` is the directory containing this SKILL.md file.

Options:
- `--prompt` (required): Detailed description of the image to generate
- `--output` (required): Output file path (PNG format)
- `--aspect` (optional): Aspect ratio - "square", "landscape", "portrait" (default: square)
- `--reference` (optional): Path to a reference image for style, composition, or content guidance
- `--model` (optional): Model to use - "flash" (fast) or "pro" (high-quality) (default: flash)
- `--size` (optional): Image resolution for pro model - "1K", "2K", "4K" (default: 1K, ignored for flash)

### Using Different Models

**Flash model (default)** - Fast generation, good for iterations:
```bash
uv run "${SKILL_DIR}/scripts/image.py" \
  --prompt "A minimalist logo design" \
  --output "/path/to/logo.png" \
  --model flash
```

**Pro model** - Higher quality for final assets:
```bash
uv run "${SKILL_DIR}/scripts/image.py" \
  --prompt "A detailed hero illustration for a tech landing page" \
  --output "/path/to/hero.png" \
  --model pro \
  --size 2K
```

### Using a Reference Image

To generate an image based on an existing reference:

```bash
uv run "${SKILL_DIR}/scripts/image.py" \
  --prompt "Create a similar abstract pattern with warmer colors" \
  --output "/path/to/output.png" \
  --reference "/path/to/reference.png"
```

The reference image helps Gemini understand the desired style, composition, or visual elements you want in the generated image.

### Step 2: Integrate with Frontend Design

After generating images, incorporate them into frontend code:

**HTML/CSS:**
```html
<img src="./generated-hero.png" alt="Description" class="hero-image" />
```

**React:**
```jsx
import heroImage from './assets/generated-hero.png';
<img src={heroImage} alt="Description" className="hero-image" />
```

**CSS Background:**
```css
.hero-section {
  background-image: url('./generated-hero.png');
  background-size: cover;
  background-position: center;
}
```

## Crafting Effective Prompts

Write detailed, specific prompts for best results:

**Good prompt:**
> A minimalist geometric pattern with overlapping translucent circles in coral, teal, and gold on a deep navy background, suitable for a modern fintech landing page hero section

**Avoid vague prompts:**
> A nice background image

### Prompt Elements to Include

1. **Subject**: What the image depicts
2. **Style**: Artistic style (minimalist, abstract, photorealistic, illustrated)
3. **Colors**: Specific color palette matching the design system
4. **Mood**: Atmosphere (professional, playful, elegant, bold)
5. **Context**: How it will be used (hero image, icon, texture, illustration)
6. **Technical**: Aspect ratio needs, transparency requirements

## Integration with Frontend-Design Skill

When used alongside the frontend-design skill:

1. **Plan the visual hierarchy** - Identify where generated images add value
2. **Match the aesthetic** - Ensure prompts align with the chosen design direction (brutalist, minimalist, maximalist, etc.)
3. **Generate images first** - Create visual assets before coding the frontend
4. **Reference in code** - Use relative paths to generated images in your HTML/CSS/React

### Example Workflow

1. User requests a landing page with custom hero imagery
2. Invoke nano-banana-pro to generate the hero image with a prompt matching the design aesthetic
3. Invoke frontend-design to build the page, referencing the generated image
4. Result: A cohesive design with custom AI-generated visuals

## Output Location

By default, save generated images to the project's assets directory:
- `./assets/` for simple HTML projects
- `./src/assets/` or `./public/` for React/Vue projects
- Use descriptive filenames: `hero-abstract-gradient.png`, `icon-user-avatar.png`

Overview

This skill generates custom images using Google's Gemini models (Flash and Pro) for frontend designs, illustrations, icons, backgrounds, and standalone artwork. It is optimized for both fast iteration and high-quality final assets and supports reference images, aspect ratios, and resolution options. Use it whenever you ask to generate or create images, including requests for multiple images or explicit "nano banana" references.

How this skill works

The skill runs a provided image script that calls Gemini image models to produce PNG outputs. You supply a detailed prompt, optional reference image, aspect ratio, model choice (flash or pro), and output path; the script returns a generated image file ready to integrate into your project. Flash prioritizes speed and volume; Pro offers higher fidelity and larger resolutions up to 4K.

When to use it

  • Create hero images, backgrounds, or illustrations for web pages and landing pages
  • Generate icons, avatars, or UI visuals for frontend projects
  • Iterate quickly on concepts using the fast Flash model
  • Produce final, high-resolution assets using the Pro model
  • Create variations or multiple images in bulk (e.g., "generate 5 images")

Best practices

  • Provide detailed prompts: subject, style, color palette, mood, context, and technical constraints
  • Use a reference image to guide style, composition, or color when needed
  • Start with Flash for rapid iteration, then switch to Pro for final assets
  • Choose aspect ratio and resolution that match the target placement (hero, icon, background)
  • Save outputs in your project assets folder with descriptive filenames for easy integration

Example use cases

  • Generate a minimalist geometric hero image (1024px) for a fintech landing page and import it into HTML/CSS
  • Create a set of 5 variant icons for a mobile UI, iterating quickly with the Flash model
  • Produce a 2K detailed illustration for a product page using the Pro model
  • Use a reference pattern to generate matching background textures for a design system
  • Generate a hero illustration, then wire it into a React component as a static asset

FAQ

What model should I pick for rapid prototyping?

Use the Flash model for speed and inexpensive iterations; switch to Pro for higher quality once the concept is locked.

How do I use a reference image?

Provide the reference file path to guide style or composition; the generator will blend prompt instructions with the visual cues from the reference.