Skip to content
OpenAgentSkill
Browsing is open · Catalog captured 2026-11-21 · Automatic updates and account services are paused.
Images & graphics

codex-imagegen

Use this skill when an agent must generate or edit raster images through Codex, especially from Claude Code or another harness without native image generation. Activates on mentions of generate image with Codex, delegate image generation, Codex imagegen, delegated image editing, or batch image handoff. Native image tools own ordinary generation when already available.

hyperb1iss · Static checks on file

Installation

Read the source and dependencies before running a command. Copying does not install or execute anything.

npx skills add hyperb1iss/hyperskills --skill codex-imagegen

About this skill


name: codex-imagegen description: Use this skill when an agent must generate or edit raster images through Codex, especially from Claude Code or another harness without native image generation. Activates on mentions of generate image with Codex, delegate image generation, Codex imagegen, delegated image editing, or batch image handoff. Native image tools own ordinary generation when already available.

Codex Image Generation

Delegate raster image generation and editing to Codex's built-in $imagegen capability, then return a verified workspace artifact to the leader harness.

Core insight: instrument Codex, not the desktop window. When the configured codex exec environment exposes image generation, use it headlessly and hand off the resulting artifact through the shared filesystem. Authentication alone does not establish tool availability.

As of Jul 2026, this path is verified with codex-cli 0.144.6. CLI and tool availability are volatile; the installed CLI and a live invocation outrank this snapshot.

Select the Execution Route

Host stateRoute
Codex with a callable built-in image-generation toolInvoke $imagegen directly. Never launch a child Codex from Codex.
Claude Code, Pi, Cursor, or another shell-capable harness with codex installedUse codex exec. This is the default delegation path.
The leader already has Codex MCP tools named codex and codex-replyUse MCP when iterative art direction benefits from a persistent thread.
No native tool, Codex CLI, or configured Codex MCP serverStop with the missing prerequisite and the exact error. Do not substitute another generator.

Run codex --version before the first delegated call. Respect the user's Codex configuration; never set --model, -m, or -c model=. Authentication, entitlements, workspace policy, and image-generation availability belong to the installed Codex environment.

Use the user's normal Codex session configuration. This skill bundles no Codex agent profile and requires no model or reasoning override.

Do not start or automate the ChatGPT desktop app. Do not install an MCP server, change Claude configuration, or switch to API billing unless the user asks.

Establish the Artifact Contract

Resolve these inputs before launching Codex:

InputRule
IntentClassify as new generation, edit, refinement, or variants.
DestinationHonor the user's path. Otherwise follow the repo's existing asset layout, or use assets/generated/<descriptive-slug>.png when no convention exists.
Existing destinationCreate a sibling version such as hero-v2.png; overwrite only when explicitly requested.
Input imagesLabel every image as edit target, content reference, style reference, or compositing input.
Exact textQuote verbatim, preserve capitalization, and forbid any other text unless requested.
InvariantsFor edits, state what may change and what must remain unchanged.
Avoid listCarry the user's negative constraints without adding invented brand, narrative, or stylistic requirements.

Resolve relative paths against the leader's current workspace. For a project asset with no user-specified destination, keep the final asset inside that workspace. Honor explicit destinations outside it when authorized. Keep the child's output in the workspace, then have the parent copy that exact verified artifact to the authorized external destination and verify the copy. A workspace-write child is not assumed to have external write access. Built-in generation may initially save under $CODEX_HOME; that location is staging, not a valid final destination for a project asset.

Delegate with codex exec

Use a single-quoted heredoc so prompts containing backticks, $(), quotes, or shell metacharacters remain data. Before executing, confirm IMAGEGEN_BRIEF does not appear as an exact standalone line in inserted content; if it does, choose a different quoted delimiter and update both marker lines. Omit -i when there are no input images.

codex exec \
  --ephemeral \
  --sandbox workspace-write \
  -C "$PWD" \
  -i "/absolute/path/to/reference.png" \
  - <<'IMAGEGEN_BRIEF'
$imagegen

Create or edit the requested raster asset.

Intent: <generation | edit | refinement | variant>
Asset purpose: <where and how the image will be used>
Primary request: <the user's request, preserving their specificity>
Input images:
- Image 1: <edit target | content reference | style reference | compositing input>
Destination: <workspace staging path, or final path when inside the workspace>
Text (verbatim): "<exact text, or none>"
Must preserve: <edit invariants, or none>
Constraints: <required p
Read the complete source ↗