AI SummaryThis skill enables users to generate and edit images directly within Claude Code using the OpenAI Image API, supporting use cases from product mockups to concept art. Developers and designers benefit by automating image creation workflows without leaving their coding environment.
Install
Copy this and paste it into Claude Code, Cursor, or any AI assistant:
I want to install the "imagegen" skill in my project. Please run this command in my terminal: # Install skill into your project (11 files) mkdir -p .claude/skills/imagegen && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/imagegen/SKILL.md "https://raw.githubusercontent.com/openai/skills/main/skills/.curated/imagegen/SKILL.md" && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/imagegen/LICENSE.txt "https://raw.githubusercontent.com/openai/skills/main/skills/.curated/imagegen/LICENSE.txt" && mkdir -p .claude/skills/imagegen/agents && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/imagegen/agents/openai.yaml "https://raw.githubusercontent.com/openai/skills/main/skills/.curated/imagegen/agents/openai.yaml" && mkdir -p .claude/skills/imagegen/assets && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/imagegen/assets/imagegen-small.svg "https://raw.githubusercontent.com/openai/skills/main/skills/.curated/imagegen/assets/imagegen-small.svg" && mkdir -p .claude/skills/imagegen/assets && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/imagegen/assets/imagegen.png "https://raw.githubusercontent.com/openai/skills/main/skills/.curated/imagegen/assets/imagegen.png" && mkdir -p .claude/skills/imagegen/references && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/imagegen/references/cli.md "https://raw.githubusercontent.com/openai/skills/main/skills/.curated/imagegen/references/cli.md" && mkdir -p .claude/skills/imagegen/references && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/imagegen/references/codex-network.md "https://raw.githubusercontent.com/openai/skills/main/skills/.curated/imagegen/references/codex-network.md" && mkdir -p .claude/skills/imagegen/references && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/imagegen/references/image-api.md "https://raw.githubusercontent.com/openai/skills/main/skills/.curated/imagegen/references/image-api.md" && mkdir -p .claude/skills/imagegen/references && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/imagegen/references/prompting.md "https://raw.githubusercontent.com/openai/skills/main/skills/.curated/imagegen/references/prompting.md" && mkdir -p .claude/skills/imagegen/references && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/imagegen/references/sample-prompts.md "https://raw.githubusercontent.com/openai/skills/main/skills/.curated/imagegen/references/sample-prompts.md" && mkdir -p .claude/skills/imagegen/scripts && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/imagegen/scripts/image_gen.py "https://raw.githubusercontent.com/openai/skills/main/skills/.curated/imagegen/scripts/image_gen.py" Then restart Claude Code (or reload the window in Cursor) so the skill is picked up.
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 normal image generation and editing. Does not require OPENAI_API_KEY. • Fallback CLI mode (explicit-only): 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: • generate • edit • generate-batch Rules: • Use the built-in image_gen tool by default for all normal image generation and editing requests. • Never switch to CLI fallback automatically. • 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: • If the user names a destination, move or copy the selected output there. • If the image is meant for the current project, move or copy the final selected image into the workspace before finishing. • 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
Discussion
Health Signals
My Fox Den
Community Rating
Sign in to rate this booster