Imagegen
OpenAIOfficialPublished by OpenAI
- Skill
- Content generator
- Design and creative
- Apache-2.0
- Low risk
- Has scripts
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The imagegen skill provides capabilities to create or modify bitmap assets such as photos, illustrations, and mockups. It operates primarily through a built-in tool for standard tasks and offers an explicit CLI fallback for advanced workflows requiring specific API parameters. The skill includes structured prompt guidance to ensure consistent output across various use cases, including product mockups, UI designs, and narrative illustrations.
What it does
- Generates new raster images from text prompts
- Edits existing images through inpainting, background replacement, and style transfer
- Supports reference-based generation for style and composition
- Provides a structured taxonomy for classifying image generation tasks
- Offers an optional CLI fallback for batch processing and advanced configuration
- Manages asset saving and versioning within the project workspace
When to use it
- Creating new visual assets like website heroes, product shots, or concept art
- Performing edits on existing images such as object removal or lighting adjustments
- Generating multiple variants of an asset for design exploration
- When you need bitmap outputs rather than vector or code-native graphics
Advantages
- Integrated workflow with built-in tools for immediate image creation
- Structured prompt scaffolding improves consistency and output relevance
- Clear separation between simple built-in usage and advanced CLI requirements
- Non-destructive saving policy with versioning support
- Flexible execution strategies for single assets or batch processing
Usage examples
- “Generate a minimal hero image of a ceramic coffee mug for a landing page.”
- The agent uses the built-in tool to create a product-mockup style image with studio lighting and appropriate negative space.
- “Replace the background of this product photo with a warm sunset gradient.”
- The agent loads the image and performs a precise-object-edit to swap the background while preserving the product.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/openai/imagegen/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip imagegen.zip -d .agents/skills
Documentation by OpenAI
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_gentool for normal image generation and editing. Does not requireOPENAI_API_KEY.Fallback CLI mode (explicit-only):
scripts/image_gen.pyCLI. Use only when the user explicitly asks for the CLI path. RequiresOPENAI_API_KEY.
Within the explicit CLI fallback only, the CLI exposes three subcommands:
generateeditgenerate-batch
Rules:
Use the built-in
image_gentool 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.pyworkflow. 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_gentool. 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.pngoritem-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.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:
Intent: is this a new image or an edit of an existing image?
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_imagetool 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_gencall per requested asset or variant.In the explicit CLI fallback path, use the CLI
generate-batchsubcommand 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.
Workflow
Decide the top-level mode: built-in by default, fallback CLI only if explicitly requested.
Decide the intent:
generateoredit.Decide whether the output is preview-only or meant to be consumed by the current project.
Decide the execution strategy: single asset vs repeated built-in calls vs CLI
generate-batch.Collect inputs up front: prompt(s), exact text (verbatim), constraints/avoid list, and any input images.
For every input image, label its role explicitly:
reference image
edit target
supporting insert/style/compositing input
If the edit target is only on the local filesystem and you are staying on the built-in path, inspect it with
view_imagefirst so the image is available in conversation context.If the user asked for a photo, illustration, sprite, product image, banner, or other explicitly raster-style asset, use
image_genrather 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.Augment the prompt based on specificity:
If the user's prompt is already specific and detailed, normalize it into a clear spec without adding creative requirements.
If the user's prompt is generic, add tasteful augmentation only when it materially improves output quality.
Use the built-in
image_gentool by default.If the user explicitly chooses the CLI fallback, then and only then use the fallback-only docs for quality,
input_fidelity, masks, output format, output paths, and network setup.Inspect outputs and validate: subject, style, composition, text accuracy, and invariants/avoid items.
Iterate with a single targeted change, then re-check.
For preview-only work, render the image inline; the underlying file may remain at the default
$CODEX_HOME/generated_images/...path.For project-bound work, move or copy the selected artifact into the workspace and update any consuming code or references. Never leave a project-referenced asset only at the default
$CODEX_HOME/generated_images/...path.For batches, persist only the selected finals in the workspace unless the user explicitly asked to keep discarded variants.
Always report the final saved path for any workspace-bound asset, plus the final prompt and whether the built-in tool or fallback CLI mode was used.
Prompt augmentation
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.
Specificity policy
Use the user's prompt specificity to decide how much augmentation is appropriate:
If the prompt is already specific and detailed, preserve that specificity and only normalize/structure it.
If the prompt is generic, you may add tasteful augmentation when it will materially improve the result.
Allowed augmentations:
composition or framing hints
polish level or intended-use hints
practical layout guidance
reasonable scene concreteness that supports the stated request
Not allowed augmentations:
extra characters or objects that are not implied by the request
brand names, slogans, palettes, or narrative beats that are not implied
arbitrary side-specific placement unless the surrounding layout supports it
Use-case taxonomy (exact slugs)
Classify each request into one of these buckets and keep the slug consistent across prompts and references.
Generate:
photorealistic-natural — candid/editorial lifestyle scenes with real texture and natural lighting.
product-mockup — product/packaging shots, catalog imagery, merch concepts.
ui-mockup — app/web interface mockups and wireframes; specify the desired fidelity.
infographic-diagram — diagrams/infographics with structured layout and text.
logo-brand — logo/mark exploration, vector-friendly.
illustration-story — comics, children’s book art, narrative scenes.
stylized-concept — style-driven concept art, 3D/stylized renders.
historical-scene — period-accurate/world-knowledge scenes.
Edit:
text-localization — translate/replace in-image text, preserve layout.
identity-preserve — try-on, person-in-scene; lock face/body/pose.
precise-object-edit — remove/replace a specific element (including interior swaps).
lighting-weather — time-of-day/season/atmosphere changes only.
background-extraction — transparent background / clean cutout.
style-transfer — apply reference style while changing subject/scene.
compositing — multi-image insert/merge with matched lighting/perspective.
sketch-to-render — drawing/line art to photoreal render.
Shared prompt schema
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 typeandInput imagesare prompt scaffolding, not dedicated CLI flags.Scene/backdroprefers to the visual setting. It is not the same as the fallback CLIbackgroundparameter, which controls output transparency behavior.Fallback-only execution notes such as
Quality:,Input fidelity:, masks, output format, and output paths belong in the explicit CLI path only. Do not treat them as built-inimage_gentool arguments.
Augmentation rules:
Keep it short.
Add only the details needed to improve the prompt materially.
For edits, explicitly list invariants (
change only X; keep Y unchanged).If any critical detail is missing and blocks success, ask a question; otherwise proceed.
Examples
Generation example (hero image)
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 watermarkEdit example (invariants)
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 watermarkPrompting best practices
Structure prompt as scene/backdrop -> subject -> details -> constraints.
Include intended use (ad, UI mock, infographic) to set the mode and polish level.
Use camera/composition language for photorealism.
Only use SVG/vector stand-ins when the user explicitly asked for vector output or a non-image placeholder.
Quote exact text and specify typography + placement.
For tricky words, spell them letter-by-letter and require verbatim rendering.
For multi-image inputs, reference images by index and describe how they should be used.
For edits, repeat invariants every iteration to reduce drift.
Iterate with single-change follow-ups.
If the prompt is generic, add only the extra detail that will materially help.
If the prompt is already detailed, normalize it instead of expanding it.
For explicit CLI fallback only, see
references/cli.mdandreferences/image-api.mdforquality,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.
Guidance by asset type
Asset-type templates (website assets, game assets, wireframes, logo) are consolidated in references/sample-prompts.md.
Fallback CLI mode only
Temp and output conventions
These conventions apply only to the explicit CLI fallback. They do not describe built-in image_gen output behavior.
Use
tmp/imagegen/for intermediate files (for example JSONL batches); delete them when done.Write final artifacts under
output/imagegen/.Use
--outor--out-dirto control output paths; keep filenames stable and descriptive.
Dependencies
Prefer uv for dependency management in this repo.
Required Python package:
uv pip install openaiOptional for downscaling only:
uv pip install pillowPortability note:
If you are using the installed skill outside this repo, install dependencies into that environment with its package manager.
In uv-managed environments,
uv pip install ...remains the preferred path.
Environment
OPENAI_API_KEYmust be set for live API calls.Do not ask the user for
OPENAI_API_KEYwhen using the built-inimage_gentool.Never ask the user to paste the full key in chat. Ask them to set it locally and confirm when ready.
If the key is missing, give the user these steps:
Create an API key in the OpenAI platform UI: https://platform.openai.com/api-keys
Set
OPENAI_API_KEYas an environment variable in their system.Offer to guide them through setting the environment variable for their OS/shell if needed.
If installation is not possible in this environment, tell the user which dependency is missing and how to install it into their active environment.
Script-mode notes
CLI commands + examples:
references/cli.mdAPI parameter quick reference:
references/image-api.mdNetwork approvals / sandbox settings for CLI mode:
references/codex-network.md
Reference map
references/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 viascripts/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.
Files
- ATTRIBUTION.mdAdded by AutoGineer855 B
- LICENSE.txt10.5 KiB
- SKILL.md15.8 KiB
- agents/openai.yaml918 B
- assets/imagegen-small.svg2.8 KiB
- assets/imagegen.png1.7 KiB
- references/cli.md6.1 KiB
- references/codex-network.md1.6 KiB
- references/image-api.md2.4 KiB
- references/prompting.md6.3 KiB
- references/sample-prompts.md14.4 KiB
- scripts/image_gen.pyScript31.1 KiB
LICENSE.txt
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf of
any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don\'t include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Requirements and compatibility
Written for: OpenAI Codex
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs an API key, Needs Python
Security
What our scanner noticed· Low risk
- Instructions that use the network
- Scripts that your agent may run
This skill includes scripts that your agent may run. Read them before you use it.
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- OpenAI
- Publisher
- OpenAI (Official)
- Source
- openai/skills · skills/.system/imagegen · commit 49f948f
- Licence
- Apache License 2.0 (redistribution allowed)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by OpenAI.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download imagegen.zip