Agent skill

Bananahub

by bananahub-ai in bananahub-ai/bananahub-skill

Agent-native image workflow and optional prompt optimizer for /bananahub and generic agent image generation requests.

MITAuto-check passedMedia & Creative

Install Bananahub

skills CLI
$ npx skills add bananahub-ai/bananahub-skill --skill bananahub -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install bananahub-ai/bananahub-skill bananahub --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
bananahub
GitHub stars
118
Token cost
~7.1k tokens
SKILL.md length
2,910 words
Files
93 (incl. scripts, references)
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Agent-native image workflow and optional prompt optimizer for /bananahub and generic agent image generation requests.

  • Works in 5 steps: config CLI flag → Selected skill profile in… → Environment variables fill missing… → …
  • Tasks that involve Image generation
  • SKILL.md covers Quick Start, Key Paths, First-Run Detection and Runtime Mode Layers, plus 9 more sections
  • Calls python3, npx and claude; needs OPENAI_API_KEY and GOOGLE_API_KEY

What it does

Bananahub is an agent skill from bananahub-ai/bananahub-skill. Agent-native image workflow and optional prompt optimizer for /bananahub and generic agent image generation requests. Normalizes non-English prompts into English by default, generates or edits images across Gemini/Nano Banana, OpenAI GPT Image, chat-compatible routes, and Codex/host-native image tools when available, discovers or uses BananaHub templates, and captures successful multi-turn image iterations as reusable workflow templates. Explicit /bananahub requests execute the BananaHub workflow. Requests like…

Its SKILL.md is about 7.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 97 other files, including scripts and reference files (for example `BANANAHUB.md`, `BANANAHUB.zh-CN.md` and `CONTRIBUTING.md`).

It sits in Media & Creative, covering Image generation and Prompt engineering. It works with OpenAI and Google Gemini. The repository describes itself as: Agent-native Gemini image skill for Claude Code. Distills official best practices into conservative prompt optimization and reusable BananaHub templates. The licence is MIT.

When your agent uses it

  • Tasks that involve Image generation
  • Tasks that involve Prompt engineering

Example prompts

  • “把刚才的调图流程沉淀成模板”
  • “save this image workflow”
  • “capture workflow”
  • “/bananahub”

Requirements

  • Python 3
  • Node.js
  • A credential in OPENAI_API_KEY
  • A credential in GEMINI_API_KEY

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. config CLI flag
  2. Selected skill profile in ~/.config/bananahub/config.json
  3. Environment variables fill missing fields by default (OPENAI_API_KEY, OPENAI_BASE_URL, GOOGLE_API_KEY, GEMINI_API_KEY, BANANAHUB_PROVIDER…
  4. Skill config examples
  5. Persistent config helpers

What it can do on your machine

Read from SKILL.md and the folder at commit ffee193. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/, which the agent can run.

    Shell commands in SKILL.md call:

    • python3
    • npx
    • claude

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npx, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • OPENAI_API_KEY
    • GOOGLE_API_KEY
    • GEMINI_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Bananahub loads about 7.1k tokens when it runs, and up to ~2.4M if it reads all its reference files. Until then it costs about 221 tokens; SKILL.md has 2,910 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~221
When it runs · the whole SKILL.md, loaded when a task matches
~7.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.4M

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from bananahub-ai/bananahub-skill at commit ffee193, republished under its MIT licence (© bananahub-ai). 2,910 words, ~7,070 tokens.

Download SKILL.mdSave it as .claude/skills/bananahub/SKILL.md (or your agent's skills folder). This skill also uses 92 other files; get the full folder from GitHub.
name
bananahub
description
Agent-native image workflow and optional prompt optimizer for `/bananahub` and generic agent image generation requests. Normalizes non-English prompts into English by default, generates or edits images across Gemini/Nano Banana, OpenAI GPT Image, chat-compatible routes, and Codex/host-native image tools when available, discovers or uses BananaHub templates, and captures successful multi-turn image iterations as reusable workflow templates. Explicit `/bananahub` requests execute the BananaHub workflow. Requests like "把刚才的调图流程沉淀成模板", "save this image workflow", or "capture workflow" should use the capture-workflow flow. Generic requests like "生成图片", "画一个", "create an image", or "edit this image" should load BananaHub as an optimization advisor: ask whether to optimize/template-route the prompt before generation, then continue with the user's chosen image channel.
metadata.version
0.1.0
metadata.author
bananahub-ai
metadata.emoji
🍌
metadata.primaryEnv
OPENAI_API_KEY
user_invocable
true

BananaHub

Generate or edit images from non-English or mixed-language requests inside one /bananahub workflow. GPT Image 2 through an OpenAI-compatible image endpoint is the default provider path; user-configured Gemini/Nano Banana, OpenAI official, Vertex, chat-compatible paths, and Codex/host-native image tools are preserved. BananaHub keeps prompt optimization, conservative enhancement, model fallback, image editing, template use, and BananaHub discovery in a single skill instead of splitting them across separate installs.

When BananaHub is loaded implicitly for a generic agent image request, act as a lightweight optimization layer first. Do not silently take over generation: ask whether the user wants BananaHub to optimize the prompt before the image tool runs, then respect the answer.

Quick Start

  • Install via Open Agent Skills: npx skills add https://github.com/bananahub-ai/bananahub-skill --skill bananahub
  • Install in Claude Code directly: claude skill install https://github.com/bananahub-ai/bananahub-skill
  • Run setup once: /bananahub init
  • Test a host-native image tool such as Codex built-in image generation: /bananahub test-host-imagegen
  • Generate from a natural-language request: /bananahub 一只橘猫趴在键盘上打盹
  • Edit an image: /bananahub edit 把背景换成海滩 --input photo.png
  • Discover a reusable template: /bananahub discover 代码库讲解图
  • Capture the current image iteration as a workflow template: /bananahub capture-workflow

Key Paths

  • Generation script: {baseDir}/scripts/bananahub.py
  • Provider adapters: {baseDir}/scripts/providers/ — Gemini, OpenAI Images, and chat/completions-compatible runtime adapters
  • Runtime config module: {baseDir}/scripts/runtime_config.py — provider constants, aliases, transport defaults, config keys, and endpoint normalization
  • Config store module: {baseDir}/scripts/config_store.py — config loading, profile merge, validation, provider override, and serialization helpers
  • Prompt optimization rules: references/prompt-guide.md — read during Phase 1 (base optimization)
  • Enhancement profiles: references/profiles/{name}.md — read during Phase 3 (on-demand)
  • Official references: references/official-sources.md — authoritative source URLs, core example library
  • Capability registry: references/capability-registry.md — provider/model feature routing and fallback policy
  • Model registry: references/model-registry.json — canonical model ids, aliases, defaults, and provider families
  • Provider guides: references/providers/{provider}.md — lazy-loaded model-family prompt and runtime rules
  • Template system: references/template-system.md — read when handling templates/use/create-template commands
  • Hub discovery guide: references/hub-discovery.md — read when handling discover or when local template matching is weak
  • Template files: {baseDir}/references/templates/<id>/template.md (built-in) + ~/.config/bananahub/templates/<id>/template.md (user-installed)
  • Telemetry helper: python3 {baseDir}/scripts/bananahub.py telemetry ... — use for built-in/installed template adoption events
  • Telemetry state: ~/.config/bananahub/telemetry.json — stores the local anonymous usage id
  • Init guide: references/init-guide.md — read when handling init command
  • Optimization pipeline: references/optimization-pipeline.md — read when optimizing prompts
  • Template format spec: references/template-format-spec.md — detailed field definitions, repo structure, sample requirements
  • Template validator: python3 {baseDir}/scripts/validate_templates.py — validates bundled/user template metadata for schema v1/v2 compatibility
  • Mode detector: python3 {baseDir}/scripts/bananahub.py check-mode — reports provider-backed / host-native / prompt-only execution mode and capability layer boundaries
  • Host-native image tool test: /bananahub test-host-imagegen or /bananahub test-codex-imagegen — skill-layer command; call the host/Codex built-in image generation tool with the validation prompt below
  • Prompt archive: current working directory bananahub-prompts/ when --save-prompt, --prompt-output, or BANANAHUB_SAVE_PROMPTS=1 is used
  • API config (priority high→low):
    1. --config <file> CLI flag
    2. Selected skill profile in ~/.config/bananahub/config.json
    3. Environment variables fill missing fields by default (OPENAI_API_KEY, OPENAI_BASE_URL, GOOGLE_API_KEY, GEMINI_API_KEY, BANANAHUB_PROVIDER, BANANAHUB_AUTH_MODE, BANANAHUB_MODEL, GOOGLE_GEMINI_BASE_URL, GEMINI_BASE_URL, BANANAHUB_BASE_URL, GOOGLE_CLOUD_PROJECT, GOOGLE_CLOUD_LOCATION)
      • Use BANANAHUB_PROFILE=<name> to select another persisted profile
      • Set BANANAHUB_ENV_OVERRIDE=1 only when environment variables should temporarily override profile fields
    4. Skill config examples:
      • {"provider": "google-ai-studio", "api_key": "...", "model": "gemini-3-pro-image-preview"}
      • {"provider": "gemini-compatible", "api_key": "...", "base_url": "https://..."}
      • {"provider": "openai", "openai_api_key": "...", "model": "gpt-image-2"}
      • {"provider": "openai-compatible", "openai_api_key": "...", "openai_base_url": "https://...", "model": "gpt-image-2"}
      • {"provider": "chatgpt-compatible", "chatgpt_api_key": "...", "chatgpt_base_url": "https://...", "model": "gpt-5.4"}
      • multi-profile: {"default_profile":"gpt","profiles":{"gpt":{"provider":"openai-compatible","openai_api_key":"...","openai_base_url":"https://...","model":"gpt-image-2"},"nano":{"provider":"google-ai-studio","api_key":"..."}}}
      • {"provider": "vertex-ai", "auth_mode": "adc", "project": "...", "location": "global"}
    5. Persistent config helpers:
      • python3 {baseDir}/scripts/bananahub.py config show
      • python3 {baseDir}/scripts/bananahub.py config doctor --json
      • python3 {baseDir}/scripts/bananahub.py config quickset --provider openai-compatible --profile gpt --default-profile --base-url https://your-openai-compatible-endpoint --api-key <key> --model gpt-image-2
      • python3 {baseDir}/scripts/bananahub.py config quickset --provider openai-compatible --profile gpt --default-profile --base-url https://your-openai-compatible-endpoint --api-key-stdin --model gpt-image-2
      • python3 {baseDir}/scripts/bananahub.py config quickset --provider openai --profile gpt --default-profile --api-key <key> --model gpt-image-2
      • python3 {baseDir}/scripts/bananahub.py config quickset --provider google-ai-studio --profile nano --default-profile --api-key <key> --model gemini-3-pro-image-preview
      • python3 {baseDir}/scripts/bananahub.py config quickset --provider vertex-ai --profile vertex --default-profile --auth-mode adc --project <gcp-project> --location global
      • python3 {baseDir}/scripts/bananahub.py init --wizard (human-terminal fallback only)
      • python3 {baseDir}/scripts/bananahub.py config set --clear-base-url
  • Output directory: current working directory (where the skill is invoked)

First-Run Detection

Before executing any command other than help, check if the environment is ready:

  1. Run python3 {baseDir}/scripts/bananahub.py config doctor --json when setup status is unclear.
  2. If status is needs_setup, read references/init-guide.md, ask only for missing provider-required fields, then persist them with the matching config quickset command.
  3. Direct API-key entry is allowed when the user chooses it or already pasted a key. Write it with config quickset --api-key-stdin and do not echo it back.
  4. If the user does not want secrets in chat, give them the config quickset command with <key> placeholders for their local terminal.
  5. If config exists but generation fails with auth/dependency errors → suggest config doctor --json.
  6. Persist new config into ~/.config/bananahub/config.json, preferably as a named profile (gpt, nano, vertex, or chat).
  7. Treat init --wizard as a human-terminal fallback only; do not assume agents can run interactive prompts.
  8. Treat openai-compatible + gpt-image-2 as the default setup path. If the user already configured a provider/profile/model, preserve it and route within that provider.
  9. Before asking for a provider API key, check whether the current client exposes a host-native image generation tool. In Codex, OAuth sessions and some API logins expose a built-in image tool; if available, offer it as a no-local-AK image channel and optionally run /bananahub test-host-imagegen.
  10. Supported runtime providers:
  • google-ai-studio: generate / edit / models / init
  • gemini-compatible: generate / edit / models / init
  • vertex-ai: generate / edit / models / init
  • openai: OpenAI-native GPT Image generate / edit / models / init
  • openai-compatible: OpenAI-style Images API generate / edit / models / init, capability-dependent
  • chatgpt-compatible: chat/completions endpoint that returns images inside assistant replies
  1. openai-compatible is not the same as OpenAI-native GPT Image. The runtime attempts standard Images API generation/editing, but exact support still depends on the gateway.
  2. Endpoint normalization rules:
  • gemini-compatible: if the user pastes a URL ending in /v1beta, keep it conceptually but normalize the trailing version during runtime so it is not duplicated
  • openai-compatible: if the user pastes a bare host, the runtime may append /v1; for Google's official endpoint, resolve it to /v1beta/openai

Runtime Mode Layers

Run python3 {baseDir}/scripts/bananahub.py check-mode --pretty when the execution path is unclear. BananaHub has three execution modes:

ModeTriggerBehavior
provider-backedConfig validates for a supported providerOptimize/render prompt, call generate or edit, and save image outputs
host-nativeProvider config is missing or incomplete, but BANANAHUB_HOST_IMAGEGEN=1, check-mode --host-imagegen, or the agent has a Codex/host built-in image toolOptimize/render prompt, optionally archive it, then hand it to the host image tool instead of calling the provider script
prompt-onlyNo valid provider and no host image toolAct as a prompt/template advisor: return the final prompt and archive it when requested; do not claim image generation succeeded

Capability ownership is layered:

  • Cross-model skill layer: prompt optimization, translation policy, conservative enhancement, --direct, --raw, prompt archiving, template discovery/activation, host-native delegation, and prompt-only advisory output.
  • Template layer: matching and activation are common, but provider/model compatibility, prompt variants, tested quality, and samples belong to template metadata.
  • Provider/model layer: image edit, mask edit, multi-reference, exact size, native quality, transparent background, output format/compression, and fallback are not universal; route them through references/capability-registry.md, references/model-registry.json, and provider adapters.
Host-Native Codex Image Tool

Treat Codex built-in image generation as a host-native channel, not as a persisted provider. It is useful when the user is authenticated through Codex OAuth or another host/API login that exposes an image tool and does not want to enter a separate BananaHub API key.

  • Offer this channel during init when the current agent visibly has an image generation tool.
  • To verify it, run /bananahub test-host-imagegen or /bananahub test-codex-imagegen: optimize no extra provider config, call the host image generation tool directly, and report whether an image file was produced.
  • Validation prompt:
    text
    Create a compact BananaHub channel validation image: a clean workflow card connected to a built-in image generation tool node, with a green check indicator. Include only the exact label "Codex Image Tool OK". Crisp modern product illustration, high readability, no logos, no watermark, no extra text.
  • After a successful test, treat the current session as host-native. For CLI-only diagnostics, run python3 {baseDir}/scripts/bananahub.py check-mode --host-imagegen --pretty or set BANANAHUB_HOST_IMAGEGEN=1.
  • Do not promise provider-native controls on this path. Exact pixel size, mask editing, native quality, output format, compression, transparent background, and multi-reference limits depend on the host tool surface.
  • If a generated image is meant for the current project, move or copy the final asset from the host tool's default output location into the workspace before referencing it.

If a feature changes request payload shape, file validation, cost, policy behavior, or output parsing, do not treat it as cross-model even if several providers happen to support similar wording.

Agent operating principle: do not ask the human to make choices the agent can resolve from diagnosis, config, templates, or file paths. Ask only for secrets, provider/channel selection when unknown, paid generation consent, or genuinely creative direction.

Implicit Image Request Flow

This flow applies when BananaHub is loaded by a generic agent image request rather than an explicit /bananahub command.

  1. Detect the user's intent:
    • image generation: "生成图片", "画一个", "create an image", "make a poster", "generate a logo", etc.
    • image editing: "改这张图", "replace the background", "edit this image", etc.
  2. If the user explicitly asks to skip optimization, says "直接生成/直接画/raw/no optimization", or the request is already a highly structured final prompt, do not interrupt. Use the current image channel directly.
  3. Otherwise ask one short confirmation before generation:
    text
    要不要我先用 BananaHub 优化一下 prompt,再用当前可用的生图通道生成?我会保留你的原意,只增强结构、约束和模型适配。
    In English sessions:
    text
    Do you want BananaHub to optimize the prompt before I generate it? I will preserve your intent and only tighten structure, constraints, and model fit.
  4. If the user agrees, run the normal BananaHub optimization pipeline, suggest a matching local template only when there is a clear fit, then generate through the active provider or host-native image tool.
  5. If the user declines, do not use BananaHub optimization for that request. Hand the original request to the current image generation tool.
  6. If the request includes exact text, brand constraints, a reference image, editing boundaries, a workflow/template need, or a deliverable that benefits from prompt archiving, briefly recommend optimization but still wait for confirmation unless the user invoked /bananahub explicitly.
Show full SKILL.md (1,399 more words)Show less

Command Routing

Route user input to the appropriate action based on arguments:

ArgumentAction
initRead references/init-guide.md, then diagnose and fix environment issues
helpShow usage instructions (brief list of supported commands and examples)
<description>Read references/optimization-pipeline.md, then: base optimization → intent recognition → optional enhancement → generate
edit <description> --input <image-path> [--ref <reference-image>...]Edit an existing image: optimize prompt → call edit subcommand
optimize <description>Optimize prompt only; display result without generating
generate <English prompt>Generate image directly with given English prompt (skip optimization)
modelsRun python3 {baseDir}/scripts/bananahub.py models to query image-capable models from API
check-modeRun python3 {baseDir}/scripts/bananahub.py check-mode --pretty to inspect provider-backed / host-native / prompt-only mode and capability layers
test-host-imagegen / test-codex-imagegenSkill-layer command: call the host/Codex built-in image generation tool with the validation prompt, then mark the session as host-native if it succeeds
templatesRead references/template-system.md, then list all templates grouped by profile and type
templates <name>Read references/template-system.md, parse frontmatter type, then show prompt-template or workflow-template details accordingly
use <template-id> [custom description]Read references/template-system.md, parse frontmatter type, then either generate from a prompt template or activate a workflow template
discover <request>Read references/hub-discovery.md, then search BananaHub for matching templates without scraping the visual site
discover curated <request>Read references/hub-discovery.md, then search only the curated BananaHub catalog
discover trendingRead references/hub-discovery.md, then show current trending BananaHub templates
create-template [description]Read references/template-system.md, determine whether the user needs a prompt or workflow template, then guide creation
capture-workflow / save-workflow / summarize-workflowRead references/template-system.md, inspect the current multi-turn image iteration, and draft a reusable type: workflow template

Note:

  • optimize, --direct, and --raw are skill-layer controls interpreted by you before invoking the script
  • Do not pass --direct or --raw through to {baseDir}/scripts/bananahub.py
  • optimize, templates, use, discover, create-template, capture-workflow, save-workflow, summarize-workflow, test-host-imagegen, and test-codex-imagegen are skill-layer commands. If they are accidentally passed to {baseDir}/scripts/bananahub.py, the script returns a machine-readable status: "skill_layer_command" explanation for agents.
  • discover uses BananaHub machine-readable files and npx bananahub add ..., not provider generation directly.
  • telemetry is an internal helper, not a user-facing chat command. Use it when a template is selected or successfully produces output.

Optional flags (append to any generation command):

  • --model <model_id> — specify model
  • --aspect <ratio> — aspect ratio (e.g., 16:9, 1:1, 9:16)
  • --image-size <preset> — native image-size preset (1K, 2K, 4K)
  • --openai-size <value> — OpenAI-native size for OpenAI-style image generation
  • --quality <value> — provider-native quality preset when supported
  • --background <value> — provider-native background option when supported
  • --output-format <value> — provider-native output format when supported
  • --output-compression <N> — provider-native output compression when supported
  • --resize <WxH> — post-process resize after generation/edit (e.g., 1024x1024)
  • --size <value> — legacy compatibility flag; 1K/2K/4K means native image size, WxH means post-process resize
  • --output <path> — specify output path
  • --save-prompt — archive the final prompt under bananahub-prompts/
  • --prompt-output <path> — archive the final prompt to a specific file or directory
  • --input <path> — source image for edit commands
  • --ref <path> [path...] — reference images for edit commands (Gemini up to 13 refs; OpenAI provider enforces its own lower runtime limit)
  • --mask <path> — OpenAI-native mask image for masked edits
  • --direct — direct mode: skip all confirmations, generate immediately
  • --raw — raw mode: translate only, no optimization
  • --retries <N> — retry count per model on 503 before fallback (default: 1, i.e. try each model twice)
  • --no-fallback — disable automatic model fallback

Three Optimization Modes

Mode 1: Default (no flag)
User input → Base optimization (silent) → Intent recognition → Profile match?
  ├─ Yes → Show enhancement suggestion → User confirms/edits/rejects → Generate
  └─ No (general) → Generate directly
Mode 2: Direct (--direct or user says "直接画/直出")
User input → Base optimization → Intent recognition → Load Profile enhancement → Generate directly

No confirmations. Suitable for experienced users or batch generation.

Mode 3: Raw (--raw)
User input → Translate to English only → Generate directly

No optimization. In-image text is still preserved in original language.

Prompt Optimization Summary

Read references/optimization-pipeline.md for the full pipeline. Overview:

  1. Phase 0: Extract hard constraints (exact_text, must_keep, must_avoid, style_lock, approved_baseline, allowed_delta when relevant)
  2. Phase 1: Base optimization — format correction, smart translation, structuring, conservative guardrail
  3. Phase 1.5: Capability/provider routing — inspect references/capability-registry.md, resolve model aliases from references/model-registry.json, then lazy-load references/providers/*.md only for the selected model family
  4. Phase 2: Intent recognition — match to one of 10 profiles via keyword table
  5. Phase 2.1: Local template auto-matching — suggest installed templates (progressive disclosure)
  6. Phase 2.2: BananaHub discovery — search remote catalog only when explicitly useful
  7. Phase 2.5: Style overlay detection (hand-drawn sketch-note)
  8. Phase 3: Enhancement — read matching profile from references/profiles/, classify subject, fill missing dimensions
  9. Phase 3.5: Model recommendation — prefer gpt-image-2 for generation-led high-fidelity outputs; prefer Gemini/Nano Banana for edit/reference/consistency-heavy flows unless the user or template overrides it

Image Generation Flow

  1. If execution mode is host-native, use the final optimized prompt with the host/Codex built-in image tool instead of calling {baseDir}/scripts/bananahub.py generate. Save or report the host-generated output path, and archive the prompt when requested.
  2. Otherwise build command:
    bash
    python3 {baseDir}/scripts/bananahub.py generate "<prompt>" [--aspect RATIO] [--model MODEL] [--output PATH]
    When this generation comes from an active template, also pass: --template-id <id> --template-repo <repo> --template-distribution bundled|remote --template-source curated|discovered
  3. Execute script and parse JSON output
  4. Automatic model fallback: on server error (500/502/503/504), tries the selected provider family fallback chain from references/model-registry.json. Do not cross provider families unless the user explicitly enables cross-provider fallback. Use --no-fallback to disable.
  5. On success:
    ✅ 图片已生成
    📁 路径: [file_path]
    🔧 模型: [model] | 宽高比: [ratio] | 尺寸: [WxH]
    📝 使用的 Prompt: [final prompt used]
    If the script returns template_telemetry, treat it as best-effort success reporting only; do not surface failures unless the user asked.
  6. On failure: suggest fix based on error type (content policy → rephrase, auth → check key, network → check proxy)

Image Editing Flow

  1. Validate input: confirm --input image path exists; validate --ref images Reject more than 13 reference images or more than 14 total images.
  2. Extract invariants: what must remain unchanged in the source image
  3. Lock the baseline when applicable: if the source image is an accepted result, treat it as the only source of truth for later rounds
  4. Name the allowed delta: isolate the one change this round is allowed to make
  5. Optimize edit prompt: run Phase 1 only (skip Phase 2/3); keep conservative, isolate the delta
  6. Build command:
    bash
    python3 {baseDir}/scripts/bananahub.py edit "<prompt>" --input <image_path> [--ref <ref1> ...] [--model MODEL] [--output PATH]
    --ref accepts up to 13 reference images. Total images (input + refs) ≤ 14. When this edit runs inside an active template/workflow, also pass: --template-id <id> --template-repo <repo> --template-distribution bundled|remote --template-source curated|discovered
  7. On success:
    ✅ 图片已编辑
    📁 路径: [file_path]
    📥 原图: [input_path]
    📎 参考图: [ref_images, if any]
    🔧 模型: [model] | 尺寸: [WxH]
    📝 使用的 Prompt: [final prompt used]

Multi-image use cases: style transfer, character consistency, multi-image blending, object replacement.

Iteration Guide

  • Change one variable at a time
  • Retain the last effective prompt as a base
  • Treat follow-ups as deltas, not full rewrites
  • Preserve locked constraints unless user explicitly changes them
  • After the user accepts an output, treat that file as the approved baseline until the user replaces it
  • For follow-up edits, state the exact keep-unchanged constraints before the allowed delta
  • For deterministic derivative tasks such as invert, crop, export, add safe padding, or build exact lockups, prefer local deterministic transforms instead of asking the model to redraw the asset

Template System Summary

Read references/template-system.md for the full template system. Overview:

  • Search paths: built-in (references/templates/) + user-installed (~/.config/bananahub/templates/)
  • Local vs remote: templates / use operate on installed templates; discover operates on BananaHub catalog, including the official bananahub-ai/templates library, and installs only on demand
  • Format: template.md with YAML frontmatter and type: prompt | workflow
  • Prompt templates: produce a reusable prompt with variables, then generate or edit
  • Workflow templates: act as progressive-disclosure context; load the workflow, ask only for missing blockers, and execute step-by-step with generate / edit primitives when needed
  • Model transparency: when a template or heuristic selects gpt-image-2 or Gemini/Nano Banana automatically, state that recommendation explicitly instead of hiding the model choice
  • Built-in starter examples: info-diagram for one-page infographics, article-one-page-summary for article explainers, background-replace-edit for edit workflows
  • Commands: templates (list installed), templates <name> (details), use <id> [desc] (activate), discover <need> (search hub), create-template (create), capture-workflow (turn current iteration into a workflow draft)
  • Auto-matching: Phase 2.1 suggests installed templates first; Phase 2.2 can search BananaHub when local coverage is weak
  • Adoption telemetry: when a template is selected, call python3 {baseDir}/scripts/bananahub.py telemetry track --event selected ...; when template-driven generate/edit succeeds, pass template telemetry flags so the script can report generate_success / edit_success
  • Install more: prefer discover inside the skill; official rich templates install from bananahub-ai/templates, and known targets can still be installed with npx bananahub add <user/repo[/template]>
  • Publishing rule: when creating templates, save samples as sample-{model-short}-{nn}.png and make README list verified models, supported models, and sample-to-prompt mappings

Safety Rules

  • Never generate images that violate content policies (violence, sexual content, hate, etc.)
  • Never expose the API key in output
  • If a user request might trigger safety filters, proactively suggest alternative phrasing

© bananahub-ai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 92 other files (scripts, references) in the repository root of bananahub-ai/bananahub-skill.

  • SKILL.md
  • .gitignore
  • BANANAHUB.md
  • BANANAHUB.zh-CN.md
  • CONTRIBUTING.md
  • LICENSE
  • README.md
  • README.zh-CN.md
  • agents/openai.yaml
  • docs/assets/github/prompts/readme-hero-gpt-5-4.md
  • docs/assets/github/prompts/setup-guide-gpt-5-4.md
  • docs/assets/github/prompts/skill-architecture-gpt-5-4.md
  • docs/assets/github/prompts/user-flow-infographic-gpt-5-4.md
  • docs/assets/github/readme-hero-gpt-5-4.png
  • docs/assets/github/setup-guide-gpt-5-4.png
  • docs/assets/github/skill-architecture-gpt-5-4.png
  • … and 77 more

Open the folder on GitHubat commit ffee193

Compare with similar skills

Bananahub next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Bananahub compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Bananahub this skillbananahub-ai/bananahub-skill118—~7.1kAutomated safety check: PassMIT
Image Ad Clonekrusemediallc/arcads-claude-code1.6k—~2.4kAutomated safety check: NotesMIT
AI Image Prompts SkillLeoYeAI/openclaw-master-skills2.2k—~4.3kAutomated safety check: PassMIT
Nano Banana Pro Prompts Recommend SkillYouMind-OpenLab/nano-banana-pro-prompts-recommend-skill1.9k1 repos~4.1kAutomated safety check: PassNone
AI Image Creatorcentminmod/my-claude-code-setup2.7k—~8.1kAutomated safety check: NotesMIT
Chatgpt Image Adkrusemediallc/arcads-claude-code1.6k—~2.7kAutomated safety check: NotesMIT

Similar skills

  • Image Ad Clone

    krusemediallc/arcads-claude-code

    A skill your agent uses when the user wants to reverse-engineer an existing image ad into a reusable prompt template.

    1.6k GitHub stars~2.4k tokensUpdated 18 days ago
    Media & CreativeAuto-check: notes
  • AI Image Prompts Skill

    LeoYeAI/openclaw-master-skills

    Recommend curated prompts from a 10,000+ real-world image generation prompt library.

    2.2k GitHub stars~4.3k tokensUpdated 2 mo ago
    Media & CreativeAuto-check passed
  • Nano Banana Pro Prompts Recommend Skill

    YouMind-OpenLab/nano-banana-pro-prompts-recommend-skill

    Recommend suitable prompts from 10,000+ Nano Banana Pro image generation prompts based on user needs.

    1.9k GitHub starsUsed in 1 repo~4.1k tokens
    Media & CreativeAuto-check passed
  • AI Image Creator

    centminmod/my-claude-code-setup

    Generate, edit-from-reference, or analyze images with AI via OpenRouter (Gemini, GPT Image, Seedream, Qwen, MAI, Grok, FLUX.2, Recraft, Muse, Riverflow; Cloudflare AI Gateway BYOK).

    2.7k GitHub stars~8.1k tokensUpdated 3 days ago
    Media & CreativeAuto-check: notes
  • Chatgpt Image Ad

    krusemediallc/arcads-claude-code

    Generate one or more standalone Meta image-ad creatives via ChatGPT Image 2 (gpt-image-2) through the Arcads external API.

    1.6k GitHub stars~2.7k tokensUpdated 18 days ago
    Media & CreativeAuto-check: notes
  • Zy Cinematic Realism

    popopo-99/zy-cinematic-realism

    Develop supplied scripts, short stories, or synopses into scene understanding, director-facing art concepts, and motivated narrative keyframes; compile scene ideas, visual references, or existing…

    570 GitHub stars~4.6k tokensUpdated 7 days ago
    Media & CreativeAuto-check passed

Questions about Bananahub

What does Bananahub do?

Agent-native image workflow and optional prompt optimizer for /bananahub and generic agent image generation requests. Bananahub is an agent skill from bananahub-ai/bananahub-skill. Agent-native image workflow and optional prompt optimizer for /bananahub and generic agent image generation requests.

When should I use Bananahub?

Bananahub fits situations like: tasks that involve Image generation; tasks that involve Prompt engineering.

How do I install Bananahub in Claude Code?

Run `npx skills add bananahub-ai/bananahub-skill --skill bananahub -a claude-code`. Or copy the skill folder (the bananahub-ai/bananahub-skill repository) into .claude/skills/bananahub in your project. Claude Code loads it when a task matches its description.

How do I install Bananahub in Codex?

Run `npx skills add bananahub-ai/bananahub-skill --skill bananahub -a codex`. Or copy the skill folder (the bananahub-ai/bananahub-skill repository) into .agents/skills/bananahub in your project. Codex loads it when a task matches its description.

Can I use Bananahub in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add bananahub-ai/bananahub-skill --skill bananahub -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/bananahub, .gemini/skills/bananahub, .github/skills/bananahub and .opencode/skills/bananahub in your project.

What does Bananahub need to run?

Going by SKILL.md and its folder, Bananahub needs the command-line tools its instructions call (python3, npx and claude) and credentials named OPENAI_API_KEY, GOOGLE_API_KEY and GEMINI_API_KEY. Our summary lists: Python 3; Node.js; A credential in OPENAI_API_KEY; A credential in GEMINI_API_KEY.

Does Bananahub access the network?

SKILL.md contains no URLs. Its commands use npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Bananahub safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Bananahub use?

Bananahub is published under the MIT licence (from the LICENSE file in the skill folder). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Bananahub use?

About 7.1k tokens (SKILL.md is roughly 28k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.4M tokens, read only when the agent opens those files.

What are the alternatives to Bananahub?

Skills that share tags, products or a category with Bananahub: Image Ad Clone (krusemediallc/arcads-claude-code, 1.6k stars), AI Image Prompts Skill (LeoYeAI/openclaw-master-skills, 2.2k stars), Nano Banana Pro Prompts Recommend Skill (YouMind-OpenLab/nano-banana-pro-prompts-recommend-skill, 1.9k stars) and AI Image Creator (centminmod/my-claude-code-setup, 2.7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Bananahub?

bananahub-ai (a GitHub organization) maintains it in bananahub-ai/bananahub-skill, which has 118 GitHub stars. The repository was last updated on May 17, 2026.

Source: bananahub-ai/bananahub-skill on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.