Agent skill

Generate Image

by happycapy-ai in happycapy-ai/Happycapy-skills

Generate and transform images using AI Gateway API. An agent skill from happycapy-ai/Happycapy-skills.

MITAuto-check: notesMedia & Creative

Install Generate Image

skills CLI
$ npx skills add happycapy-ai/Happycapy-skills --skill generate-image -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install happycapy-ai/Happycapy-skills generate-image --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/happycapy-ai/Happycapy-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/generate-image .claude/skills/generate-image && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
generate-image
GitHub stars
137
Token cost
~2k tokens
SKILL.md length
635 words
Files
4 (incl. scripts)
Skills in repo
28
Repo updated
First seen
Licence
MIT

At a glance

Generate and transform images using AI Gateway API. An agent skill from happycapy-ai/Happycapy-skills.

  • Works in 3 steps: generate_image.py → transform_image.py → batch_generate.py
  • The user asks to create
  • SKILL.md covers Overview, Prerequisites, Quick Start and Supported Models, plus 8 more sections
  • Runs Python scripts from its folder; calls python3; reaches trickle.so; needs AI_GATEWAY_API_KEY

What it does

Generate Image is an agent skill from happycapy-ai/Happycapy-skills. Generate and transform images using AI Gateway API. Use when the user asks to create, generate, produce, or transform images, or work with image generation.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including scripts (for example `scripts/batch_generate.py`, `scripts/generate_image.py` and `scripts/transform_image.py`).

It sits in Media & Creative, covering Image generation. It works with OpenAI, Google Gemini and Vertex AI. The repository describes itself as: A curated collection of high-quality Claude Code skills to enhance your development workflow. The licence is MIT.

When your agent uses it

  • The user asks to create
  • Transform images
  • Work with image generation

Example prompts

  • “/generate-image”

Requirements

  • Python 3
  • A credential in AI_GATEWAY_API_KEY
  • Pre-approved tools (allowed-tools): Bash, Read

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. generate_image.py
  2. transform_image.py
  3. batch_generate.py

What it can do on your machine

Read from SKILL.md and the folder at commit 9ff72fe. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash
    • Read

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 3 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • trickle.so

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • AI_GATEWAY_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Generate Image loads about 2k tokens when it runs. Until then it costs about 43 tokens; SKILL.md has 635 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~43
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Bash, Read

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from happycapy-ai/Happycapy-skills at commit 9ff72fe, republished under its MIT licence (© happycapy-ai). 635 words, ~1,952 tokens.

Download SKILL.mdSave it as .claude/skills/generate-image/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
generate-image
description
Generate and transform images using AI Gateway API. Use when the user asks to create, generate, produce, or transform images, or work with image generation.
allowed-tools
Bash, Read

Image Generation Skill

Generate images from text prompts and transform existing images using the AI Gateway API with support for multiple AI models including Google Gemini, Byteplus Seedream, and OpenAI GPT-Image.

Overview

This Skill enables Claude to generate images from text descriptions and transform existing images with AI-powered modifications. It uses the AI Gateway API which routes requests to appropriate providers based on the model selected.

Prerequisites

Required Environment Variable:

  • AI_GATEWAY_API_KEY: Your AI Gateway API key

If this environment variable is not set, the scripts will fail with an error message asking you to provide it.

Quick Start

Generate an Image from Text

Use the bundled script to generate images from text descriptions:

bash
python3 scripts/generate_image.py "A serene landscape with mountains and a lake at sunset, photorealistic style"
Transform an Existing Image

Apply transformations to existing images using reference URLs:

bash
python3 scripts/transform_image.py "Make this image more vibrant and add dramatic lighting" "https://example.com/image.jpg"

Supported Models

Image Generation Models
ModelProviderBest For
google/gemini-3.1-flash-image-previewGoogle Vertex AILatest fast image generation with improved quality
google/gemini-3-pro-image-previewGoogle Vertex AIHigh-quality photorealistic images
google/gemini-2.5-flash-imageGoogle Vertex AIFast image generation
byteplus/seedream-4-5Byteplus SeedreamCreative artistic styles
byteplus/seedream-4-0Byteplus SeedreamGeneral purpose image generation
openai/gpt-image-1OpenAIAdvanced image synthesis
openai/gpt-image-1-miniOpenAIQuick image generation
openai/gpt-image-1.5OpenAIEnhanced image synthesis
openai/gpt-image-2OpenAILatest generation, multi-aspect ratio support

API Parameters

Image Generation
  • prompt (required): Text description of the desired image
  • model (required): Model to use for generation
  • images (optional): Array of reference image URLs for image-to-image transformation
  • response_format (optional): "url" (default) or "b64_json"
  • n (optional): Number of images to generate (default: 1)
  • size (optional): Image dimensions (e.g., "1024x1024", "1792x1024", "1024x1792", "1536x1024", "1024x1536")
  • aspectRatio (optional): Aspect ratio — alternative to size. Supported values: "1:1", "16:9", "9:16", "3:2", "2:3", "4:3", "3:4", "3:1", "1:3"
  • background (optional, OpenAI models only): "transparent" | "opaque" | "auto" — controls background transparency
  • user (optional): User identifier for tracking
OpenAI gpt-image-2 / gpt-image-1.5 Parameters

These models support the full parameter set above. Key notes:

  • Supports all aspect ratios via aspectRatio field
  • Supports background: "transparent" for PNG output with transparency
  • Use response_format: "b64_json" to receive raw image data; use "url" for a hosted URL
  • Image editing (passing images) routes to the /images/edits endpoint automatically

Bundled Scripts

1. generate_image.py

Generate images from text prompts with customizable parameters.

Usage:

bash
python3 scripts/generate_image.py "prompt" [--model MODEL] [--output OUTPUT] [--format FORMAT]

Options:

  • --model: Model to use (default: google/gemini-3.1-flash-image-preview)
  • --output: Output file path (default: generated_image.png)
  • --format: Response format - "url" or "b64_json" (default: b64_json)

Example:

bash
python3 scripts/generate_image.py \
  "A futuristic city with flying cars at night, cyberpunk style" \
  --model "google/gemini-3.1-flash-image-preview" \
  --output "city.png"
2. transform_image.py

Transform existing images using AI with text instructions.

Usage:

bash
python3 scripts/transform_image.py "prompt" "image_url" [--model MODEL] [--output OUTPUT]

Example:

bash
python3 scripts/transform_image.py \
  "Make this image more vibrant and add dramatic sunset lighting" \
  "https://example.com/original.jpg" \
  --output "enhanced.png"
3. batch_generate.py

Generate multiple images in batch.

Usage:

bash
python3 scripts/batch_generate.py prompts.txt [--model MODEL]

Example prompts.txt:

A sunset over the ocean
A mountain landscape at dawn
A bustling city street at night
Show full SKILL.md (264 more words)Show less

Implementation Notes

When implementing image generation tasks:

  1. Always use JavaScript for API calls when writing custom code

  2. Check for API Key at the start:

    javascript
    const apiKey = process.env.AI_GATEWAY_API_KEY;
    if (!apiKey) {
      throw new Error('AI_GATEWAY_API_KEY environment variable is required. Please set it with your AI Gateway API key.');
    }
  3. Use the bundled Python scripts for quick generation tasks rather than writing custom code

  4. Include Origin header in all API requests: Set Origin: https://trickle.so header for proper request routing

  5. Handle both streaming and non-streaming responses appropriately

  6. Save generated images to appropriate file paths and inform the user

JavaScript Implementation Template

When you need to write custom JavaScript code for image generation:

javascript
const apiKey = process.env.AI_GATEWAY_API_KEY;
if (!apiKey) {
  throw new Error('AI_GATEWAY_API_KEY environment variable is required. Please set it with your AI Gateway API key.');
}

const API_BASE = `${process.env.AI_GATEWAY_BASE_URL}/api/v1`;

async function generateImage(prompt, model = 'google/gemini-3.1-flash-image-preview') {
  const response = await fetch(`${API_BASE}/images/generations`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': `Bearer ${apiKey}`,
      'Origin': 'https://trickle.so'
    },
    body: JSON.stringify({
      model,
      prompt,
      response_format: 'url'
    })
  });

  if (!response.ok) {
    throw new Error(`API request failed: ${response.status} ${response.statusText}`);
  }

  return await response.json();
}

// Use the function
const result = await generateImage('A beautiful sunset over mountains');
console.log('Generated image URL:', result.data[0].url);

Error Handling

All scripts include comprehensive error handling for:

  • Missing API key
  • Network failures
  • Invalid responses
  • File I/O errors

Errors will include helpful messages to guide troubleshooting.

Best Practices

  1. Be Specific in Prompts: Include style, mood, lighting, and composition details
  2. Use Appropriate Models: Choose models based on your quality vs. speed requirements
  3. Reference Images: Use image-to-image transformation for style transfer or modifications
  4. Batch Processing: Use the batch script for multiple generations to save time
  5. Save Outputs: Always specify meaningful output file names for organization

Troubleshooting

"AI_GATEWAY_API_KEY environment variable is required"

Set the environment variable before running scripts:

bash
export AI_GATEWAY_API_KEY="your-api-key-here"
Network Errors

Check your internet connection and verify the API Gateway is accessible.

Invalid Model Errors

Ensure you're using a valid model name from the supported models list above.

Additional Resources

For more details on API parameters and response formats, see the API documentation at the AI Gateway repository.

© happycapy-ai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (scripts) in skills/generate-image of happycapy-ai/Happycapy-skills.

  • SKILL.md
  • scripts/batch_generate.py
  • scripts/generate_image.py
  • scripts/transform_image.py

Open the folder on GitHubat commit 9ff72fe

Compare with similar skills

Generate Image next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Generate Image compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Generate Image this skillhappycapy-ai/Happycapy-skills137—~2kAutomated safety check: NotesMIT
Nano Banana Pro Prompts Recommend SkillYouMind-OpenLab/nano-banana-pro-prompts-recommend-skill1.9k1 repos~4.1kAutomated safety check: PassNone
AI Image Creatorcentminmod/my-claude-code-setup2.7k—~8.1kAutomated safety check: NotesMIT
Chatgpt Image Adkrusemediallc/arcads-claude-code1.6k—~2.7kAutomated safety check: NotesMIT
Zy Cinematic Realismpopopo-99/zy-cinematic-realism570—~4.6kAutomated safety check: PassCC-BY-NC-4.0
Image GenerationNegai-ai/AgentClaw330—~1.9kAutomated safety check: NotesApache-2.0

Similar skills

  • Nano Banana Pro Prompts Recommend Skill

    YouMind-OpenLab/nano-banana-pro-prompts-recommend-skill

    Recommend suitable prompts from 10,000+ Nano Banana Pro image generation prompts based on user needs.

    1.9k GitHub starsUsed in 1 repo~4.1k tokens
    Media & CreativeAuto-check passed
  • AI Image Creator

    centminmod/my-claude-code-setup

    Generate, edit-from-reference, or analyze images with AI via OpenRouter (Gemini, GPT Image, Seedream, Qwen, MAI, Grok, FLUX.2, Recraft, Muse, Riverflow; Cloudflare AI Gateway BYOK).

    2.7k GitHub stars~8.1k tokensUpdated 2 days ago
    Media & CreativeAuto-check: notes
  • Chatgpt Image Ad

    krusemediallc/arcads-claude-code

    Generate one or more standalone Meta image-ad creatives via ChatGPT Image 2 (gpt-image-2) through the Arcads external API.

    1.6k GitHub stars~2.7k tokensUpdated 17 days ago
    Media & CreativeAuto-check: notes
  • Zy Cinematic Realism

    popopo-99/zy-cinematic-realism

    Develop supplied scripts, short stories, or synopses into scene understanding, director-facing art concepts, and motivated narrative keyframes; compile scene ideas, visual references, or existing…

    570 GitHub stars~4.6k tokensUpdated 6 days ago
    Media & CreativeAuto-check passed
  • Image Generation

    Negai-ai/AgentClaw

    Generate, edit, and iterate raster images from text prompts or reference images with GPT Image, Nano Banana, or Seedream.

    330 GitHub stars~1.9k tokensUpdated 4 mo ago
    Media & CreativeAuto-check: notes
  • Image

    Nexus-JPF/note-companion

    When the user wants to create, generate, edit, or optimize images for marketing — blog heroes, social graphics, product mockups, profile banners, listing visuals, or brand assets.

    870 GitHub starsUsed in 3 repos~3.9k tokens
    Media & CreativeAuto-check passed

More from happycapy-ai/Happycapy-skills

All 28 skills in this repo
  • Happycapy Skill Creator

    happycapy-ai/Happycapy-skills

    Automate HappyCapy skill creation by finding and adapting existing skills from anthropics/skills repository.

    137 GitHub stars~627 tokensUpdated 1 mo ago
    Auto-check passed
  • 360 Panorama Viewer

    happycapy-ai/Happycapy-skills

    Build a fully self-contained 360° equirectangular panorama viewer as a single HTML file.

    137 GitHub stars~2.1k tokensUpdated 1 mo ago
    Auto-check passed
  • LLM Council

    happycapy-ai/Happycapy-skills

    Multi-model LLM Council with live dashboard. An agent skill from happycapy-ai/Happycapy-skills.

    137 GitHub stars~581 tokensUpdated 1 mo ago
    Auto-check passed
  • PPTX

    happycapy-ai/Happycapy-skills

    Create polished PowerPoint (.pptx) presentations directly from a topic or content description.

    137 GitHub stars~1.5k tokensUpdated 1 mo ago
    Auto-check passed
  • World Class Carousel

    happycapy-ai/Happycapy-skills

    Generate world-class Instagram carousel content on any topic.

    137 GitHub stars~16k tokensUpdated 1 mo ago
    Auto-check: notes
  • Happycapy Social Publisher

    happycapy-ai/Happycapy-skills

    HappyCapy-specific skill for publishing content to 13+ social media platforms (Instagram, Twitter, LinkedIn, Threads, Facebook, TikTok, YouTube, Pinterest, Reddit, Telegram, Discord, etc.)…

    137 GitHub stars~3.6k tokensUpdated 1 mo ago
    Auto-check: notes

Questions about Generate Image

What does Generate Image do?

Generate and transform images using AI Gateway API. An agent skill from happycapy-ai/Happycapy-skills. Generate Image is an agent skill from happycapy-ai/Happycapy-skills. Generate and transform images using AI Gateway API.

When should I use Generate Image?

Generate Image fits situations like: the user asks to create; transform images; work with image generation.

How do I install Generate Image in Claude Code?

Run `npx skills add happycapy-ai/Happycapy-skills --skill generate-image -a claude-code`. Or copy the skill folder (skills/generate-image in happycapy-ai/Happycapy-skills) into .claude/skills/generate-image in your project. Claude Code loads it when a task matches its description.

How do I install Generate Image in Codex?

Run `npx skills add happycapy-ai/Happycapy-skills --skill generate-image -a codex`. Or copy the skill folder (skills/generate-image in happycapy-ai/Happycapy-skills) into .agents/skills/generate-image in your project. Codex loads it when a task matches its description.

Can I use Generate Image in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add happycapy-ai/Happycapy-skills --skill generate-image -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/generate-image, .gemini/skills/generate-image, .github/skills/generate-image and .opencode/skills/generate-image in your project.

What does Generate Image need to run?

Going by SKILL.md and its folder, Generate Image needs Python for the scripts in its folder, the command-line tools its instructions call (python3) and credentials named AI_GATEWAY_API_KEY. Our summary lists: Python 3; A credential in AI_GATEWAY_API_KEY. Its frontmatter pre-approves these tools: Bash, Read.

Does Generate Image access the network?

SKILL.md names 1 domain. In commands or code: trickle.so; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Generate Image safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Generate Image use?

Generate Image is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Generate Image use?

About 2k tokens (SKILL.md is roughly 7.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Generate Image?

Skills that share tags, products or a category with Generate Image: Nano Banana Pro Prompts Recommend Skill (YouMind-OpenLab/nano-banana-pro-prompts-recommend-skill, 1.9k stars), AI Image Creator (centminmod/my-claude-code-setup, 2.7k stars), Chatgpt Image Ad (krusemediallc/arcads-claude-code, 1.6k stars) and Zy Cinematic Realism (popopo-99/zy-cinematic-realism, 570 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Generate Image?

happycapy-ai (a GitHub user) maintains it in happycapy-ai/Happycapy-skills, which has 137 GitHub stars. The repository holds 28 skills in this directory. The repository was last updated on September 3, 2026.

Source: happycapy-ai/Happycapy-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.