К основному содержанию
скилл CX Codex

vision-multimodal — скилл для Claude Code: анализ изображений и PDF

Скилл с готовыми шаблонами кода для распознавания картинок, скриншотов и PDF через API Anthropic. Пригодится, когда агенту нужно разобрать чужой интерфейс или вытащить таблицу из скана.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add TheLobbi/claude --skill vision-multimodal -a claude-code
Открыть на GitHub

Что делает vision-multimodal

Скилл включается на слова vision, image, screenshot, pdf, ocr и visual. Внутри — набор паттернов на Python: одиночная картинка, загрузка по URL, сравнение нескольких изображений, few-shot с примерами и разбор PDF через Files API. Для каждого случая показано, как закодировать файл в base64 и собрать блок content для client.messages.create.

Есть отдельный блок про промпты: назначение роли, пошаговое размышление перед ответом, вывод в JSON. Плюс функция optimize_for_claude на Pillow — уменьшает картинку до 1568 px по длинной стороне, чтобы срезать расход токенов. Размеры тоже разобраны: минимум 200 px, оптимум 1000x1000, максимум 8000x8000.

Скилл советует не ждать идеального OCR рукописного текста и напоминает, что у анимированного GIF берётся только первый кадр. Конкретных людей по фото он не опознаёт. Зависимость указана одна — llm-integration, так что без неё часть примеров работать не будет.

Какие задачи решает

  • вытащить текст из скриншота или скана
  • сравнить две картинки и перечислить различия
  • разобрать таблицу с изображения и вернуть её в markdown
  • сжать фото перед отправкой в модель, чтобы не жечь токены
  • получить из чека или счёта структурированный JSON

Примеры запросов агенту

  • проанализируй скриншот dashboard.png и опиши, что на нём происходит
  • сравни before.jpg и after.jpg, перечисли отличия
  • вытащи таблицу с этого изображения и верни её в markdown

Как установить vision-multimodal

1Через Skills CLI (Vercel)

npx skills add TheLobbi/claude --skill vision-multimodal -a claude-code

2Вручную: положить файлы

~/.claude/skills/vision-multimodal/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/vision-multimodal/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о vision-multimodal

Как установить vision-multimodal в Claude?

Выполните npx skills add TheLobbi/claude --skill vision-multimodal -a claude-code. После этого файл скилла окажется в ~/.claude/skills/vision-multimodal/SKILL.md.

Что делает vision-multimodal?

Даёт агенту шаблоны для работы с изображениями и PDF: кодирование в base64, отправку в API Anthropic, сравнение нескольких картинок, few-shot примеры и вывод в структурированном виде.

Какие ограничения у скилла?

Рукописный текст распознаётся плохо, у GIF читается только первый кадр, а конкретных людей по фото модель не опознаёт. Ещё указана зависимость от скилла llm-integration.

Исходный текст

SKILL.md · MIT
---
name: vision-multimodal
description: Vision and multimodal capabilities for Claude including image analysis, PDF processing, and document understanding. Activate for image input, base64 encoding, multiple images, and visual analysis.
allowed-tools:
  - Bash
  - Read
  - Write
  - Edit
  - Glob
  - Grep
  - Task
  - WebFetch
triggers:
  - vision
  - image
  - multimodal
  - base64
  - screenshot
  - pdf
  - document
  - ocr
  - visual
  - picture
dependencies:
  - llm-integration
related-skills:
  - extended-thinking
  - citations-retrieval
---

# Vision & Multimodal Skill

Leverage Claude's vision capabilities for image analysis, document processing, and multimodal understanding.

## When to Use This Skill

- Image analysis and description
- Document/PDF processing
- Screenshot analysis
- OCR-like text extraction
- Visual comparison
- Chart and diagram interpretation

## Supported Formats

| Format | Status | Best For |
|--------|--------|----------|
| JPEG | ✓ | Photos, natural scenes |
| PNG | ✓ | Screenshots, UI, text |
| GIF | ✓ | Animated (first frame) |
| WebP | ✓ | Modern, compressed |
| PDF | ✓ | Documents (via Files API) |

## Image Size Guidelines

- **Minimum:** 200 pixels (smaller = reduced accuracy)
- **Optimal:** 1000x1000 pixels
- **Maximum:** 8000x8000 pixels
- **Token cost:** ~(width × height) / 1000
- **Tip:** Resize to 1568px max dimension for 30-50% token savings

## Core Patterns

### Pattern 1: Single Image Analysis

```python
import anthropic
import base64

client = anthropic.Anthropic()

# Load and encode image
with open("image.jpg", "rb") as f:
    image_data = base64.standard_b64encode(f.read()).decode("utf-8")

response = client.messages.create(
    model="claude-sonnet-5",
    max_tokens=1024,
    messages=[{
        "role": "user",
        "content": [
            {
                "type": "image",
                "source": {
                    "type": "base64",
                    "media_type": "image/jpeg",
                    "data": image_data
                }
            },
            {
                "type": "text",
                "text": "Describe this image in detail."
            }
        ]
    }]
)
```

### Pattern 2: Image from URL

```python
import httpx

# Fetch and encode from URL
image_url = "https://example.com/image.jpg"
response = httpx.get(image_url)
image_data = base64.standard_b64encode(response.content).decode("utf-8")

# Then use same pattern as above
```

### Pattern 3: Multiple Images

```python
# Compare multiple images (up to 100 per request)
messages = [{
    "role": "user",
    "content": [
        {"type": "image", "source": {"type": "base64", "media_type": "image/jpeg", "data": image1}},
        {"type": "image", "source": {"type": "base64", "media_type": "image/jpeg", "data": image2}},
        {"type": "text", "text": "Compare these two images and list the differences."}
    ]
}]
```

### Pattern 4: Few-Shot with Images

```python
# Teach by example
messages = [
    # Example 1
    {"role": "user", "content": [
        {"type": "image", "source": {...}},
        {"type": "text", "text": "Classify this image."}
    ]},
    {"role": "assistant", "content": "Category: Landscape\nElements: Mountains, lake, trees"},

    # Example 2
    {"role": "user", "content": [
        {"type": "image", "source": {...}},
        {"type": "text", "text": "Classify this image."}
    ]},
    {"role": "assistant", "content": "Category: Portrait\nElements: Person, indoor, professional"},

    # Target image
    {"role": "user", "content": [
        {"type": "image", "source": {"type": "base64", "media_type": "image/jpeg", "data": target_image}},
        {"type": "text", "text": "Classify this image."}
    ]}
]
```

### Pattern 5: PDF Processing

```python
# Using Files API (beta)
with open("document.pdf", "rb") as f:
    pdf_data = base64.standard_b64encode(f.read()).decode("utf-8")

response = client.messages.create(
    model="claude-sonnet-5",
    max_tokens=4096,
    messages=[{
        "role": "user",
        "content": [
            {
                "type": "document",
                "source": {
                    "type": "base64",
                    "media_type": "application/pdf",
                    "data": pdf_data
                }
            },
            {"type": "text", "text": "Summarize this document."}
        ]
    }]
)
```

## Prompt Engineering for Vision

### Strategy 1: Role Assignment

```python
prompt = """You have perfect vision and exceptional attention to detail,
making you an expert at analyzing technical diagrams.

Analyze this architecture diagram and identify:
1. All components
2. Data flow between components
3. Potential bottlenecks"""
```

### Strategy 2: Step-by-Step Thinking

```python
prompt = """Before answering, analyze the image systematically:

<thinking>
1. What is the overall subject?
2. What are the key elements?
3. How do elements relate to each other?
4. What details stand out?
</thinking>

Then provide your answer based on this analysis."""
```

### Strategy 3: Structured Output

```python
prompt = """Extract information from this receipt and return as JSON:

{
    "vendor": "",
    "date": "",
    "items": [{"name": "", "price": 0}],
    "total": 0
}"""
```

## Image Optimization

```python
from PIL import Image
import io

def optimize_for_claude(image_path, max_dimension=1568):
    """Resize image to reduce token usage by 30-50%"""
    with Image.open(image_path) as img:
        # Calculate new dimensions
        ratio = min(max_dimension / img.width, max_dimension / img.height)
        if ratio < 1:
            new_size = (int(img.width * ratio), int(img.height * ratio))
            img = img.resize(new_size, Image.LANCZOS)

        # Convert to bytes
        buffer = io.BytesIO()
        img.save(buffer, format="JPEG", quality=85)
        return base64.standard_b64encode(buffer.getvalue()).decode("utf-8")
```

## Common Use Cases

### Text Extraction (OCR-like)

```python
prompt = """Extract all text from this image.
Preserve the original formatting and structure as much as possible.
If text is unclear, indicate with [unclear]."""
```

### Table Extraction

```python
prompt = """Extract the table data from this image.
Return as a markdown table with proper headers and alignment."""
```

### Chart Analysis

```python
prompt = """Analyze this chart:
1. What type of chart is this?
2. What are the axes/labels?
3. What are the key data points?
4. What trends or patterns are visible?"""
```

## Best Practices

### DO:
- Use high-quality images (≥1000px)
- Resize large images to save tokens
- Provide context about what to look for
- Use few-shot examples for consistent output

### DON'T:
- Send images smaller than 200px
- Expect perfect OCR for handwriting
- Send very large images (>8000px)
- Ignore token costs for multiple images

## Limitations

- Cannot identify specific individuals
- May struggle with very small text
- Animated GIFs: only first frame analyzed
- Some specialized symbols may be misread

## See Also

- [[llm-integration]] - API basics
- [[extended-thinking]] - Complex reasoning
- [[citations-retrieval]] - Document citations

© TheLobbi · MIT · TheLobbi/claude

Похожие скиллы

Всё по теме «ИИ и ML» →
vision kotot Передаёт изображения внешней совместимой с OpenAI визуальной модели, когда у текущего агента нет встроенного зрения. Помогает разбирать скриншоты ошибок, графики и текст со сканов. CX Codex +1 13 400установок qianwen-vision QianWen-AI Разбирает изображения и видео с помощью визуальных моделей Qwen. Скилл распознаёт текст через OCR, читает графики, сравнивает картинки и отвечает на вопросы по видео. CX Codex +1 5 700установок qwencloud-vision QwenCloud Скилл для анализа изображений и видео через модели Qwen VL и QVQ: OCR, чтение графиков и таблиц, сравнение нескольких картинок, визуальные рассуждения. CX Codex +1 1 800установок vision-analysis MiniMax-AI Описывает картинки, вытаскивает текст и разбирает интерфейсы через инструмент MiniMax. Пригодится, когда агенту нужно понять, что на скриншоте или макете. CX Codex +1 2 700установок configuring-vision oxbshw Настраивает провайдеров зрения для Watch Skill: подключает OpenAI, Anthropic, Gemini, OpenRouter или локальную Ollama без привязки к одной модели. CX Codex +1 496установок ai-multimodal mrgoonie Скилл для работы с аудио, видео, изображениями и PDF через Gemini API. Пригодится, когда надо расшифровать запись, разобрать скриншот или вытащить таблицу из документа. CX Codex +1 530установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой