Skip to content

hashgraph-online/awesome-codex-plugins / plugins/BestLemoon/codex-seo/skills/seo-image-gen

seo-image-gen

Verified

AI image generation for SEO assets: OG/social preview images, blog hero images, schema images, product photography, infographics. Powered by Gemini via nanobanana-mcp. Requires banana extension installed. Use when user says "generate image", "OG image", "social preview", "hero image", "blog image", "product photo", "infographic", "seo image", "create visual", "image-gen", "favicon", "schema image", "pinterest pin", "generate visual", "banner", or "thumbnail".

FileKindSize
LICENSE.txtmarkdown142 B
SKILL.mdskill md8.1 KB
references/cost-tracking.mdmarkdown1.4 KB
references/gemini-models.mdmarkdown7.5 KB
references/mcp-tools.mdmarkdown3.7 KB
references/post-processing.mdmarkdown5.1 KB
references/presets.mdmarkdown2.2 KB
references/prompt-engineering.mdmarkdown20.2 KB
references/seo-image-presets.mdmarkdown3.9 KB
scripts/batch.pyexecutablescript3.1 KB
scripts/cost_tracker.pyexecutablescript6.2 KB
scripts/edit.pyexecutablescript4.5 KB
scripts/generate.pyexecutablescript5.4 KB
scripts/presets.pyexecutablescript4.9 KB
scripts/setup_mcp.pyscript1.5 KB
scripts/validate_setup.pyscript686 B

scripts/presets.py

View on GitHub
#!/usr/bin/env python3
"""Banana Codex - Brand/Style Presets

Manage reusable brand and style presets for consistent image generation.

Usage:
    presets.py list
    presets.py show NAME
    presets.py create NAME --colors "#hex,#hex" --style "..." [options]
    presets.py delete NAME --confirm
"""

import argparse
import json
import re
import sys
from pathlib import Path

PRESETS_DIR = Path.home() / ".banana" / "presets"


def _ensure_dir():
    """Ensure presets directory exists."""
    PRESETS_DIR.mkdir(parents=True, exist_ok=True)


def _sanitize_name(name):
    """Sanitize preset name to prevent path traversal."""
    # Strip path separators and keep only safe characters
    safe = re.sub(r'[^a-zA-Z0-9_\-]', '', name)
    if not safe:
        print("Error: Preset name must contain only letters, numbers, hyphens, and underscores.", file=sys.stderr)
        sys.exit(1)
    return safe


def _preset_path(name):
    """Get path for a preset file."""
    safe_name = _sanitize_name(name)
    return PRESETS_DIR / f"{safe_name}.json"


def _load_preset(name):
    """Load a preset by name."""
    path = _preset_path(name)
    if not path.exists():
        print(f"Error: Preset '{name}' not found.", file=sys.stderr)
        sys.exit(1)
    with open(path, "r") as f:
        return json.load(f)


def cmd_list(args):
    """List available presets."""
    _ensure_dir()
    presets = sorted(PRESETS_DIR.glob("*.json"))
    if not presets:
        print("No presets found. Create one with: presets.py create NAME --style \"...\"")
        return
    print(f"Available presets ({len(presets)}):\n")
    for p in presets:
        try:
            with open(p, "r") as f:
                data = json.load(f)
            desc = data.get("description", "No description")
            print(f"  {p.stem:20s} - {desc}")
        except (json.JSONDecodeError, KeyError):
            print(f"  {p.stem:20s} - (invalid preset file)")


def cmd_show(args):
    """Show full preset details."""
    preset = _load_preset(args.name)
    print(json.dumps(preset, indent=2))


def cmd_create(args):
    """Create a new preset."""
    _ensure_dir()
    path = _preset_path(args.name)
    if path.exists():
        print(f"Error: Preset '{args.name}' already exists. Use a different name.", file=sys.stderr)
        sys.exit(1)

    colors = [c.strip() for c in args.colors.split(",")] if args.colors else []

    preset = {
        "name": args.name,
        "description": args.description or f"Custom preset: {args.name}",
        "colors": colors,
        "style": args.style or "",
        "typography": args.typography or "",
        "lighting": args.lighting or "",
        "mood": args.mood or "",
        "default_ratio": args.ratio or "16:9",
        "default_resolution": args.resolution or "2K",
    }

    with open(path, "w") as f:
        json.dump(preset, f, indent=2)

    print(f"Preset '{args.name}' created at {path}")
    print(json.dumps(preset, indent=2))


def cmd_delete(args):
    """Delete a preset."""
    if not args.confirm:
        print("Error: Pass --confirm to delete the preset.", file=sys.stderr)
        sys.exit(1)
    path = _preset_path(args.name)
    if not path.exists():
        print(f"Error: Preset '{args.name}' not found.", file=sys.stderr)
        sys.exit(1)
    path.unlink()
    print(f"Preset '{args.name}' deleted.")


def main():
    parser = argparse.ArgumentParser(description="Banana Codex Brand/Style Presets")
    sub = parser.add_subparsers(dest="command", required=True)

    # list
    sub.add_parser("list", help="List available presets")

    # show
    p_show = sub.add_parser("show", help="Show preset details")
    p_show.add_argument("name", help="Preset name")

    # create
    p_create = sub.add_parser("create", help="Create a new preset")
    p_create.add_argument("name", help="Preset name (e.g., tech-saas, luxury-brand)")
    p_create.add_argument("--colors", default="", help="Comma-separated hex colors")
    p_create.add_argument("--style", default="", help="Visual style description")
    p_create.add_argument("--typography", default="", help="Typography description")
    p_create.add_argument("--lighting", default="", help="Lighting description")
    p_create.add_argument("--mood", default="", help="Mood/emotion description")
    p_create.add_argument("--description", default="", help="Brief preset description")
    p_create.add_argument("--ratio", default="16:9", help="Default aspect ratio")
    p_create.add_argument("--resolution", default="2K", help="Default resolution")

    # delete
    p_delete = sub.add_parser("delete", help="Delete a preset")
    p_delete.add_argument("name", help="Preset name")
    p_delete.add_argument("--confirm", action="store_true", help="Confirm deletion")

    args = parser.parse_args()
    cmds = {"list": cmd_list, "show": cmd_show, "create": cmd_create, "delete": cmd_delete}
    cmds[args.command](args)


if __name__ == "__main__":
    main()
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall