All skills
simota avatar

/sketch

@16a3f28
by shingo imotasimota/agent-skills85 stars
15

Generating AI image-generation code using the Gemini API. Handles text-to-image generation, image editing, and prompt optimization. Use when image generation code is needed.

Use this Skill: https://skilld.dev/gh/simota/agent-skills/sketch

This session only. Nothing lands on disk.

referencecodex-image-gen.md

≈707 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Codex Built-in Image Generation (image_gen)

Alternative engine to the Gemini API path: OpenAI Codex (CLI / desktop / IDE extension) ships a built-in image_gen tool backed by gpt-image-2. It runs inside a ChatGPT Plus/Pro subscription — ChatGPT account auth only, no OPENAI_API_KEY, no per-image billing. Researched 2026-08.

When to prefer over the Gemini API path

Signal Engine
User wants images without API billing, already pays for ChatGPT Plus/Pro Codex image_gen
Reproducible code deliverable, seeds, batch pipelines, metadata (Sketch's core contract) Gemini API (default)
Assets generated alongside a coding session and saved into the repo Codex image_gen
Fine parameter control (resolution tiers, aspect ratios, thinking level, grounding) Gemini API

Sketch's deliverable stays "code, not images" on the Gemini path; the Codex path is operating guidance (commands + config), not Python code.

Usage

  • Inside Codex CLI, request in natural language, or invoke the built-in skill explicitly as $imagegen. Outputs are saved under $CODEX_HOME.
  • Some installs require enabling the feature in ~/.codex/config.toml:
[features]
image_generation = true
  • If saving fails, check the sandbox mode: --sandbox workspace-write (read-only sandbox cannot write generated files — community report, unverified).
  • Transparent backgrounds: image_gen generates via chroma-key + post-process script, or falls back to gpt-image-1.5 (per the official imagegen SKILL.md).
  • Do not confuse with --image / -i: that flag is image input (vision) for mockup-to-code, not generation. Input constraints: no BMP/TIFF/SVG/HEIC, ≤5MB recommended.

Cost model

  • Consumes standard Codex usage limits; an image-generation turn burns the quota 3–5× faster than a text turn (official docs).
  • No extra charge within the subscription. For high volume, switching to the OpenAI Image API (metered, OPENAI_API_KEY) is the documented alternative — that path exits the subscription.

UNVERIFIED (as of 2026-08)

  • Whether image_gen works in Codex cloud (async tasks; agent phase defaults to network-off sandbox).
  • Whether Codex image_gen quota is shared with ChatGPT's own image generation.
  • "Unlimited on Pro" claims (personal-blog sourced only).
  • Full official parameter reference for $imagegen.

Sources

Source: SKILL.md on GitHub

2 warnings4mo5 checks · Risk SAFE
  • Gen Agent Trust Hub4mo

    This skill provides a secure and well-architected framework for generating Python code to interact with the Google Gemini image generation API. It adheres to security best practices by emphasizing environment-variable-based credential management, providing explicit .gitignore guidance, and incorporating comprehensive error handling for API and safety filter responses. The skill acts exclusively as a code generator, ensuring that no actual API calls or external network requests are executed within the agent context itself.

  • Socket4mo

    No alerts

  • Snyk4mo

    Risk: MEDIUM · 1 issue

  • Runlayer6mo

    2/4 files flagged

  • ZeroLeaks5mo

    1 finding · Score: 86/100

Signed by skilld at 16a3f28. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Activeupdated last month

README badge

README badge for simota/agent-skills/sketch