generate-images
Generate and edit images using Nano Banana (Google Gemini image generation). Use whenever Claude Code needs to create new images, edit existing images, generate icons, diagrams, mockups, or any visual content.
What this skill does
<essential_principles> This skill generates images using the Nano Banana model via `~/.claude/scripts/generate_image.py`. **Always use this skill when the user asks to:** - Generate, create, or make an image - Create icons, logos, banners, or visual assets - Edit, modify, or transform an existing image - Generate mockups, diagrams, or illustrations - Create any visual content **Prerequisites:** - `GEMINI_API_KEY` must be set in `~/.claude/settings.json` under `env` - Script: `~/.claude/scripts/generate_image.py` (runs via `uv run`) **Reference images:** Users can store named images in `~/.claude/images/` for use as editing sources. Filenames describe the content (e.g., `myself.jpg`, `company-logo.png`, `office.jpg`). </essential_principles> <process> <step name="1_check_api_key"> Before generating, verify the API key is available: ```bash uv run ~/.claude/scripts/generate_image.py --check-key ``` If `API_KEY_MISSING`: inform the user they need to set `GEMINI_API_KEY` in `~/.claude/settings.json` or get one at https://aistudio.google.com/apikey </step> <step name="2_match_reference_images"> Check if the user's request refers to a known reference image. **List available reference images:** ```bash ls ~/.claude/images/ 2>/dev/null ``` **Matching rules:** - Match user mentions to filenames (without extension). Examples: - "add a hat to **myself**" → look for `myself.jpg`, `myself.png`, etc. - "put **my dog** in a park" → look for `my-dog.jpg`, `dog.jpg`, etc. - "update the **company logo**" → look for `company-logo.png`, `logo.png`, etc. - Match is case-insensitive, try with and without hyphens/underscores - If a match is found, use `--edit` mode with the matched file as source - If no match and the user clearly references a personal image, ask them to place it in `~/.claude/images/` **Also check the current project** for relevant images if the user references project assets: - Look in `assets/`, `images/`, `public/`, `static/`, or project root </step> <step name="3_determine_output_path"> Choose an appropriate output path based on context: - If user specifies a path, use it - If editing a reference image, save to the current project (not back to `~/.claude/images/`) - If inside a project, use a sensible location (e.g., `assets/`, `images/`, `public/`, or project root) - Default filename: descriptive kebab-case with `.png` extension (e.g., `hero-banner.png`, `app-icon.png`) </step> <step name="4_craft_prompt"> Write an effective image prompt. Good prompts include: - **Subject**: What to generate (e.g., "a minimalist logo of a rocket") - **Style**: Visual style (e.g., "flat design", "photorealistic", "watercolor", "pixel art") - **Details**: Specific attributes (colors, lighting, composition, mood) - **Quality**: Resolution hints (e.g., "high detail", "4K quality", "professional") Example prompt structure: `[Subject], [style], [details], [quality]` </step> <step name="5_generate"> Run the generation script: **Text-to-image (new image):** ```bash uv run ~/.claude/scripts/generate_image.py "prompt here" --output path/to/output.png ``` **Image editing with reference image:** ```bash uv run ~/.claude/scripts/generate_image.py "editing instructions" --edit ~/.claude/images/myself.jpg --output path/to/output.png ``` **Image editing with project image:** ```bash uv run ~/.claude/scripts/generate_image.py "editing instructions" --edit path/to/source.png --output path/to/output.png ``` **Options:** - `--output PATH` - Output file path (default: `generated_image.png`) - `--edit IMAGE` - Source image for editing mode - `--json` - Output metadata as JSON </step> <step name="6_verify"> After generation: 1. Read the output image using the Read tool to verify it was created and looks correct 2. Report the file path and size to the user 3. If the result doesn't match expectations, refine the prompt and regenerate </step> </process> <prompt_examples> **Icon/Logo:** "A minimalist app icon for a task management tool, flat design, blue and white color scheme, clean geometric shapes, centered composition, professional quality" **Banner/Hero:** "Wide panoramic banner for a tech blog, abstract gradient background in purple and teal, modern typography space on the left, subtle geometric patterns, professional web design" **Edit with reference image:** User says: "add a clown hat to myself" → Match `myself.jpg` in `~/.claude/images/` → Run: `uv run ~/.claude/scripts/generate_image.py "Add a colorful clown hat to the person in this photo" --edit ~/.claude/images/myself.jpg --output clown-hat-myself.png` **Edit with reference image:** User says: "put my dog on a beach" → Match `dog.jpg` or `my-dog.jpg` in `~/.claude/images/` → Run: `uv run ~/.claude/scripts/generate_image.py "Place the dog on a tropical beach with waves and sunset" --edit ~/.claude/images/dog.jpg --output dog-on-beach.png` </prompt_examples> <success_criteria> Image generation is complete when: - API key check passes - Reference images matched when applicable - Image is saved to the specified output path - Output image has been visually verified via Read tool - User is informed of the file location </success_criteria>
Related in Image & Video
watch
IncludedWatch a video (URL or local path). Downloads with yt-dlp, extracts auto-scaled frames with ffmpeg, pulls the transcript from captions (or Whisper API fallback), and hands the result to Claude so it can answer questions about what's in the video.
physical-ai-defect-image-generation
IncludedUse when the user wants to orchestrate defect image generation, run associated setup, or handle outputs on OSMO. The Day 0 path handles cold-start with USD-to-ROI, image-edit augmentation, and AnomalyGen to create initial PCBA datasets. The Day 1 path performs inference and labeling on real images. This skill helps with first-time asset setup, creation of finetuning checkpoints, and configuring deployment. Trigger keywords: defect image generation, dig workflow, dig pipeline, defect image detection workflow, aoi pipeline, aoi anomalygen, usd2roi anomalygen, day 0 pcba, day 1 pcba, day 1 real-photo alignment, day 1 manual roi, metal surface anomaly, glass defect, anomalygen finetune, setup_pcb, setup_metal, setup_glass, setup_pretrained, dig setup, dig datasets, dig pretrained checkpoint, dig image-edit endpoint.
accelint-react-best-practices
IncludedReact performance optimization and best practices. ALWAYS use this skill when working with any React code - writing components, hooks, JSX; refactoring; optimizing re-renders, memoization, state management; reviewing for performance; fixing hydration mismatches; debugging infinite re-renders, stale closures, input focus loss, animations restarting; preventing remounting; implementing transitions, lazy initialization, effect dependencies. Even simple React tasks benefit from these patterns. Covers React 19+ (useEffectEvent, Activity, ref props). Triggers - useEffect, useState, useMemo, useCallback, memo, inline components, nested components, components inside components, re-render, performance, hydration, SSR, Next.js, useDeferredValue, combined hooks.
elevenlabs-agents
IncludedBuild conversational AI voice agents with ElevenLabs Platform using React, JavaScript, React Native, or Swift SDKs. Configure agents, tools (client/server/MCP), RAG knowledge bases, multi-voice, and Scribe real-time STT. Use when: building voice chat interfaces, implementing AI phone agents with Twilio, configuring agent workflows or tools, adding RAG knowledge bases, testing with CLI "agents as code", or troubleshooting deprecated @11labs packages, Android audio cutoff, CSP violations, dynamic variables, or WebRTC config. Keywords: ElevenLabs Agents, ElevenLabs voice agents, AI voice agents, conversational AI, @elevenlabs/react, @elevenlabs/client, @elevenlabs/react-native, @elevenlabs/elevenlabs-js, @elevenlabs/agents-cli, elevenlabs SDK, voice AI, TTS, text-to-speech, ASR, speech recognition, turn-taking model, WebRTC voice, WebSocket voice, ElevenLabs conversation, agent system prompt, agent tools, agent knowledge base, RAG voice agents, multi-voice agents, pronunciation dictionary, voice speed control, elevenlabs scribe, @11labs deprecated, Android audio cutoff, CSP violation elevenlabs, dynamic variables elevenlabs, case-sensitive tool names, webhook authentication
humanizer
IncludedHumanize AI-generated text by detecting and removing patterns typical of LLM output. Rewrites text to sound natural, specific, and human. Uses 28 pattern detectors, 560+ AI vocabulary terms across 3 tiers, and statistical analysis (burstiness, type-token ratio, readability) for comprehensive detection. Use when asked to humanize text, de-AI writing, make content sound more natural/human, review writing for AI patterns, score text for AI detection, or improve AI-generated drafts. Covers content, language, style, communication, and filler categories.
generating-mermaid-diagrams
IncludedSalesforce architecture diagrams using Mermaid with ASCII fallback. Use this skill when generating text-based diagrams for Salesforce architecture, OAuth flows, ERDs, integration sequences, or Agentforce structure. TRIGGER when: user says "diagram", "visualize", "ERD", or asks for sequence diagrams, flowcharts, class diagrams, or architecture visualizations in Mermaid. DO NOT TRIGGER when: user wants PNG/SVG image output (use generating-visual-diagrams), or asks about non-Salesforce systems.