원클릭으로
nano-banana
// Generate or edit images with Google's Nano Banana 2 (`gemini-3.1-flash-image-preview`). Use when the user asks to generate an image, edit an image, or create a picture. Supports 512 / 1K / 2K / 4K resolutions.
// Generate or edit images with Google's Nano Banana 2 (`gemini-3.1-flash-image-preview`). Use when the user asks to generate an image, edit an image, or create a picture. Supports 512 / 1K / 2K / 4K resolutions.
Use BEFORE any spec, plan, or code exists — the Stage 0 gate that decides whether a project should start at all. NO-GO is the default. GO requires passing five framework checks (Differentiation · Audience–Market Fit · Acquisition Channel · Capacity · 7-Factor Wedge), a memory check against your own prior attempts, and a 24-hour pattern-interrupt if enthusiasm-high is detected. Output is a public commitment artifact with pre-mortemed kill criteria (D14/D30/D60/D90 review gates). Triggered by "/go-no-go [project]", any "I want to build / start / take on X" intent, or before opening any new repo or signing any new contract. Pairs with spec-driven-dev (this is Stage 0, that is Stage 1).
Use BEFORE invoking the Task or Agent tool to spawn a subagent. Anthropic does NOT share prefix cache across subagents — every subagent cold-starts and re-tokenizes its full prompt (system prompt + tool definitions + the context you handed it). Spawning N subagents with full context = N× token cost; a single fan-out can burn an entire Max-plan day. This skill enforces a pre-flight discipline: compress every subagent prompt into a ≤200-word brief before spawning. Triggers when the agent is about to call Task / Agent tool, especially with long files, full repo dumps, or N parallel subagents on similar work.
Use when an agent will work for hours or days across many files and multiple vertical slices. Drives a three-level Project → Sprint → Task hierarchy with isolated per-task execution, a review round-loop, context packs for subagent reviewers, governance-as-code, and orchestrator-readable state. Designed for long-running drivers like /loop, autoresearch:ship, and goal-driven.
Use when you have N≥3 raw research artifacts (notes, podcast summaries, deep-research dumps, daily intel, paper analyses) on one topic and want to lift them into a single structured pack with cross-source claims and provenance — instead of one-shot summarization that loses 90% of intermediate evidence. Treats the N sources as an environment a lite aggregator agent navigates with `inspect` / `search` / `synthesize` tools, rather than concatenating into one prompt.
Use when debugging any non-trivial bug — wrong output, crash, flaky test, performance regression, or "it works locally but not in CI." Forces a scientific-method loop (Observe → Hypothesize → Experiment → Conclude) so the agent stops guessing and starts reasoning. Prevents the
Use when starting any non-trivial feature, refactor, or new project that will touch more than one file. Drives an AI coding agent through a gated Spec → Plan → Build → Test → Review → Ship lifecycle so work is specified before it is built, verified before it is reviewed, and reviewed before it ships.
| name | nano-banana |
| description | Generate or edit images with Google's Nano Banana 2 (`gemini-3.1-flash-image-preview`). Use when the user asks to generate an image, edit an image, or create a picture. Supports 512 / 1K / 2K / 4K resolutions. |
Text-to-image and image edit via Google's Nano Banana 2 model, aka gemini-3.1-flash-image-preview. Fast, cheap, high-quality. Returns PNG.
Get a Gemini API key: https://aistudio.google.com/app/apikey
Export it:
export GEMINI_API_KEY="YOUR_KEY_HERE"
# or
export GOOGLE_API_KEY="YOUR_KEY_HERE"
Install uv if missing:
command -v uv || curl -LsSf https://astral.sh/uv/install.sh | sh
First run auto-installs google-genai and pillow via uv's inline script deps.
uv run ~/.claude/skills/lich-skills/skills/nano-banana/scripts/generate_image.py \
--prompt "A cinematic rainy Tokyo alley, neon reflections, 35mm, low angle" \
--filename "tokyo-alley.png" \
--resolution 1K
Output is saved to tokyo-alley.png in the current directory unless the filename is absolute.
Pass an input image with --input-image. The model sees the image + your instruction.
uv run .../generate_image.py \
--prompt "Remove the crowd behind the subject. Keep framing and grading unchanged." \
--filename "cleaned.png" \
--input-image "./portrait.png" \
--resolution 2K
When editing, the script auto-matches output resolution to the input's dimensions unless you explicitly pass --resolution.
| Flag | Default | Purpose |
|---|---|---|
--prompt, -p | required | Image description or edit instruction |
--filename, -f | required | Output path (PNG) |
--input-image, -i | — | Source image for editing |
--resolution, -r | 1K | One of 512, 1K, 2K, 4K |
--api-key, -k | env | Overrides GEMINI_API_KEY / GOOGLE_API_KEY |
--model, -m | gemini-3.1-flash-image-preview | Rarely needed |
Map loose user language to a resolution flag:
| User says | Use |
|---|---|
| (nothing) | 1K |
| "small", "thumbnail", "quick draft" | 512 |
| "normal", "medium" | 1K |
| "high quality", "large" | 2K |
| "4k", "print", "wallpaper" | 4K |
Subject: <subject>.
Style: <photo | illustration | 3D | painting | pixel art | ...>.
Composition: <shot type, angle>.
Lighting: <lighting description>.
Background: <background>.
Avoid: <what should NOT be in the image>.
Change only: <the specific edit>.
Keep subject, framing, lighting, palette, text, and overall style unchanged.
Being explicit about what to keep is the difference between a clean edit and a total re-render.
--api-key → GEMINI_API_KEY → GOOGLE_API_KEYcommand -v uv
test -n "$GEMINI_API_KEY" || test -n "$GOOGLE_API_KEY"
# If editing:
test -f ./input.png
| Error | Fix |
|---|---|
Error: No API key provided. | Export GEMINI_API_KEY or pass --api-key |
Error loading input image: | Bad path or unreadable file |
Error: No image was generated in the response. | Prompt too vague or unsafe — rewrite |
403 / quota | Wrong key, region-locked, or over quota |
$GEMINI_API_KEY or $GOOGLE_API_KEY set in env, not in filesgitleaks detect --source . clean