rolandone/codex-image-generation/image-generation
Claude Code and agent skill by rolandone/codex-image-generation
- community
- ext:[{"type":"config","description":"Configuration overrides"}]
Checking that the SKILL.md file is still in the repository.
Generate or edit raster images (photos, illustrations, mockups, sprites, logos, infographics, ads, transparent cutouts) by writing a production prompt spec and delegating generation to Codex's built-in imagegen skill (gpt-image-2). Use when the user asks to "generate an image", "create an image", "make a picture", "render", "draw me", "produce a mockup/sprite/asset", "headshot", "logo", "thumbnail", "banner", "hero image", or any other bitmap-asset request. Do not use for SVG/vector edits, icon-system extensions, or HTML/CSS/canvas drawings.
Install
npx vskill@latest install rolandone/codex-image-generation/image-generationSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as rolandone/codex-image-generation/image-generation.
Image Generation
Two jobs, in this order:
- You write the spec. Turn the user's brief into a production prompt spec in the schema Codex's own
imagegenskill expects. This is the point of the skill: a reasoning model sits in front of the image model. Never forward the brief verbatim. - Codex generates. One
codex execrun calls Codex's built-inimage_gentool (gpt-image-2) and saves the file. NoOPENAI_API_KEYrequired.
Benchmarked on 2026-09-02 across ten briefs: the spec beat the verbatim brief on seven and tied three, and raising Codex's reasoning effort did not change a single result. See the README.
Prerequisites
- Codex CLI installed, logged in, and new enough for the configured model.
codex --versionprints a version andcodex login statusreports a login. Every flag below exists on Codex 0.148 and later. Since Codex 0.153.4 the bundled default agent model is GPT-6 Astra (gpt-6-astra); a CLI older than 0.153 fails withThe 'gpt-6-astra' model requires a newer version of Codexwhen that model is configured, so keep Codex current (npm install -g @openai/codex@latest, or your package manager). If Codex is missing or logged out, tell the user to install it and runcodex login. If OpenAI's Codex plugin for Claude Code (codex@openai-codex) happens to be installed,/codex:setupcan diagnose it, but this skill does not depend on that plugin. - Codex's bundled `imagegen` system skill at
${CODEX_HOME:-$HOME/.codex}/skills/.system/imagegen/SKILL.md. It ships with Codex; if it is missing, the user should upgrade Codex. - POSIX shell (bash/zsh). On Windows, run from WSL or Git Bash.
No other host assumptions: paths come from $HOME, $CODEX_HOME, $TMPDIR and Claude Code's cwd.
Costs
Per image: one gpt-image-2 generation plus roughly 20–25k Codex agent tokens and one to two and a half minutes at Codex's default reasoning effort. Writing the spec adds about fifteen seconds. Do not raise Codex's reasoning effort for this skill: xhigh costs about forty percent more time and buys nothing once the spec is written. For batches, prefer one run with a count over N runs. Codex validates what it generated and may re-render once or twice inside a single run when the aspect or the alpha comes out wrong; each re-render is another gpt-image-2 generation. Stating the canvas aspect in Constraints, not only in Asset type, reduces this.
When to use
Any raster request: "generate an image", "make a mockup", "draw me", "render a sprite", "a hero image for", "a logo for", "an infographic showing".
Skip when the user wants an SVG or vector icon (edit the SVG), an extension to an existing icon or logo set (edit the sources), or HTML/CSS/canvas graphics (write the code).
Inputs
- Brief (required). The user's words. They go into the spec's
Primary requestline unchanged. - Output path or folder (optional). Resolve in this order: an explicit path the user named; otherwise
./tmp/imagegen/at the git repo root if cwd is inside a repo; otherwise~/Downloads/. If the user gave a full filename, use it. If they gave only a folder, or nothing, you choose a descriptive kebab-case filename such ashero-pickleball-golden-hour.png. Never let Codex pick the name. - Aspect or size (optional). The built-in tool pins size to
auto, so treat any size the user gives as an aspect hint in the spec (square, 16:9, 9:19.5 phone) and verify the real dimensions after the run. Exact pixel dimensions cannot be guaranteed on this path; if the user needs them, say so before running. - Count (optional, default 1). For more than one, the spec describes each asset or variant and Codex is told to issue one
image_gencall per asset. - Reference images (optional). Pass each with
--image <PATH>and label its role in the spec: reference, edit target, or style.
Ask a question (via AskUserQuestion) only when the subject is missing, or when the asset must carry factual copy the user did not supply: prices, dates, names, claims. For everything else, decide.
Step 0 — Write the spec
Use the imagegen skill's own schema. Include only the lines that change the output; skip the rest.
Rules for the spec:
- Keep the user's intent intact. Do not change the subject, count, medium or style they named. Do not add characters, objects, brand names, slogans or palettes that are not implied by the brief. Add the production detail a generic brief lacks: intended use, aspect, composition, lighting, palette, constraints.
- Write out every text string. If the asset carries text, spell each string exactly, with case and line breaks, and say where it goes. If no text is wanted, say
Text (verbatim): noneand add "no text" to Constraints. - Give each asset class what it needs.
- Hero / marketing: where copy will be overlaid and keep that region soft and empty; one subject; no dashboards, HUD widgets or text unless asked.
- Product photo: seamless white ground, three-quarter angle slightly above, softbox key light, soft contact shadow, one object, no props.
- Logo: flat, vector-friendly, no gradients, two colors unless asked, exact wordmark text, must read at 32 px; avoid badge clutter, mountains, the generic cup-with-steam.
- UI mockup: platform conventions (iOS status bar showing 9:41), exact labels, a state that adds up (three of five done means three checks), screen only unless a device frame is asked, no lorem ipsum.
- Infographic / diagram: exact title, numbered stages with short captions, relationships written out so they come out physically or scientifically correct, color coding, labels never overlapping art.
- Sprite / cutout: fully transparent background with true alpha, no ground shadow, even padding, upper-left key light, crisp silhouette. Sprite sheets: exact frame count, identical frame size, one shared baseline, no anti-aliasing for pixel art.
- Photo / editorial: lens and aperture, natural light, a candid direction rather than a pose, realistic hands, no readable screens, no logos.
- Ad / social: kicker, headline, detail line and call to action as separate exact strings, safe margins, one product.
- State the canvas in Constraints too. Size is
auto, so the aspect is inferred from the prompt. Write it twice, inAsset typeand inConstraints("square canvas, 1:1"), or the model may pick portrait for a tall subject and Codex will spend a re-render fixing it. - Length: 120 to 300 words. Every line must change the picture; cut anything that does not.
- Unfamiliar class? Read
${CODEX_HOME:-$HOME/.codex}/skills/.system/imagegen/references/sample-prompts.mdfor Codex's own recipes before writing.
Example, from the brief "product photo of a ceramic coffee mug for an online store":
Step 1 — prepare paths, result file and spec file
The result file needs a stable path that survives between Bash tool calls. Do not use `$$`: each Bash call is a fresh subprocess, so $$ changes between calls. Use mktemp, capture the printed path, and reuse that literal path later.
Save the spec beside the image as <OUTPUT_PATH minus extension>.spec.md. It documents what was sent and makes the next revision a diff rather than a rewrite. Writing it with a heredoc is fine here; the heredoc feeds a file, not Codex.
<OUTPUT_PARENT> is dirname "<OUTPUT_PATH>". Capture the printed RESULT_FILE path; it is the literal value used in Step 2 and Step 3.
Step 2 — run Codex
One Bash call. Set the Bash timeout to ten minutes (600000 ms, the tool's maximum) or use run_in_background: true; a run usually takes one to three minutes but a single image can take five or more when Codex inspects and verifies its output.
Substitute <COUNT>, <SPEC_FILE>, <OUTPUT_PATH>, <OUTPUT_PARENT>, <CWD>, <RESULT_FILE> and optionally <REFERENCE_IMAGE_PATH>. The spec arrives through $(cat ...), so nothing inside it needs shell escaping; keep the \$ escapes in the fixed text so Codex sees $imagegen and $CODEX_HOME literally.
`</dev/null` is mandatory. With a piped, still-open stdin, codex exec prints Reading additional input from stdin... and waits forever. Never pipe the prompt through stdin.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/image-generation/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Extension points
configConfiguration overrides
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/rolandone/codex-image-generation/image-generation)