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

generate-image

Skill0 starsChanged 9 months agoMITView on GitHub

Generate or edit images using Google's Gemini API. Use this skill when the user asks to create, generate, draw, or make an image, picture, illustration, photo, graphic, icon, logo, or visual. Also use when the user asks to edit, modify, change, or transform an existing image. Supports aspect ratios, sizes up to 4K, and image editing with an input image.

  • Reads credentials
  • Installs packages

44 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

7 rules. 0 are common, 1 is distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 36 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When the user asks you to generate or edit an image:

    line 53
  2. Very specific:

    If the user references an existing image file, use --input with that file path.

    line 58
  3. Very specific:

    If they say "edit", "modify", "change", "update", "fix", or "transform" an image, use --input.

    line 59
  4. Very specific:

    Default to 2K for most requests.

    line 71
  5. Very specific:

    Use 4K if they ask for high-res, print-quality, or detailed output.

    line 72
  6. Very specific:

    Use 1K for quick drafts, icons, or thumbnails.

    line 73
  7. Very specific:

    If they specify a filename or location, use --output.

    line 76

“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 & Editing with Gemini

Generate or edit images by running the bundled Python script. The script uses only Python stdlib (no pip install needed). It requires the GEMINI_API_KEY environment variable.

Usage

python3 ~/.claude/skills/generate-image/scripts/generate_image.py "PROMPT" [OPTIONS]

Options

FlagDescriptionDefault
--ratio RATIOAspect ratio: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:91:1
--size SIZEResolution: 1K, 2K, 4K (4K only with default model)2K
--output PATHOutput file path (auto-adds .png if needed)Auto-generated timestamped name in cwd
--input PATHInput image for editing modeNone (text-to-image)
--fastUse gemini-2.5-flash-image (faster, cheaper, max 2K)Off (uses gemini-3-pro-image-preview)
--no-openDo not open the image after generationOff (opens by default)

Examples

Basic generation:

python3 ~/.claude/skills/generate-image/scripts/generate_image.py "a watercolor painting of a mountain lake at sunset"

With options:

python3 ~/.claude/skills/generate-image/scripts/generate_image.py "product photo of a coffee mug" --ratio 4:3 --size 4K --output mug.png

Fast model:

python3 ~/.claude/skills/generate-image/scripts/generate_image.py "simple icon of a house" --fast --ratio 1:1 --size 1K

Image editing:

python3 ~/.claude/skills/generate-image/scripts/generate_image.py "remove the background and replace with a beach scene" --input photo.png

Interpreting user requests

When the user asks you to generate or edit an image:

  1. Extract the prompt from their request. Use their description as-is when it's detailed. Enhance vague requests with reasonable artistic details.
  2. Detect generate vs edit mode:
    • If the user references an existing image file, use --input with that file path.
    • If they say "edit", "modify", "change", "update", "fix", or "transform" an image, use --input.
    • Otherwise, it's a text-to-image generation.
  3. Choose aspect ratio based on context:
    • Portrait/vertical/phone/story: 9:16
    • Landscape/wide/desktop/banner: 16:9
    • Ultra-wide/cinematic: 21:9
    • Square/social media/icon/avatar: 1:1
    • Standard photo: 4:3 or 3:2
    • Tall/poster/pin: 2:3 or 3:4
  4. Choose size:
    • Default to 2K for most requests.
    • Use 4K if they ask for high-res, print-quality, or detailed output.
    • Use 1K for quick drafts, icons, or thumbnails.
  5. Choose output path:
    • If they specify a filename or location, use --output.
    • Otherwise let it auto-generate a timestamped filename in the current directory.
  6. Run the script and report the output path and file size to the user.
  7. If the script fails, read the error output and explain the issue clearly. Common fixes:
    • Missing API key: tell them to set GEMINI_API_KEY
    • Safety filter: suggest rephrasing the prompt
    • Rate limit: suggest waiting or using --fast

Environment setup

The GEMINI_API_KEY environment variable must be set. If missing, the script exits with setup instructions.

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.