media-image-gen
Installation
SKILL.md
media-image-gen
Turn the user's loose visual brief into a well-engineered GPT Image 2 prompt, generate the asset, and log cost. Built around OpenAI's official prompting guide — see PROMPTING.md in this directory for the full distilled cookbook.
Setup: TypeScript CLI (cli.ts) — run pnpm install in this directory once (needs Node.js ≥ 18). Auth either way:
- API key (default): in
~/.config/image-gen/envasexport OPENAI_API_KEY=sk-…, or exported in shell. - ChatGPT plan (default when signed in): no API key — bills your ChatGPT Plus/Pro quota. Run
pnpm exec tsx cli.ts setuponce to sign in; after that it's used automatically unless you pass--api. See the auth section below.
Usage log at ~/.config/image-gen/usage.jsonl.
Your job
- Classify the request into one of these categories:
logo | illustration | photoreal | infographic | ui-mockup | ad | story-panel | style-transfer | edit - Interview the user for anything missing. Ask one short message — no questionnaires. The critical fields by category are listed below.
- Assemble the prompt using the structure in
PROMPTING.md: Scene → Subject → Details → Composition → Constraints. Quote literal text. Spell tricky words letter-by-letter. - Show the user the final prompt + estimated cost (
--dry-runfirst if you're unsure). - Call
cli.ts generateorcli.ts editand report the actual cost. - Iterate small. Single-change edits — "change only X, keep everything else the same" — and repeat the preserve list each turn (per the cookbook's anti-drift rule).