Algorithmic Art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art …
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:
- 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:
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
Think about two separate questions:
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 asset or variant.
- In the explicit CLI fallback path, use the CLI 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: - 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
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.
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.
- 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-in image_gen tool 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.
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.
- Use tmp/imagegen/ for intermediate files (for example JSONL batches); delete them when done.
- Write final artifacts under output/imagegen/.
- Use --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:
- 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.
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:
1. Create an API key in the OpenAI platform UI: https://platform.openai.com/api-keys
2. Set OPENAI_API_KEY as an environment variable in their system.
3. 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.
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.Source: openai · Apache-2.0 · SHA-256 shown alongside the download.
License file included. A license and checksum are not a security certification. Review package instructions and scripts before running them.
openai-imagegen/LICENSE.txt10776 bytesopenai-imagegen/LICENSE.upstream.txt10776 bytesopenai-imagegen/SKILL.md16325 bytesopenai-imagegen/SOURCE.txt217 bytesopenai-imagegen/agents/openai.yaml918 bytesopenai-imagegen/assets/imagegen-small.svg2889 bytesopenai-imagegen/assets/imagegen.png1711 bytesopenai-imagegen/references/cli.md6257 bytesopenai-imagegen/references/image-api.md2500 bytesopenai-imagegen/references/prompting.md6462 bytesopenai-imagegen/references/sample-prompts.md14789 bytesopenai-imagegen/scripts/image_gen.py31856 bytesopenai-imagegen/upstream-original/SKILL.md16204 bytesAn adaptation record is bundled. Inspect the declared changes and archived original before use. Review adaptation and original-file hashes →
Machine-readable installation guide →Records are supplied by the site administrator and bound to a specific package. They are not third-party safety certification. This page does not execute skills.
No published scenario records yet. Resource availability and download counts do not imply measured task performance.
Be the first to share your experience.
Sign in to leave a review →Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art …
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching cour…
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a pos…
Use when starting any conversation - establishes how to find and use skills, requiring skill invocation before ANY response including clarif…