GPT Image 2 SkillSAFE
ConardLi's open-source Skills collection, featuring web design, knowledge retrieval, image generation, and more.
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
A focused image-generation / editing skill for GPT Image 2, with a single SKILL definition that adapts to three runtime modes — local generation, host-native delegation, and pure prompt advisor.
中文文档 · Back to collection root
What it does
This skill is a structured prompt-engineering and image-generation pack built around the GPT Image 2 model (and OpenAI-compatible image endpoints). It only does two image tasks — POST /images/generations and POST /images/edits — but it does them in three different runtime environments without changing user-facing behavior.
It bundles:
- A mode-aware workflow so the same skill works whether the agent itself owns the image API key, the host has its own image tool, or there is no image tool at all.
- A structured template library of 18 categories and 79 prompt templates covering posters, UI mockups, product visuals, infographics, academic figures, technical diagrams, comics, avatars, and editing workflows.
- Reproducible prompt + image archival under
garden-gpt-image-2/prompt/andgarden-gpt-image-2/image/with task-slug + timestamp naming.
The three runtime modes
The very first thing this skill does on any task is run a tiny detection script:
node skills/gpt-image-2/scripts/check-mode.js # or for structured output: node skills/gpt-image-2/scripts/check-mode.js --json
The output picks one of three modes:
55e1bdf03b47OBSERVED · 2026-10-21Host compatibility
What the documentation claims. We have not run a compatibility test.
| Host | Status | Notes |
|---|---|---|
| codex | mentioned | |
| cursor | mentioned |
What it tells the agent
The instruction file, verbatim from the audited commit — this is the text the model reads, and the surface the audit's instruction layer examines. Quoted here so you can judge it without cloning anything.
---
name: gpt-image-2
description: 面向 GPT Image 2 的图像生成 / 编辑技能。可在 3 种环境下使用:(A) Garden 本地模式,通过 OpenAI 兼容接口直接出图并落盘;(B) Host-Native 模式,把本 Skill 当作提示词工程指引,把渲染好的 prompt 交给宿主 Agent 自带的图像工具出图;(C) Advisor 模式,宿主无任何图像工具时退化为高质量 prompt 顾问。涵盖 18 大类、80+ 个结构化模板,覆盖海报 / UI / 产品 / 信息图 / 学术图 / 技术架构图 / 漫画 / 头像 / 流程板 / 电影分镜 / IP 周边 / 编辑工作流等场景。
---
# GPT Image 2
这是一个面向 GPT Image 2 的聚焦型技能,在 3 种运行环境下都能用,但行为差异显著。**第一步必须先确定当前运行模式**。
它只做两类图像任务:
- 生成图片:`POST /images/generations`
- 编辑图片:`POST /images/edits`
本文件保留:运行模式、技能结构、环境变量、保存 / 命名规则、模板索引、模式感知工作流。详细模板全部放在 `references/`,分层组织:
- 一级:分类目录
- 二级:单模板 Markdown 文件
## 运行模式(必读,做任何事之前先确定)
本 Skill 自带一个轻量探测脚本,先跑一次,再根据结果决定怎么干活:
```bash
node skills/gpt-image-2/scripts/check-mode.js
# 想拿结构化结果给上层程序用:
node skills/gpt-image-2/scripts/check-mode.js --json
```
输出会给出 `mode = A` / `A?` / `B-or-C` 以及 `recommendation`。三个模式定义如下:
### Mode A · Garden 本地生图
**触发条件**:环境变量 `ENABLE_GARDEN_IMAGEGEN` 为真(`1` / `true` / `yes` / `on`)**且** 存在 `OPENAI_API_KEY`。
**行为**:完整端到端跑通"选模板 → 写 prompt → 调用脚本 → 出图落盘"。
- 用 `scripts/generate.js` 文本生图、`scripts/edit.js` 编辑现有图。
- prompt 默认落盘到 `garden-gpt-image-2/prompt/`、图片落盘到 `garden-gpt-image-2/image/`。
- 这是最强的模式:你是图像工具的"持有者"。
### Mode B · Host-Native 委托宿主出图
**触发条件**:未启用 Garden(`ENABLE_GARDEN_IMAGEGEN` 未设置 / 为假),但**当前宿主 Agent 自带图像生成工具或图像 MCP**。
**典型识别信号**(你应该自检):
- 你的工具集里出现 `image_generation` / `imagegen` / `dalle` / `nano_banana` / `mcp__*image*` / `make_image` / 类似名字
- 用户在 ChatGPT / Codex / Gemini / Cursor 等支持原生出图的客户端中调用本 Skill
- 用户显式说"用你自己的工具出图"
**行为**:本 Skill **退化成提示词工程指引**——
1. 仍按"选模板 → 填字段 → 渲染最终 prompt"的流程走。
2. **不要调用 `node scripts/generate.js`**(没有 API key、必失败)。
3. 直接调用宿主自带的图像工具,把渲染好的 prompt 作为输入。
4. 如用户希望可顺手把 prompt 文件保存到 `garden-gpt-image-2/prompt/`,但图片去向由宿主决定,不强制。
### Mode C · Advisor 纯提示词顾问
**触发条件**:未启用 Garden,**且**宿主 Agent 也没有任何图像生成工具。
**行为**:本 Skill 退化为"高质量 prompt 撰写顾问"——
1. 按"选模板 → 填字段 → 渲染最终 prompt"流程走,缺信息就问用户。
2. 把最终 prompt **直接打印给用户** + 保存一份到 `garden-gpt-image-2/prompt/<task-slug>-<timestamp>.md`。
3. 附一句简短的"如何使用"建议(如:丢进 ChatGPT / Midjourney / DALL·E / Sora / Nano Banana / 自己后端 / 第三方 GPT Image 2 网关)。
4. **不要假装出图成功**。明确告知用户:"已生成可直接复用的高质量 prompt,请用你的图像工具执行。"
### 模式决策表
| 条件 | 模式 | 调用脚本? | 落盘 prompt? | 落盘图片? |
|---|---|---|---|---|
| `ENABLE_GARDEN_IMAGEGEN=1` + 有 KEY | **A** | ✅ `generate.js` / `edit.js` | ✅ 自动 | ✅ 自动 |
| `ENABLE_GARDEN_IMAGEGEN=1` 但没 KEY | A? | ❌(先要 KEY) | — | — |
| 未启用 + 宿主有图像工具 | **B** | ❌(用宿主工具) | 可选 | 由宿主决定 |
| 未启用 + 宿主无图像工具 | **C** | ❌ | ✅ 必须 | ❌(无法) |
### 模式不确定时
- 如果你判断不清自己是 B 还是 C,**直接问用户一句**:"是用你环境里的图像工具出图,还是只要我写好提示词?"
- Mode A 调脚本失败(401 / 网络 / 配额)→ 报错并询问"切到 B / C 吗?"
## 用户输入工具
当此技能需要向用户提问时,遵循以下规则:
1. 优先使用当前运行时提供的用户输入工具。
2. 如果没有对应工具,则用简短的纯文本编号问题提问。
3. 能合并的问题尽量一次问完。
## 技能结构
- `scripts/check-mode.js`:**先跑这个**,检测运行模式(A / B / C)
- `scripts/generate.js`:文本生图(仅 Mode A 使用)
- `scripts/edit.js`:基于原图 / 遮罩改图(仅 Mode A 使用)
- `scripts/shared.js`:共享请求、保存、环境变量读取逻辑
- `references/`:分层结构化提示词模板(A / B / C 三模式都用)
## 环境变量
按以下顺序读取配置:
1. CLI 参数
2. `process.env`
3. `<cwd>/.env`
4. `<cwd>/.gateway.env`
5. `~/.gateway.env`
核心变量:
- `ENABLE_GARDEN_IMAGEGEN` — **模式开关**。`1` / `true` / `yes` / `on` 时启用 Mode A;未设置或其它值则进入 Mode B / C。
- `OPENAI_API_KEY` — Mode A 必需;B / C 不需要。
- `OPENAI_BASE_URL` — 默认 `https://api.openai.com/v1`,可指向第三方兼容网关。
- `OPENAI_IMAGE_MODEL` — 默认 `gpt-image-2`,可换成网关支持的型号(如 `gpt-image-1` / `dall-e-3`)。
默认实现按 OpenAI 兼容接口工作,不写死任何第三方网关。
## 默认输出目录
如果用户没有明确指定输出路径,统一使用当前工作区下的:
- 提示词目录:`garden-gpt-image-2/prompt/`(**A / B / C 三种模式都建议用**,方便复用与版本管理)
- 图片目录:`garden-gpt-image-2/image/`(**仅 Mode A 使用**;Mode B 由宿主决定,Mode C 不产生图)
如果目录不存在,脚本(Mode A)必须自动创建;Mode B / C 在写 prompt 前手动 `mkdir -p`。
## 默认命名规则
如果用户没有明确指定文件名,脚本应自动生成与当前任务相关的文件名,并追加当前时间戳,避免重名。
命名规则:
- 提示词:`garden-gpt-image-2/prompt/<task-slug>-<timestamp>.md`
- 图片:`garden-gpt-image-2/image/<task-slug>-<timestamp>.png`
其中:
- `<task-slug>`:根据当前用户要求自动提取一个相关短名称
- `<timestamp>`:当前时间戳,例如 `20260424-153045`
示例:
- `garden-gpt-image-2/prompt/live-commerce-ui-20260424-153045.md`
- `garden-gpt-image-2/image/live-commerce-ui-20260424-153045.png`
- `garden-gpt-image-2/prompt/vr-headset-exploded-view-20260424-153102.md`
- `garden-gpt-image-2/image/vr-headset-exploded-view-20260424-153102.png`
## Prompt 保存规则
| 模式 | 是否必须保存 prompt | 说明 |
|---|---|---|
| Mode A | ✅ 必须 | 进入实际生成 / 编辑流程必落盘 |
| Mode B | 推荐 | 默认建议保存方便复用;用户说"不用"就略过 |
| Mode C | ✅ 必须 | 用户拿走 prompt 自己执行,不落盘等于白干 |
通用规则(适用三种模式):
1. 如果用户显式给了 prompt 文件路径,可直接使用该文件作为输入。
2. 如果用户直接给的是文本 prompt,也要先把最终 prompt 保存到 `garden-gpt-image-2/prompt/`。
3. 如果用户显式指定了 `--prompt-output`,则尊重用户指定路径。
4. 否则使用默认命名规则自动保存。
## 图片保存规则(仅 Mode A)
1. 如果用户显式指定了 `--image` 或 `--output`,则尊重用户指定路径。
2. 否则默认保存到 `garden-gpt-image-2/image/`。
3. 文件名应和当前任务语义相关,并附加时间戳。
Mode B 由宿主图像工具决定保存方式;Mode C 不产生图片。
## 快速用法
### 0. 检测运行模式(**任何任务的第一步**)
```bash
node skills/gpt-image-2/scripts/check-mode.js
```
输出会告诉你当前是 Mode A / B / C,决定后续是否调用 `generate.js` / `edit.js`。下面 1~4 仅在 **Mode A** 下使用。
### 1. 文本生图(Mode A)
```bash
node skills/gpt-image-2/scripts/generate.js \
--prompt "A cute baby sea otter" \
--size 1024x1024 \
--quality high
```
### 2. 用提示词文件生图(Mode A)
```bash
node skills/gpt-image-2/scripts/generate.js \
--promptfile garden-gpt-image-2/prompt/poster-20260424-153045.md
```
### 3. 编辑已有图片(Mode A)
```bash
node skills/gpt-image-2/scripts/edit.js \
--image assets/source.png \
--prompt "Replace the background with a clean studio scene"
```
### 4. 带遮罩的局部编辑(Mode A)
```bash
node skills/gpt-image-2/scripts/edit.js \
--image assets/source.png \
--mask assets/mask.png \
--prompt "Replace only the masked area with a glass vase"
```
### 5. Mode B / C 的"用法"
没有命令行入口——本 Skill 此时只是**提示词工程指南**:
- **Mode B**:渲染好最终 prompt → 调用宿主自带的 `image_generation` 类工具(参数中传入 prompt)→ 拿到图。
- **Mode C**:渲染好最终 prompt → 保存到 `garden-gpt-image-2/prompt/<task-slug>-<timestamp>.md` → 把内容直接展示给用户 → 提示用户在哪些图像工具中可以直接复用。
## JSON 模板工作方式
当 `references/` 中提供 JSON 模板时,按下面规则使用:
1. 先从 `SKILL.md` 找到最贴近的分类目录。
2. 再定位到具体模板文件。
3. 模板中的 `{argument ...}` 表示可替换参数。
4. 用户明确提供的值,直接填入。
5.Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- declared (3 observation(s))
- Shell
- none-observed
- Dependencies
- pinned
- Secrets in source
- none-found
Findings (1)
Read in this order: CLI args → `process.env` → `<cwd>/.env` → `<cwd>/.gateway.env` → `~/.gateway.env`.
Gates applied: no_behavioural_pass.
55e1bdf03b47full audit observations/trust-audit/skill/conardli__gpt-image-2.json · Report an issue / request a re-scanAudit history
Every audit this skill has had.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-21 | 55e1bdf03b47 | SAFE | B | 89 | first audit |
Questions
What does the gpt-image-2 — conardli/garden-skills skill do?
ConardLi's open-source Skills collection, featuring web design, knowledge retrieval, image generation, and more.
Is gpt-image-2 — conardli/garden-skills safe to install?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean skill reads B.
What can gpt-image-2 — conardli/garden-skills access on my machine?
The audit observed that it reaches the network. Each of those is consistent with what it says it does. Secrets in the source: none found.
Which assistants does gpt-image-2 — conardli/garden-skills work with?
Its documentation mentions codex and cursor. That is what the text claims, not a compatibility test we ran.
How current is this page?
The grade is for one exact copy of the source (55e1bdf03b47), read on 2026-10-21. The repository is watched, and a new audit runs when it changes — this is the first audit.
Add this badge to your README
Shows this page's audit result and links back to it. It updates when the audit does.
[](https://modelsatlas.com/skills/conardli/gpt-image-2/)
Not your listing, or something out of date? Claim or update your listing.