with one click
ai-multimodal
// [AI & Tools] Use when processing multimedia content with Gemini vision, audio, video, document, image, or video-generation APIs.
// [AI & Tools] Use when processing multimedia content with Gemini vision, audio, video, document, image, or video-generation APIs.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | ai-multimodal |
| version | 2.0.0 |
| description | [AI & Tools] Use when processing multimedia content with Gemini vision, audio, video, document, image, or video-generation APIs. |
Goal: Process and generate multimedia content (images, audio, video, documents) using Google Gemini API via Python scripts.
Workflow:
gemini_batch_process.py with appropriate task and filesKey Rules:
GEMINI_API_KEY environment variablemedia_optimizer.py to compress/split files exceeding limitsBe skeptical. Apply critical thinking, sequential thinking. Every claim needs traced proof, confidence percentages (Idea should be more than 80%).
Process audio, images, videos, and documents or generate images/videos using Google Gemini's multimodal API via bundled Python scripts.
Read toolapi-design or frontend-designreferences/music-generation.md only when specifically requestedai-artist skillexport GEMINI_API_KEY="your-key" # From https://aistudio.google.com/apikey
pip install google-genai python-dotenv pillow
python scripts/check_setup.py # Verify setup
Optional: API key rotation for rate limits (set GEMINI_API_KEY_2, GEMINI_API_KEY_3).
| Input Type | Task | Command |
|---|---|---|
| Image (PNG/JPG/WEBP) | Analyze, caption, OCR | --task analyze |
| Audio (WAV/MP3/AAC) | Transcribe, summarize | --task transcribe |
| Video (MP4/MOV) | Scene detection, Q&A | --task analyze |
| PDF/Document | Extract tables, forms | --task extract |
| Text prompt | Generate image | --task generate |
| Text prompt | Generate video | --task generate-video |
IF file exceeds limits, use scripts/media_optimizer.py to compress/split first.
Quick check: If gemini CLI is available, use: "<prompt>" | gemini -y -m gemini-2.5-flash
Standard: Use the batch processing script:
# Analyze media
python scripts/gemini_batch_process.py --files <file> --task <analyze|transcribe|extract>
# Generate content
python scripts/gemini_batch_process.py --task generate --prompt "description"
python scripts/gemini_batch_process.py --task generate-video --prompt "description"
Stdin support: cat image.png | python scripts/gemini_batch_process.py --task analyze --prompt "Describe this"
[HH:MM:SS -> HH:MM:SS] timestampsdocs/assets/| Purpose | Model | Notes |
|---|---|---|
| Analysis (fast) | gemini-2.5-flash | Recommended default |
| Analysis (advanced) | gemini-2.5-pro | Complex reasoning tasks |
| Image generation | imagen-4.0-generate-001 | Standard quality |
| Image generation (quality) | imagen-4.0-ultra-generate-001 | Best quality |
| Image generation (speed) | imagen-4.0-fast-generate-001 | Fastest |
| Video generation | veo-3.1-generate-preview | 8s clips with audio |
gemini_batch_process.py -- CLI orchestrator for all tasks, auto-resolves API keys and modelsmedia_optimizer.py -- Compress/resize/split media to fit Gemini limitsdocument_converter.py -- Convert PDFs/images/Office docs to markdowncheck_setup.py -- Verify environment, dependencies, and API keyUse --help on any script for full options.
Input: 45-minute meeting audio file meeting-2025-01-15.mp3
Steps:
python scripts/media_optimizer.py --input meeting-2025-01-15.mp3 --split-duration 900
python scripts/gemini_batch_process.py --files meeting-part-*.mp3 --task transcribe
Input: Quarterly HR report PDF with tables, charts, and forms
Steps:
python scripts/document_converter.py --input quarterly-report.pdf --output docs/assets/
Load for in-depth guidance:
| Topic | File |
|---|---|
| Audio processing | references/audio-processing.md |
| Vision/image analysis | references/vision-understanding.md |
| Image generation | references/image-generation.md |
| Video analysis | references/video-analysis.md |
| Video generation | references/video-generation.md |
| Music generation | references/music-generation.md |
ai-artist -- for prompt engineering and optimization (not media processing)media-processing -- for FFmpeg-based audio/video encoding without AIpdf-to-markdown -- for simple PDF text extraction without vision AI[IMPORTANT] Use
TaskCreateto break ALL work into small tasks BEFORE starting — including tasks for each file read. This prevents context loss from long files. For simple tasks, AI MUST ATTENTION ask user whether to skip.
AI Mistake Prevention — Failure modes to avoid on every task:
Check downstream references before deleting. Deleting components causes documentation and code staleness cascades. Map all referencing files before removal. Verify AI-generated content against actual code. AI hallucinates APIs, class names, and method signatures. Always grep to confirm existence before documenting or referencing. Trace full dependency chain after edits. Changing a definition misses downstream variables and consumers derived from it. Always trace the full chain. Trace ALL code paths when verifying correctness. Confirming code exists is not confirming it executes. Always trace early exits, error branches, and conditional skips — not just happy path. When debugging, ask "whose responsibility?" before fixing. Trace whether bug is in caller (wrong data) or callee (wrong handling). Fix at responsible layer — never patch symptom site. Assume existing values are intentional — ask WHY before changing. Before changing any constant, limit, flag, or pattern: read comments, check git blame, examine surrounding code. Verify ALL affected outputs, not just the first. Changes touching multiple stacks require verifying EVERY output. One green check is not all green checks. Holistic-first debugging — resist nearest-attention trap. When investigating any failure, list EVERY precondition first (config, env vars, DB names, endpoints, DI registrations, data preconditions), then verify each against evidence before forming any code-layer hypothesis. Surgical changes — apply the diff test. Bug fix: every changed line must trace directly to the bug. Don't restyle or improve adjacent code. Enhancement task: implement improvements AND announce them explicitly. Surface ambiguity before coding — don't pick silently. If request has multiple interpretations, present each with effort estimate and ask. Never assume all-records, file-based, or more complex path.
Critical Thinking Mindset — Apply critical thinking, sequential thinking. Every claim needs traced proof, confidence >80% to act. Anti-hallucination: Never present guess as fact — cite sources for every claim, admit uncertainty freely, self-check output for errors, cross-reference independently, stay skeptical of own confidence — certainty without evidence root of all hallucination.
MUST ATTENTION apply critical thinking — every claim needs traced proof, confidence >80% to act. Anti-hallucination: never present guess as fact.
MUST ATTENTION apply AI mistake prevention — holistic-first debugging, fix at responsible layer, surface ambiguity before coding, re-read files after compaction.
TaskCreate BEFORE startingfile:line evidence for every claim (confidence >80% to act)[TASK-PLANNING] Before acting, analyze task scope and systematically break it into small todo tasks and sub-tasks using TaskCreate.