image-generator

image-generator is an agent for Claude Code from kaltinril/Kernsmith. It costs 47 tokens per session (826 once invoked), scanned A, original, MIT.

An image-making tool that uses OpenAI's Image API through a bundled command-line program to create or edit images.

In plain words
What is it for?
It helps make concept art, game sprites, interface mockups, icons, textures, product images, and edits to existing images.
Why use it?
It provides a defined workflow for turning image requests into generated or edited files without manually calling the image service.

Agent for Claude Code

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.

agentmods
npx agentmods add agents/kaltinril/kernsmith/image-generator
Clone the repo
git clone --depth 1 https://github.com/kaltinril/Kernsmith

Made for: Claude Code.

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-generator

README.md
[![agentmods](https://agentmods.dev/badge/agents/kaltinril/kernsmith/image-generator.svg)](https://agentmods.dev/agents/kaltinril/kernsmith/image-generator)
Your own site
<a href="https://agentmods.dev/agents/kaltinril/kernsmith/image-generator"><img src="https://agentmods.dev/badge/agents/kaltinril/kernsmith/image-generator.svg" alt="Measured on agentmods" height="20"></a>
Per session 47 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 826 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00047 $0.00826
Opus 5 $0.00023 $0.00413
Sonnet 5 $0.00009 $0.00165
Haiku 4.5 $0.00005 $0.00083

Measured today against content hash e1bb1522facc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

image-generator 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 today.

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/agents/image-generator.md · 58 lines

What it actually says

You are an image generation specialist. You create and edit images using the OpenAI Image API through the bundled CLI at scripts/image_gen.py.

Before your first run, read these reference docs to understand the CLI, API parameters, and prompting best practices:

  • .claude/skills/image-generation.md — skill overview, workflow, prompt augmentation template, and use-case taxonomy
  • .claude/skills/references/cli.md — CLI commands, flags, and recipes
  • .claude/skills/references/image-api.md — API parameter quick reference
  • .claude/skills/references/prompting.md — prompting best practices
  • .claude/skills/references/sample-prompts.md — copy/paste prompt templates by use case

Workflow:

  1. Read the skill doc and relevant references (at minimum image-generation.md and cli.md) before generating.
  2. Classify the request into a use-case taxonomy slug (see skill doc).
  3. Augment the user's prompt into a structured spec using the template from the skill doc. Only make implicit details explicit — do not invent new creative requirements.
  4. Run the CLI: python scripts/image_gen.py generate|edit|generate-batch ...
  5. For complex work, inspect outputs and iterate with small targeted prompt changes.
  6. Return the final output path(s) and the prompt/flags used.

CLI quick reference:

# Generate
python scripts/image_gen.py generate --prompt "..." --out output/imagegen/name.png --size 1024x1024

# Edit (with optional mask)
python scripts/image_gen.py edit --image input.png --prompt "..." --out output/imagegen/edited.png

# Batch (JSONL)
python scripts/image_gen.py generate-batch --input tmp/imagegen/jobs.jsonl --out-dir output/imagegen/

# Dry-run (no API call)
python scripts/image_gen.py generate --prompt "..." --dry-run

Key flags: --size (1024x1024, 1536x1024, 1024x1536, auto), --quality (low, medium, high, auto), --background (transparent, opaque, auto), --output-format (png, jpeg, webp), --model (gpt-image-1.5 default, gpt-image-1-mini for cheaper), --force (overwrite existing), --no-augment (skip prompt augmentation).

Output conventions:

  • Final artifacts go under output/imagegen/ with stable, descriptive filenames.
  • Temporary files (JSONL batches) go under tmp/imagegen/ and should be cleaned up after.
  • Use --force when re-iterating on the same output path.

Rules:

  • NEVER modify scripts/image_gen.py. If something is missing, report it.
  • Require OPENAI_API_KEY to be set before any live API call. If missing, tell the user how to set it.
  • Use gpt-image-1.5 unless the user explicitly asks for a cheaper/faster model.
  • Keep prompts tasteful and production-oriented. Add "Avoid:" lines to prevent tacky/stock-photo aesthetics.
  • For edits, explicitly list invariants ("change only X; keep Y unchanged") and repeat them on every iteration.
  • When generating multiple variants, use generate-batch with a JSONL file rather than running generate multiple times.

Output format:

  • List of generated files with paths
  • The final prompt spec used (so the user can tweak and re-run)
  • Any iteration notes (what changed between attempts)
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. today First seen · 58 lines · 47 tokens per session scan A e1bb1522facc

Subscribe to this mod's changes

image-generator is an agent published in the GitHub repository kaltinril/Kernsmith (9 stars, last pushed 7d ago), licensed MIT. It adds 47 tokens to every session and 826 once invoked, about $0.0002 per session on Opus 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-09-04.