AgriciDaniel/banana-claude / skills/banana
banana
VerifiedPlan, generate, edit, compare, and review images with Google Gemini (Nano Banana) image models, with an exact plan and explicit approval before every paid call. Use when the user asks to create or edit an image, picture, photo, illustration, logo, thumbnail, poster, banner, product shot, mockup, character sheet, infographic, or diagram; keep a character or product consistent across images; add exact text to an image; or compare image models.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 17.4 KB |
| references/cost-tracking.md | markdown | 13.2 KB |
| references/gemini-models.md | markdown | 18.5 KB |
| references/mcp-tools.md | markdown | 22.3 KB |
| references/models.json | config | 29.2 KB |
| references/post-processing.md | markdown | 18.7 KB |
| references/presets.md | markdown | 8.9 KB |
| references/prompt-engineering.md | markdown | 20.2 KB |
| references/review-and-recovery.md | markdown | 8.4 KB |
| scripts/approval_store.pyexecutable | script | 22.6 KB |
| scripts/banana_core.pyexecutable | script | 183.8 KB |
| scripts/batch.pyexecutable | script | 5.5 KB |
| scripts/cost_tracker.pyexecutable | script | 117.7 KB |
| scripts/doctor.pyexecutable | script | 5.5 KB |
| scripts/edit.pyexecutable | script | 4.7 KB |
| scripts/generate.pyexecutable | script | 5.7 KB |
| scripts/legacy_cleanup.pyexecutable | script | 93.4 KB |
| scripts/mcp_server.pyexecutable | script | 42.9 KB |
| scripts/portfolio.pyexecutable | script | 20.9 KB |
| scripts/presets.pyexecutable | script | 128.1 KB |
| scripts/typeset.pyexecutable | script | 23.9 KB |
scripts/edit.py
View on GitHub#!/usr/bin/env python3
"""Plan or execute a preservation-aware Gemini image edit."""
from __future__ import annotations
import argparse
import json
import sys
from banana_core import (
BananaError,
SecretSafeArgumentParser,
build_plan,
build_reference_specs,
execute_image,
issue_public_plan,
load_visual_brief_file,
)
def build_parser() -> argparse.ArgumentParser:
parser = SecretSafeArgumentParser(description="Plan or execute a Gemini image edit")
parser.add_argument(
"--image",
action="append",
required=True,
help="Source/reference image path, repeatable",
)
parser.add_argument(
"--reference-name",
action="append",
default=[],
help="Non-sensitive disclosure alias aligned by image order",
)
parser.add_argument(
"--reference-role",
action="append",
choices=["object", "character", "style"],
default=[],
)
parser.add_argument(
"--reference-purpose",
action="append",
default=[],
help="Purpose aligned by image order",
)
parser.add_argument(
"--reference-subject-id",
action="append",
default=[],
help="Subject label aligned by image order",
)
parser.add_argument(
"--prompt", required=True, help="Exact edit delta and preservation instructions"
)
parser.add_argument("--model", default="gemini-nano-banana-2.1")
parser.add_argument("--aspect-ratio", default="1:1")
parser.add_argument("--resolution", default="auto")
parser.add_argument("--thinking", choices=["minimal", "medium", "high"])
parser.add_argument("--web-search", action="store_true")
parser.add_argument("--image-search", action="store_true")
parser.add_argument("--store", action="store_true")
parser.add_argument("--mime-type", choices=["image/jpeg"], default="image/jpeg")
parser.add_argument("--output-dir")
parser.add_argument("--brief-file", help="UTF-8 JSON banana.visual-brief.v1 file")
parser.add_argument("--label", default="edit")
parser.add_argument("--record-prompt", action="store_true")
parser.add_argument(
"--execute", action="store_true", help="Make the paid provider request"
)
parser.add_argument("--confirm", help="Single-use approval ID approved by the user")
return parser
def main() -> int:
args = build_parser().parse_args()
try:
references = build_reference_specs(
args.image,
names=args.reference_name,
roles=args.reference_role,
purposes=args.reference_purpose,
subject_ids=args.reference_subject_id,
)
visual_brief = (
load_visual_brief_file(args.brief_file) if args.brief_file else None
)
plan = build_plan(
operation="edit",
prompt=args.prompt,
model=args.model,
aspect_ratio=args.aspect_ratio,
image_size=args.resolution,
reference_paths=references,
thinking_level=args.thinking,
web_search=args.web_search,
image_search=args.image_search,
store=args.store,
mime_type=args.mime_type,
destination=args.output_dir,
label=args.label,
record_prompt=args.record_prompt,
visual_brief=visual_brief,
)
if not args.execute:
print(
json.dumps(
{"network_called": False, "plan": issue_public_plan(plan)}, indent=2
)
)
return 0
if not args.confirm:
raise BananaError(
"confirmation_required",
"Execution requires --confirm with the single-use approval ID.",
)
result = execute_image(
operation="edit",
prompt=args.prompt,
approval_id=args.confirm,
model=args.model,
aspect_ratio=args.aspect_ratio,
image_size=args.resolution,
reference_paths=references,
thinking_level=args.thinking,
web_search=args.web_search,
image_search=args.image_search,
store=args.store,
mime_type=args.mime_type,
destination=args.output_dir,
label=args.label,
record_prompt=args.record_prompt,
visual_brief=visual_brief,
)
result.pop("image_contents", None)
print(json.dumps(result, indent=2, ensure_ascii=False))
return 0
except BananaError as exc:
print(json.dumps(exc.as_dict()), file=sys.stderr)
return 1
if __name__ == "__main__":
raise SystemExit(main())
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |