skills/.curated/imagegen/SKILL.md
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.
npx skillsauth add openai/skills imagegenInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
4 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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).
This skill has exactly two top-level modes:
image_gen tool for normal image generation and editing. Does not require OPENAI_API_KEY.scripts/image_gen.py CLI. Use only when the user explicitly asks for the CLI path. Requires OPENAI_API_KEY.Within the explicit CLI fallback only, the CLI exposes three subcommands:
generateeditgenerate-batchRules:
image_gen tool by default for all normal image generation and editing requests.OPENAI_API_KEY. Proceed only if the user explicitly asks for that fallback.scripts/image_gen.py workflow. Do not create one-off SDK runners.scripts/image_gen.py. If something is missing, ask the user before doing anything else.Built-in save-path policy:
$CODEX_HOME/* by default.image_gen tool. If a specific location is needed, generate first and then move or copy the selected output from $CODEX_HOME/generated_images/....$CODEX_HOME/* path.$CODEX_HOME/* path.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.mdreferences/image-api.mdreferences/codex-network.mdscripts/image_gen.pyThink about two separate questions:
Intent:
Built-in edit semantics:
view_image tool so the image is visible in the conversation context, then proceed with the built-in edit flow.Execution strategy:
image_gen call per requested asset or variant.generate-batch subcommand only when the user explicitly chose CLI mode and needs many prompts/assets.Assume the user wants a new image unless they clearly ask to change an existing one.
generate or edit.generate-batch.view_image first so the image is available in conversation context.image_gen rather than substituting SVG/HTML/CSS placeholders. If the request is for an icon, logo, or UI graphic that should match existing repo-native SVG/vector/code assets, prefer editing those directly instead.image_gen tool by default.input_fidelity, masks, output format, output paths, and network setup.$CODEX_HOME/generated_images/... path.$CODEX_HOME/generated_images/... path.Reformat user prompts into a structured, production-oriented spec. Make the user's goal clearer and more actionable, but do not blindly add detail.
Treat this as prompt-shaping guidance, not a closed schema. Use only the lines that help, and add a short extra labeled line when it materially improves clarity.
Use the user's prompt specificity to decide how much augmentation is appropriate:
Allowed augmentations:
Not allowed augmentations:
Classify each request into one of these buckets and keep the slug consistent across prompts and references.
Generate:
Edit:
Use the following labeled spec as shared prompt scaffolding for both top-level modes:
Use case: <taxonomy slug>
Asset type: <where the asset will be used>
Primary request: <user's main prompt>
Input images: <Image 1: role; Image 2: role> (optional)
Scene/backdrop: <environment>
Subject: <main subject>
Style/medium: <photo/illustration/3D/etc>
Composition/framing: <wide/close/top-down; placement>
Lighting/mood: <lighting + mood>
Color palette: <palette notes>
Materials/textures: <surface details>
Text (verbatim): "<exact text>"
Constraints: <must keep/must avoid>
Avoid: <negative constraints>
Notes:
Asset type and Input images are prompt scaffolding, not dedicated CLI flags.Scene/backdrop refers to the visual setting. It is not the same as the fallback CLI background parameter, which controls output transparency behavior.Quality:, Input fidelity:, masks, output format, and output paths belong in the explicit CLI path only. Do not treat them as built-in image_gen tool arguments.Augmentation rules:
change only X; keep Y unchanged).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
Use case: precise-object-edit
Asset type: product photo background replacement
Primary request: replace only the background with a warm sunset gradient
Constraints: change only the background; keep the product and its edges unchanged; no text; no watermark
references/cli.md and references/image-api.md for quality, input_fidelity, masks, output format, and output-path guidance.More principles shared by both modes: references/prompting.md.
Copy/paste specs shared by both modes: references/sample-prompts.md.
Asset-type templates (website assets, game assets, wireframes, logo) are consolidated in references/sample-prompts.md.
These conventions apply only to the explicit CLI fallback. They do not describe built-in image_gen output behavior.
tmp/imagegen/ for intermediate files (for example JSONL batches); delete them when done.output/imagegen/.--out or --out-dir to control output paths; keep filenames stable and descriptive.Prefer uv for dependency management in this repo.
Required Python package:
uv pip install openai
Optional for downscaling only:
uv pip install pillow
Portability note:
uv pip install ... remains the preferred path.OPENAI_API_KEY must be set for live API calls.OPENAI_API_KEY when using the built-in image_gen tool.If the key is missing, give the user these steps:
OPENAI_API_KEY as an environment variable in their system.If installation is not possible in this environment, tell the user which dependency is missing and how to install it into their active environment.
references/cli.mdreferences/image-api.mdreferences/codex-network.mdreferences/prompting.md: shared prompting principles for both modes.references/sample-prompts.md: shared copy/paste prompt recipes for both modes.references/cli.md: fallback-only CLI usage via scripts/image_gen.py.references/image-api.md: fallback-only API/CLI parameter reference.references/codex-network.md: fallback-only network/sandbox troubleshooting for CLI mode.scripts/image_gen.py: fallback-only CLI implementation. Do not load or use it unless the user explicitly chooses CLI mode.development
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.
tools
Build a composable CLI for Codex from API docs, an OpenAPI spec, existing curl examples, an SDK, a web app, an admin tool, or a local script. Use when the user wants Codex to create a command-line tool that can run from any repo, expose composable read/write commands, return stable JSON, manage auth, and pair with a companion skill.
tools
Use only when the user explicitly asks to stage, commit, push, and open a GitHub pull request in one flow using the GitHub CLI (`gh`).
tools
Use when the user asks to inspect Sentry issues or events, summarize recent production errors, or pull basic Sentry health data via the Sentry CLI; perform read-only queries using the `sentry` command.