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 zjp1997720/zhijian-skills --skill codex-image-gengit clone --depth 1 https://github.com/zjp1997720/zhijian-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/zjp1997720/zhijian-skills/codex-image-gen)<a href="https://agentmods.dev/skills/zjp1997720/zhijian-skills/codex-image-gen"><img src="https://agentmods.dev/badge/skills/zjp1997720/zhijian-skills/codex-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.
<a href="https://agentmods.dev/skills/zjp1997720/zhijian-skills/codex-image-gen"><img src="https://agentmods.dev/badge/skills/zjp1997720/zhijian-skills/codex-image-gen.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 2 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 Privilege Escalation · line 39 Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
- high Privilege Escalation · line 40 Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
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.00126 | $0.02281 |
| Opus 5.5 | $0.00050 | $0.00912 |
| Sonnet 5.5 | $0.00025 | $0.00456 |
| Haiku 4.5 | $0.00013 | $0.00228 |
Grade A, and why
codex-image-gen 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 10d 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.
How it starts
The opening of the file, as written. The whole thing — 199 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Codex Image Gen
目标:把“本机已登录的 Codex OAuth 生图能力”封装成一个零私有依赖的跨 Agent Skill。
它不依赖任何私有模块;任何能执行 python3 的 Agent,只要宿主机已经装好 Codex CLI 并执行过 codex auth login,就能直接调用 scripts/codex_image.py 生图或做图像编辑。
前置条件
必须同时满足:
- 本机已安装 Codex CLI
- 已执行过
codex auth login ~/.codex/auth.json存在且可读- 机器可访问:
https://chatgpt.com/backend-api/codex/responseshttps://auth.openai.com/oauth/token
如果 ~/.codex/auth.json 不存在,不要猜测或绕过。直接提示用户先运行:
codex auth login
这个 skill 能做什么
- 文生图
- 配图 / 插图 / 封面图生成
- image-to-image / 编辑
- 用
--image与--reference-image显式区分主编辑画布和身份/风格参考,避免多图角色混淆 - 每次生成自动保存可审计、可继续编辑的 manifest;可用
--continue-from接着上一轮返修 - 把本地参考图编码成
data:image/...;base64,...后发给 Codex Responses API - 自动检查 access token 是否过期
- access token 过期时自动用 refresh token 刷新,并写回
~/.codex/auth.json - 从 SSE 流里提取图片 base64,保存为本地 PNG
核心脚本
相对路径:scripts/codex_image.py
典型调用方式:
python3 scripts/codex_image.py \
--prompt "极简科技感课程封面,无文字" \
--aspect landscape
如果 Agent 不是在 skill 根目录执行,就显式传 skill 相对路径或绝对路径,例如:
python3 .claude/skills/codex-image-gen/scripts/codex_image.py \
--prompt "商业文章封面插图,克制,干净,无文字" \
--aspect landscape \
--quality high \
--out-dir ./outputs
CLI 参数
必填
二选一:
--prompt "..."--prompt-file /path/to/prompt.txt
可选
--quality low|medium|high:默认medium--aspect landscape|square|portrait:选择后端母版方向,默认square--out-dir /path/to/output-dir:默认当前目录--image /path/to/image.png:主编辑图 / 输入图--reference-image /path/to/ref.png:参考图,可重复传入--model gpt-image-2:默认gpt-image-2--response-model gpt-6-astra:负责理解 prompt、图片区分和调度生图工具的外层模型,默认gpt-6-astra--continue-from /path/to/previous.png.manifest.json:自动把上一张成图作为主编辑图,并复用上一轮可复用参考图--manifest-out /path/to/run.json:自定义 manifest 路径;默认与最终图片同名并追加.manifest.json--name 基础名:输出<基础名>.png与<基础名>.png.manifest.json;同名已存在时不覆盖,自动改为<基础名>-2、-3。不传则用默认随机文件名
Codex 通道目前在服务端把尺寸与质量改为 auto(2026-10 实测,见 references/api-notes.md),请求的方向常被忽略;需要横版或竖版时在 prompt 里写清画幅。脚本会把实际 PNG 原样保存,并在 manifest 中记录 aspect 与实际尺寸;不做扩边、裁切或缩放。若比例偏离,直接返修或重生成。
What ships with it
6 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.
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.
- 10d ago Changed · +25 lines 00aa2246440a
- 2mo ago First seen · 174 lines · 126 tokens per session scan A d686cfd083b6
codex-image-gen is a skill published in the GitHub repository zjp1997720/zhijian-skills (787 stars, last pushed 4d ago), licensed MIT. It adds 126 tokens to every session and 2,281 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
codex-image-gen compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| codex-image-genzjp1997720/zhijian-skills | Skill | 787 | 4d ago | MIT | A | 126 | Claude Code, Codex |
| imagegenopenai/codex | Skill | 133k | yesterday | Apache-2.0 | A | 113 | Codex |
| playwright-climicrosoft/playwright | Skill | 99k | yesterday | Apache-2.0 | A | 19 | Claude Code |
| local-ai-agentsmicrosoft/ai-agents-for-beginners | Skill | 79k | 4d ago | MIT | A | 200 | Claude Code, Codex |
| systematic-debuggingobra/superpowers | Skill | 313k | 3d ago | MIT | A | 21 | Claude Code |
| next-cache-components-adoptionvercel/next.js | Skill | 143k | today | MIT | A | 95 | Claude Code |
| next-partial-prefetching-adoptionvercel/next.js | Skill | 143k | today | MIT | A | 103 | Claude Code |