skills/nanobanana/SKILL.md
Generate and edit images using Nano Banana (Gemini image generation). Use when users want to create images, generate visuals, edit photos, design mockups, produce thumbnails, create logos, make hero images, or integrate Nano Banana into their codebase.
npx skillsauth add mgiovani/cc-arsenal nanobananaInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate and edit images using Google's Nano Banana (Gemini image generation API). This skill handles direct image generation, iterative editing, and expert guidance for integrating the API into codebases.
Core differentiator: A prompt enhancement system that analyzes user intent and project context to craft optimized prompts before calling the API.
Before anything else, verify the environment is ready.
1. Check API key:
echo "${GEMINI_API_KEY:0:10}..." # Show first 10 chars only (security)
If GEMINI_API_KEY is empty or unset:
references/integration-guide.md (the setup section)2. Check uv is available:
uv --version 2>&1
If uv is not installed, direct the user to https://docs.astral.sh/uv/getting-started/installation/ and stop. uv handles dependency installation automatically via PEP 723 inline metadata — no manual pip install needed.
Expert Integration Mode — if the user wants to integrate Nano Banana into their codebase (e.g., "how do I add image generation to my app", "show me the API", "I'm building a feature that generates images"):
references/integration-guide.mdGeneration Mode — if the user wants an image generated now:
If invoked within a project directory, gather context to improve prompts:
# Identify project type
ls package.json pyproject.toml README.md 2>/dev/null | head -5
# Find project description
head -20 README.md 2>/dev/null || head -20 pyproject.toml 2>/dev/null
# Find existing images (identify style conventions)
find . -name "*.png" -o -name "*.jpg" -o -name "*.svg" 2>/dev/null | grep -v node_modules | head -10
# Find color schemes (Tailwind, CSS variables, theme files)
grep -r "primary\|brand\|#[0-9a-fA-F]\{6\}" --include="*.css" --include="*.ts" --include="*.json" -l 2>/dev/null | head -5
Use this context to make the generated image fit the project's visual language.
Choose the most fitting category:
photorealistic — scenes, portraits, product photos, landscapesstylized — illustrations, art, cartoon, concept arttext-heavy — posters, banners, infographics with textproduct-marketing — commercial product shotsui-mockup — app screens, website designs, wireframesdiagram — technical illustrations, flowcharts, architectureminimalist — abstract, logos, icon conceptsOnly ask for information the conversation did not already provide. If the user said "a minimalist logo for my SaaS app", you already know: subject (logo), style (minimalist), purpose (SaaS branding). Don't ask for things you already know.
Read the relevant section from references/prompt-engineering.md based on the request category.
Apply category-specific enhancements:
| Category | Add to Prompt |
|---|---|
| photorealistic | Camera angle, lens type, lighting setup, depth of field, atmosphere |
| stylized | Art style, quality level, shading approach, color palette reference |
| text-heavy | Exact text in quotes, font style, weight, color, placement |
| product-marketing | Studio lighting setup, surface material, background type |
| ui-mockup | Device frame, design language, project colors if known |
| diagram | Diagram type, color coding scheme, label style, clean lines |
| minimalist | Background color (exact), element positioning, size proportions |
Incorporate any project context found in Phase 1 (brand colors, design system, domain).
ALWAYS show this before generating. Never skip this step.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PROMPT REVIEW
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ORIGINAL: [user's original prompt]
ENHANCED: [improved prompt with additions]
CHANGES:
+ [what was added]
+ [why it was added]
MODEL: [Selected model name]
ASPECT: [e.g., 16:9]
RESOLUTION: [e.g., 2K]
EST. COST: ~$[estimate]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Proceed with enhanced prompt? (yes / modify / use original)
If the user wants modifications, update the enhanced prompt and show the review block again before proceeding.
Default: Nano Banana 2 (gemini-3.1-flash-image-preview) at 2K resolution.
See references/model-guide.md for full details. Quick reference:
| Use Case | Model | Resolution |
|---|---|---|
| Quick drafts / iteration | gemini-2.5-flash-image | 512 or 1K |
| Most production assets (DEFAULT) | gemini-3.1-flash-image-preview | 2K |
| Text-heavy images | gemini-3-pro-image-preview | 2K–4K |
| Print / high-DPI | gemini-3-pro-image-preview | 4K |
Aspect ratio defaults by use case:
16:91:19:162:34:3Always present the model and resolution choice to the user as part of the Phase 2 review block and allow them to override.
Determine the output path (default to ./generated-image.png if not specified, or a contextually appropriate name like ./hero-image.png or ./logo-concept.png).
uv run "$(dirname "$0")/scripts/generate.py" \
--prompt "ENHANCED_PROMPT_HERE" \
--model "MODEL_ID_HERE" \
--aspect-ratio "ASPECT_RATIO_HERE" \
--resolution "RESOLUTION_HERE" \
--output "OUTPUT_PATH_HERE"
uv run "$(dirname "$0")/scripts/generate.py" \
--prompt "EDIT_INSTRUCTION_HERE" \
--input-image "INPUT_IMAGE_PATH_HERE" \
--model "MODEL_ID_HERE" \
--aspect-ratio "ASPECT_RATIO_HERE" \
--resolution "RESOLUTION_HERE" \
--output "OUTPUT_PATH_HERE"
The script outputs a JSON object. Parse and handle each case:
Success:
{"status": "success", "output_path": "/abs/path/image.png", "model_used": "...", "text_response": "...", "size_bytes": 245760}
→ Report the file path. Use Read on image files if the platform supports inline display.
Error cases:
| error_code | Meaning | Action |
|---|---|---|
| CONTENT_POLICY | Prompt blocked by safety filters | Suggest rephrasing; remove sensitive elements |
| RATE_LIMIT | API quota exceeded | Wait before retrying; suggest lower-cost model |
| AUTH_ERROR | Invalid or missing API key | Direct user to references/integration-guide.md setup section |
| NO_IMAGE_GENERATED | Model returned no image | Try rephrasing prompt; try different model |
| DEPENDENCY_ERROR | google-genai not installed | Ensure uv is available; uv run handles deps automatically via PEP 723 metadata |
| FILE_NOT_FOUND | Input image path invalid | Verify the path and re-run |
After a successful generation, offer iteration options based on user feedback:
Minor tweaks (color, brightness, small compositional changes):
→ Use image editing mode — pass the previous output as --input-image
Major changes (completely different subject, style change): → Modify the enhanced prompt and regenerate from scratch
Rapid exploration (testing multiple concepts):
→ Use gemini-2.5-flash-image at 512 resolution for all iterations
→ Identify the winning concept, then regenerate with gemini-3.1-flash-image-preview at 2K
For iterative editing sessions, keep track of the prompt evolution so the user can revert to a previous version if needed.
When the user wants to add image generation to their codebase:
references/integration-guide.mdreferences/prompt-engineering.md — Photography terms, style guides, sparse→rich examples by categoryreferences/model-guide.md — Model comparison, pricing, rate limits, resolution optionsreferences/integration-guide.md — SDK examples (Python/JS/REST), setup, production best practicesscripts/generate.py — Core API caller with retry logic and JSON outputscripts/requirements.txt — google-genai>=1.0.0development
Generate comprehensive test suites with coverage analysis and parallel test writing. Automatically activates when users want to write tests, add test coverage, generate test cases, improve testing, or analyze coverage gaps. Supports pytest, vitest, jest, and all major test frameworks.
development
Multi-agent PR review team orchestration with 7 specialized reviewers for security-sensitive or architectural PRs. Spawns architecture, security, performance, testing, style, docs/UX, and adversary reviewers as a coordinated team. Premium review for critical code changes.
development
Spec-driven team orchestration: adaptive development team scaling from 3 to 11 agents based on complexity.
development
Perform comprehensive security review targeting OWASP Top 10 2025 vulnerabilities for PRs, commits, or entire codebases. This skill should be used when a user wants to audit code security, scan for vulnerabilities, review security posture, or check for OWASP compliance. Analysis only - identifies vulnerabilities without modifying code.