codex-imagegen
Skill0 starsChanged 5 months agoMITView on GitHub
Generate illustrations/images for free using Codex's built-in image_gen tool (OpenAI's latest image model) by driving a Codex TUI inside a tmux pane. Use when you need raster images — slide illustrations, hero images, concept art, mockups, textures, sprites — and want to avoid paid APIs (fal-ai, gpt-image API). No OPENAI_API_KEY needed. Triggers: "generate an image/illustration", "make a picture", "用 codex 生成图片/插图", "give the deck some illustrations", "draw me a ...".
- Reads credentials
19 other projects use a version of this.
Adopted by
Most recently taken up by
- justinwilliames/skillstheir own version, first seen Nov 29, 2026
- mgiovani/ai-arsenaltheir own version, first seen Nov 22, 2026
- alexeygrigorev/.agentstheir own version, first seen Nov 22, 2026
- willink-oss/willink-claude-kittheir own version, first seen Nov 15, 2026
- lothlorienblade/agent-skillstheir own version, first seen Nov 8, 2026
- github774/roblox-claude-skillstheir own version, first seen Nov 8, 2026
Used with
Projects with it also use orchestrate and implement.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
varun29ankuSSkillorchestrate
This skill should be used when the user asks to 'orchestrate a task', 'break down work into parallel agents', 'coordinate subtasks', 'run agents in parallel', or mentions 'multi-agent'. Decomposes complex tasks into tracked subtasks, dispatches parallel subagents, and coordinates until completion.
Also in 4 projects that use this
Hugging FaceSkillimplement
Make tests pass. Invoke after /write-tests produces failing tests.
Also in 3 projects that use this
Other versions19 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 19
- gongnyang/codex-fleet★ 46same name
- hyperb1iss/hyperskills★ 39same name
- nathanonn/agent-skills★ 23same name
- JunSeo99/claude-skill-codex-imagegen★ 22same name
- alexeygrigorev/.agents★ 17same name
- mgiovani/ai-arsenal★ 8same name
- mgiovani/cc-arsenal★ 8same name
- evelan-de/claude-code-plugins★ 3same name
- luminary19/atelier★ 2same name
- Vallykrie/swarmGPT★ 2same name
9 more not listed
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.
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 17 edited versions we read keep these.
0
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
- Very specific: line 72
Call gen in a loop — the same TUI session is reused, so start happens once:
“Common” is measured: kept by at least 6 in 10 of the 17 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 (via tmux pane)
Codex ships a system imagegen skill that exposes a built-in image_gen
tool — OpenAI's latest image model, free, no OPENAI_API_KEY, no fal-ai.
This is the preferred way to make raster illustrations.
The one gotcha that defines this whole skill
The native image_gen tool only exists in the interactive Codex TUI.
codex exec (headless) cannot see it and will fall back to writing code or
refusing. So the only reliable path is: keep a real Codex TUI alive in a
tmux pane and feed it prompts with tmux send-keys. That's what the helper
script automates.
Other hard-won facts:
codex -pis--profile, not a prompt flag. Don't use it to pass prompts.- Long/multiline prompts get captured by the TUI as a single
[Pasted Content]chunk that does not auto-submit — you must send an extra Enter. The script always does this. - Output lands at
~/.codex/generated_images/<session-uuid>/, named eitherexec-*.png(older Codex) orig_*.png(newerimage_gentool). The helper matches both globs; if you copy by hand, glob both. (A staleexec-*-only match is what madegenhang forever while the pane already showed "Generated".) - A batch of N images can take ~7–15 min; each single image ~30–120s of
inference — but a flaky connection can add 1–2 min of stream reconnects
before inference starts, so the per-image wait defaults to 360s. If a
gentimes out but the pane shows "Generated Image", the connection dropped the image bytes mid-download — just re-rungen(a freshstartclears a wedged reconnect state). - Codex must launch in a trusted cwd (see
~/.codex/config.toml,trust_level = "trusted") so full-auto/YOLO needs no approval prompt./tmpand~are already trusted.
Quick start
SKILL=~/xc-setup/skills/codex-imagegen/scripts/codex-imagegen.sh
# 1. spin up the long-lived Codex TUI (idempotent — safe to call repeatedly)
"$SKILL" start
# 2. generate one image and copy it to a named path
"$SKILL" gen "A friendly cartoon robot reading a paper receipt, flat vector \
style, warm gold-on-black palette, minimal background" \
/home/ubuntu/myproject/assets/ill-robot.png
# 3. when done with the whole batch
"$SKILL" stopgen prints the destination path on stdout (or the raw exec-*.png path if you
omit the destination), so you can capture it:
OUT=$("$SKILL" gen "a glowing terminal window, isometric, gold accents" /tmp/term.png)Generating a batch
Call gen in a loop — the same TUI session is reused, so start happens once:
"$SKILL" start
declare -A imgs=(
[ill-engine]="a stylized engine block labeled LLM, gold-on-black, flat vector"
[ill-context]="a window filling up with colored blocks, memory metaphor, gold-on-black"
[ill-verify]="a magnifying glass over a checklist, gentle humor, gold-on-black"
)
for name in "${!imgs[@]}"; do
"$SKILL" gen "${imgs[$name]}" "/home/ubuntu/myproject/assets/${name}.png"
done
"$SKILL" stopVerify what you got — don't trust it blind
The model can crop, misread, or stylize wrong. Always look at the output
before wiring it into a deck/page. Either open it with the Read tool (it renders
images) or, for slides, render the page and view it with agent-browser. A
common failure: a landscape image placed in a ![bg right:N%] Marp slot gets
cover-cropped — check for cut-off subjects and switch to a contained ![w:...]
two-column layout if so.
Style consistency
For a themed deck, repeat the palette/style clause in every prompt (e.g.
warm gold #f8ba00 on near-black background, flat vector, minimal). The model
has no memory of earlier images across calls beyond the conversation in the
pane, so being explicit each time keeps a batch coherent.
Troubleshooting
| Symptom | Fix |
gen times out, no new PNG | tmux attach -t codex-imagegen and look — likely an approval prompt (cwd not trusted) or the model answered in prose. Add the cwd to ~/.codex/config.toml as trusted, or re-run start with CIG_CWD=/tmp. |
Prompt sat as [Pasted Content], never ran | The script's extra-Enter handles this; if attaching manually, press Enter twice. |
| Model wrote code instead of an image | The prompt must say use the image_gen tool; the script forces this. |
| Picks up an old image | The script gates on mtime newer than the pre-existing newest PNG, so this shouldn't happen; if confused, stop then start fresh. |
Detach from an attached pane with Ctrl-b d (never Ctrl-c — that kills Codex).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
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.

