codex-image-gen
Skill1 starsChanged 21 days agoMITView on GitHub
Image asset needed (icon, sprite, texture, splash, logo, marketing art, illustration) from inside Claude Code → drive Codex image_gen via codex exec. Use: \"generate an image\", \"make an icon\", \"use gpt-image / my Codex sub\", placeholder asset → real art.
We split this skill into the rules it gives an agent
5 rules. 0 are common, 4 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
If the project has its own art-direction or visual-style skill/reference, load it FIRST and fold its constraints into the image prompt.
- Distinctive: line 66
Use HighQualityBicubic, not NearestNeighbor: generated "pixel art" pixels are not grid-aligned, so nearest-neighbor shreds edges.
- Distinctive: line 72
Read the final PNG with the Read tool and judge it at actual output size against the style refs / stated requirements (the user is still …
- Very specific: line 73
Check dimensions/alpha mechanically (e.g.
- Distinctive: line 74
Delete the scratch raw once the final asset is committed.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Codex Image Generation
Overview
Codex CLI runs on the user's ChatGPT/Codex subscription and its agent carries an image_gen.imagegen tool. Claude Code cannot generate images itself, but it can drive Codex non-interactively: Bash → codex exec → the prompt tells Codex to generate and save a PNG into the workspace. No API key; billing rides the user's subscription.
Preflight
codex --version && codex login status- Expect
Logged in using ChatGPT. Not logged in → STOP and ask the user to runcodex login(browser OAuth) in their own terminal. Never handle credentials yourself. - If the project has its own art-direction or visual-style skill/reference, load it FIRST and fold its constraints into the image prompt.
Recipe
codex exec -m gpt-6-astra -c model_reasoning_effort=medium -c model_provider=openai -s workspace-write -i ref1.png -i ref2.png - <<'PROMPT'
Use your image generation tool (image_gen) to create ONE image and save it to <scratch-dir>/<name>-raw.png in this workspace. Do nothing else - no code changes. If image_gen is not available, say so and stop; do not draw the image any other way.
The attached images are style references: <name what each one is>.
Match: <medium, material language, palette ROLES (not just hex), background/transparency, framing>.
Subject: <composition: what dominates, what contains it, where accents route>.
Do NOT produce: <the drift you fear: generic styles, backgrounds, text, extra variants>.
Requirements: <W>x<H> PNG, <transparent background if the asset needs alpha>, save exactly to <scratch-dir>/<name>-raw.png
PROMPTHard rules:
- Prompt goes via stdin (
-).-iis VARIADIC: a trailing prompt argument is swallowed as a filename and codex dies withNo prompt provided via stdin. -s workspace-write: the default read-only sandbox blocks the save.-m gpt-6-astra -c model_reasoning_effort=mediumpins the agent model that drivesimage_gen, overriding~/.codex/config.toml. The image model itself is chosen by Codex's backend.-c model_provider=openaiforces direct ChatGPT login for this run only. A proxy/gatewaymodel_providerin~/.codex/config.toml(e.g. CLIProxyAPI) does not exposeimage_gen: Codex answers "image_gen is not available" and makes nothing. The config file stays untouched.Reconnecting... n/5followed by401 Unauthorized: Incorrect API key provided: sk-svcac…onchatgpt.com/backend-api/codex/responses, whilecodex login statusreports ChatGPT, points to an OpenAI outage rather than local auth. Check https://status.openai.com before debugging auth.json, env vars or config; report the outage and stop.- The "do not draw it any other way" line stops Codex from faking the image with System.Drawing or code when the tool is missing. Check the result: a generated PNG is hundreds of KB with visible texture; a few-KB flat file means it was drawn in code.
- Style references are optional but strongly recommended for anything that must match an existing look: attach 1-3 with
-i(the project's canonical art plus the 1-2 nearest existing assets of the same class). No refs → generic output. One-off standalone art with no house style → refs optional, but still write palette/medium/negatives explicitly. - Generate large (1024×1024 or the model's native size) even for small targets; downscale afterwards. Raw output goes to a gitignored scratch dir (
.tmp/,scratch/, whatever the project uses); only the processed asset is committed. - Transparent background only when the asset genuinely needs alpha (icons, sprites, cutouts). Full-bleed art (splash, marketing, photos) → opaque, and say so in the prompt.
Post-process (Windows, no image libs needed)
Downscale preserving alpha via PowerShell System.Drawing:
Add-Type -AssemblyName System.Drawing
$src=[System.Drawing.Image]::FromFile("$PWD\.tmp\<name>-raw.png")
$bmp=New-Object System.Drawing.Bitmap <W>,<H>,([System.Drawing.Imaging.PixelFormat]::Format32bppArgb)
$g=[System.Drawing.Graphics]::FromImage($bmp)
$g.InterpolationMode=[System.Drawing.Drawing2D.InterpolationMode]::HighQualityBicubic
$g.PixelOffsetMode=[System.Drawing.Drawing2D.PixelOffsetMode]::HighQuality
$g.Clear([System.Drawing.Color]::Transparent)
$g.DrawImage($src,0,0,<W>,<H>); $g.Dispose(); $src.Dispose()
$bmp.Save("$PWD\<final-path>.png",[System.Drawing.Imaging.ImageFormat]::Png); $bmp.Dispose()Use HighQualityBicubic, not NearestNeighbor: generated "pixel art" pixels are not grid-aligned, so nearest-neighbor shreds edges.
On non-Windows hosts use whatever is available (sips on macOS, ImageMagick/ffmpeg if installed), same rule: high-quality resample, preserve alpha.
Verify
- Read the final PNG with the Read tool and judge it at actual output size against the style refs / stated requirements (the user is still the final visual check; never claim visual verification beyond this).
- Check dimensions/alpha mechanically (e.g.
node -ePNG header read: bytes 16-23 hold width/height big-endian; color type byte 25 = 6 → RGBA). If the project pins assets with a test, run it. - Delete the scratch raw once the final asset is committed.
Common mistakes
| Symptom | Cause → fix |
Reading prompt from stdin... No prompt provided | prompt arg eaten by variadic -i → pass prompt via stdin - |
| generation ran but no file | read-only sandbox → -s workspace-write |
| output reads generic / off-brand | no style refs, no art-direction constraints → attach refs, describe palette roles + negatives |
| jagged downscale | NearestNeighbor on unaligned pixels → HighQualityBicubic |
| surprise sub usage | one generation ≈ 60-70k Codex tokens → don't spray unrequested variants; batch deliberate prompts |
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- zjp1997720/zhijian-skills★ 784same name
- Jewel591/claude-with-codex★ 1same name
- stephenlzc/codex-image-gen★ 1same name
- wisky3107/agents★ 0same name
- zazencodes/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository85 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- addskillSkill
- adopt-repoSkill
- advocateSkill
- apply-firmwareSkill
- arenaSkill
- astra-reviewSkill
- babysit-ciSkill
- brainstormingSkill
- broSkill
- cache-loopSkill
- cavemanSkill
- claude-reviewSkill
- codex-reviewSkill
- dareSkill
- deep-planSkill
- design-prototypesSkill
- enhance-promptSkill
- external-reviewSkill
- fable-modeSkill
- forge-repo-ui-skillSkill
- handoff-auditSkill
- impartial-reviewSkill
- init-projectSkill
- labSkill
- long-horizonSkill
- optimize-contextSkill
- opus-fullreviewSkill
- perf-loopSkill
- recallSkill
- redesign-conceptsSkill
- refineSkill
- serversSkill
- session-hubSkill
- showpieceSkill
- sync-starterSkill
- whySkill
- wow-loopSkill
- wrapupSkill
- writing-plansSkill
- writingSkill
- addskillSkill
- adopt-repoSkill
- advocateSkill
- apply-firmwareSkill
- arenaSkill
- astra-fullreviewSkill
- astra-reviewSkill
- babysit-ciSkill
- brainstormingSkill
- broSkill
- cache-loopSkill
- cavemanSkill
- claude-reviewSkill
- codex-fullreviewSkill
- codex-reviewSkill
- coordinateSkill
- dareSkill
- deep-planSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

