avibebuilder/claude-prime / .claude/skills/media-processor
media-processor
VerifiedSpecialized visual and multimedia processing tools. Use this skill whenever a task involves complex visual content — UI mockups, dense screenshots, design images, charts, artwork — where precise details like spacing, hex colors, font sizes, and component hierarchy need to be extracted accurately. Also use for: reviewing or auditing existing UI against designs, comparing screenshots for visual regressions, transcribing audio/video, extracting data from PDFs with complex layouts, and generating images. Trigger whenever the user wants to implement from a design, review or compare UI screenshots, analyze visual details precisely, describe artwork or aesthetic content, or process any media file (audio, video, PDF).
| File | Kind | Size |
|---|---|---|
| .env.example | other | 122 B |
| SKILL.md | skill md | 4.6 KB |
| references/api-gotchas.md | markdown | 1.9 KB |
| references/media-optimization.md | markdown | 1.3 KB |
| references/model-routing.md | markdown | 1.8 KB |
| scripts/document_converter.py | script | 11.0 KB |
| scripts/gemini_batch_process.py | script | 10.8 KB |
| scripts/image_gen.py | script | 6.9 KB |
| scripts/requirements.txt | manifest | 156 B |
references/api-gotchas.md
View on GitHub# API Gotchas & Non-Obvious Details
Things that will cause failures or waste tool calls if you don't know them upfront.
## Image Generation
**`aspect_ratio` must be nested inside `image_config`** — passing it directly to `GenerateContentConfig` raises "Extra inputs are not permitted":
```python
# WRONG
config = types.GenerateContentConfig(
response_modalities=['image'],
aspect_ratio='16:9'
)
# CORRECT
config = types.GenerateContentConfig(
response_modalities=['Image'], # Capital 'I'
image_config=types.ImageConfig(
aspect_ratio='16:9'
)
)
```
**`response_modalities` requires capital case**: `['Image']`, `['Text']` — not `['image']`, `['text']`.
**Text in images**: max 25 characters, up to 3 phrases.
## Video Processing
**Videos require polling after upload** — they aren't ready immediately:
```python
while myfile.state.name == 'PROCESSING':
time.sleep(5)
myfile = client.files.get(name=myfile.name)
```
**Clip to relevant segments** to avoid burning tokens on a full video:
```python
types.Part.from_video_metadata(
file_uri=myfile.uri,
start_offset='40s',
end_offset='80s'
)
```
**FPS control** — lower FPS = fewer tokens. Use `fps=0.5` for presentations, `fps=3-5` for fast action:
```python
types.Part.from_video_metadata(file_uri=myfile.uri, fps=0.5)
```
## Vision / Image Analysis
**Bounding box format**: object detection returns `[ymin, xmin, ymax, xmax]` normalized to `[0, 1000]` — not pixel coordinates. Scale to actual image dimensions.
**Image token formula** (decides whether resizing is worth it):
- Both dimensions ≤ 384px → 258 tokens flat
- Larger → tiled into 768×768 chunks, 258 tokens each
- 1920×1080 = 1,548 tokens. 3840×2160 (4K) = 6,192 tokens.
## Audio
**Token rate**: 32 tokens/second (1 min = 1,920 tokens, 1 hour = 115,200 tokens). Max 9.5 hours per request.
## YouTube
Public videos only. Free tier: 8 hours/day limit.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 470k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 470k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 470k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |