agentleFS
uprinteruprinter/ai-agents-team/.claude/skills/image-gen/SKILL.md

image-gen

Skill1 starsChanged 23 days agoMITView on GitHub

Generate raster images (PNG/JPEG/WebP) from a text prompt via Google's Gemini image model ("Nano Banana") through a direct API call — no browser automation, no screenshot-cropping. Use whenever a task calls for an actual image to be generated — an illustration, icon, mascot, banner, product photo mockup, texture, or any other raster artwork — not just when Gemini is named explicitly. Requires GEMINI_API_KEY set in the user's shell environment.

  • Reads credentials
  • Installs packages

49 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, 3 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 36 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the key is missing or empty, the script fails loudly with a clear message rather than silently doing nothing.

    line 34
  2. Distinctive:

    Every invocation costs real money (per-image, not a fixed monthly fee) — there is no free-tier ceiling backstopping careless use.

    line 40
  3. Distinctive:

    Use this for actual raster image generation of any kind.

    line 100
  4. Very specific:

    Don't use this for logo/wordmark typography-only work, UI mockups, or landing page layout — those are better served by the design skill or …

    line 101
  5. Very specific:

    If the target output must be a true vector (editable SVG paths), this script won't give you that — it returns raster images.

    line 104

“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

Bundles a small, zero-dependency Node script that calls the Gemini Developer API's image model directly over REST and writes clean image files to disk — a general raster-image-generation utility, not scoped to any particular project, brand, or subject matter. A direct API call avoids the failure modes of driving an AI image tool's web UI through browser automation (screenshot-cropping the result bakes in cursor icons, UI chrome, and wrong backgrounds).

This is a plain general-purpose tool — the script takes a prompt and optional reference images as arguments and returns image files. Any project needing an image generated uses the same tool rather than reinventing it or copying it into a project repo.

Prerequisite: GEMINI_API_KEY

The script reads this from the environment, not from any file. On macOS keep it in the Keychain with envchain (brew install envchain), never in a shell profile:

printf '%s\n' "$KEY" | envchain --set agents GEMINI_API_KEY   # once, key from your clipboard or a prompt
envchain agents node generate-ai.mjs --prompt "..." --out-dir <dir>

Elsewhere, any way that puts GEMINI_API_KEY in the process environment works. This is a personal credential — it must never live inside a project repo, committed or not. Get a key from Google AI Studio if you don't have one.

If the key is missing or empty, the script fails loudly with a clear message rather than silently doing nothing. It never prints, logs, or writes the key value anywhere.

Use it responsibly — this is billed per call, not a flat subscription

Every invocation costs real money (per-image, not a fixed monthly fee) — there is no free-tier ceiling backstopping careless use. Don't generate more candidates than the task actually needs "just in case," don't loop retries blindly on a bad prompt without first fixing the prompt, and don't regenerate something that already exists and is still good. Default to the minimum count that lets a human make a real decision (often 1, rarely more than 2-3), and iterate the prompt/reference images between calls rather than brute-forcing many candidates per attempt.

How to run it

node ./scripts/generate-ai.mjs \
  --prompt "<detailed description of the desired image>" \
  --out-dir <directory to write results into> \
  [--ref <path-to-reference-image>]... \
  [--count 3] \
  [--name candidate] \
  [--model <model id>] \
  [--background <colour>] \
  [--meta]
  • --prompt — required. Be specific and exhaustive: subject, composition, exact details required, palette, background, and anything that must not appear (the model does not infer omissions correctly by default).
  • --ref — repeatable. Pass one or more existing images (PNG/JPG/WebP) as visual reference input to keep a new generation visually consistent with something already approved (same subject, same style, a specific pose/angle) rather than getting a fresh, unrelated result each time.
  • --out-dir — required. Files are written here as plain PNG/JPEG/WebP; nothing is committed to git by this script — that decision belongs to whoever calls it.
  • --count — how many independent candidates to generate (the model returns one image per call, so this loops the request rather than trusting a batch parameter).
  • --background — adds the instruction for one flat solid background colour, edge to edge. Use it when the image goes on to tracing or cut-out: a flat background keeps the subject separable by colour.
  • --meta — writes <file>.json beside each image: the final prompt, model, response metadata (finishReason, usage), the sha256 of the image and of each reference, and the time. Keep it with the image; the record is how the image is reproduced or audited.
  • --model — default is DEFAULT_MODEL in scripts/generate-ai.mjs, the one place the id lives. Check the current ids at https://ai.google.dev/gemini-api/docs/models and the dated deprecations at https://ai.google.dev/gemini-api/docs/changelog before assuming the default is still right; change DEFAULT_MODEL there.
  • finishReason: IMAGE_RECITATION — the model refused this prompt, not the model id or the key. A bare prompt ("a red circle") triggers it; rephrase with subject, style and palette. Run smoke tests with a descriptive prompt.

An accepted image is the source

Once a person accepts an image, it is the source file. Change it with a new call that passes it as --ref and says "change only X, keep everything else", never by rewriting the original prompt and generating again: a new generation gives a different image. Record the accepted file's sha256 (--meta does) before the first edit.

When to reach for this vs. something else

  • Use this for actual raster image generation of any kind.
  • Don't use this for logo/wordmark typography-only work, UI mockups, or landing page layout — those are better served by the design skill or the frontend-design/hallmark skills.
  • If the target output must be a true vector (editable SVG paths), this script won't give you that — it returns raster images. Diagrams and infographics come from the vector-gen skill; accept raster and vectorize afterward only if actually needed. A logo or symbol from a raster idea goes through the mark form of vector-gen (references/logo-craft.md): trace, reduce to flat colours, set the lettering from a font in code.

Known limitation to flag to the user

Gemini's own image model does not currently support Vertex AI or gcloud-based auth as a lower-friction alternative in every environment — this script only supports the Gemini Developer API key path. If the user already has GCP/Vertex AI set up and prefers that auth path, that would need to be added as a second mode rather than assumed to already work here.

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.