---
name: codex-image-generator
description: Generate or edit finished images in Codex with the native image tool, using the bundled awesome-gpt-image-2 style library for stronger visual direction. Use when the user asks to create, draw, render, design, illustrate, generate, or edit an image, cover, poster, social card, thumbnail, infographic, product shot, UI concept, character, scene, or visual variation. Return actual images by default, not prompts.
---

# Codex Image Generator

Turn an ordinary image request into finished images inside Codex. Use the bundled style library internally, build the production prompt, call the native image-generation tool, and show the result in the chat.

## Non-negotiable outcome

- When the user asks for an image, generate the image. Do not stop after drafting or displaying a prompt.
- Use Codex's native image-generation tool. Do not ask for API keys, install image-generation CLIs, register on third-party sites, or route through external paid providers.
- Do not make the user learn prompt engineering. Accept natural-language requests and make reasonable visual decisions.
- Show the generated image first. Keep the explanation brief and reveal the full production prompt only if the user asks for it.
- If native image generation is unavailable, state that limitation plainly. Only then provide the prepared prompt as a fallback.

## Workflow

1. Determine whether the request is a new image, an edit of an attached image, or multiple variations.
2. Capture the hard constraints already present: subject, purpose, audience, aspect ratio, exact visible text, references, must-keep elements, and must-avoid elements.
3. Read `references/style-library.md` before choosing the visual direction. Match the request by output category, visual style, scene, and nearest useful cases.
4. Choose the strongest direction internally. Do not force the user to choose from concepts unless they explicitly ask to review directions before generation.
5. Build a production prompt with subject, composition, layout, style, materials, lighting, text requirements, aspect ratio, and likely failure constraints.
6. Call the native image-generation tool with the complete prompt.
7. Inspect the result for the user's hard constraints, especially readable text, composition, cropping, reference preservation, and unintended style drift.
8. Return the image with one short note describing the chosen direction. Suggest a refinement only when there is a concrete reason.

## Multiple images

- Generate one finished image by default.
- If the user requests a specific number of variants, generate that number as separate images.
- For genuinely different directions, vary the central metaphor, composition, palette, medium, or template—not just minor decorations.
- If the user asks to compare directions before spending generation turns, present 2–3 concise options and wait for the choice.

## Brief handling

Proceed without questions when a reasonable interpretation is safe. Infer ordinary style decisions from the artifact, audience, and context.

Ask a short question only when the missing answer materially changes the result, such as:

- required visible wording is unclear;
- an edit requires an attachment that is missing;
- a named brand identity or person must be reproduced accurately but no reference is available;
- the requested number or format cannot be inferred.

When exact text is not required, prefer no text or one short headline. Image models are unreliable with paragraphs, tables, URLs, legal copy, and small labels.

## New images

- Start with the canvas and composition before stylistic adjectives.
- Use concrete visual language: subject placement, scale, depth, lighting, material, palette, camera or illustration grammar, and whitespace.
- Preserve quoted text exactly and keep it large, short, and high contrast.
- Avoid generic AI defaults when the library offers a more specific visual system.

## Image edits

- Include every target image in the native edit call.
- State what must remain unchanged before describing the modification.
- Preserve identity, product shape, composition, text, colors, or background whenever the user marks them as fixed.
- Make only the requested transformation. Do not silently redesign unrelated parts.

## Output behavior

For a normal request, the visible response should be:

1. the generated image;
2. one short sentence naming the visual direction;
3. an optional concrete iteration suggestion.

Do not lead with a long prompt, template ID, case list, methodology, or installation explanation. Provide those details only on request.

## Source boundary

The bundled reference adapts the `gpt-image-2-style-library` from `freestylefly/awesome-gpt-image-2`. Use it for patterns and selection, not to reproduce a third-party image, logo, living artist's signature style, or protected brand asset literally. Attribution and the pinned upstream revision are recorded in the repository's `THIRD_PARTY_NOTICES.md`.
