Skip to the usage guide
imagegenby OpenAI

ImageGen Skill.

A Claude Code and Codex skill for image work: generates or edits raster images: illustrations, photos, textures, sprites, mockups.

  • Images & Generative Art
  • Image
openai/skills · skills/.system/imagegen/SKILL.mdSKILL.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 … --- ## Top-level modes and rules ## When to use ## When not to use ## Decision tree ## Workflow ## Prompt augmentation
Front matter and section headings read from the upstream file on 2026-09-14 · 16,170 characters in full

01 What it does

What the imagegen Skill Does in Claude Code and Codex

Summary, workflow and outputs, all read from the skill's SKILL.md.

From the SKILL.mdRead 2026-09-14 · not a recorded run

In the Skill's Own Terms

Imagegen gives Codex a raster-image workflow: generate or edit bitmap assets such as photos, illustrations, textures, sprites, mockups, and transparent-background cutouts, then get the finished file into the project. It defines two top-level modes: the preferred built-in image_gen tool, which needs no API key, and an explicit-only CLI fallback through scripts/image_gen.py requiring OPENAI_API_KEY.

The file separates intent (generate versus edit) from execution (one asset or many), collects prompts, verbatim text, constraints and role-labeled input images, and reshapes them into a labeled schema. It ends with validation against subject, style, composition and text accuracy, single-change iteration, and non-destructive saves.

What it produces

  • A bitmap image produced through image_gen rather than an SVG, HTML/CSS, or canvas placeholder, whenever the user asked for a raster-style asset.
  • The selected final image moved or copied into the workspace, with any consuming code or references updated to point at it.
  • A closing report giving the final saved path of any workspace-bound asset, the final prompt, and which mode produced it.
  • In the explicit CLI fallback only, final artifacts written under output/imagegen/.
See the example prompt ↗

How It Works

  1. 01
    Pick the top-level Mode First

    Normal generation and editing runs through the built-in image_gen tool; the bundled CLI is a fallback the user has to ask for by name.

  2. 02
    Classify the Request as Generate or Edit

    Modifying an existing image while keeping parts of it is an edit; supplying images purely as style, composition or mood references is still a generation.

  3. 03
    Decide Where the Output Lives

    Preview or brainstorming work can stay inline at the default location, while anything the project consumes has to end up in the workspace.

  4. 04
    Collect Inputs Before Generating

    Gather the prompt, any exact in-image text, the constraints or avoid list, and all input images up front rather than filling gaps later.

  5. 05
    Reshape the Prompt into a Spec

    Prompts are normalized into a structured, production-oriented spec instead of being expanded with unrequested creative detail.

  6. 06
    Issue One Call per Asset

    In the built-in path, batches and variants come from repeated image_gen calls, one per requested asset or variant, not from a single batch flag.

02 Find your fit

When to Use the imagegen Skill

Use the imagegen skill in Claude Code or Codex when the job is image work of this kind. Fit and limits below are taken from the skill's own file.

Good Fit

  • Producing a brand-new bitmap such as concept art, a product shot, a cover, or a website hero image.
  • Generating a new image where supplied images act only as references for style, composition, or mood.
  • Editing an existing image for tasks like lighting or weather changes, background replacement, object removal, compositing, or transparent-background cutouts.
  • Producing many assets or variants for a single task rather than one image.

Know the Boundaries

  • Extending or matching an SVG/vector icon set, logo system, or illustration library that already exists in the repo.
  • Simple shapes, diagrams, wireframes, or icons that are cleaner to build directly in SVG, HTML/CSS, or canvas.
  • Small project-local asset edits where 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.

What to Provide

  • The main requestThe user's primary prompt supplies the subject and goal, and is carried into the spec as the primary request line.
  • Input images with explicit rolesEvery supplied image is labeled as a reference image, an edit target, or a supporting insert/style/compositing input before generation.
  • Exact text and its typographyAny words that must appear inside the image are quoted verbatim, with the typeface and placement specified alongside them.
  • Invariants and the avoid listFor edits, the things that must not change are written out explicitly, such as change only X while keeping Y unchanged.
  • Intended use of the assetStating whether the image is an ad, UI mock, or infographic sets the mode and the polish level the prompt aims for.

03 Inside the skill

Rules the imagegen Skill Gives Claude Code and Codex

8 concrete instructions, defaults and limits the SKILL.md sets for the agent — the part of the file that changes the result.

  1. Built-in Tool Is the Default

    Every ordinary generation or editing request goes through the built-in image_gen tool, which does not require OPENAI_API_KEY.

  2. Never Downgrade on Its Own

    The agent must not move itself onto the CLI path; that switch is always the user's decision.

  3. CLI Only When Asked for

    If the user does choose CLI mode, use the bundled scripts/image_gen.py workflow and do not write one-off SDK runners.

  4. The Bundled Script Is read-only

    scripts/image_gen.py is never modified; if something is missing from it, ask the user before doing anything else.

  5. Project Assets Cannot Stay in $CODEX_HOME

    A file referenced by the project must be moved or copied out of the default generated-images location before the task is finished.

  6. Version Rather Than Overwrite

    Existing assets are only replaced when the user explicitly asked for replacement; otherwise the new file gets a sibling versioned name such as hero-v2.png.

  7. Preserve Invariants on Edits

    Edit work locks down what must not change and saves non-destructively rather than rewriting the source asset.

  8. No Key Handling in the built-in Path

    The agent never asks for OPENAI_API_KEY while using image_gen, and never asks the user to paste a full key into chat.

04 Put it to work

Install imagegen in Claude Code or Codex

One npx skills add command, then a first task in your agent and a checklist for the result.

Add imagegen to Claude Code, Codex or Your Agent

Run in your project; the installer asks which agent to add it to.

Terminal
npx skills add https://github.com/openai/skills --skill imagegen

Generic skills CLI form for skills/.system/imagegen/SKILL.md; the repository may document its own path.

Give the Skill a First Image Work Task

Adapt this prompt with your own content and constraints, then run it in Claude Code or Codex.

Example prompt
Use case: product-mockup Asset type: landing page hero Primary request: a minimal hero image of a ceramic coffee mug Style/medium: clean product photography Composition/framing: wide composition with usable negative space for page copy if needed Lighting/mood: soft studio lighting Constraints: no logos, no text, no watermark

Source: SKILL.md example (verbatim).

Check the First Result

What the SKILL.md itself says a correct result looks like:

  • Inspect the output against subject, style, composition, text accuracy, and the invariants and avoid items agreed up front.
  • Follow up with a single targeted change and re-check, rather than bundling several changes into one iteration.
  • For edits, restate the invariants on every iteration so the image does not drift away from what had to stay unchanged.

In OpenDesign imagegen is bundled: Plugins → Skills, pick it in the top bar.

05 Open source, traceable

Source, License and Verification

Where this page's facts come from, and when they were last checked.

Author
OpenAI
Repository
github.com/openai/skills Branch main
Skill file
skills/.system/imagegen/SKILL.md Content checksum recorded at verification; commit 49f948f
License
Apache-2.0 From skills/.system/imagegen/LICENSE.txt. The skill is open source; image generation still depends on a hosted service.
Repository stars
27,129 GitHub snapshot taken 2026-09-14 for the whole openai/skills repository. Not a rating or usage count for imagegen.
Verified by OpenDesign
2026-09-14 Source file, path, license text and star count were checked. Bundled in OpenDesign main (checked 2026-08-28); a live run has not been recorded on this page.

Inside the SKILL.md

  1. Top-level modes and rulesBuilt-in image_gen is default; CLI fallback is explicit-only, with save-path precedence and overwrite limits.
  2. When to useNew images, reference-guided generation, edits of existing images, and many assets or variants.
  3. When not to useRepo-native vector systems, code-native shapes, editable native files, and deterministic code-native output.
  4. Decision treeSeparates intent (generate versus edit) from execution strategy (one asset versus many).
  5. WorkflowSeventeen ordered steps from mode choice through prompt building, generation, validation, and reporting.
  6. Prompt augmentationStructures prompts into a production spec, with allowed and forbidden augmentations keyed to specificity.
  7. Use-case taxonomy (exact slugs)Fixed generate and edit slugs to keep consistent across prompts and references.
  8. Shared prompt schemaLabeled scaffolding fields such as asset type, scene, subject, lighting, verbatim text, and avoid list.
  9. ExamplesA hero-image generation spec and a background-replacement edit spec that names its invariants.
  10. Prompting best practicesOrdering, quoting exact text, indexing multiple images, and iterating with single-change follow-ups.
  11. Guidance by asset typePoints asset-type templates for website, game, wireframe, and logo work to sample-prompts.md.
  12. Fallback CLI mode onlyCLI temp and output conventions, uv dependencies, and OPENAI_API_KEY setup steps.
The Skill's Own 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.”

Front-matter description from SKILL.md. The full file is about 16,170 characters. Read the full file on GitHub.

ImageGen

Run imagegen on a Real Image Work Task.

The imagegen skill ships inside OpenDesign. Download the app, pick the skill in Plugins → Skills, paste the prompt above, and read the plan before the result.

Terminal
npx skills add https://github.com/openai/skills --skill imagegen