ask-llm-codex-image
БесплатноБез исполняемых скриптовНе проверенGenerate an image via OpenAI's gpt-image-2 model through the Codex CLI. Use when user asks to "generate an image", "create an image", "make a picture of"…
от Lykhoyda★ 20 звёзд на GitHubОб этом скилле
Portable contract
Refine the requested image prompt without changing intent, select an explicit output path, invoke ask-codex-write with sandbox: "workspace-write" so its image tool may create the file, verify the resulting file on disk, and report the path and provider response. Surface feature, policy, timeout, and filesystem failures verbatim.
Host adapters
Pi adapter
Call native ask-codex-write with sandbox: "workspace-write". After it returns, use Pi's read-only filesystem tools to verify the output file. Do not claim automatic inline rendering in print mode.
Other hosts adapter
Codex, Cursor Agent, Antigravity, Grok Build, Gemini CLI and OpenCode get this skill from their skills folder, not from a plugin. Use the writable Codex call from ../ask-llm-review/transport.md with sandbox: "workspace-write" and the exact model the user named (gpt-6.2-sol otherwise), then read the output file to confirm it exists.
Claude Code adapter
The existing detailed workflow below is the Claude Code adapter. Its Agent, MCP, hook, CLAUDE_PLUGIN_ROOT, and AskUserQuestion mechanics apply only on Claude Code; they do not override the Pi adapter above.
Codex Image Generation
Generate an image by delegating to the ask-codex-write MCP tool with a prompt-engineered template that triggers Codex's built-in image_generation tool. The result is saved to disk and the path is returned to the user.
Model capabilities (gpt-image-2)
Codex's image_generation tool selects the image model server-side; as of 2026-04-21 that is gpt-image-2. Three capabilities are worth accounting for when building prompts:
- Legible in-image text — per OpenAI's launch materials, gpt-image-2 renders text at ~99% accuracy across many scripts, so captions, labels, and UI copy are now reliable. gpt-image-1's weak text is no longer a reason to avoid asking for it.
- High resolution — up to 4K and custom dimensions; ask for it explicitly in the prompt body when you need it. Default square renders observed in testing varied (1024×1024 and 1254×1254), so don't hard-code an expected size — read it back from the file if it matters.
- Provenance + watermark — every render embeds a C2PA provenance manifest and an invisible AI-origin watermark. Flag this to the user when the image is destined for a context sensitive to AI-generated-content metadata.
Prerequisites
codex-cli>= 0.125.0 installed and authenticatedimage_generationfeature flag enabled (default: stable + true). Verify withcodex features list | grep image_generation- The
ask-codex-writeMCP tool available (from the Claude plugin's bundledcodexserver) or the unifiedmcp__ask-llm__ask-llmtool (from@ask-llm/mcp) whose schema includessandbox
Instructions
Phase 1: Build the image prompt
Take the user's natural-language ask and prepare it for image generation. Rules:
- Keep the user's intent intact — do not change meaning. Refine, don't replace.
- If the prompt is sparse (e.g., "an apple") AND the surrounding conversation has design context (e.g., a LinkedIn post, an article), enrich with that context: aspect ratio, style cues, what to avoid.
- If the prompt is already detailed, send it through verbatim — the user knows what they want.
- Default exclusions worth adding: "no humanoid figures, no glowing brains, no chatbot iconography" if the topic is AI / LLM-related (these are diffusion-model failure modes and the user will almost certainly want them excluded).
If you significantly enrich the prompt, briefly tell the user what you added and let them push back before dispatching.
Phase 2: Determine output path
Convention:
- Default path:
/tmp/codex-images/$(date +%Y-%m-%d)/<slug>.pngwhere<slug>is a short kebab-case derivation from the user's prompt (max 40 chars). - Override: if the user explicitly provided an output path (absolute or relative), use that exactly.
- Ensure parent directory exists —
mkdir -p <parent>before dispatching. Codex's image tool will fail if the directory doesn't exist.
Example slug derivation:
- "Generate an image of a dark terminal with two reviewers" →
dark-terminal-with-two-reviewers.png - "Make me a cat picture" →
cat-picture.png
Phase 3: Dispatch to Codex
Call an exact ask-codex-write leaf when exposed (NOT raw codex exec — that bypasses ADR-044 quota fallback, ADR-042 stdin handling, and ADR-047 PATH resolution). If only unified mcp__ask-llm__ask-llm is exposed, use that instead with provider: "codex". If the unified schema lacks sandbox, stop and tell the user to upgrade @ask-llm/mcp (npx -y @ask-llm/mcp@latest or npm install -g @ask-llm/mcp); do not omit sandbox to make the call succeed. Use this prompt template:
Use your image_generation tool to create the following image and save it
Установить ask-llm-codex-image в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл ask-llm-codex-image?
Generate an image via OpenAI's gpt-image-2 model through the Codex CLI. Use when user asks to "generate an image", "create an image", "make a picture of", "render a graphic", "draw something", or wants visual content via Codex. Requires codex-cli >= 0.125.0 with the `image_generation` feature flag enabled (stable + on-by-default since 0.125).
Как установить скилл ask-llm-codex-image?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ask-llm-codex-image запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic