Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add PracticalSwan/agent-skills --skill imagegengit clone --depth 1 https://github.com/PracticalSwan/agent-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/practicalswan/agent-skills/imagegen)<a href="https://agentmods.dev/skills/practicalswan/agent-skills/imagegen"><img src="https://agentmods.dev/badge/skills/practicalswan/agent-skills/imagegen/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/practicalswan/agent-skills/imagegen"><img src="https://agentmods.dev/badge/skills/practicalswan/agent-skills/imagegen.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00075 | $0.06023 |
| Opus 5 | $0.00037 | $0.03011 |
| Sonnet 5 | $0.00015 | $0.01205 |
| Haiku 4.5 | $0.00007 | $0.00602 |
Grade A, and why
imagegen scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
This is a copy
81% identical to imagegen — 147 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 429 lines — stays where its author put it; the contents beside it link to each section on GitHub.
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).
Host routing
Resolve this before applying the built-in-tool instructions below:
- Codex: use the built-in
image_genworkflow when it is exposed. Preserve the Codex save-path,view_image, chroma-key helper, confirmation, and CLI fallback rules below. - Claude Code, including GLM Coding Plan sessions: the GLM endpoint does
not provide Codex's built-in
image_gentool. Use an image-generation MCP or tool only when it appears in the active Claude Code tool list. Otherwise, offer the bundled OpenAI CLI fallback only after explicit user approval and the normal localOPENAI_API_KEYsetup; if neither route is available, stop with a prompt/manual handoff. - GitHub Copilot: use a host-exposed image tool or the approved CLI fallback. Do not invent Codex paths or tool names.
All later references to the "built-in" path are conditional on this host check. Do not infer image capability from the model name or API endpoint.
Top-level modes and rules
This skill has exactly two top-level modes:
- Host image-tool mode (preferred when exposed): Codex built-in
image_gen, or an equivalent active host tool that supports the requested operation. Codex's built-in path does not requireOPENAI_API_KEY. - Fallback CLI mode:
scripts/image_gen.pyCLI. Use when the user explicitly asks for the CLI/API/model path, or after the user explicitly confirms a true model-native transparency fallback withgpt-image-1.5. RequiresOPENAI_API_KEY.
Within CLI fallback, the CLI exposes three subcommands:
generateeditgenerate-batch
Rules:
- Use the built-in
image_gentool by default for normal image generation and editing requests. - Do not switch to CLI fallback for ordinary quality, size, or file-path control.
- If the user explicitly asks for a transparent image/background, stay on built-in
image_genfirst: prompt for a flat removable chroma-key background, then remove it locally with the installed helper at$CODEX_HOME/skills/.system/imagegen/scripts/remove_chroma_key.py. - Never silently switch from built-in
image_genor CLIgpt-image-2to CLIgpt-image-1.5. Treat this as a model/path downgrade and ask the user before doing it, unless the user has already explicitly requestedgpt-image-1.5,scripts/image_gen.py, or CLI fallback. - If a transparent request appears too complex for clean chroma-key removal, asks for true/native transparency, or local removal fails validation, explain that true transparency requires CLI
gpt-image-1.5 --background transparent --output-format pngbecausegpt-image-2does not supportbackground=transparent, then ask whether to proceed. Run the CLI fallback only after the user confirms. - The word
batchby itself does not mean CLI fallback. If the user asks for many assets or says to batch-generate assets without explicitly asking for CLI/API/model controls, stay on the built-in path and issue one built-in call per requested asset or variant. - 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.
What ships with it
12 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- agents/openai.yaml 275 B
- assets/imagegen-small.svg 2.8 KB
- assets/imagegen.png 1.7 KB
- CHANGELOG.md 4.3 KB
- LICENSE.txt 11 KB
- references/cli.md 9.9 KB
- references/codex-network.md 1.7 KB
- references/image-api.md 5.9 KB
- references/prompting.md 9.7 KB
- references/sample-prompts.md 19 KB
- scripts/image_gen.py 33 KB runs code
- scripts/remove_chroma_key.py 14 KB runs code
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago Changed · +3 lines 768651d7777f
- 4d ago Changed da0725f58163
- 7d ago First seen · 426 lines · 75 tokens per session scan A 6ccecc0daa35
imagegen is a skill published in the GitHub repository PracticalSwan/agent-skills (14 stars, last pushed 3d ago), licensed MIT. It adds 75 tokens to every session and 6,023 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. It is 81% identical to imagegen, differing in 147 lines, and is treated as a copy.
Other skills, from other repositories
shuai-cover-resize
An image-resizing tool that rebuilds one cover image for different shapes and platforms while preserving its text, subject, key objects, and visual style.
imagegen
Generate or edit images with OpenAI image tools or the bundled API CLI, including inpainting, background changes, transparent assets, and variants.
html-ppt-zhangzara-retro-zine
A neighborhood zine on the disappearing corner shops — portraits, voices, and what a block loses when they close. Built as a decision-grade story deck for community, local readers.
html-ppt-zhangzara-studio
A photography studio's portfolio-and-rate deck — the signature work, the process, and the packages that win the brief. Built as a decision-grade design craft deck for prospective clients.
motion-frames
A single-frame motion-design composition with looping CSS animations — rotating type ring, animated globe, ticking timer, parallax labels. Renders as a hero video poster you can hand straight to HyperFrames or any keyframe-based exporter. Use when the brief asks for "motion design", "animated hero", "loop", "video…
webgl-halftone-drift
A self-contained WebGL2 hero: a flowing field screened through a rotated halftone dot grid into a duotone print aesthetic; move the cursor to bend the drift.