gemini-nanobanana
Skill254 starsChanged 7 months agoMITView on GitHub
Use this skill when users ask to generate, edit, or compose images with Gemini Nano Banana 2, including text-to-image, image editing, multi-image composition, grounding, and output sizing/saving controls.
- Reads credentials
In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- best-practices-for-agent-skillsSkill
- githubclaw-json-generatorSkill
- pr-creatorSkill
- skill-creatorSkill
- agent-browserSkill
- felo-searchSkill
- felo-slidesSkill
- felo-superAgentSkill
- felo-web-fetchSkill
- felo-x-searchSkill
- find-skillsSkill
- gemini-audio-transcriberSkill
- gemini-deep-researcherSkill
- gemini-image-describerSkill
- gemini-lyria-3Skill
- gemini-summarySkill
- google-stitchSkill
- skill-creatorSkill
- telegram-notifySkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 1 is distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 7
Use a Node.js wrapper (@google/genai) as the primary flow (multi-turn edits, grounding, advanced generationConfig).
- Very specific: line 8
Use scripts/gemini-nanobanana-cli.js for quick single-turn generation/editing runs.
- Very specific: line 9
Do not teach raw curl; keep guidance in JS CLI/wrapper form.
- Very specific: line 13
Default model: gemini-3.1-flash-image-preview (allow env override via GEMINI_NANOBANANA_MODEL).
- Very specific: line 24
Start in references\image-generation-api.md for operational payload rules, model behavior, sizing, thinking, grounding, and limits.
- Very specific: line 25
Use references\sources.md to verify source provenance and jump to upstream docs.
- Distinctive: line 35
After successful generation, always report results in this format:
- Very specific: line 79
Default to Node.js wrapper flows for regular usage, especially when payload control is needed.
- Very specific: line 83
Add references via repeated -i/--image (up to 14).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Do this first
- Use a Node.js wrapper (
@google/genai) as the primary flow (multi-turn edits, grounding, advancedgenerationConfig). - Use
scripts/gemini-nanobanana-cli.jsfor quick single-turn generation/editing runs. - Do not teach raw
curl; keep guidance in JS CLI/wrapper form.
Enforce these defaults
- API key source:
GEMINI_NANOBANANA_API_KEYwith fallbackGEMINI_API_KEY. - Default model:
gemini-3.1-flash-image-preview(allow env override viaGEMINI_NANOBANANA_MODEL). - Reference images: support up to 14 total.
- Thinking strength: configurable (
minimal|low|medium|high), default High. - Aspect ratio: default Auto.
- Resolution: default 1K.
- Output mode: default Images only.
- Google Search grounding tool: default Disabled; enable with
--google-searchwhen needed. - Output directory: default
nanobanana-output/, unless the prompt explicitly asks for another location. - 512px rule: send
imageConfig.imageSizeas string"512"in API calls (never numeric512).
Read references intentionally
- Start in
references\image-generation-api.mdfor operational payload rules, model behavior, sizing, thinking, grounding, and limits. - Use
references\sources.mdto verify source provenance and jump to upstream docs. - For canonical API behavior, read:
Output formatting rules
After successful generation, always report results in this format:
✅ 圖片已產出- Each image as a markdown embed with absolute GitHub URL:
 - File metadata: format (
JPEG/PNG), dimensions, file size - Artifact metadata block (enables Telegram relay to send the actual photo):
<!-- githubclaw-artifacts: {"images":[{"branch":"{BRANCH}","path":"{relative_path}"}],"html":[]} -->
Example (single image)
Assuming GITHUB_REPO=test/baoclaw-5, BRANCH=issue-3:
✅ 圖片已產出

- 格式:JPEG · 1408×768 · 757 KB
<!-- githubclaw-artifacts: {"images":[{"branch":"issue-3","path":"issue-3/artifacts/4153431460/matcha-latte-01.jpg"}],"html":[]} -->Example (multiple images)
✅ 圖片已產出


- 圖 1:JPEG · 1408×768 · 703 KB
- 圖 2:JPEG · 1408×768 · 512 KB
<!-- githubclaw-artifacts: {"images":[{"branch":"issue-3","path":"issue-3/artifacts/4153431460/cute-puppy-01.jpg"},{"branch":"issue-3","path":"issue-3/artifacts/4153431460/cute-puppy-02.jpg"}],"html":[]} -->Why this format
- GitHub Issue comments require absolute URLs to render images inline (relative paths won't display).
- Telegram relay detects
githubclaw-artifactsmetadata → downloads image via GitHub API → sends as photo. ?raw=trueensures GitHub serves raw image bytes instead of the HTML file viewer.
Execution pattern
- Default to Node.js wrapper flows for regular usage, especially when payload control is needed.
- Quick path (agent runs from
issue-N/; resolve the repo root first):REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || echo "../..")thennode "$REPO_ROOT/.agents/skills/gemini-nanobanana/scripts/gemini-nanobanana-cli.js" --prompt "..."- Add references via repeated
-i/--image(up to 14). - Enable grounding via
--google-searchwhen prompt needs fresh web context.
- The API key (
GEMINI_NANOBANANA_API_KEY/GEMINI_API_KEY) is injected by the workflow environment; do not hardcode it. The CLI reads it automatically from the environment.
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
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.

