Claude Skill

imagen

Generate images using Google Gemini's image generation capabilities. Use this skill when the user needs to create, generate, or produce images for any purpose including UI mockups, icons, illustrations, diagrams, concept art, placeholder images, or visual representations.

LLM Mart · 0 points · 2 views 0 listing impressions 0 install-command copies
Download sanjay3290-ai-skills-skills_imagen-c842558.zip · 14 KB

Install

skills CLI npx skills add https://github.com/sanjay3290/ai-skills/tree/main/skills/imagen
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install sanjay3290-ai-skills@llmmart
Git git clone https://github.com/sanjay3290/ai-skills.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole sanjay3290/ai-skills collection as a plugin from our marketplace. Git is the plain clone.

README

Imagen - AI Image Generation Skill

A Claude Code skill that generates images using Google Gemini's image generation model. Simply ask Claude to create an image during any coding session, and it will generate and save it for you.

Cross-Platform: Works on Windows, macOS, and Linux.

Quick Start

1. Install the Skill

# Via plugin marketplace (recommended)
/plugin install imagen@ai-skills

# Or add the entire marketplace
/plugin marketplace add sanjay3290/ai-skills

2. Set Your API Key

Get a free API key from Google AI Studio:

Windows (PowerShell):

$env:GEMINI_API_KEY = "your-api-key-here"

Windows (CMD):

set GEMINI_API_KEY=your-api-key-here

macOS/Linux:

export GEMINI_API_KEY="your-api-key-here"

# Add to ~/.zshrc or ~/.bashrc to persist
echo 'export GEMINI_API_KEY="your-api-key-here"' >> ~/.zshrc

3. Use It!

Just ask Claude to generate an image during any conversation:

"Generate an image of a sunset over mountains"
"I need a hero image for my landing page"
"Create an app icon for a weather app"

How It Works

When you mention needing an image, Claude will automatically:

  1. Recognize the request and activate this skill
  2. Call the Google Gemini API with your prompt
  3. Save the generated image to your project
  4. Tell you where to find it

Features

  • Cross-Platform: Python script works on Windows, macOS, and Linux
  • Automatic Activation: Claude detects when you need an image
  • Multiple Sizes: 512px, 1K (default), or 2K resolution
  • Custom Output Paths: Save images wherever you need them
  • Frontend Ready: Perfect for UI development, placeholders, icons
  • Documentation Images: Generate diagrams, illustrations, flowcharts

Usage Examples

During Frontend Development

You: "I'm building a dashboard. Generate a placeholder chart image."
Claude: *generates and saves image* "Created the image at ./assets/chart-placeholder.png"

For Documentation

You: "Create an architecture diagram for our microservices"
Claude: *generates image* "Saved to ./docs/architecture.png"

Custom Size & Location

You: "Generate a high-res hero image and save it to ./public/hero.png"
Claude: *generates 2K image at specified path*

Configuration

Environment Variables

Variable Required Default Description
GEMINI_API_KEY Yes - Your Google Gemini API key
IMAGE_SIZE No 1K Default size (512, 1K, or 2K)
GEMINI_MODEL No gemini-3-pro-image-preview Gemini model ID

Image Sizes

Size Resolution Best For
512 512x512 Icons, thumbnails, quick previews
1K 1024x1024 General use, web images
2K 2048x2048 High-res, print, retina displays

Manual Script Usage

# Basic usage
python scripts/generate_image.py "A serene lake at dawn"

# Custom output path
python scripts/generate_image.py "App icon" "./icon.png"

# With size option
python scripts/generate_image.py --size 2K "Detailed landscape" "./wallpaper.png"

# With custom model
python scripts/generate_image.py --model gemini-3-pro-image-preview "A logo" "./logo.png"

File Structure

imagen/
├── SKILL.md               # Skill definition (Claude reads this)
├── README.md              # This file
├── reference.md           # Detailed API reference
├── examples.md            # Usage examples
├── .env.example           # API key template
└── scripts/
    └── generate_image.py  # Cross-platform Python script

Requirements

  • Python 3.6+: No additional packages needed (uses standard library only)
  • Gemini API Key: Free from Google AI Studio

Troubleshooting

"GEMINI_API_KEY not set"

Windows:

echo $env:GEMINI_API_KEY  # Should show your key

macOS/Linux:

echo $GEMINI_API_KEY  # Should show your key
source ~/.zshrc       # Reload if you just added it

API Errors

  • 400: Check your prompt for special characters
  • 429: Rate limited, wait and retry
  • 403: Invalid API key

Getting a Gemini API Key

  1. Go to Google AI Studio
  2. Sign in with your Google account
  3. Click "Get API Key" in the left sidebar
  4. Create a new key or copy an existing one
  5. Add it to your environment as shown above

License

Apache-2.0 License - See LICENSE for details.

Skill manifest

Imagen - AI Image Generation Skill

Overview

This skill generates images using Google Gemini's image generation model (gemini-3-pro-image-preview). It enables seamless image creation during any Claude Code session - whether you're building frontend UIs, creating documentation, or need visual representations of concepts.

Cross-Platform: Works on Windows, macOS, and Linux.

When to Use This Skill

Automatically activate this skill when:

  • User requests image generation (e.g., "generate an image of...", "create a picture...")
  • Frontend development requires placeholder or actual images
  • Documentation needs illustrations or diagrams
  • Visualizing concepts, architectures, or ideas
  • Creating icons, logos, or UI assets
  • Any task where an AI-generated image would be helpful

How It Works

  1. Takes a text prompt describing the desired image
  2. Calls Google Gemini API with image generation configuration
  3. Saves the generated image to a specified location (defaults to current directory)
  4. Returns the file path for use in your project

Usage

Python (Cross-Platform - Recommended)

# Basic usage
python scripts/generate_image.py "A futuristic city skyline at sunset"

# With custom output path
python scripts/generate_image.py "A minimalist app icon for a music player" "./assets/icons/music-icon.png"

# With custom size
python scripts/generate_image.py --size 2K "High resolution landscape" "./wallpaper.png"

Requirements

  • GEMINI_API_KEY environment variable must be set
  • Python 3.6+ (uses standard library only, no pip install needed)

Output

Generated images are saved as PNG files. The script returns:

  • Success: Path to the generated image
  • Failure: Error message with details

Examples

Frontend Development

User: "I need a hero image for my landing page - something abstract and tech-focused"
-> Generates and saves image, provides path for use in HTML/CSS

Documentation

User: "Create a diagram showing microservices architecture"
-> Generates visual representation, ready for README or docs

UI Assets

User: "Generate a placeholder avatar image for the user profile component"
-> Creates image in appropriate size for component use
Files (ai-skills)
  • scripts
    • generate_image.py 11.2 KB
      Loading…
  • .env.example 175 B · in bundle
  • .gitignore 280 B · in bundle
  • examples.md 8.9 KB
    Loading…
  • README.md 4.5 KB
    # Imagen - AI Image Generation Skill
    
    A Claude Code skill that generates images using Google Gemini's image generation model. Simply ask Claude to create an image during any coding session, and it will generate and save it for you.
    
    **Cross-Platform**: Works on Windows, macOS, and Linux.
    
    ## Quick Start
    
    ### 1. Install the Skill
    
    ```bash
    # Via plugin marketplace (recommended)
    /plugin install imagen@ai-skills
    
    # Or add the entire marketplace
    /plugin marketplace add sanjay3290/ai-skills
    ```
    
    ### 2. Set Your API Key
    
    Get a free API key from [Google AI Studio](https://aistudio.google.com/):
    
    **Windows (PowerShell):**
    ```powershell
    $env:GEMINI_API_KEY = "your-api-key-here"
    ```
    
    **Windows (CMD):**
    ```cmd
    set GEMINI_API_KEY=your-api-key-here
    ```
    
    **macOS/Linux:**
    ```bash
    export GEMINI_API_KEY="your-api-key-here"
    
    # Add to ~/.zshrc or ~/.bashrc to persist
    echo 'export GEMINI_API_KEY="your-api-key-here"' >> ~/.zshrc
    ```
    
    ### 3. Use It!
    
    Just ask Claude to generate an image during any conversation:
    
    ```
    "Generate an image of a sunset over mountains"
    "I need a hero image for my landing page"
    "Create an app icon for a weather app"
    ```
    
    ## How It Works
    
    When you mention needing an image, Claude will automatically:
    1. Recognize the request and activate this skill
    2. Call the Google Gemini API with your prompt
    3. Save the generated image to your project
    4. Tell you where to find it
    
    ## Features
    
    - **Cross-Platform**: Python script works on Windows, macOS, and Linux
    - **Automatic Activation**: Claude detects when you need an image
    - **Multiple Sizes**: 512px, 1K (default), or 2K resolution
    - **Custom Output Paths**: Save images wherever you need them
    - **Frontend Ready**: Perfect for UI development, placeholders, icons
    - **Documentation Images**: Generate diagrams, illustrations, flowcharts
    
    ## Usage Examples
    
    ### During Frontend Development
    ```
    You: "I'm building a dashboard. Generate a placeholder chart image."
    Claude: *generates and saves image* "Created the image at ./assets/chart-placeholder.png"
    ```
    
    ### For Documentation
    ```
    You: "Create an architecture diagram for our microservices"
    Claude: *generates image* "Saved to ./docs/architecture.png"
    ```
    
    ### Custom Size & Location
    ```
    You: "Generate a high-res hero image and save it to ./public/hero.png"
    Claude: *generates 2K image at specified path*
    ```
    
    ## Configuration
    
    ### Environment Variables
    
    | Variable | Required | Default | Description |
    |----------|----------|---------|-------------|
    | `GEMINI_API_KEY` | Yes | - | Your Google Gemini API key |
    | `IMAGE_SIZE` | No | `1K` | Default size (512, 1K, or 2K) |
    | `GEMINI_MODEL` | No | `gemini-3-pro-image-preview` | Gemini model ID |
    
    ### Image Sizes
    
    | Size | Resolution | Best For |
    |------|------------|----------|
    | `512` | 512x512 | Icons, thumbnails, quick previews |
    | `1K` | 1024x1024 | General use, web images |
    | `2K` | 2048x2048 | High-res, print, retina displays |
    
    ## Manual Script Usage
    
    ```bash
    # Basic usage
    python scripts/generate_image.py "A serene lake at dawn"
    
    # Custom output path
    python scripts/generate_image.py "App icon" "./icon.png"
    
    # With size option
    python scripts/generate_image.py --size 2K "Detailed landscape" "./wallpaper.png"
    
    # With custom model
    python scripts/generate_image.py --model gemini-3-pro-image-preview "A logo" "./logo.png"
    ```
    
    ## File Structure
    
    ```
    imagen/
    ├── SKILL.md               # Skill definition (Claude reads this)
    ├── README.md              # This file
    ├── reference.md           # Detailed API reference
    ├── examples.md            # Usage examples
    ├── .env.example           # API key template
    └── scripts/
        └── generate_image.py  # Cross-platform Python script
    ```
    
    ## Requirements
    
    - **Python 3.6+**: No additional packages needed (uses standard library only)
    - **Gemini API Key**: Free from [Google AI Studio](https://aistudio.google.com/)
    
    ## Troubleshooting
    
    ### "GEMINI_API_KEY not set"
    
    **Windows:**
    ```powershell
    echo $env:GEMINI_API_KEY  # Should show your key
    ```
    
    **macOS/Linux:**
    ```bash
    echo $GEMINI_API_KEY  # Should show your key
    source ~/.zshrc       # Reload if you just added it
    ```
    
    ### API Errors
    - **400**: Check your prompt for special characters
    - **429**: Rate limited, wait and retry
    - **403**: Invalid API key
    
    ## Getting a Gemini API Key
    
    1. Go to [Google AI Studio](https://aistudio.google.com/)
    2. Sign in with your Google account
    3. Click "Get API Key" in the left sidebar
    4. Create a new key or copy an existing one
    5. Add it to your environment as shown above
    
    ## License
    
    Apache-2.0 License - See [LICENSE](../../LICENSE) for details.
    
  • reference.md 8 KB
    Loading…
  • SKILL.md 2.6 KB
    ---
    name: imagen
    description: |
      Generate images using Google Gemini's image generation capabilities.
      Use this skill when the user needs to create, generate, or produce images
      for any purpose including UI mockups, icons, illustrations, diagrams,
      concept art, placeholder images, or visual representations.
    license: Apache-2.0
    metadata:
      author: sanjay3290
      version: "1.0"
    ---
    
    # Imagen - AI Image Generation Skill
    
    ## Overview
    
    This skill generates images using Google Gemini's image generation model (`gemini-3-pro-image-preview`). It enables seamless image creation during any Claude Code session - whether you're building frontend UIs, creating documentation, or need visual representations of concepts.
    
    **Cross-Platform**: Works on Windows, macOS, and Linux.
    
    ## When to Use This Skill
    
    Automatically activate this skill when:
    - User requests image generation (e.g., "generate an image of...", "create a picture...")
    - Frontend development requires placeholder or actual images
    - Documentation needs illustrations or diagrams
    - Visualizing concepts, architectures, or ideas
    - Creating icons, logos, or UI assets
    - Any task where an AI-generated image would be helpful
    
    ## How It Works
    
    1. Takes a text prompt describing the desired image
    2. Calls Google Gemini API with image generation configuration
    3. Saves the generated image to a specified location (defaults to current directory)
    4. Returns the file path for use in your project
    
    ## Usage
    
    ### Python (Cross-Platform - Recommended)
    
    ```bash
    # Basic usage
    python scripts/generate_image.py "A futuristic city skyline at sunset"
    
    # With custom output path
    python scripts/generate_image.py "A minimalist app icon for a music player" "./assets/icons/music-icon.png"
    
    # With custom size
    python scripts/generate_image.py --size 2K "High resolution landscape" "./wallpaper.png"
    ```
    
    ## Requirements
    
    - `GEMINI_API_KEY` environment variable must be set
    - Python 3.6+ (uses standard library only, no pip install needed)
    
    ## Output
    
    Generated images are saved as PNG files. The script returns:
    - Success: Path to the generated image
    - Failure: Error message with details
    
    ## Examples
    
    ### Frontend Development
    ```
    User: "I need a hero image for my landing page - something abstract and tech-focused"
    -> Generates and saves image, provides path for use in HTML/CSS
    ```
    
    ### Documentation
    ```
    User: "Create a diagram showing microservices architecture"
    -> Generates visual representation, ready for README or docs
    ```
    
    ### UI Assets
    ```
    User: "Generate a placeholder avatar image for the user profile component"
    -> Creates image in appropriate size for component use
    ```
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.