agentleFS
sinediedsinedied/agent-skills/.agents/skills/image-gen/SKILL.md

image-gen

Skill4 starsChanged 5 months agoMITView on GitHub

Create and edit images using OpenAI image generation API with GPT image models (gpt-image-1, gpt-image-1-mini, gpt-image-1.5, gpt-image-2 and later). Use when the user asks to generate an image from a text prompt, edit or modify an existing image, create illustrations, logos, icons, concept art, or any visual content using AI image generation. Also use when combining multiple source images into a new composition.

  • Reads credentials

48 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use spotify, trello and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • QuixiAISkill

    spotify

    Search Spotify, inspect current playback and devices, and control playback with explicit approval

    Also in 3 projects that use this

  • QuixiAISkill

    trello

    List Trello boards, lists, and cards and create or update cards with explicit approval

    Also in 3 projects that use this

  • AnthropicSkill

    daily-briefing

    Morning rundown - today's meetings with account context, opps closing soon with stale flags, waiting customer emails, and the day's top actions. Use when the user says "daily briefing", "daily brief", "morning briefing", "what's my day", "what's on my plate today", "prep my day", "start my day", "morning rundown", or on a schedule.

    Also in 3 projects that use this

  • silvainfmSkill

    paid-ads

    When the user wants help with paid advertising campaigns on Google Ads, Meta (Facebook/Instagram), LinkedIn, Twitter/X, or other ad platforms. Also use when the user mentions 'PPC,' 'paid media,' 'ad copy,' 'ad creative,' 'ROAS,' 'CPA,' 'ad campaign,' 'retargeting,' or 'audience targeting.' This skill covers campaign strategy, ad creation, audience targeting, and optimization.

    Also in 3 projects that use this

  • AnthropicSkill

    weather

    The optional standing status report ("the weather"): compile open incidents, build health, merge-queue stats, and deploy lag into one always-current report page, and post to the channel only when a defined event fires. Use when the weather routine fires, or when someone asks to run/update the weather report.

    Also in 3 projects that use this

  • SentrySkill

    notion

    Search, fetch, create, update, and move Notion pages and data sources. Use when users ask to look up docs, specs, notes, meeting notes, project context, roadmaps, trackers, or internal references stored in Notion, or when they explicitly ask to create or edit Notion content.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 36 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All variables can also be passed as CLI flags (--api-key, --base-url, --model).

    line 48
  2. Very specific:

    Important: Do not pass --model unless the user explicitly asks for a specific model.

    line 88
  3. Distinctive:

    Before generating an images, always first generate a prompt using these copy/paste instructions for prompt recipes: …

    line 112

“Common” is measured: kept by at least 6 in 10 of the 36 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Image Generation & Editing

Generate and edit images via OpenAI-compatible REST APIs using the bundled Python CLI script. No external dependencies required (Python 3.8+ standard library only). Compatible with OpenAI, Azure OpenAI (v1 endpoint), and other OpenAI-compatible providers.

Quick Reference

Supported Models

ModelGenerationEditingNotes
gpt-image-1✓✓Base GPT image model
gpt-image-1-mini✓✓Smaller, faster variant
gpt-image-1.5✓✓Latest, most capable
gpt-image-2✓✓Next-gen model (2026-04-21+)

Key Parameters

ParameterValuesDefaultNotes
sizeauto, 1024x1024, 1536x1024 (landscape), 1024x1536 (portrait)auto
qualityauto, low, medium, highauto
backgroundauto, transparent, opaqueautoTransparent requires png or webp output
output_formatpng, jpeg, webppng
output_compression0–100100Only for jpeg/webp
n1–101Number of images
moderationauto, lowautoGeneration only

Usage

The script at scripts/image_gen.py is a zero-dependency Python CLI.

Authentication

Variables can be defined in a .env file in the working directory or any parent directory.

VariableDescriptionDefault
OPENAI_API_KEYAPI key (required)—
OPENAI_BASE_URLBase URL for custom endpoints (Azure OpenAI, etc.)https://api.openai.com/v1
OPENAI_IMAGE_MODELDefault modelgpt-image-1.5

All variables can also be passed as CLI flags (--api-key, --base-url, --model).

Generate an Image

python scripts/image_gen.py generate "A cat wearing a top hat" -o ./output

With full options:

python scripts/image_gen.py generate "A minimalist coffee shop logo" \
  --size 1024x1024 \
  --quality high \
  --background transparent \
  --output-format png \
  -o ./output

Edit an Image

python scripts/image_gen.py edit "Add sunglasses to the person" \
  -i photo.png -o ./output

Multiple input images (up to 16):

python scripts/image_gen.py edit "Create a gift basket with these items" \
  -i item1.png -i item2.png -i item3.png -o ./output

With mask for inpainting:

python scripts/image_gen.py edit "Replace the background with a beach" \
  -i photo.png --mask mask.png -o ./output

Important: Do not pass --model unless the user explicitly asks for a specific model. The default model is resolved from OPENAI_IMAGE_MODEL env var or falls back to gpt-image-1.5.

Prompt Guidelines

For best results with GPT image models:

  • Be specific and descriptive: include subject, style, mood, colors, composition.
  • Specify the art style: "photorealistic", "watercolor", "flat illustration", "3D render", etc.
  • For logos/icons: request "transparent background" and set --background transparent --output-format png.
  • For edits: clearly describe what should change and what should remain.
  • The maximum prompt length for GPT image models is 32,000 characters.

Output

-o accepts a file path or a directory:

  • File path (e.g. -o logo.png): saves directly to that path. With --n >1, appends _1, _2, etc. before the extension. Intermediate directories are created automatically.
  • Directory (e.g. -o ./out): saves as image_1.{ext}, image_2.{ext}, etc.

Existing files are never overwritten — a numeric suffix is appended automatically if the target already exists.

The script prints saved file path(s) to stdout (one per line) and any revised prompts to stderr.

Recipes

Before generating an images, always first generate a prompt using these copy/paste instructions for prompt recipes: references/sample-prompts.md.

An image genaration/editing workflow consists of 2 steps:

  1. Generate a prompt for the image generation/editing based on the user query using the sample prompts.
  2. Pass the generated prompt to the image generation/editing command to generate/edit the image.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.