buildoak/fieldwork-skills/image-gen
Claude Code and agent skill by buildoak/fieldwork-skills
- community
Checking that the SKILL.md file is still in the repository.
Image generation, editing, and review via OpenRouter API. Five models from budget to premium. Style presets for series consistency, JSON structured prompts, reference image anchoring, system message support, prompt upsampling. Vision-based quality review loop. Zero dependencies beyond Python stdlib. Use when: generate, create, draw, design, illustrate, edit, or modify images.
Install
npx vskill@latest install buildoak/fieldwork-skills/image-genSKILL.md
image-gen
Image generation and editing via OpenRouter. Five models, three scripts, style presets, one JSON contract.
Scripts: ./scripts/generate.py, ./scripts/edit.py, ./scripts/review.py Presets: ./presets/*.json Output dir: ./data/
Setup
- Claude Code: copy this skill folder into
.claude/skills/image-gen/ - Codex CLI: append this SKILL.md content to your project's root
AGENTS.md
For the full installation walkthrough (prerequisites, API keys, verification, troubleshooting), see references/installation-guide.md.
Credential management
Three tiers for managing the OPENROUTER_API_KEY_IMAGES environment variable:
- Vault skill (recommended): If you have a vault or secret-management skill, store the key there and export it before running scripts. Example:
export OPENROUTER_API_KEY_IMAGES=$(vault get OPENROUTER_API_KEY_IMAGES) - Custom secret manager: Use your team's preferred secret manager (1Password CLI, AWS Secrets Manager, etc.)
- Plain export:
export OPENROUTER_API_KEY_IMAGES='your-api-key-here'in your shell profile
Optional keys for additional features:
OPENAI_API_KEY-- for mask-based inpainting viaedit.py --mode openaiANTHROPIC_API_KEY-- for auto-review viareview.py --auto
Model Selection
| Alias | Type | Cost | Best For | |
|---|---|---|---|---|
flux.2-pro | Image-only | ~$0.03/MP | Default high-quality generation | |
flux.2-klein | Image-only | ~$0.014/MP | Fast, budget generation | |
gpt-5-image | Text+Image | ~$0.04/image | Text rendering, complex edits | |
nanobanana-pro | Text+Image | ~$0.012/image | Balanced quality + editing | |
nanobanana | Text+Image | ~$0.0004/image | Lowest-cost generation |
Full comparison: ./references/model-card.md
Quick Reference
Style Presets
Presets encode visual identity into reusable JSON files. A preset defines palette, composition, rendering style, model defaults, and system messages.
How Presets Work
- Pick a preset based on the project context
generate.py --preset <name>loads the preset JSON- The script applies the preset: enhances the prompt with style data, selects model defaults, injects system messages
- For Flux models: prompt is constructed as JSON (structured prompt, prevents concept bleeding)
- For GPT-5/NanoBanana: style block is prepended as natural language, system message is injected
Available Presets
| Preset | File | Description | |
|---|---|---|---|
default | presets/default.json | No style constraints. Quality-focused defaults. |
Preset Schema
Priority Order (CLI > Preset > Hardcoded)
--modelflag overridespreset.defaults.model--aspect-ratioflag overridespreset.defaults.aspect_ratio--sizeflag overridespreset.defaults.size--system-promptflag overridespreset.system_message- If no preset and no flag: hardcoded defaults (flux.2-pro, 1:1, 2K)
Creating a New Preset
- Copy
presets/default.jsonas a template - Set
nameanddescription - Fill
defaultswith preferred model, aspect ratio, size - Fill
stylewith palette (HEX values), composition rules, rendering constraints - Write
system_messagefor GPT-5/NanoBanana (ignored by Flux) - Optionally add
reference_imagespaths for visual anchoring - Test:
python generate.py --prompt "test scene" --preset your-preset
Style References
Use --style-ref to pass reference images for visual anchoring. The script prepends a style transfer instruction automatically.
Reference images from presets (style.reference_images) are automatically loaded alongside CLI refs.
Full workflow and per-model consistency techniques: ./references/style-consistency.md
System Messages
Use --system-prompt to set persistent style context for GPT-5 Image and NanoBanana models. System messages are injected as the system role, keeping the user prompt focused on scene content only.
System messages can also be set in presets via the system_message field. CLI --system-prompt overrides preset system messages.
Flux models do not support system messages (the flag is silently ignored).
Prompt Upsampling
Flux models support prompt_upsampling -- an API feature that auto-enhances basic prompts into richer descriptions before generation.
- Default: ON for Flux models (flux.2-pro, flux.2-klein)
- Disable:
--no-prompt-upsamplingwhen you want exact prompt control - Enable:
--prompt-upsampling(explicit, same as default) - Non-Flux models: Flag is silently ignored
Prompt Engineering
Enhance-before-generate protocol
- Identify intent: photo, illustration, logo, diagram, etc.
- Select preset if this is series work.
- Fill missing details: subject, style, lighting, composition, camera/look.
- Tune prompt shape to model: concise for Flux, more explicit for GPT-5/NanoBanana family.
- Add quality boosters that match requested style.
Example: raw prompt -> enhanced prompt
- Raw prompt:
a cat in space - Enhanced prompt:
Orange tabby cat in a custom spacesuit floating in zero gravity, Earth visible in helmet reflection, dramatic rim lighting, cinematic framing, ultra-detailed, high contrast, clean background
Templates, per-model formats, JSON structured prompts, and examples: ./references/prompt-templates.md
Generation Workflow
1. Select Preset (if applicable)
If the image is part of a series or project with established visual identity, select the appropriate preset.
2. Enhance Prompt
Transform the raw prompt into a model-optimized prompt. Each model interprets prompts differently:
- Flux: Concise, front-loaded, under 80 words. JSON for complex multi-element scenes. HEX colors for precision.
- GPT-5 Image: Detailed natural language. System messages for series work. Text in quotes for rendering.
- NanoBanana: Structured narrative. Constrain palette explicitly for muted styles ("no neon, desaturated").
3. Generate
Output: JSON to stdout with path, model, cost_estimate, generation_time_ms.
When a preset is used, the script handles prompt enhancement internally. Enhance the scene description but do NOT manually add style parameters -- the preset handles that.
4. Review (Optional)
For quality-critical work:
Output: JSON with score, verdict (accept/refine/reject), critique, suggested_refinement.
accept(score >= 7): Deliver to userrefine(score 4-6): Re-generate withsuggested_refinementappliedreject(score < 4): Re-generate with different model or reworked prompt
5. Deliver
Return the file path and a brief description.
Editing Workflow
Chat-Based Editing (OpenRouter)
For natural language edits: "make it darker", "change background to beach", "add a hat".
Best models for chat editing: gpt-5-image, nanobanana-pro.
Mask-Based Inpainting (OpenAI Direct)
For precise area editing with a mask image.
Requires OPENAI_API_KEY. Mask: PNG with transparent areas where edits should happen.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/image-gen/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/buildoak/fieldwork-skills/image-gen)