gpt-image-gen

gpt-image-gen is a skill for Claude Code, Codex from KerberosClaw/kc_ai_skills. It costs 135 tokens per session (15,962 once invoked), scanned B, original, MIT.

A guided workflow for generating or editing images with GPT through Codex. It helps turn a loose request into an approved Chinese-and-English image prompt before generation.

In plain words
What is it for?
Use it to create new images, edit attached images, remove backgrounds, or prepare prompts for Codex's built-in image generation.
Why use it?
It adds a review step before an image is generated, which helps prevent accidental or unwanted image requests. It also gives special handling to reference-image edits and transparent PNG results.

Skill for Claude CodeCodex

Written for Claude Code and Codex: argument-hint in frontmatter, but also runs codex exec. Also seen: mentions Claude Code; mentions Codex.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is # 輸出夾:cwd 是 git repo → ./generated_images/ 子夾(避免雜進 git 根);否則 cwd 根.

Good fit Use it to create new images, edit attached images, remove backgrounds, or prepare prompts for Codex's built-in image generation.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/KerberosClaw/kc_ai_skills
agentmods
npx agentmods add skills/kerberosclaw/kc_ai_skills/gpt-image-gen

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for gpt-image-gen

README.md
[![agentmods](https://agentmods.dev/badge/skills/kerberosclaw/kc_ai_skills/gpt-image-gen/github.svg)](https://agentmods.dev/skills/kerberosclaw/kc_ai_skills/gpt-image-gen)
Your own site
<a href="https://agentmods.dev/skills/kerberosclaw/kc_ai_skills/gpt-image-gen"><img src="https://agentmods.dev/badge/skills/kerberosclaw/kc_ai_skills/gpt-image-gen/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.

agentmods 80×15 button for gpt-image-gen

Your own site · 80×15
<a href="https://agentmods.dev/skills/kerberosclaw/kc_ai_skills/gpt-image-gen"><img src="https://agentmods.dev/badge/skills/kerberosclaw/kc_ai_skills/gpt-image-gen.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 135 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 15,962 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 6 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Excessive Agency · line 373
    Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.
    Fix: Remove the model/provider override or disclose it prominently and require explicit operator approval before invoking an external coding CLI or billed model.
  • high Excessive Agency · line 384
    Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.
    Fix: Remove the model/provider override or disclose it prominently and require explicit operator approval before invoking an external coding CLI or billed model.
  • high Agent Snooping · line 556
    Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
    Fix: Remove all code or instructions that access agent configuration directories (.claude/, .codex/, .gemini/). If configuration values are needed, pass them explicitly as parameters or environment variabl
  • high Tool Misuse · line 557
    Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.
    Fix: Limit tool chaining depth and validate the output of each tool before passing it to the next. Require explicit user approval for multi-step chains.
  • medium Rogue Agent · line 376
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
  • medium Rogue Agent · line 376
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00135 $0.15962
Opus 5 $0.00068 $0.07981
Sonnet 5 $0.00027 $0.03192
Haiku 4.5 $0.00014 $0.01596

Measured 7d ago against content hash 574ecb39f887, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade B, and why

gpt-image-gen scanned grade B with 1 finding 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 7d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/collect.sh, scripts/preflight_edit.sh, scripts/verify_edit.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

STRAY=$(find ~/.codex/generated_images -type f -iname '*.png' -newer "$START_MARKER" 2>/dev/null | head -1)
gpt-image-gen/SKILL.md · 742 lines

How it starts

The opening of the file, as written. The whole thing — 742 lines — stays where its author put it; the contents beside it link to each section on GitHub.

gpt-image-gen — Claude Code 走 Codex CLI;Codex 直接生圖

You are a prompt-crafting partner who turns the user's loose Chinese description into a tight bilingual prompt pair, iterates until the user explicitly approves, then uses the executor native to the current host. In Claude Code, orchestrate Codex CLI as before. In Codex, call the built-in image_gen tool yourself — do not launch another Codex inside Codex. Your job is prompt design, user confirmation gating, execution, and verifying the result before you hand it over.

Step 0: 先鎖定執行宿主(MANDATORY)

目前 assistant 的宿主身分設定一次 RUNTIME,後面不得改道:

目前是誰在執行這個 skill RUNTIME 拍板後的路徑
Codex(目前 assistant/system 明確自稱 Codex) codex Step 4-Codex,直接呼叫目前 session 的 built-in image_gen
Claude Code claude_code Step 4-Claude,維持既有背景 codex exec 流程
  • 不要用 which codex、環境變數或「有沒有 codex binary」判斷宿主。 Claude Code 的機器本來就可能裝 Codex;那不是執行者身分。
  • RUNTIME=codex 時,禁止 shell-out 到 codex / codex exec、禁止再開 Codex 子程序或子 agent,也不跑 Step 4-Claude。這條正是避免疊床架屋的 hard invariant。
  • RUNTIME=codex 但 built-in image_gen 不可用時,如實告訴 user;不要靜默退回 Codex CLI
  • Step 1~Step 3 的模式判斷、雙語 prompt、拍板 gate 與安全判斷兩邊共用;只有拍板後的 executor 分流。

CRITICAL — 四條紅線

  1. 未拍板絕不啟動生圖 executor — 拍板 = user 明確說 OK / / go / 下去。其他正向回應(「不錯」「可以喔」「應該行」)一律當「還沒拍板」處理,繼續等明確指令。生圖會花 user 的錢,誤觸發 = 違規。
  2. 有 reference image → 走 img2img 或編輯 — user 這輪有附底圖(拖曳/貼上/[Image #N])→ Step 3a 偵測。Claude Code 用 codex exec ... -i <ref>;Codex 把底圖直接交給 built-in image_gen,不再包一層 CLI。拍板 gate(紅線 1)對 img2img 與編輯一樣適用。
  3. 不寫死任何預設風格 — Skill 不存 style preset。每張圖風格純靠當下 conversation context + user 描述推。沒 context 就問。
  4. 🔴 編輯模式一律交 png,不轉 jpg,無例外 — Step 5c-1 的預設是「轉 jpg q85、刪 png」,那對生成是對的,對編輯是災難:jpg 沒有 alpha 通道,帶透明度的結果轉一次就永久消失,而編輯結果不可重現(同 prompt 同 ref 再跑不會是同一張)。不要去猜它有沒有 alphamode P 的透明 PNG 就會猜錯),一律走 Step 5c-2。

Step 1: 先判斷模式,再判斷語境

Step 1-0: 生成 or 編輯(先決,決定後面每一步

user 要的 模式 判準
一張新的圖(有沒有底圖都算) 生成 — 走 Step 1 下半、Step 2 生成模板 底圖只是參考(鎖臉/鎖角色/鎖場景),輸出本來就該跟底圖不同
這張圖動一個地方,其他不要變 編輯 — Step 1b → Step 2-edit 模板 → Step 3a-edit → 對應 runtime executor → 驗收只交 png 輸出應該還是同一張圖,只有指定處不同

Read the full file on GitHub · 742 lines

Files

What ships with it

3 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.

Changes

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.

  1. 7d ago Changed · +57 lines · -69 tokens per session 574ecb39f887
  2. 12d ago First seen · 685 lines · 204 tokens per session scan B 61cdc83888f1

Subscribe to this mod's changes

gpt-image-gen is a skill published in the GitHub repository KerberosClaw/kc_ai_skills (79 stars, last pushed 3d ago), licensed MIT. It adds 135 tokens to every session and 15,962 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.