agentleFS
NicegarrryNicegarrry/claude-skills/generate-image/SKILL.md

generate-image

Skill0 starsChanged 5 months agoMITView on GitHub

Use when asked to generate, create, make, draw, or edit an image, illustration, icon, logo, poster, diagram, mockup, sticker, avatar, or any visual/picture from a text description — produces real PNG files via Google's Nano Banana (Gemini) image API.

  • Reads credentials

37 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use edit-image, scientific-slides and 6 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.
  • SamurAIGPTSkill

    edit-image

    Edits an existing image using natural language instructions via MuAPI. Use when the user wants to modify, change, transform, or retouch an existing image.

    Also in 3 projects that use this

  • ZanderRussSkill

    scientific-slides

    Build slide decks and presentations for research talks. Use this for making PowerPoint slides, conference presentations, seminar talks, research presentations, thesis defense slides, or any scientific talk. Provides slide structure, design templates, timing guidance, and visual validation. Works with PowerPoint and LaTeX Beamer.

    Also in 3 projects that use this

  • nicepkgSkill

    team

    根据任务快速组建临时 AI Agent 团队协作。自动从 .claude/agents/ 中选择最合适的成员组队。

    Also in 3 projects that use this

  • AnthropicSkill

    pptx

    Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions \"deck,\" \"slides,\" \"presentation,\" or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.

    Also in 5 projects that use this

  • AnthropicSkill

    pdf

    Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.

    Also in 4 projects that use this

  • SentrySkill

    skill-creator

    Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.

    Also in 5 projects that use this

  • +1 more from anthropics

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 31 edited versions we read keep these.

  • 3

    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. Distinctive:

    If they'd rather not run the script, the one-liner is:

    line 50
  2. Distinctive:

    Write a sentence or two, not tags.

    line 142
  3. Very specific:

    Text in the image: put the exact words in quotes and name the font — the words "LAUNCH DAY" in a bold sans-serif.

    line 149
  4. Distinctive:

    All output carries an invisible SynthID watermark + C2PA credentials (Google policy).

    line 166

“Common” is measured: kept by at least 6 in 10 of the 31 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

Generate Image (Nano Banana)

Overview

Turn a text description into a real image file using Google's Nano Banana (Gemini) image models. The helper script handles the API call, key loading, and saving — your job is to write a good prompt and pick the right model/size.

Core principle: describe a scene in natural language (subject, action, setting, lighting, style) — not a list of keywords.

When to use

  • "Make me an illustration / icon / logo / poster / diagram / mockup of …"
  • "Generate an image of …", "draw …", "create a picture of …"
  • "Edit this image: …" (change, add, remove, restyle — pass it with -i)
  • Hero art, avatars, stickers, textures, concept art, marketing visuals

Not for: charts from data (use a plotting lib), vector/SVG icon sets (use Heroicons per global prefs), or anything needing exact pixel-perfect logos.

Quick start

~/.claude/skills/generate-image/generate_image.py -p "PROMPT" -o out.png

The script auto-installs its dependencies via uv on first run. It saves a PNG and prints the path. Default model is Nano Banana 2 at 2K, 1:1.

First run / no API key

The helper exits 2 with "no API key found" until a key is configured. When that happens, do NOT retry blindly — walk the user through setup, then retry:

  1. Tell them to get a free key from Google AI Studio: https://aistudio.google.com/apikey ("Create API key" → copy).
  2. Have them run the guided installer in their own terminal (so the key is pasted hidden, never into this chat):
    ~/.claude/skills/generate-image/setup.sh
    It opens AI Studio, prompts for the key with hidden input, writes it to ~/.config/nano-banana/credentials.env (chmod 600), and offers a test gen.
  3. If they'd rather not run the script, the one-liner is:
    printf 'GEMINI_API_KEY=YOUR_KEY\n' > ~/.config/nano-banana/credentials.env && chmod 600 ~/.config/nano-banana/credentials.env

$GEMINI_API_KEY in the env overrides the file. A separate slides key can be added as SLIDES_GEMINI_API_KEY (run setup.sh SLIDES_GEMINI_API_KEY) and selected with --profile SLIDES_GEMINI_API_KEY.

Models — pick one

AliasModel idUse for
flash (default)gemini-3.1-flash-imageMost work: illustrations, icons, concepts. Fast, ~$0.05–0.13/img.
progemini-3-pro-imageHeavy text-in-image (posters, infographics), complex/precise scenes, max realism. Slower, ~$0.13–0.24/img.
nano-bananagemini-2.5-flash-imageLegacy / fallback.

Reach for pro when the image must contain legible text or many precise elements.

Presets (archetypes)

Common image types come pre-styled. Pass -P <preset> and put the subject in -p; the preset supplies the style + sensible model/aspect/size. Any explicit -m/-a/-s flag overrides the preset.

generate_image.py -P illustration -p "an electric-type fox with a lightning-bolt tail" -o fox.png
generate_image.py -P hyperreal    -p "white wireless earbuds in an open charging case" -o buds.png
generate_image.py -P abstract-title -p "the future of AI" -o slide_bg.png
PresetModel / aspect / sizeFor
infographicpro · 4:3 · 2KLabelled explainer diagrams (sharp text)
abstract-titleflash · 16:9 · 2KSlide title / transition backgrounds (text-safe negative space)
illustrationflash · 1:1 · 2KFriendly cel-shaded creature/character ("pokemon" house style)
hyperrealpro · 1:1 · 2KPhotorealistic studio product shots for demos
avatarflash · 1:1 · 1KProfile-picture portraits
iconflash · 1:1 · 1KMinimal flat vector icons on white (multi-colour)
diagrampro · 16:9 · 2KSapphireOS line-art schematic / flow (sapphire on white)
diagram-darkpro · 16:9 · 2KSame, dark facet (bright sapphire on charcoal)
icon-lineflash · 1:1 · 1KSapphireOS single-stroke line icon (sapphire on white)
icon-line-darkflash · 1:1 · 1KSame, dark facet (bright sapphire on charcoal)

The diagram* / icon-line* presets bake the SapphireOS palette into the template itself (so they're not double-styled by -S); use the -dark variants for dark decks.

--list-presets prints them. To tune a house style, edit the PRESETS dict at the top of generate_image.py — each entry is a prompt template ({prompt} = your subject) plus default model/aspect/size.

Brand style (SapphireOS)

Slide-bound presets (infographic, abstract-title) apply the SapphireOS brand by default — cool sapphire-blue palette (#306FA8), white/cool-paper surfaces, clean grotesque type, generous radii, restrained translucency. Sourced from qubit-os/platform/design.

generate_image.py -P infographic -p "how an agent works"        # sapphireos (default)
generate_image.py -P abstract-title -p "lab" -S sapphireos-dark # dark facet
generate_image.py -P infographic -p "..." -S none               # opt out, plain
generate_image.py -p "a dashboard mockup" -S sapphireos         # brand any raw prompt
FlagEffect
-S sapphireosLight brand (white canvas, sapphire accent).
-S sapphireos-darkDark facet (charcoal canvas, bright sapphire).
-S noneOpt out — no brand styling.
(omitted)Slide presets → sapphireos; everything else → none.

Non-slide presets (illustration, hyperreal, avatar, icon) are not branded by default — add -S sapphireos to opt in. To change the default-on set, flip the "slide": True tag on a preset; to retune the look, edit the STYLES dict (built from the SapphireOS tokens). Default brand = DEFAULT_BRAND_STYLE constant.

Options

FlagDefaultNotes
-p/--prompt—Prompt (also positional).
-o/--out./nano-banana.pngOutput path.
-m/--modelflashAlias or raw model id.
-a/--aspect1:116:9 9:16 3:2 2:3 4:3 3:4 4:5 5:4 21:9 (+ 1:4 4:1 1:8 8:1 on flash).
-s/--size2K512(flash) 1K 2K 4K. Drop to 1K for drafts; 4K for print.
-i/--input—Input image(s) to edit/reference. Repeatable (up to ~14).
--profileGEMINI_API_KEYWhich key var to read (e.g. SLIDES_GEMINI_API_KEY).

Prompting cheat-sheet

Write a sentence or two, not tags. Hit these beats:

[subject] + [action/pose] + [setting] + [composition] + [style/lighting]

  • Name the medium up front: "a watercolour illustration of…", "a 3D clay render of…", "a flat vector icon of…", "a photorealistic photo of…".
  • Use positive framing: "an empty street" not "a street with no cars".
  • Add camera/light for realism: "low angle, shallow depth of field (f/1.8), golden-hour backlight".
  • Text in the image: put the exact words in quotes and name the font — the words "LAUNCH DAY" in a bold sans-serif. Use -m pro for anything text-heavy.
  • Editing: pass the image with -i and say what to keep — "keep the composition, change only the season to winter".
  • Consistency across images: pass a reference with -i and say "same character/style as the reference".

For the full guide with worked examples (product shots, posters, character consistency, style transfer), see PROMPTING.md in this folder.

Common mistakes

  • Keyword soup ("fox, book, cozy, 4k, trending") → weak results. Write a scene.
  • Negatives ("no text", "without people") → describe the positive instead.
  • Tiny text on flash → use -m pro for legible/long text.
  • -s 4K everywhere → slower + pricier; use 1K/2K unless it's for print.
  • Model NOT_FOUND → during rollout the id may need a -preview suffix; the script prints the hint. Try -m gemini-3.1-flash-image-preview.

Note

All output carries an invisible SynthID watermark + C2PA credentials (Google policy).

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.