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 Jxin-Cai/jxin-skills --skill gpt-image-gengit clone --depth 1 https://github.com/Jxin-Cai/jxin-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/jxin-cai/jxin-skills/gpt-image-gen)<a href="https://agentmods.dev/skills/jxin-cai/jxin-skills/gpt-image-gen"><img src="https://agentmods.dev/badge/skills/jxin-cai/jxin-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.
<a href="https://agentmods.dev/skills/jxin-cai/jxin-skills/gpt-image-gen"><img src="https://agentmods.dev/badge/skills/jxin-cai/jxin-skills/gpt-image-gen.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.00102 | $0.02118 |
| Opus 5 | $0.00051 | $0.01059 |
| Sonnet 5 | $0.00020 | $0.00424 |
| Haiku 4.5 | $0.00010 | $0.00212 |
Grade A, and why
gpt-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 12d 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 — 231 lines — stays where its author put it; the contents beside it link to each section on GitHub.
GPT 图片生成器
通过 OpenAI API 调用 gpt-image-2 生成图片。优先走 Images API(/v1/images/generations),不可用时自动 fallback 到 Responses API(/v1/responses)。设计为既可被用户直接调用,也可被其他技能(如 PPT 叙事分镜技能)程序化调用。
核心能力
- 接收提示词 + 样式要求,调用 GPT 图片模型生成 PNG
- 双协议支持:优先 Images API,自动 fallback Responses API
- 首次使用时保存项目级 host/key 配置
- 后续同一项目自动复用配置
- 支持指定输出路径,默认写入当前会话根目录的
image_output/ - 不向日志输出完整 key
执行流程
Step 1: 检查项目配置
配置保存于调用该技能的项目/会话根目录下:
.gpt-image-gen/
├── config.json # host、模型、默认尺寸等非敏感配置
├── credentials.json # API key
└── .gitignore # 忽略本目录内所有内容
先检查配置:
cd <gpt-image-gen 技能目录>
bun scripts/config.ts --check --workspace <项目根目录绝对路径>
如果配置存在且可读取,继续生成图片。
如果配置不存在,必须引导用户提供:
- host:API 服务地址,例如
https://api.openai.com或https://example.com/v1 - key:API key
拿到 host/key 后,先验证再保存(验证时优先尝试 Images API,失败后自动尝试 Responses API):
bun scripts/config.ts \
--set \
--workspace <项目根目录绝对路径> \
--host <host> \
--key <key> \
--image-model gpt-image-2
验证失败时不要保存配置,向用户报告脱敏后的错误原因。
Step 2: 明确生成意图
需要两个关键输入:
- 图片提示词(必需):描述要生成什么图片的详细文本
- 样式要求(可选):视觉风格、配色、布局等要求
如果用户没给提示词而是给了一段内容或文件,先把内容转化为适合图片生成的提示词。转化时:
- 提取核心主题和关键视觉元素
- 用英文描述视觉构图,中文只出现在标题/具体内容引用中
- 指定比例(默认 16:9)
- 结合用户指定的样式要求
如果用户只给了很短的模糊需求,先用 AskUserQuestion 补齐最影响结果的选项:
- 用途:封面 / 插图 / 海报 / PPT 配图
- 画幅:16:9 / 1:1 / 3:4 / 自定义
- 风格:现代简约 / 商务科技 / 手绘插画 / 自定义
如果用户已经给出清晰提示词,不要为了形式强行追问。
如果用户既没有显式指定提示词文件保存目录,也没有显式指定图片输出目录,则默认使用调用该技能的会话当前根目录下的 image_output/ 作为工作目录,并在其中创建:
prompts/:保存生成或整理后的提示词文件images/:保存最终生成的图片
不要把提示词、图片或配置写到 gpt-image-gen 技能自身目录里;技能目录只用于读取脚本。
Step 3: 构建完整提示词
将用户的图片描述和样式要求组合成一份完整提示词。如果是从其他技能调用(如 ppt-storyboard),提示词已经准备好,直接使用。
提示词保存为 .md 文件,路径由调用方指定;如果调用方未指定,则默认保存到当前会话根目录下 image_output/prompts/。图片默认保存到当前会话根目录下 image_output/images/。
直接用户调用时,提示词应组织成便于预览的结构:
Generate an image based on the following description:
## Subject
...
## Composition
...
## Style
...
## Constraints
- Aspect ratio: 16:9
- No unwanted text unless explicitly requested
What ships with it
13 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.
- package.json 157 B
- references/scene-types/cover.md 6.1 KB
- references/scene-types/flowchart.md 8.0 KB
- references/scene-types/mindmap.md 7.2 KB
- references/scene-types/note.md 7.3 KB
- references/scene-types/poster.md 9.0 KB
- references/styles/chalkboard.md 978 B
- references/styles/minimal.md 727 B
- references/styles/notion.md 940 B
- references/styles/obsidian.md 7.1 KB
- references/styles/thoughtworks.md 15 KB
- scripts/config.ts 9.4 KB runs code
- scripts/generate-image.ts 7.5 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.
- 12d ago First seen · 231 lines · 102 tokens per session scan A 8db17f670cfd
gpt-image-gen is a skill published in the GitHub repository Jxin-Cai/jxin-skills (5 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 102 tokens to every session and 2,118 once invoked, about $0.0005 per session on Opus 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-31.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
local-ai-agents
Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…
next-cache-components-adoption
Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…
chat-pet-sprite-creation
Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.
cpu-profile-analysis
Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…
insight-error-page
Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…