Agent skill

Draw Image Diagrams

by RealSeaberry in RealSeaberry/AutoMCM-Pro

Generates diagrams, flowcharts and conceptual illustrations with OpenAI's gpt-image models, while leaving data plots and result figures to real plotting code.

MITAuto-check: notesMedia & Creative

SKILL.md written in Chinese; this summary is our English description.

Install Draw Image Diagrams

skills CLI
$ npx skills add RealSeaberry/AutoMCM-Pro --skill draw-image -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install RealSeaberry/AutoMCM-Pro draw-image --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/RealSeaberry/AutoMCM-Pro.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/draw-image .claude/skills/draw-image && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
draw-image
GitHub stars
257
Token cost
~1.9k tokens
SKILL.md length
354 words
Files
1
Skills in repo
7
Repo updated
First seen
Licence
MIT

At a glance

Generates diagrams, flowcharts and conceptual illustrations with OpenAI's gpt-image models, while leaving data plots and result figures to real plotting code.

  • Works in 4 steps: 访问 platform.openai.com/api-keys(需科学上网) → 注册/登录 OpenAI 账号(需邮箱 + 手机号验证) → 点击 "Create new secret key" → 复制… → …
  • Drawing an algorithm or code flow diagram for a report
  • SKILL.md covers 两种使用路径, 前置条件(路径 A — Claude Code), 在 OpenAI Codex 中使用(路径 B,无需 API… and Agent 调用前置检查(必须执行), plus 8 more sections
  • Calls python and pip; needs OPENAI_API_KEY

What it does

The skill draws algorithm flowcharts, system architecture sketches and concept illustrations with gpt-image-2 by default, or gpt-image-1. It draws a firm line at anything that represents actual results: scatter plots, curves, heatmaps and fitted lines must still be produced by running plotting code such as matplotlib or seaborn. The skill text is written in Chinese.

Two paths are described. The default calls scripts/draw_image.py from Claude Code with an OPENAI_API_KEY and is billed by tokens, and it requires OpenAI organization verification, since GPT Image models otherwise fail with a 403 error. The second uses OpenAI Codex's built-in image generation, triggered in natural language or with $imagegen, which needs no separate API key for subscribers. The key must never be written into code or committed.

Before any generation the agent runs draw_image.py with --check. An available API key means it can generate directly, a Codex login means it should switch to Codex's image tool, and no credentials means it skips image generation, leaves a missing-figure placeholder in the LaTeX source and carries on, because exit code 2 is a skip signal rather than an error.

When your agent uses it

  • Drawing an algorithm or code flow diagram for a report
  • Sketching a system architecture figure for a paper
  • Making a conceptual illustration that is not tied to real data
  • Checking whether image generation credentials are available before a pipeline run

Example prompts

  • “Draw a flowchart of the simulated annealing procedure for the method section of our paper.”
  • “Generate an architecture sketch showing data flowing from the ingest service to the model server.”
  • “Check the image generation credentials and tell me which path is available.”

Requirements

  • An OPENAI_API_KEY with OpenAI organization verification, or OpenAI Codex with a ChatGPT subscription
  • Python with the openai package, version 1.0 or newer

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. 访问 platform.openai.com/api-keys(需科学上网)
  2. 注册/登录 OpenAI 账号(需邮箱 + 手机号验证)
  3. 点击 "Create new secret key" → 复制 sk-proj-...
  4. 去 Billing 充值(最低 $5,2025 年起无免费额度)

What it can do on your machine

Read from SKILL.md and the folder at commit 90c4727. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python
    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • platform.openai.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • OPENAI_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Draw Image Diagrams loads about 1.9k tokens when it runs. Until then it costs about 135 tokens; SKILL.md has 354 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~135
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:58
    > ⚠️ **切勿把 API Key 写入代码文件或 git commit**,`.env` 已在 `.gitignore` 中排除。

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from RealSeaberry/AutoMCM-Pro at commit 90c4727, republished under its MIT licence (© RealSeaberry). 354 words, ~1,929 tokens.

Download SKILL.mdSave it as .claude/skills/draw-image/SKILL.md (or your agent's skills folder).
name
draw-image
description
Generate diagrams, flowcharts, and conceptual illustrations using OpenAI gpt-image-2 (default) or gpt-image-1. Use for: algorithm/code flow diagrams, system architecture sketches, conceptual illustrations, and any figure that does NOT represent actual code execution output (data plots, model results, etc. must still be generated by running Python code). Requires OPENAI_API_KEY and OpenAI organization verification when used from Claude Code / API path. OpenAI Codex subscribers can use built-in $imagegen without an API key.

draw-image: OpenAI gpt-image-2 图像生成


两种使用路径

路径工具是否需要 API Key费用
路径 A(本 skill 默认)Claude Code + draw_image.py✅ 需要 OPENAI_API_KEY按 token 计费(见费用表)
路径 BOpenAI Codex(含 ChatGPT Plus/Pro 订阅)❌ 不需要额外 API Key订阅内 usage limit 扣减

本 skill 属于路径 A,设计用于 Claude Code 和 AutoMCM-Pro agent。
若你使用 OpenAI Codex(桌面 app / CLI),见下方"在 Codex 中使用"章节。


前置条件(路径 A — Claude Code)

第一步:申请 OpenAI API Key
  1. 访问 platform.openai.com/api-keys(需科学上网)
  2. 注册/登录 OpenAI 账号(需邮箱 + 手机号验证)
  3. 点击 "Create new secret key" → 复制 sk-proj-...
    ⚠️ 关闭弹窗后无法再次查看,务必立即保存
  4. 去 Billing 充值(最低 $5,2025 年起无免费额度)
第二步:组织验证(GPT Image 系列必须)

访问 platform.openai.com/settings/organization/general
完成"Organization Verification",否则调用 GPT Image 模型会返回 403。

第三步:配置到环境
bash
# 临时(当前终端有效)
export OPENAI_API_KEY=sk-proj-xxxxxxxxxxxxxxxx

# 永久(写入 shell 配置)
echo 'export OPENAI_API_KEY=sk-proj-xxxxxxxxxxxxxxxx' >> ~/.bashrc
source ~/.bashrc

# 验证
echo $OPENAI_API_KEY | head -c 15

⚠️ 切勿把 API Key 写入代码文件或 git commit,.env 已在 .gitignore 中排除。

第四步:安装依赖
bash
pip install "openai>=1.0"
python -c "import openai; print(openai.__version__)"

在 OpenAI Codex 中使用(路径 B,无需 API Key)

OpenAI Codex(ChatGPT Plus $20/月 及以上订阅已包含)内置 gpt-image-2 支持,
不消耗 API 额度,用自然语言或 $imagegen 关键字直接触发:

# Codex CLI 中自然语言触发
Generate a technical flowchart showing the AutoMCM pipeline steps

# 显式触发(更可靠)
$imagegen Clean flowchart: 建模流程 from 读取题目 to 生成PDF, white background

订阅内 usage limit 耗尽后,设置 OPENAI_API_KEY 可自动切换到 API 计费:

bash
export OPENAI_API_KEY=sk-proj-...   # Codex CLI 检测到此变量后切换为 API 定价

Agent 调用前置检查(必须执行)

在生成任何图像前,先运行 --check:

bash
python scripts/draw_image.py --check
输出含义Agent 应该做什么
method=api_key available=TrueOPENAI_API_KEY 已设置✅ 直接调用 --prompt 生成
method=codex_oauth available=TrueCodex 已登录,但脚本不能直接用 OAuth⚡ 改用 Codex CLI:$imagegen <prompt>
method=none available=False(退出码 2)无任何认证⏭ 跳过图像生成;在 LaTeX 中留 \missingfigure{描述} 占位,继续流水线

退出码 2 = "跳过"信号,不是错误。流水线不应因此中断。

bash
# 示例:优雅跳过
python scripts/draw_image.py --check || {
  if [ $? -eq 2 ]; then
    echo "[draw_image] 跳过 — 无认证,继续流水线"
  fi
}

适用范围决策树

需要一张图?
├─ 内容来自代码运行数值(散点图、折线图、热力图、拟合曲线…)
│   └─ ✗ 不用本 skill → 必须用 matplotlib/seaborn 生成
└─ 非数值内容(流程图、架构图、概念示意)
    ├─ 极简几何图(≤3个框) → tikz 即可
    └─ 复杂流程图 / 概念插图
        ├─ --check 返回 api_key → python scripts/draw_image.py --prompt ...
        ├─ --check 返回 codex_oauth → $imagegen ... (Codex CLI)
        └─ --check 退出码 2 → 跳过,\missingfigure{} 占位

模型说明

模型最大分辨率特点何时使用
gpt-image-2 (默认)3840×2160最新,文字渲染更准,支持灵活分辨率论文插图、高质量输出
gpt-image-1.51536×1024gpt-image-1 的改进版中等需求
gpt-image-11536×1024稳定,经过充分测试兼容性需求
gpt-image-1-mini1024×1024轻量快速,价格低草稿、快速迭代

Show full SKILL.md (161 more words)Show less

参数说明

参数默认值有效值说明
--prompt—任意文字(最多 32,000 字符)图像描述
--output—.png / .jpg / .webp保存路径
--modelgpt-image-2见上表模型选择
--size1024x1024任意 WxH(gpt-image-2 规则见下)分辨率
--qualitymediumlow medium high auto质量
--output-format从文件扩展名推断png jpeg webp格式
--compression—0–100jpeg/webp 压缩率
--backgroundopaqueopaque auto ⚠️ transparent 不支持于 gpt-image-2背景
--moderationautoauto low内容审核强度
gpt-image-2 分辨率规则
  • 每条边必须是 16px 的倍数
  • 最大边 ≤ 3840px
  • 长短边比 ≤ 3:1
  • 总像素:655,360 – 8,294,400

常用预设:1024x1024、1536x1024、1024x1536、2048x2048、2048x1152、3840x2160


调用示例

基础(算法流程图)
bash
python scripts/draw_image.py \
  --prompt "Clean technical flowchart on white background, Chinese labels.
Steps: (1) 读取赛题 → (2) 识别问题类型 → (3) 文献调研 → (4) 建立数学模型
→ (5) 编写求解代码 → (6) 运行验证脚本 → Decision: 全部通过?
→ Yes: 写入LaTeX / No: 修复代码 回到(5).
Style: professional diagram, blue/gray color scheme, sans-serif font,
clear arrows, minimal decoration." \
  --output "CUMCM_Workspace/latex/images/fig00_pipeline.png" \
  --size 1024x1536 \
  --quality high
系统架构图(横版)
bash
python scripts/draw_image.py \
  --prompt "System architecture diagram on white background.
Left: User inputs problem PDF. Center: AutoMCM-Pro Agent with three modules:
[Problem Analysis] [Model & Verify] [LaTeX Writing]. Right: Output PDF paper.
Arrows show data flow. Style: clean tech diagram, English labels, gray boxes." \
  --output "CUMCM_Workspace/latex/images/fig_architecture.png" \
  --size 2048x1152 \
  --quality high
草稿快速预览(低成本)
bash
python scripts/draw_image.py \
  --prompt "Simple flowchart: A → B → C → D" \
  --output "draft_check.png" \
  --model gpt-image-1-mini \
  --quality low
WebP 格式(更小体积)
bash
python scripts/draw_image.py \
  --prompt "..." \
  --output "fig.webp" \
  --output-format webp \
  --compression 20 \
  --quality high

Prompt 工程指南

流程图 Prompt 模板
"Clean technical flowchart on white background. [中/英] labels.
Steps: (1) [step1] → (2) [step2] → ...
Decision nodes: [condition] → Yes: [action_yes] / No: [action_no]
Style: professional, minimal, blue/gray color scheme,
sans-serif font, clear directional arrows."
架构图 Prompt 模板
"System architecture diagram, white background.
Components: [component list with roles].
Connections: [arrows describing data/control flow].
Style: clean labeled boxes, professional tech diagram, no decorative elements."
概念插图 Prompt 模板
"Scientific illustration: [scenario].
Show [element1] as [visual], [element2] as [visual].
Style: technical/scientific, clean white background, labeled key elements,
suitable for academic paper, no heavy text."

LaTeX 集成

latex
\begin{figure}[htbp]
  \centering
  \includegraphics[width=0.85\textwidth]{images/fig00_pipeline.png}
  \caption{建模流程图}
  \label{fig:pipeline}
\end{figure}

路径说明:images/ 相对于 CUMCM_Workspace/latex/,与 \graphicspath{{images/}} 配合使用。


费用参考(gpt-image-2,2026-04-21 定价)

分辨率lowmediumhigh
1024×1024~$0.006~$0.053~$0.211
1536×1024~$0.005~$0.041~$0.165
1024×1536~$0.005~$0.041~$0.165

以 token 计费:Image output $30/M tokens,text input $5/M tokens。


错误处理

错误信息原因解决方案
OPENAI_API_KEY not set未设置 keyexport OPENAI_API_KEY=sk-proj-...
openai package not installed缺少依赖pip install "openai>=1.0"
HTTP 403 / organization_verification未完成组织验证访问 platform.openai.com/settings/organization/general
content_policy_violationPrompt 触发审核简化描述,避免真实人物/商标
invalid_sizegpt-image-2 尺寸不合规确保每边是 16 倍数,比例 ≤3:1
API returned no image data响应无数据检查网络,重试

© RealSeaberry, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/draw-image of RealSeaberry/AutoMCM-Pro.

Open the folder on GitHubat commit 90c4727

Compare with similar skills

Draw Image Diagrams next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Draw Image Diagrams compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Draw Image Diagrams this skillRealSeaberry/AutoMCM-Pro257—~1.9kAutomated safety check: NotesMIT
Gpt Image Skillfeiskyer/claude-code-settings1.7k—~1.4kAutomated safety check: PassMIT
Gemini Interactions APIAyuilos/Miffan208—~4.6kAutomated safety check: PassAGPL-3.0
Gpt Imagenikships/droidproxy122—~2.5kAutomated safety check: PassMIT
Gpt Image Genninehills/skills280—~1.8kAutomated safety check: NotesMIT
Gemini API Devgoogle-gemini/gemini-skills4.3k—~5.1kAutomated safety check: PassApache-2.0

Similar skills

  • Gpt Image Skill

    feiskyer/claude-code-settings

    Generate or edit images using OpenAI GPT Image API (gpt-image-2, gpt-image-1, etc).

    1.7k GitHub stars~1.4k tokensUpdated 12 days ago
    Media & CreativeAuto-check passed
  • A skill your agent uses when writing code that calls the Gemini API for text generation, multi-turn chat, multimodal understanding, image generation, video generation, streaming responses…

    208 GitHub stars~4.6k tokensUpdated today
    Media & CreativeAuto-check passed
  • Gpt Image

    nikships/droidproxy

    Generate or edit images via GPT Image 2.5 Flare or Sunburst through DroidProxy Codex OAuth (no OPENAIAPIKEY).

    122 GitHub stars~2.5k tokensUpdated today
    Media & CreativeAuto-check passed
  • Gpt Image Gen

    ninehills/skills

    生图 / 生成图片 / 画图 — 用 OpenAI gpt-image-2 生成图像。支持文生图、参考图生图 (img2img)、蒙版修补 (inpainting)。当用户要求用 GPT 画图、OpenAI 生图、gpt-image-2、文+图生图、参考图片生成、img2img、inpainting 时必加载此技能。Auth 自动继承 OPENAIAPIKEY / Codex OAuth…

    280 GitHub stars~1.8k tokensUpdated 3 mo ago
    Media & CreativeAuto-check: notes
  • Gemini API Dev

    google-gemini/gemini-skills

    Official

    A skill your agent uses when writing code that calls the Gemini API for text generation, multi-turn chat, multimodal understanding, image generation, video generation, speech generation (TTS), voice…

    4.3k GitHub stars~5.1k tokensUpdated 3 days ago
    AI & LLM EngineeringAuto-check passed
  • Forge Media Route Layer

    0x0funky/agent-sprite-forge

    Generates an image or an image-to-video clip through a configured provider API or a signed-in Codex or Grok CLI, and reports the route, file, hash and cost estimate.

    4.4k GitHub stars~2.2k tokensUpdated 3 days ago
    Media & CreativeAuto-check passed

More from RealSeaberry/AutoMCM-Pro

  • AutoMCM-Pro for Codex CLI

    RealSeaberry/AutoMCM-Pro

    Runs a math modeling contest pipeline for CUMCM and MCM/ICM entries in Codex CLI, with git checkpoints, verified solver code and human review at each stage.

    257 GitHub stars~1.6k tokensUpdated 29 days ago
    Auto-check passed
  • AutoMCM Math Modeling Agent

    RealSeaberry/AutoMCM-Pro

    Runs a staged workflow for math modeling contests such as CUMCM and MCM/ICM, with checkpoints, verified solver code and a LaTeX paper, on DeepSeek Harness.

    257 GitHub stars~2.3k tokensUpdated 29 days ago
    Auto-check passed
  • AutoMCM-Pro for opencode

    RealSeaberry/AutoMCM-Pro

    The opencode binding of the AutoMCM-Pro math modeling pipeline for CUMCM and MCM/ICM contests, with tool mappings, install prompts and checkpointed runs.

    257 GitHub stars~1.2k tokensUpdated 29 days ago
    Auto-check passed
  • CUMCM Math Modeling Agent

    RealSeaberry/AutoMCM-Pro

    Drives an end-to-end workflow for the CUMCM math modeling contest: reads the problem and data, researches, codes and verifies models, then writes a LaTeX paper and PDF.

    257 GitHub stars~1.6k tokensUpdated 29 days ago
    Auto-check passed
  • MCM/ICM Autonomous Modeling Agent

    RealSeaberry/AutoMCM-Pro

    Runs an MCM/ICM math modeling competition end to end: collects contest metadata, builds and verifies models and code, then generates an English LaTeX paper and any required memo.

    257 GitHub stars~2.8k tokensUpdated 29 days ago
    Auto-check passed
  • AutoMCM-Pro Math Modeling Agent

    RealSeaberry/AutoMCM-Pro

    Runs a math modeling competition entry end to end, in AI-led or human-led mode, with Git checkpoints and self-verified solver code before it enters the LaTeX paper.

    257 GitHub stars~8.5k tokensUpdated 29 days ago
    Auto-check passed

Works with

Questions about Draw Image Diagrams

What does Draw Image Diagrams do?

Generates diagrams, flowcharts and conceptual illustrations with OpenAI's gpt-image models, while leaving data plots and result figures to real plotting code. The skill draws algorithm flowcharts, system architecture sketches and concept illustrations with gpt-image-2 by default, or gpt-image-1. It draws a firm line at anything that represents actual results: scatter plots, curves, heatmaps and fitted lines must still be produced by running plotting code such as matplotlib or seaborn.

When should I use Draw Image Diagrams?

Draw Image Diagrams fits situations like: drawing an algorithm or code flow diagram for a report; sketching a system architecture figure for a paper; making a conceptual illustration that is not tied to real data; checking whether image generation credentials are available before a pipeline run.

How do I install Draw Image Diagrams in Claude Code?

Run `npx skills add RealSeaberry/AutoMCM-Pro --skill draw-image -a claude-code`. Or copy the skill folder (.claude/skills/draw-image in RealSeaberry/AutoMCM-Pro) into .claude/skills/draw-image in your project. Claude Code loads it when a task matches its description.

How do I install Draw Image Diagrams in Codex?

Run `npx skills add RealSeaberry/AutoMCM-Pro --skill draw-image -a codex`. Or copy the skill folder (.claude/skills/draw-image in RealSeaberry/AutoMCM-Pro) into .agents/skills/draw-image in your project. Codex loads it when a task matches its description.

Can I use Draw Image Diagrams in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add RealSeaberry/AutoMCM-Pro --skill draw-image -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/draw-image, .gemini/skills/draw-image, .github/skills/draw-image and .opencode/skills/draw-image in your project.

What does Draw Image Diagrams need to run?

Going by SKILL.md and its folder, Draw Image Diagrams needs the command-line tools its instructions call (python and pip) and credentials named OPENAI_API_KEY. Our summary lists: An OPENAI_API_KEY with OpenAI organization verification, or OpenAI Codex with a ChatGPT subscription; Python with the openai package, version 1.0 or newer.

Does Draw Image Diagrams access the network?

SKILL.md names 1 domain. As links in the text: platform.openai.com. This is read from the text; nothing was executed.

Is Draw Image Diagrams safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Draw Image Diagrams use?

Draw Image Diagrams is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Draw Image Diagrams use?

About 1.9k tokens (SKILL.md is roughly 7.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Draw Image Diagrams?

Skills that share tags, products or a category with Draw Image Diagrams: Gpt Image Skill (feiskyer/claude-code-settings, 1.7k stars), Gemini Interactions API (Ayuilos/Miffan, 208 stars), Gpt Image (nikships/droidproxy, 122 stars) and Gpt Image Gen (ninehills/skills, 280 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Draw Image Diagrams?

RealSeaberry (a GitHub user) maintains it in RealSeaberry/AutoMCM-Pro, which has 257 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on September 10, 2026.

Source: RealSeaberry/AutoMCM-Pro on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.