gemini-image
Generate images via Google Gemini AI (gemini-3.1-flash-image-preview or pro). Supports model selection, aspect ratios, resolutions (1K/2K/512), batch generation, image editing. Triggers: image, picture, photo, graphic, illustration, banner, logo, icon, thumbnail, header, hero image. Use when user wants AI-generated visual output.
What this skill does
# Gemini Image Generation
You detected an image generation request. Confirm intent before proceeding.
**Say:** "It sounds like you want to generate an image. I can do that using the Gemini API. Let me walk you through the options."
If the user confirms, proceed. If not, stop.
**Tip:** You can also use `/gemini-image <description>` to generate images directly.
## 1. Check Prerequisites
```bash
echo "GEMINI_API_KEY set: $([ -n "$GEMINI_API_KEY" ] && echo 'yes' || echo 'no')"
which python3
```
If `GEMINI_API_KEY` is not set:
> `GEMINI_API_KEY` is not set. Get one free at https://aistudio.google.com/apikey
> Then export it: `export GEMINI_API_KEY="your-key-here"`
Stop and wait for the user to set the key. If `python3` is missing, inform the user Python 3 is required.
> **Note:** The Gemini CLI's Nano Banana extension was investigated as an alternative generation path, but it has a known MCP tool registration bug (Gemini CLI v0.34.0 / Nano Banana v1.0.12). The REST API is the only reliable path right now.
## 2. Gather Image Details
Extract the image description from the user's request and confirm it. Then collect (ask the user or infer from context):
- **Model** — `gemini-3.1-flash-image-preview` (default, fastest) or `gemini-2.5-flash-image` (more reliable for `imageConfig`)
- **Aspect ratio** — infer from "banner"/"avatar"/"vertical"/etc., default `1:1`
- **Resolution** — `1K` default; `2K`, `4K`, or `512` available
- **Service tier** — `standard` default; `flex` (~50% cheaper, may queue) or `priority` (~80% more, fastest)
- **Reference image** — optional path to an existing file
- **Output path** — auto-generate a descriptive filename in CWD if not given
For full option matrices, model trade-offs, the aspect-ratio inference table, and tier pricing details — Read `reference.md`.
Export the gathered values as environment variables. **Always single-quote** user-provided values to prevent shell injection (quotes, backticks, `$`):
```bash
export GEMINI_PROMPT='<user image description, single-quote wrapped>'
export GEMINI_MODEL='<selected model, e.g. gemini-3.1-flash-image-preview>'
export GEMINI_ASPECT_RATIO='<selected ratio, e.g. 1:1>'
export GEMINI_IMAGE_SIZE='<selected resolution, e.g. 1K>'
export GEMINI_REF_IMAGE='<reference image path, or empty>'
export GEMINI_OUTPUT_PATH='<output file path>'
export GEMINI_SERVICE_TIER='<FLEX, PRIORITY, or empty for standard>'
```
## 3. Build Request JSON
Read `request-builder.md` and run the **build block**. It writes the request to `/tmp/gemini-image-request-<pid>.json` and prints the path. Capture as `REQUEST_FILE`.
## 4. API Call
```bash
RESPONSE_FILE="/tmp/gemini-image-response-$$.json"
HTTP_STATUS=$(curl -s -o "$RESPONSE_FILE" -w "%{http_code}" -X POST \
"https://generativelanguage.googleapis.com/v1beta/models/${GEMINI_MODEL}:generateContent?key=$GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-d @"${REQUEST_FILE}")
export GEMINI_RESPONSE_FILE="$RESPONSE_FILE"
echo "HTTP status: $HTTP_STATUS"
```
If `HTTP_STATUS` is 429, wait 30s and retry once. If 400/403, see `troubleshooting.md`. Only proceed if 200.
## 5. Extract and Save Image
Read `request-builder.md` and run the **parse block**. It handles base64 decoding, JPEG→PNG conversion when needed, and writes to `GEMINI_OUTPUT_PATH`.
## 6. Save Prompt File
```bash
PROMPT_FILE="${GEMINI_OUTPUT_PATH%.*}_prompt.txt"
cat > "$PROMPT_FILE" << EOF
Prompt: ${GEMINI_PROMPT}
Model: ${GEMINI_MODEL}
Aspect Ratio: ${GEMINI_ASPECT_RATIO}
Resolution: ${GEMINI_IMAGE_SIZE}
Service Tier: ${GEMINI_SERVICE_TIER:-standard}
Reference Image: ${GEMINI_REF_IMAGE:-none}
Date: $(date -u +"%Y-%m-%dT%H:%M:%SZ")
EOF
```
## 7. Cleanup and Report
```bash
rm -f "${REQUEST_FILE}" "${RESPONSE_FILE}"
```
Report:
- Image saved to: `{output_path}`
- Prompt saved to: `{prompt_file}`
- File size and any model notes from text parts
Ask: "Would you like to regenerate with different settings, adjust the prompt, or generate another image?"
## Error Handling
For HTTP errors, missing image data, JPEG-vs-PNG handling, lowercase `imageSize`, and invalid service-tier values — Read `troubleshooting.md`.
## Further Reading
- `reference.md` — model comparison, aspect-ratio inference, resolution/tier matrices
- `request-builder.md` — the Python build and parse blocks for steps 3 and 5
- `troubleshooting.md` — error triage and JPEG→PNG conversion paths
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.