agentleFS
krishagelkrishagel/geoffrey/skills/image-gen/SKILL.md

image-gen

Skill9 starsChanged 11 months agoMITView on GitHub

Generate images using Google's Nano Banana 2 (Gemini 3.1 Flash Image) with workflow-based prompting

  • Reads credentials

50 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use spotify, trello and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • QuixiAISkill

    spotify

    Search Spotify, inspect current playback and devices, and control playback with explicit approval

    Also in 3 projects that use this

  • QuixiAISkill

    trello

    List Trello boards, lists, and cards and create or update cards with explicit approval

    Also in 3 projects that use this

  • AnthropicSkill

    daily-briefing

    Morning rundown - today's meetings with account context, opps closing soon with stale flags, waiting customer emails, and the day's top actions. Use when the user says "daily briefing", "daily brief", "morning briefing", "what's my day", "what's on my plate today", "prep my day", "start my day", "morning rundown", or on a schedule.

    Also in 3 projects that use this

  • silvainfmSkill

    paid-ads

    When the user wants help with paid advertising campaigns on Google Ads, Meta (Facebook/Instagram), LinkedIn, Twitter/X, or other ad platforms. Also use when the user mentions 'PPC,' 'paid media,' 'ad copy,' 'ad creative,' 'ROAS,' 'CPA,' 'ad campaign,' 'retargeting,' or 'audience targeting.' This skill covers campaign strategy, ad creation, audience targeting, and optimization.

    Also in 3 projects that use this

  • AnthropicSkill

    weather

    The optional standing status report ("the weather"): compile open incidents, build health, merge-queue stats, and deploy lag into one always-current report page, and post to the channel only when a defined event fires. Use when the weather routine fires, or when someone asks to run/update the weather report.

    Also in 3 projects that use this

  • mitsuhikoSkill

    summarize

    Fetch a URL or convert a local file (PDF/DOCX/HTML/etc.) into Markdown using `uvx markitdown`, optionally it can summarize

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 36 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All scripts use Python via uv run with inline dependencies.

    line 34
  2. Distinctive:

    Validate: - Check against criteria, regenerate if needed

    line 84
  3. Distinctive:

    When generating images, follow the appropriate workflow:

    line 93
  4. Distinctive:

    Use simple, direct prompts: "Infographic explaining how X works"

    line 123
  5. Distinctive:

    No photorealistic humans (safety filter)

    line 158

“Common” is measured: kept by at least 6 in 10 of the 36 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Image Generation Skill

Generate professional images, infographics, and diagrams using Google's Nano Banana 2 model (gemini-3.1-flash-image-preview).

Model Capabilities

Nano Banana 2 (released February 26, 2026):

  • Text rendering - Accurate, legible text in images
  • Google Search grounding - Real-time data (weather, stocks, etc.)
  • Subject consistency - Up to 5 characters maintained across generations
  • Multi-turn conversation - Iterative refinement
  • Up to 14 reference images - For composition and style transfer
  • Resolutions: 1K, 2K, 4K
  • Aspect ratios: 1:1, 2:3, 3:2, 4:3, 16:9, 21:9

Scripts

All scripts use Python via uv run with inline dependencies.

generate.py - Text to Image

uv run scripts/generate.py "prompt" output.png [aspect_ratio] [size]

Examples:

# Basic image
uv run scripts/generate.py "A cozy coffee shop in autumn" coffee.png

# Infographic with specific aspect ratio
uv run scripts/generate.py "Infographic explaining how neural networks work" nn.png 16:9 2K

# 4K professional image
uv run scripts/generate.py "Professional headshot, studio lighting" headshot.png 3:2 4K

edit.py - Image Editing

uv run scripts/edit.py input.png "edit instructions" output.png

Examples:

# Edit existing image
uv run scripts/edit.py photo.png "Change the background to a beach sunset" edited.png

compose.py - Multi-Image Composition

uv run scripts/compose.py "prompt" output.png --refs image1.png image2.png

Examples:

# Combine styles from multiple images
uv run scripts/compose.py "Combine these styles into a logo" logo.png --refs style1.png style2.png

Workflows

Workflows provide structured approaches for specific visual types. Each workflow follows the PAI 6-step editorial process:

  1. Extract narrative - Understand the complete story/concept
  2. Derive visual concept - Single metaphor with 2-3 physical objects
  3. Apply aesthetic - Define style, colors, mood
  4. Construct prompt - Build detailed generation instructions
  5. Generate - Execute via script
  6. Validate - Check against criteria, regenerate if needed

Available Workflows

  • infographic.md - Data visualization, statistics, explainers
  • diagram.md - Technical diagrams, flowcharts, architecture

Workflow Usage

When generating images, follow the appropriate workflow:

For Infographics

1. What data/concept needs visualization?
2. What's the key insight or takeaway?
3. Aspect ratio: 16:9 (landscape) recommended
4. Include: clear hierarchy, minimal text, supporting icons
5. Generate at 2K minimum for text clarity

For Diagrams

1. What system/process is being illustrated?
2. What are the key components and relationships?
3. Style: flat colors, clean lines, minimal detail
4. Generate at 2K for label clarity

Environment Setup

Requires GEMINI_API_KEY environment variable. This should be set from Geoffrey's secrets:

source ~/Library/Mobile\ Documents/com~apple~CloudDocs/Geoffrey/secrets/.env

Best Practices

Infographics

  • Use simple, direct prompts: "Infographic explaining how X works"
  • Model auto-includes relevant icons/logos
  • 16:9 aspect ratio works best
  • Generate at 2K+ for readable text

General

  • Multi-turn refinement: generate, then ask for specific changes
  • Reference images improve consistency
  • Be specific about style, mood, lighting
  • SynthID watermark is automatic (Google provenance)

Output Location

By default, save images to /tmp/ or user-specified paths. For persistent storage, use:

~/Library/Mobile Documents/com~apple~CloudDocs/Geoffrey/images/

⚠️ CRITICAL: Never Read Generated Images

DO NOT use the Read tool on generated images.

Why:

  • 4K images (3840x2160) are within the 8000px limit
  • 2K images (2560x1440) are also safe
  • BUT: Do not Read them - they're for user consumption, not analysis
  • For edits, use edit.py script, not Read tool

Workflow:

  1. Generate image with script
  2. Return file path to user
  3. User views the high-quality output

Limitations

  • No photorealistic humans (safety filter)
  • No copyrighted characters
  • Maximum 14 reference images for composition
  • 4K only available with Nano Banana 2 and Nano Banana Pro

Pricing

SizeCost per Image
1KFree tier / $0.04
2K$0.134
4K$0.24

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.