Imagegen

From seaworld008/Commonly-used-high-value-skills · View interactive version

Imagegen is an AI agent skill from the GitHub repository seaworld008/Commonly-used-high-value-skills. Generate or edit images with OpenAI image tools or the bundled API CLI, including inpainting, background changes, transparent assets, and variants.

How to use this skill

Skill file

Image Generation Skill

Generates or edits images for the current project (e.g., website assets, game assets, UI mockups, product mockups, wireframes, logo design, photorealistic images, infographics). Follow the actual host's image-tool contract first. The bundled CLI defaults to gpt-image-1.5 and the OpenAI Image API; its flags are not automatically host-tool arguments.

When to use

Decision tree (generate vs edit vs batch)

Workflow

  1. Decide intent: generate vs edit vs batch (see decision tree above).
  2. Collect inputs up front: prompt(s), exact text (verbatim), constraints/avoid list, and any input image(s)/mask(s). For multi-image edits, label each input by index and role; for edits, list invariants explicitly.
  3. If using CLI batch: write temporary JSONL in the task's allowed temporary directory (one job per line), run once, then delete only that task file. Host tools may require separate calls instead.
  4. Augment prompt into a short labeled spec (structure + constraints) without inventing new creative requirements.
  5. Use the host-required tool, or when appropriate and available run the bundled CLI (scripts/image_gen.py) with sensible defaults (see references/cli.md).
  6. Inspect outputs using an available image viewer and validate: subject, style, composition, text accuracy, and invariants/avoid items. For transparent assets, check the alpha channel; successful CLI execution alone does not establish visual correctness.
  7. Iterate: make a single targeted change (prompt or mask), re-run, re-check.
  8. Save/return final outputs and note the final prompt + flags used.

Temp and output conventions

Dependencies (bundled CLI only)

Install dependencies only within existing task authorization. If installation is outside scope, report the missing dependency and continue independent prompt/script drafting or use a supported host tool. Prefer uv for authorized dependency management.

Use the project's selected Python environment and dependency workflow. openai is required for live CLI calls; Pillow is only needed for downscaling. Example when dependency installation is authorized:

uv pip install openai

If uv is unavailable:

python3 -m pip install openai

Environment

If the key is missing, give the user these steps:

  1. Create an API key in the OpenAI platform UI: https://platform.openai.com/api-keys
  2. Set OPENAI_API_KEY as an environment variable in their system.
  3. Offer to guide them through setting the environment variable for their OS/shell if needed.

If installation isn't possible in this environment, tell the user which dependency is missing and how to install it locally.

Defaults & rules

Prompt augmentation

Reformat user prompts into a structured, production-oriented spec. Only make implicit details explicit; do not invent new requirements.

Use-case taxonomy (exact slugs)

Classify each request into one of these buckets and keep the slug consistent across prompts and references.

Generate:

Edit:

Quick clarification (augmentation vs invention):

Template (include only relevant lines):

Use case: <taxonomy slug>
Asset type: <where the asset will be used>
Primary request: <user's main prompt>
Scene/background: <environment>
Subject: <main subject>
Style/medium: <photo/illustration/3D/etc>
Composition/framing: <wide/close/top-down; placement>
Lighting/mood: <lighting + mood>
Color palette: <palette notes>
Materials/textures: <surface details>
Quality: <low/medium/high/auto>
Input fidelity (edits): <low/high>
Text (verbatim): "<exact text>"
Constraints: <must keep/must avoid>
Avoid: <negative constraints>

Augmentation rules:

Examples

Generation example (hero image)

Use case: stylized-concept
Asset type: landing page hero
Primary request: a minimal hero image of a ceramic coffee mug
Style/medium: clean product photography
Composition/framing: centered product, generous negative space on the right
Lighting/mood: soft studio lighting
Constraints: no logos, no text, no watermark

Edit example (invariants)

Use case: precise-object-edit
Asset type: product photo background replacement
Primary request: replace the background with a warm sunset gradient
Constraints: change only the background; keep the product and its edges unchanged; no text; no watermark

Prompting best practices (short list)

More principles: references/prompting.md. Copy/paste specs: references/sample-prompts.md.

Guidance by asset type

Asset-type templates (website assets, game assets, wireframes, logo) are consolidated in references/sample-prompts.md.

CLI + environment notes

Reference map

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.