Logo von Codex Imagegen

Codex Imagegen

Community
nathanonn
codex-imagegen

Generate images such as featured images, illustrations, diagrams, thumbnails, and blog visuals with the Codex CLI built-in $imagegen skill, save them into the current project, and safely clean this run's generated-images cache. Use when the user asks to generate, create, or make an image, picture, illustration, featured image, thumbnail, visual asset, image variants, AI artwork, or explicitly asks to use Codex image generation. Do not use for screenshots, charts rendered from data, ASCII diagrams, or editing existing images.

Übersicht

Herausgebernathanonn
Repositoryagent-skills
Skill-Namecodex-imagegen
Sterne
23
Forks
4
Mitgelieferte Dateien
1
LizenzMIT
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • 1 mitgelieferte Dateien

    Skripte, Vorlagen und Referenzmaterial, die das Modell bei der Arbeit lesen kann. Die Dateien sind schreibgeschützt und werden niemals ausgeführt.

  • Open Source

    Von nathanonn auf GitHub veröffentlicht. Prüfen Sie den Quellinhalt vor der Installation.

Installation

Installieren Sie den KI-Skill Codex Imagegen in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner — liest SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/nathanonn/agent-skills/tree/main/plugins/codex-imagegen/skills/codex-imagegen
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill anlegen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format lesen kann, kann diesen Skill nutzen — kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/nathanonn/agent-skills.git /tmp/agent-skills
mkdir -p .claude/skills
cp -r /tmp/agent-skills/plugins/codex-imagegen/skills/codex-imagegen .claude/skills/codex-imagegen
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Codex Imagegen in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Codex Imagegen automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Codex Imagegen nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Keys.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

Codex Imagegen

Generate images with Codex's built-in $imagegen skill, land them in the project, and keep $CODEX_HOME/generated_images/ from silently growing. The bundled script uses the Codex CLI directly and applies machine, workspace, project, environment, and per-run configuration without shipping a fixed model.

Prerequisites

The Codex CLI is required. The Claude Code codex plugin alone is not a runtime for this skill.

bash
npm i -g @openai/codex
codex login

Authentication is OpenAI/ChatGPT-account backed. If the CLI is absent, the script exits with code 3 and prints these steps.

Project folder and destination

The project marker and configuration folder is:

text
<project>/.codex-imagegen/
├── config.toml
├── output/
└── refs/

config.toml is optional, output/ is the default image destination, and refs/ is reserved for future style references. A bare .codex-imagegen/ directory is still a project marker.

Destination precedence is:

  1. --dest DIR.
  2. Merged [imagegen] dest, resolved relative to the project folder that holds the .codex-imagegen/ directory.
  3. .codex-imagegen/output/ below the deepest marker found by walking upward.
  4. $PWD/.codex-imagegen/output/.

The walk is anchored on the normalized --dest directory when supplied and on $PWD otherwise. It visits ancestors up to $HOME, or up to the filesystem root when the anchor lives outside $HOME. The script creates the destination only for a real run; --dry-run creates nothing. Never overwrite an existing project asset unless the user explicitly approved replacement.

A destination that comes from a config file or a marker must stay inside its project folder. The script canonicalizes the path and refuses a destination that resolves outside, so a symlink committed to a repository cannot redirect writes or widen what --add-dir authorizes. A path you pass explicitly with --dest is treated as deliberate and is not restricted.

Layered configuration

Model and reasoning effort resolve independently, highest priority first:

  1. --model and --effort for this run.
  2. CODEX_IMAGEGEN_MODEL and CODEX_IMAGEGEN_EFFORT.
  3. The nearest .codex-imagegen/config.toml.
  4. Shallower .codex-imagegen/config.toml files up to $HOME.
  5. $CODEX_HOME/imagegen.config.toml, applied with -p imagegen.
  6. The normal Codex default, with no override passed.

Project files merge shallowest first and deepest last, per key. A deeper file that sets only model therefore retains a shallower effort, size, or style. Example project configuration:

toml
[codex]
model = "your-current-model-slug"
model_reasoning_effort = "high"
model_verbosity = "low"
service_tier = "priority"

[imagegen]
size = "1200x630"
style = "flat editorial illustration, warm palette, no text"
dest = "assets/generated"

When the user names a model or effort for one run, pass --model or --effort. Do not put a real model ID in this file or in any project configuration shipped with the skill; model catalogs change. Put a standing machine default in the machine profile and let users choose project values themselves.

Repository config is parsed line by line and never sourced or evaluated. It accepts only the documented [codex] model-shaping keys and [imagegen] keys; unknown sections, unknown keys, malformed TOML, and invalid values fail closed. Project values must use double-quoted strings. The machine profile is your own file, so it is parsed leniently and accepts either TOML quote style.

Workflow

1. Compose the prompt

Write plain prompt text without the $imagegen token; the script prepends the literal token safely. Include the subject, mood, colors, exact filename, and number of variants. If project config supplies size or style, do not restate that size or style in the prompt because the script appends it automatically.

2. Run the script

bash
bash <skill-dir>/scripts/codex-imagegen.sh "<prompt text>"

Pass --dest DIR only when the user names a folder. Otherwise omit it and let the script resolve the destination (config dest, then the marker's .codex-imagegen/output/, then the current directory's). Passing --dest unasked overrides a project's dest and skips the containment check.

Flags may appear in any order before the prompt:

text
codex-imagegen.sh [--dest DIR] [--model M] [--effort E] [--dry-run] "prompt text"
codex-imagegen.sh --sweep
codex-imagegen.sh --report

The script needs network access during a real generation. In Claude Code, run it with dangerouslyDisableSandbox: true so the Bash sandbox does not block the call. In other agents or shells, run the command normally. Use a 600000 ms (10 minute) timeout; generation commonly takes 2–5 minutes.

--dry-run still validates the resolved model and effort against the local Codex model catalog, then prints the exact argument vector and composed prompt. It does not create directories or files and does not invoke codex exec.

3. Read the output

Every generation invocation begins with a resolution trace:

  • RUNTIME=codex-cli
  • CONFIG_FILES= in shallowest-to-deepest merge order, or none
  • MODEL=, MODEL_SOURCE=, EFFORT=, and EFFORT_SOURCE=
  • DEST= and DEST_SOURCE=
  • SIZE= and SIZE_SOURCE= when set, STYLE=set and STYLE_SOURCE= when set

Sources identify flag, env, config:<absolute-path>, profile:<absolute-path>, or codex-default. Destination sources identify flag, config:<absolute-path>, marker, or cwd-default.

After a real run, the script retains the established output keys:

  • GENERATED_FILES: followed by new destination files. If Codex leaves images in its cache folder, the script moves them only when nothing new reached the destination. That folder is the one named after this run's Codex session id: $CODEX_HOME/generated_images/<session-id>/.
  • SESSION_ID= is that id, or unknown when the script could not read it.
  • CLEANUP= reports whether this run's own session folder was removed. Cleanup only occurs after a destination file is confirmed, and never touches any other folder under generated_images/. When the id cannot be read, nothing there is touched. Caution: runs into different destinations are safe, but two runs into the same destination at the same time are not, so do not do that.
  • LEFTOVER_THREAD_FOLDERS= and LEFTOVER_TOTAL_SIZE= report older folders.

Show the result to the user. In Claude Code, view the generated file with the Read tool; other agents can open the paths listed under GENERATED_FILES:.

4. Offer a sweep when leftovers accumulate

If the leftover count or size is high, report it and offer to clear it. Only after the user confirms:

bash
bash <skill-dir>/scripts/codex-imagegen.sh --sweep

--sweep touches only $CODEX_HOME/generated_images/; it never touches a project's .codex-imagegen/ folder. Never sweep unprompted because old folders may contain originals from other sessions.

Exit codes and failure modes

  • 0 means success or a completed dry run.
  • 1 means Codex ran but no image reached the destination.
  • 2 means invalid CLI usage.
  • 3 means the Codex CLI is missing; install it and run codex login.
  • 4 means project configuration failed closed during parsing or validation.
  • 5 means the model is unknown or its reasoning effort is unsupported.

For an authentication error such as a revoked refresh token, ask the user to run ! codex logout && codex login interactively. If no image and no cache folder for the run's session appear, inspect the Codex error; the turn may have failed before image generation or the prompt may have been refused. Rephrase and retry once when appropriate.

Mitgelieferte Dateien

Das Modell liest diese Dateien bei Bedarf, während der Skill geladen ist. Sie werden als lesbare Dateien bereitgestellt und niemals ausgeführt.

Häufig gestellte Fragen

Was macht der KI-Skill Codex Imagegen?

Generate images such as featured images, illustrations, diagrams, thumbnails, and blog visuals with the Codex CLI built-in $imagegen skill, save them into the current project, and safely clean this run's generated-images cache. Use when the user asks to generate, create, or make an image, picture, illustration, featured image, thumbnail, visual asset, image variants, AI artwork, or explicitly asks to use Codex image generation. Do not use for screenshots, charts rendered from data, ASCII diagrams, or editing existing images.

Warum Codex Imagegen in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Codex Imagegen besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Codex Imagegen in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/nathanonn/agent-skills/tree/main/plugins/codex-imagegen/skills/codex-imagegen ein. TypingMind liest die Datei SKILL.md, bündelt die zugehörigen Dateien und installiert alles als Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Codex Imagegen nutzen?

Jedes Modell, das Sie in TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Codex Imagegen verwenden?

So viele Sie möchten. Solange ein Modell Skills unterstützt, können Sie Codex Imagegen damit verwenden – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama und weitere – alles in TypingMind mit Ihren eigenen API-Schlüsseln.

Ist der KI-Skill Codex Imagegen kostenlos?

Ja. Der Skill wird von nathanonn auf GitHub unter der Lizenz MIT veröffentlicht. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: eine Datei namens SKILL.md mit einem Namen und einer Beschreibung sowie allen Skripten, Vorlagen oder Referenzdateien, die das Modell möglicherweise benötigt. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und benötigen daher weder Server noch API-Schlüssel oder Laufzeitumgebung. Sie funktionieren mit jedem Modell.

Alle

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇