agentleFS
mishagavuramishagavura/claude-code-image-generation/skills/codex-image/SKILL.md

codex-image

Skill5 starsChanged 2 months agoMITView on GitHub

Generate or edit raster images (photos, illustrations, mockups, hero images, product shots, bitmap icons, transparent cutouts) with OpenAI GPT Image 2 by triggering the local Codex CLI, billed to the user's ChatGPT subscription — no API key needed. Use when the user says "generate an image", "make a picture/illustration/mockup", "use codex / gpt image / gpt-image-2", "edit this image", "remove the background", or a project needs a bitmap asset. Not for video, SVG, or graphics better built in code.

  • Installs packages

7 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions7 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 7

    1. OpenMinis/MinisSkills★ 438same name
    2. revfactory/skills★ 159same name
    3. qwwiwi/codex-gpt-image-2-subscription★ 9same name
    4. xntj-ai/codex-image★ 9same name
    5. basejb/skills★ 5same name
    6. lsongdev/skills★ 1same name
    7. almeidasrenato/codex-image-skills★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

Files
SKILL.md

codex-image

Runs Codex CLI non-interactively. Codex calls its built-in image_gen tool (GPT Image 2) and the script copies the result to the path you choose. Each call takes roughly 30–90 seconds.

The script is gen.sh in this skill's base directory (shown when the skill loads), referred to below as <skill-dir>.

Command

<skill-dir>/gen.sh -o <out.png> [options] "<prompt>"
OptionMeaning
-o PATHOutput file (required). Put project assets inside the project; otherwise use a temp/scratch folder.
-n N1–4 variants → out-1.png, out-2.png, …
-r FILEReference image for style/composition (repeatable)
-e FILEImage to edit — only what the prompt asks changes
-tTransparent background
-a square|portrait|landscapeAspect ratio

Prints the saved absolute path(s). Never overwrites: an existing name gets a time suffix. Give the Bash call a timeout of at least 300000 ms (600000 for -n 3 or -n 4). For several different images, run separate commands in parallel instead of describing them all in one prompt — parallel runs are safe.

Workflow

  1. Turn the request into a clear prompt: subject, style/medium, composition, lighting, palette, exact text in quotes, and what to avoid. Keep the user's specifics; add detail only when the ask is vague.
  2. Run gen.sh.
  3. Look at the output image and check it matches (subject, spelling of any text, framing). If it's off, rerun with one targeted prompt change, or use -e on the result for a small fix.
  4. Report the saved path(s) and the final prompt. If the image is for a project, reference it from the code.

Troubleshooting

  • codex CLI not found → the user needs npm i -g @openai/codex.
  • Codex is not logged in → the user runs codex login and signs in with ChatGPT.
  • No image was generated → the ChatGPT plan's image limit may be used up, or the prompt was refused. Say so; don't retry in a loop.
  • -t output can have semi-transparent blotches. Check it; if dirty, regenerate on a plain white background without -t and remove the background separately.

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.