
Image Generation
Produce clean flat illustrations for blog posts and project docs using Codex built-in image generation, with Gemini script fallback when API execution is required.
Overview
Image Generation is an agent skill most often used in Build (also Launch, Grow) that standardizes flat technical illustrations via Codex `image_gen` or a Gemini script fallback and commits final files into the project wo
Install
npx skills add https://github.com/zc277584121/marketing-skills --skill image-generationWhat is this skill?
- Codex path prefers built-in `image_gen`—no `OPENAI_API_KEY` prompt on that route
- Default prompt block enforces minimalist flat illustration style for technical articles (no photorealism)
- Project-bound images must land in the workspace with lowercase hyphenated filenames such as `rag-pipeline-overview.png`
- Gemini API fallback via `scripts/generate_image.py` when OpenAI path is unavailable and `GEMINI_API_KEY` is set
- Explicit user request for script/API execution switches away from the built-in Codex tool path
Adoption & trust: 882 installs on skills.sh; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need on-brand diagrams or hero art for a post or repo, but ad-hoc image prompts leave assets in the wrong folder with inconsistent style.
Who is it for?
Solo builders writing technical content who want repeatable illustration prompts and filesystem hygiene in Codex or mixed agent setups.
Skip if: Photorealistic marketing shoots, strict brand systems that forbid generated art, or workflows that mandate a single non-OpenAI/non-Gemini provider without the script path.
When should I use this skill?
User needs project-bound or blog-style images and the agent should prefer Codex built-in `image_gen` unless they explicitly request script/API execution or OpenAI generation is unavailable.
What do I get? / Deliverables
You receive a reviewed image saved under a clear workspace path with the skill’s default blog-ready flat style, or a script-generated file when API fallback is required.
- PNG (or selected format) image file in the workspace with hyphenated filename
- Reported final path after move/copy from default Codex output when applicable
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Technical articles and README visuals are created during Build before you ship and promote the same assets. Docs is the canonical shelf because the skill’s default style targets polished technical blog and project-bound artwork.
Where it fits
Illustrate an architecture section in a README with a flat pipeline diagram saved as `rag-pipeline-overview.png`.
Create a launch-post hero image with short in-image text quoted exactly from your headline.
Refresh an older article’s hero graphic using the same minimalist style block for consistency.
How it compares
Agent skill for routed image creation and repo placement—not a hosted MCP image server or manual Figma handoff.
Common Questions / FAQ
Who is image-generation for?
Indie developers and technical writers who generate supporting visuals inside Claude Code, Codex, or Cursor while keeping files inside the project tree.
When should I use image-generation?
Use it in Build while authoring docs or README diagrams, at Launch when you need distribution-ready hero art, and in Grow when refreshing article graphics—always after you know the concept but before you publish.
Is image-generation safe to install?
Built-in generation avoids extra keys on Codex; Gemini fallback reads `GEMINI_API_KEY`—review the Security Audits panel on this page before enabling network script runs.
SKILL.md
READMESKILL.md - Image Generation
# Codex Built-In Image Path Use this path when the current agent is Codex and the built-in `image_gen` tool is available. ## Selection Rules - Prefer the built-in tool for normal image generation and image editing. - Do not ask for `OPENAI_API_KEY` on this path. - If the user names a destination, generate first, then move or copy the selected output into that destination. - If the image is meant for the current project, never leave the final asset only in the default Codex image output location. - If the user explicitly asks for script/API execution, do not use this path; use `scripts/generate_image.py` instead. ## Prompt Shape Use the same base style as the script unless the user requests a different style: ```text Use a clean, modern color palette with soft tones. Minimalist flat illustration style with clear visual hierarchy. Professional and polished look suitable for technical blog articles. No photorealistic rendering. No excessive gradients or shadows. ``` Add the user's actual concept after the style guidance. Keep in-image text short and quote it exactly. ## Output Handling 1. Generate the image with the built-in tool. 2. Inspect the result. 3. If the asset is project-bound, move or copy the final selected image into the workspace. 4. Use a lowercase, hyphenated filename such as `rag-pipeline-overview.png`. 5. Report the final workspace path. # Gemini API Fallback Use this path when OpenAI API generation is unavailable or fails, and `GEMINI_API_KEY` is set. ## Requirements - `GEMINI_API_KEY` must be set. - The default model is `gemini-3.1-flash-image-preview`. - This path preserves the original Nano Banana workflow. ## Command ```bash python <skill-root>/scripts/generate_image.py \ --provider gemini \ --prompt "your prompt here" \ --output "/path/to/save/image.png" ``` To let the script choose OpenAI first and then Gemini: ```bash python <skill-root>/scripts/generate_image.py \ --provider auto \ --prompt "your prompt here" \ --output "/path/to/save/image.png" ``` ## Options ```text --gemini-model gemini-3.1-flash-image-preview, gemini-3-pro-image-preview, gemini-2.5-flash-image --aspect-ratio 1:1, 1:4, 1:8, 2:3, 3:2, 3:4, 4:1, 4:3, 4:5, 5:4, 8:1, 9:16, 16:9, 21:9 --image-size 512, 1K, 2K, 4K --style-prefix Custom style prefix --no-style Skip default style prefix ``` ## When Gemini Is Useful - OpenAI credentials are unavailable. - The requested aspect ratio is wider or taller than OpenAI's `3:1` ratio limit. - You want to keep compatibility with the previous workflow. # OpenAI API Fallback Use this path when the built-in Codex image path is unavailable or when the user explicitly requests script/API execution. ## Requirements - `OPENAI_API_KEY` must be set. - The script uses `gpt-image-2` by default. - The script sends requests directly to the OpenAI image generation endpoint. ## Command ```bash python <skill-root>/scripts/generate_image.py \ --provider openai \ --prompt "your prompt here" \ --output "/path/to/save/image.png" ``` For automatic fallback to Gemini if OpenAI generation fails: ```bash python <skill-root>/scripts/generate_image.py \ --provider auto \ --prompt "your prompt here" \ --output "/path/to/save/image.png" ``` ## Size Mapping The script accepts the same `--aspect-ratio` and `--image-size` inputs as the Gemini path, then maps them to valid `gpt-image-2` dimensions. Useful defaults: | Request | Script args | Typical OpenAI size | |---------|-------------|---------------------| | Article illustration | `--aspect-ratio 3:2 --image-size 1K` | `1536x1024` | | Square image | `--aspect-ratio 1:1 --image-size 1K` | `1024x1024` | | Social banner | `--aspect-ratio 16:9 --image-size 2K` | near `3840x2160` | | Portrait image | `--aspect-ratio 2:3 --image-size 1K` | `1024x1536` | OpenAI size constraints handled by the script: - Max edge: `3840px` - Width and height: multiples of `16px` - Long-to-short ratio: at most `3:1` - Total pi