image-generation

image-generation is a command for Claude Code from mathiasbourgoin/roster. It costs 21 tokens per session (1,751 once invoked), scanned A, original, MIT.

A command for generating new images or editing existing ones through the Codex command line. It accepts a description and can include output size, format, and path.

In plain words
What is it for?
Use it to create illustrations or other images from prompts, edit an existing image, choose PNG, JPEG, or WebP output, set dimensions, and save the result to a specified file.
Why use it?
It gives image tasks a defined command format, including checks for editing inputs and a validation-and-retry process.

Command for Claude Code

Written for Claude Code: when-to-use in frontmatter. Also seen: runs codex exec; mentions Codex.

Part of the roster plugin — 43 commands, 8 agents shipped together

Good fit Use it to create illustrations or other images from prompts, edit an existing image, choose PNG, JPEG, or WebP output, set dimensions, and save the result to a specified file.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/mathiasbourgoin/roster/image-generation
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/mathiasbourgoin/roster

Made for: Claude Code.

Or install roster, the plugin that ships this one along with the rest of its 43 commands, 8 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for image-generation

README.md
[![agentmods](https://agentmods.dev/badge/commands/mathiasbourgoin/roster/image-generation/github.svg)](https://agentmods.dev/commands/mathiasbourgoin/roster/image-generation)
Your own site
<a href="https://agentmods.dev/commands/mathiasbourgoin/roster/image-generation"><img src="https://agentmods.dev/badge/commands/mathiasbourgoin/roster/image-generation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for image-generation

Your own site · 80×15
<a href="https://agentmods.dev/commands/mathiasbourgoin/roster/image-generation"><img src="https://agentmods.dev/badge/commands/mathiasbourgoin/roster/image-generation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 21 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,751 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00021 $0.01751
Opus 5.5 $0.00008 $0.00700
Sonnet 5.5 $0.00004 $0.00350
Haiku 4.5 $0.00002 $0.00175

Measured 2mo ago against content hash 5f16678da79c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

image-generation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/image-generation.md · 161 lines

How it starts

The opening of the file, as written. The whole thing — 161 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Image Generation

Generate or edit an image using the Codex CLI based on $ARGUMENTS.

Parse $ARGUMENTS as one of:

  • "<prompt>" — generate a new image
  • "edit <path> <prompt>" — edit an existing image
  • Optional inline hints: size:<WxH>, format:<png|jpg|webp>, out:<path>, style:<hint>

Examples:

  • "a watercolor moonlit library"
  • "edit assets/hero.png replace background with white"
  • "a minimalist OCaml logo size:512x512 out:docs/logo.png"

Step 1 — Parse and Resolve Arguments

Extract from $ARGUMENTS:

  • MODE: generate or edit
  • RAW_PROMPT: the user's original description
  • INPUT_PATH: (edit mode only) path to source image — verify it exists; abort if not
  • SIZE: default 1024x1024; override if size:WxH present
  • FORMAT: default png; override if format:X present
  • OUTPUT_PATH: if out:<path> present, use it; otherwise ask the user where to save the result

If OUTPUT_PATH is missing and $ARGUMENTS provides no hint, ask:

"Where should I save the image? (e.g., assets/hero.png)"

Do not proceed until OUTPUT_PATH is resolved.

Step 2 — Prompt Refinement

Before invoking Codex, rewrite RAW_PROMPT into a detailed, visually precise prompt:

  • Add composition, lighting, mood, and style details the user left implicit
  • Incorporate SIZE as an aspect ratio hint (e.g., "square 1:1 composition")
  • Incorporate FORMAT only if it has visual implications (e.g., transparency for PNG)
  • Keep the user's intent intact — do not substitute a different concept

Store the result as REFINED_PROMPT. Show the user both the original and refined version:

Original: <RAW_PROMPT> Refined: <REFINED_PROMPT>

If the user rejects the refinement, use RAW_PROMPT as-is.

Step 3 — Generate

Set ATTEMPT=1, MAX_ATTEMPTS=3.

Generate mode:

codex exec --full-auto "Generate a <SIZE> <FORMAT> image of: <REFINED_PROMPT>. Save the result to <OUTPUT_PATH>."

Edit mode:

codex exec --full-auto "Edit the image at <INPUT_PATH>: <REFINED_PROMPT>. Save the result to <OUTPUT_PATH>."

Read the full file on GitHub · 161 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago Changed · -5 tokens per session 5f16678da79c
  2. 3mo ago First seen · 161 lines · 26 tokens per session scan A e36aa724b0ec

Subscribe to this mod's changes

image-generation is a command published in the GitHub repository mathiasbourgoin/roster (3 stars, last pushed 7d ago), licensed MIT. It adds 21 tokens to every session and 1,751 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

image-generation compared with commands from other repositories

image-generation next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
image-generationmathiasbourgoin/rosterCommand37d agoMITA21Claude Code
anchorsraccioly/docguardCommand34yesterdayMITA11Claude Code
reviewdork-labs/dorkosCommand11todayMITA21Claude Code
spec-forgetercel/spec-forgeCommand104d agoMITA33Claude Code
harness-adoptharnessworks/harness-starter-kitCommand1145mo agoMITA0Claude Code
tdd-featurehculap/better-codeCommand21mo agoMITA9Claude Code
adr-supersedezircote-plugins/adrCommand62mo agoMITA16Claude Code