# Sofia — AI Thumbnail Designer for OpenClaw

[![GitHub stars](https://img.shields.io/github/stars/benjacord/openclaw-sofia-skill?style=social)](https://github.com/benjacord/openclaw-sofia-skill)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

**Sofia** is an AI-powered YouTube thumbnail designer that runs as an [OpenClaw](https://openclaw.com) agent skill. She generates click-worthy thumbnails using Gemini Flash Image, following a detailed style guide with your photos, brand logos, and proven design patterns.

Give her a video title, and she delivers 3 thumbnail options — composed with your face, relevant brand logos, bold text, and high-contrast layouts optimized for CTR.

---

## What's Included

| Component | Description |
|-----------|-------------|
| **Sofia Skill** (`skills/sofia/`) | The AI thumbnail designer agent — personality, rules, and workflow |
| **Thumbnail Agent** (`skills/thumbnail-agent/`) | Style guide, best practices, and reference examples |
| **Image Generator** (`scripts/generate_image.py`) | Python script that calls Gemini Flash Image API |
| **Photo Bank** (`assets/ben-photos/`) | 50+ reference photos of Ben Cordero for thumbnail compositions |
| **Logo Bank** (`assets/logos/`) | 50+ brand logos (Claude, OpenAI, n8n, Make, YouTube, and more) organized by category |

---

## Prerequisites

- [OpenClaw](https://openclaw.com) installed and configured
- **GEMINI_API_KEY** — get a free key at [Google AI Studio](https://aistudio.google.com/apikey)
- [uv](https://docs.astral.sh/uv/) package manager
- [gh](https://cli.github.com/) CLI (for cloning only)

---

## Quick Install

```bash
git clone https://github.com/benjacord/openclaw-sofia-skill && cd openclaw-sofia-skill && ./install.sh
```

---

## Manual Installation

1. **Clone the repo**
   ```bash
   git clone https://github.com/benjacord/openclaw-sofia-skill
   cd openclaw-sofia-skill
   ```

2. **Copy skills to your OpenClaw workspace**
   ```bash
   cp -r skills/sofia ~/.openclaw/workspace/skills/
   cp -r skills/thumbnail-agent ~/.openclaw/workspace/skills/
   ```

3. **Copy assets**
   ```bash
   cp -r assets/ben-photos ~/.openclaw/workspace/assets/
   cp -r assets/logos ~/.openclaw/workspace/assets/
   ```

4. **Install the generation script**
   ```bash
   mkdir -p ~/.openclaw/workspace/skills/nano-banana-pro/scripts
   cp scripts/generate_image.py ~/.openclaw/workspace/skills/nano-banana-pro/scripts/
   ```

5. **Set your API key**
   ```bash
   echo "GEMINI_API_KEY=your-key-here" >> ~/.openclaw/.env
   ```

---

## How to Use Sofia

Once installed, invoke Sofia from your OpenClaw session:

```
"Sofía, hazme el thumbnail para: How I Automated My Entire YouTube Channel with AI"
```

Or spawn her as a sub-agent:

```python
sessions_spawn({
    "task": "Generate 3 thumbnail options for the video: 'How I Automated My Entire YouTube Channel with AI'",
    "model": "anthropic/claude-opus-4-6",
    "runTimeoutSeconds": 600
})
```

Sofia will:
1. Analyze the video title and pick the best composition style
2. Select the right photo of you and relevant brand logos
3. Generate 3 distinct thumbnail options with bold text overlays
4. Deliver them for your approval

---

## Customizing for Your Channel

### Replace the photo bank
Delete the contents of `assets/ben-photos/` and add your own photos:
- Clear face shots with different expressions (surprised, confident, pointing, etc.)
- Various outfits and backgrounds
- Name them descriptively: `you-pointing-glasses.jpg`, `you-surprised-arms-open.jpg`

### Update the style guide
Edit `skills/thumbnail-agent/style-guide.md` to match your brand:
- Your color palette
- Typography preferences
- Layout patterns that work for your audience

### Add logos
Drop SVG/PNG files into the appropriate `assets/logos/` subfolder:
- `ai-tools/` — AI platforms (Claude, ChatGPT, Gemini, etc.)
- `automation/` — Automation tools (n8n, Make, Zapier, etc.)
- `social/` — Social platforms (YouTube, Instagram, X, etc.)
- `dev-tools/` — Developer tools (Cursor, VS Code, GitHub, etc.)
- `google/` — Google products (Gmail, Sheets, Calendar, etc.)
- `misc/` — Everything else

---

## Folder Structure

```
openclaw-sofia-skill/
├── README.md
├── install.sh
├── .gitignore
├── skills/
│   ├── sofia/
│   │   └── SKILL.md              # Sofia's personality + rules
│   └── thumbnail-agent/
│       ├── SKILL.md              # Thumbnail generation playbook
│       ├── style-guide.md        # Visual style reference
│       └── best-examples/        # Reference thumbnails
├── scripts/
│   └── generate_image.py         # Gemini Flash Image generator
└── assets/
    ├── ben-photos/               # 50+ reference photos
    └── logos/                    # 50+ brand logos
        ├── ai-tools/
        ├── automation/
        ├── social/
        ├── dev-tools/
        ├── google/
        └── misc/
```

---

## Troubleshooting

| Problem | Solution |
|---------|----------|
| **GEMINI_API_KEY not set** | Get a free key at [aistudio.google.com/apikey](https://aistudio.google.com/apikey) and add to `~/.openclaw/.env` |
| **uv not found** | Install: `curl -LsSf https://astral.sh/uv/install.sh \| sh` |
| **Image not generating** | Check that `generate_image.py` exists in `~/.openclaw/workspace/skills/nano-banana-pro/scripts/` and your API key is valid |
| **Logo not found** | Sofia looks in `~/.openclaw/workspace/assets/logos/`. Check the subfolder and filename match what she expects |
| **OpenClaw not recognizing Sofia** | Make sure `skills/sofia/SKILL.md` is in your workspace. Restart the gateway: `openclaw gateway restart` |

---

## About

Built by [Ben Cordero](https://youtube.com/@imperiodigital) as part of the **Imperio Digital** AI agent ecosystem, powered by [OpenClaw](https://openclaw.com).

Sofia is one of several AI agents that help run a YouTube channel about automation, AI, and building businesses with intelligent tools.

---

## License

MIT — use it, modify it, make it yours.