agentleFS
BlingtronDevBlingtronDev/codex-imagegen/SKILL.md

codex-imagegen

Skill1 starsChanged 21 days agoMITView on GitHub

Generate or edit raster images (photos, illustrations, mockups, sprites) with AI.

15 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use orchestrate and implement.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • varun29ankuSSkill

    orchestrate

    This skill should be used when the user asks to 'orchestrate a task', 'break down work into parallel agents', 'coordinate subtasks', 'run agents in parallel', or mentions 'multi-agent'. Decomposes complex tasks into tracked subtasks, dispatches parallel subagents, and coordinates until completion.

    Also in 3 projects that use this

  • Hugging FaceSkill

    implement

    Make tests pass. Invoke after /write-tests produces failing tests.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 6 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 14 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If you are Codex, do not use this skill: Use your built-in image_gen tool directly.

    line 10
  2. Distinctive:

    Use it for a new image: a concept, illustration, photo-style shot, product or UI mockup, game asset, cover, or texture.

    line 14
  3. Distinctive:

    Use it to edit an existing image: add, remove, or replace something, change the style or lighting, or cut out the background.

    line 15
  4. Distinctive:

    Use it for a new image guided by reference images for style or composition.

    line 16
  5. Very specific:

    Do not use it for diagrams, charts, flowcharts, simple icons, or anything that should stay editable as SVG/HTML/canvas/code.

    line 18
  6. Very specific:

    After generating, look at the image if you can view images.

    line 44
  7. Distinctive:

    Detailed requests: if the request is already specific, write it as a clean spec and don't invent extra elements.

    line 49
  8. Distinctive:

    Text in the image: put the exact words in quotes, require verbatim rendering, and describe the font, size, color, and placement.

    line 51
  9. Distinctive:

    Transparent cutouts: ask for "a genuinely transparent background, clean edges, no halo".

    line 54

“Common” is measured: kept by at least 6 in 10 of the 14 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Codex Image Generation

scripts/codex-imagegen runs codex exec with Codex's built-in image_gen tool, which uses the user's ChatGPT login (no API key), and copies the result to a path you choose.

If you are Codex, do not use this skill. Use your built-in image_gen tool directly.

When to use

  • Use it for a new image: a concept, illustration, photo-style shot, product or UI mockup, game asset, cover, or texture.
  • Use it to edit an existing image: add, remove, or replace something, change the style or lighting, or cut out the background.
  • Use it for a new image guided by reference images for style or composition.

Do not use it for diagrams, charts, flowcharts, simple icons, or anything that should stay editable as SVG/HTML/canvas/code. Build those directly.

Running it

The script is at scripts/codex-imagegen inside this skill's directory (the folder that contains this SKILL.md). Replace <skill-dir> below with that folder's absolute path.

<skill-dir>/scripts/codex-imagegen -o OUTPUT.png "PROMPT"
<skill-dir>/scripts/codex-imagegen -i input.png -o output-v2.png "Change only X; keep everything else unchanged"
<skill-dir>/scripts/codex-imagegen -i style.png -o new.png "Image 1 is a style reference. Draw ..."

Flags:

  • -o sets the output path (.png, .jpg or .jpeg).
  • -i attaches an input image. You can repeat it.
  • -f overwrites an existing output file.

On success the script prints the absolute path of the saved image. On failure it exits non-zero and prints Codex's reason.

  • Each image takes 30–90 seconds. Give the shell command a timeout of at least 300 seconds.
  • Each call makes exactly one image. For several images or variants, make one call per image. Independent calls can run in parallel, each with its own -o.
  • Do not overwrite existing assets unless the user asked for that. Write a sibling such as hero-v2.png.
  • Use .png for transparent backgrounds. JPEG drops the alpha channel.
  • Save project assets inside the project, at the path where the project will use them.

After generating, look at the image if you can view images. If it misses the request, make one targeted follow-up. You can pass the result back with -i and describe only the change. Tell the user the saved path.

Writing the prompt

  • Order: scene/backdrop → subject → key details → constraints → intended use, such as "website hero" or "game sprite".
  • Detailed requests: if the request is already specific, write it as a clean spec and don't invent extra elements. If it is vague, add only composition, lighting, and style cues that help.
  • Photorealism: say photorealistic and name real texture, lens, and lighting.
  • Text in the image: put the exact words in quotes, require verbatim rendering, and describe the font, size, color, and placement.
  • Edits: say "change only X; keep Y unchanged". Repeat the invariants on every iteration so the image does not drift.
  • Several input images: give each one a role, for example "Image 1: edit target; Image 2: style reference".
  • Transparent cutouts: ask for "a genuinely transparent background, clean edges, no halo".
  • Size and shape: describe the aspect ratio in words, such as "wide 16:9 landscape" or "square". There is no size flag.

More examples are in Codex's own guide: ~/.codex/skills/.system/imagegen/references/prompting.md and sample-prompts.md.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.