Skip to content
Development
Skill

/imagegen

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual

From plugin
codex
135k5 skills1 agent1 MCP

Claude Code

$ npx -y skills add openai/codex --skill imagegen --agent claude-code

SKILL.md

imagegen.SKILL.md
name: "imagegen"
description: "Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output should be a bitmap asset rather than repo-native code or vector. Do not use when the task is better handled by editing existing SVG/vector/code-native assets, extending an established icon or logo system, or building the visual directly in HTML/CSS/canvas."

Image Generation Skill

Generates or edits images for the current project (for example website assets, game assets, UI mockups, product mockups, wireframes, logo design, photorealistic images, or infographics).

Top-level modes and rules

This skill has exactly two top-level modes:

  • **Default built-in tool mode (preferred):** built-in `image_gen` tool for image generation, editing, and transparent-image requests. Does not require `OPENAI_API_KEY`.
  • **Fallback CLI mode:** `scripts/image_gen.py` CLI. Use when the user explicitly asks for or confirms the CLI/API/model path. Requires `OPENAI_API_KEY`.

Within CLI fallback, the CLI exposes three subcommands:

  • `generate`
  • `edit`
  • `generate-batch`

Rules:

  • Use the built-in `image_gen` tool by default for normal image generation and editing requests.
  • Do not switch to CLI fallback for ordinary quality, size, or file-path control.
  • For transparent images, ask built-in `image_gen` for a transparent background and preserve the generated alpha.
  • Never silently switch from built-in `image_gen` or CLI `gpt-image-2` to CLI `gpt-image-1.5`; ask the user first unless they explicitly requested `gpt-image-1.5`.
  • The word `batch` by itself does not mean CLI fallback. If the user asks for many assets or says to batch-generate assets without explicitly asking for CLI/API/model controls, stay on the built-in path and issue one built-in call per requested asset or variant.
  • If the built-in tool fails or is unavailable, tell the user the CLI fallback exists and that it requires `OPENAI_API_KEY`. Proceed only if the user explicitly asks for that fallback.
  • If the user explicitly asks for CLI mode, use the bundled `scripts/image_gen.py` workflow. Do not create one-off SDK runners.
  • Never modify `scripts/image_gen.py`. If something is missing, ask the user before doing anything else.

Built-in save-path policy:

  • In built-in tool mode, Codex saves generated images under `$CODEX_HOME/*` by default.
  • Do not describe or rely on OS temp as the default built-in destination.
  • Do not describe or rely on a destination-path argument (if any) on the built-in `image_gen` tool. If a specific location is needed, generate first and then move or copy the selected output from `$CODEX_HOME/generated_images/...`.
  • Save-path precedence in built-in mode:

1. If the user names a destination, move or copy the selected output there. 2. If the image is meant for the current project, move or copy the final selected image into the workspace before finishing. 3. If the image is only for preview or brainstorming, render it inline; the underlying file can remain at the default `$CODEX_HOME/*` path.

  • Never leave a project-referenced asset only at the default `$CODEX_HOME/*` path.
  • Do not overwrite an existing asset unless the user explicitly asked for replacement; otherwise create a sibling versioned filename such as `hero-v2.png` or `item-icon-edited.png`.

Shared prompt guidance for both modes lives in `references/prompting.md` and `references/sample-prompts.md`.

Fallback-only docs/resources for CLI mode:

  • `references/cli.md`
  • `references/image-api.md`
  • `references/codex-network.md`
  • `scripts/image_gen.py`

When to use

  • Generate a new image (concept art, product shot, cover, website hero)
  • Generate a new image using one or more reference images for style, composition, or mood
  • Edit an existing image (inpainting, lighting or weather transformations, background replacement, object removal, compositing, transparent background)
  • Produce many assets or variants for one task

When not to use

  • Extending or matching an existing SVG/vector icon set, logo system, or illustration library inside the repo
  • Creating simple shapes, diagrams, wireframes, or icons that are better produced directly in SVG, HTML/CSS, or canvas
  • Making a small project-local asset edit when the source file already exists in an editable native format
  • Any task where the user clearly wants deterministic code-native output instead of a generated bitmap

Decision tree

Think about two separate questions:

1. **Intent:** is this a new image or an edit of an existing image? 2. **Execution strategy:** is this one asset or many assets/variants?

Intent:

  • If the user wants to modify an existing image while preserving parts of it, treat the request as **edit**.
  • If the user provides images only as references for style, composition, mood, or subject guidance, treat the request as **generate**.
  • If the user provides no images, treat the request as **generate**.

Built-in edit semantics:

  • Built-in edit mode is for images already visible in the conversation context, such as attached images or images generated earlier in the thread.
  • If the user wants to edit a local image file with the built-in tool, first load it with built-in `view_image` tool so the image is visible in the conversation context, then proceed with the built-in edit flow.
  • Do not promise arbitrary filesystem-path editing through the built-in tool.
  • If a local file still needs direct file-path control, masks, or other explicit CLI-only parameters, use the explicit CLI fallback only when the user asks for it.
  • For edits, preserve invariants aggressively and save non-destructively by default.

Execution strategy:

  • In the built-in default path, produce many assets or variants by issuing one `image_gen` call per requested
Read more
@openai
Ships withcodex

Lightweight coding agent that runs in your terminal

135k5 skills1 agent1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
134.6k
Star history of openai/codex on GitHub, a chart by star-history.com

Other skills on codex.

openai-docs

openai-docs

API first-timers, Codex/Work Q&A. If the user already has an OpenAI API integration, skip this skill for API questions and use…

@openai@openaiInstall Skill
review-agent

review-agent

Perform a read-only, defect-first review of a specified code change and return every actionable finding. Use when another agent…

@openai@openaiInstall Skill
skill-creator

skill-creator

Create or update a Codex skill with appropriately scoped instructions and any needed supporting resources.

@openai@openaiInstall Skill
skill-installer

skill-installer

Install Codex skills into $CODEX_HOME/skills from a curated list or a GitHub repo path. Use when a user asks to list installable…

@openai@openaiInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills10d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc11d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about imagegen.

Which coding agents can use imagegen?
imagegen installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.