/gemini-video-producer:gemini-video-producerfrom gemini-video-producer
Creates AI-generated videos using Google Flow via MCP Playwright browser automation. Handles storyboarding, keyframe generation, and video prompt writing through a structured, iterative workflow.
Ships in gemini-video-producer. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Create professional AI-generated videos through a structured, iterative workflow using Google Flow via MCP Playwright.
This skill uses a main agent + sub-agents architecture for efficient context management:
┌─────────────────────────────────────────────────────────────────┐
│ MAIN AGENT (this skill) │
│ - Handles all user interaction and approvals │
│ - Creates philosophy.md, style.json, scene-breakdown.md │
│ - Generates pipeline.json │
│ - Orchestrates sub-agents via Task tool │
│ - Updates pipeline.json status after each sub-agent returns │
│ - Runs FFmpeg concatenation │
└───────────────────────────┬─────────────────────────────────────┘
│ Task tool spawns general-purpose agents
│ with embedded instructions from references/
┌───────────────────┼───────────────────┐
▼ ▼ ▼
┌───────────────┐ ┌───────────────┐ ┌───────────────┐
│ asset-generator│ │keyframe-generator│ │segment-generator│
│ (general-purpose)│ │ (general-purpose)│ │ (general-purpose)│
├───────────────┤ ├───────────────┤ ├───────────────┤
│ Fresh context │ │ Fresh context │ │ Fresh context │
│ MCP browser │ │ MCP browser │ │ MCP browser │
│ Returns path │ │ Returns path │ │ Returns paths │
│ + status only │ │ + status only │ │ + status only │
└───────────────┘ └───────────────┘ └───────────────┘
Benefits:
Implementation Note: Sub-agents are spawned using subagent_type="general-purpose" with the full instructions from references/*.md files embedded in the prompt. This achieves the same isolation benefits while using Claude Code's built-in agent system.
Required:
MCP Playwright: If not installed, run automatically:
claude mcp add playwright -- npx @playwright/mcp@latest
Generation is controlled through browser automation. Local Python helpers handle frame extraction and concatenation. Resource paths are relative to this SKILL.md. Use the current host's browser, planning, and delegation tools; Claude Code tool names below are examples of those interfaces, not a runtime dependency.
At workflow start, verify MCP Playwright is available:
mcp__playwright__browser_snapshot()claude mcp add playwright -- npx @playwright/mcp@latest. In another host, use its browser tooling setup.URL: https://labs.google/fx/flow
Flow is a project-based AI filmmaking tool with these generation modes:
| Mode | German Label | Model | Purpose |
|---|---|---|---|
| Text to Image | "Bild erstellen" | Nano Banana Pro | Generate assets and keyframes |
| Video from Frames | "Video aus Frames" | Veo 3.1 - Quality | Generate video segments from start frame |
| Text to Video | "Video aus Text" | Veo 3.1 - Quality | Generate video from text only |
| Video from Elements | "Video aus Elementen" | Veo 3.1 - Quality | Generate video with reference elements |
Current UI adaptation: Read references/browser-generation.md when executing any generation role. Flow may expose an AI-agent composer rather than the mode selector shown above. In that UI, express the same generation mode and settings in the request; attach references and explicitly identify the starting image as FIRST FRAME for segments. Inspect the proposed generation settings and submit the service's single-job confirmation.
Video Settings:
YOU MUST FOLLOW THESE RULES:
Three sub-agents are defined in references/:
Use the Task tool with subagent_type="general-purpose" and embed the agent instructions from references/ in the prompt:
Task(
subagent_type="general-purpose",
prompt='''
You are an asset-generator sub-agent. Follow these instructions:
[Read and embed full contents of references/asset-generator.md here]
---
NOW EXECUTE THIS TASK:
{
"asset_id": "hero_character",
"prompt": "A heroic knight in silver armor, standing tall, dramatic lighting",
"output_path": "output/project/assets/characters/hero.png",
"project_dir": "D:/Project/gemini-video-producer-skill/output/project"
}
''',
description="Generate hero character asset"
)
IMPORTANT: Before spawning sub-agents, use the Read tool to load the agent instructions:
Read("references/asset-generator.md") for asset generationRead("references/keyframe-generator.md") for keyframe generationRead("references/segment-generator.md") for segment generationThen embed those instructions in the Task prompt.
Parallel Execution: For independent tasks, spawn multiple sub-agents in a single message:
# Assets can be generated in parallel (all use general-purpose with embedded instructions)
Task(subagent_type="general-purpose", prompt="[asset-generator instructions] + asset 1 task", description="Generate asset 1")
Task(subagent_type="general-purpose", prompt="[asset-generator instructions] + asset 2 task", description="Generate asset 2")
Task(subagent_type="general-purpose", prompt="[asset-generator instructions] + asset 3 task", description="Generate asset 3")
Sequential Execution: Segments within a scene must be sequential (frame chaining):
# Segment A first (uses keyframe)
result_A = Task(subagent_type="general-purpose", prompt="[segment-generator instructions] + seg A task...")
# Segment B uses extracted frame from A
result_B = Task(subagent_type="general-purpose", prompt="[segment-generator instructions] + seg B task...")
Videos are structured hierarchically:
Scene 1 (20 sec target → 3 segments)
├── Keyframe: scene-01-start.png (GENERATED via keyframe-generator)
├── Segment A (8 sec) → extract frame (via segment-generator)
├── Segment B (8 sec) → extract frame (via segment-generator)
└── Segment C (4 sec) (via segment-generator, no extraction)
[TRANSITION: fade/cut/dissolve]
Scene 2 (8 sec target → 1 segment)
├── Keyframe: scene-02-start.png (GENERATED via keyframe-generator)
└── Segment A (8 sec) (via segment-generator)
Why this model:
1. Navigate to https://labs.google/fx/flow (use MCP directly for initial check)
2. Handle cookie consent if needed
3. Verify login status (look for project list or user avatar)
4. If not logged in, guide user through login
5. Create a new project or use existing one
Note: This phase is done by the main agent directly to verify MCP is working.
Create both files before proceeding:
{output_dir}/philosophy.md{output_dir}/style.jsonphilosophy.md template:
# Production Philosophy: [Project Name]
## Visual Identity
- **Art Style**: [e.g., cinematic realistic, anime, painterly]
- **Color Palette**: [primary colors, mood, temperature]
- **Lighting**: [natural, dramatic, soft, high-contrast]
- **Composition**: [rule of thirds, centered, dynamic angles]
## Motion Language
- **Movement Quality**: [smooth/fluid, dynamic/energetic, subtle/minimal]
- **Pacing**: [fast cuts, slow contemplative, rhythmic]
- **Camera Style**: [static, tracking, handheld, cinematic sweeps]
## Subject Consistency
- **Characters/Products**: [detailed descriptions]
- **Environment**: [setting details]
- **Props/Elements**: [recurring visual elements]
## Constraints
- **Avoid**: [unwanted elements]
- **Maintain**: [elements that must stay consistent]
style.json template:
{
"project_name": "Project Name",
"visual_style": {
"art_style": "description",
"color_palette": "description",
"lighting": "description",
"composition": "description"
},
"motion_language": {
"movement_quality": "description",
"pacing": "description",
"camera_style": "description"
},
"subject_consistency": {
"main_subject": "detailed description",
"environment": "detailed description"
},
"constraints": {
"avoid": ["list", "of", "things"],
"maintain": ["list", "of", "things"]
}
}
CHECKPOINT: Get user approval before proceeding.
Create {output_dir}/scene-breakdown.md:
# Scene Breakdown: [Project Name]
## Overview
- **Total Duration**: [X seconds]
- **Number of Scenes**: [N]
- **Segment Duration**: 8 seconds (Flow Veo limit)
- **Video Type**: [promotional/narrative/educational/etc.]
---
## Scene 1: [Title]
**Duration**: [X seconds] → [ceil(X/8)] segments
**Purpose**: [What this scene communicates]
**Transition to Next**: [cut/fade/dissolve/wipe]
**Starting Keyframe**:
[Detailed visual description for the generated keyframe that starts this scene]
**Segments**:
1. **Seg A** (0-8s): [Motion description for first 8 seconds]
2. **Seg B** (8-16s): [Motion description for next 8 seconds]
3. **Seg C** (16-Xs): [Motion description for remaining seconds]
**Camera**: [static/tracking/pan/zoom/POV]
---
## Scene 2: [Title]
**Duration**: [X seconds] → [ceil(X/8)] segments
**Purpose**: [What this scene communicates]
**Transition to Next**: [null - last scene]
**Starting Keyframe**:
[Detailed visual description - this is a NEW scene so needs its own keyframe]
**Segments**:
1. **Seg A** (0-8s): [Motion description]
**Camera**: [camera style]
---
Planning Guidelines:
| When to Create a New Scene |
|---|
| Camera angle/perspective changes significantly |
| Location or setting changes |
| Time jump occurs |
| Subject/focus changes |
| You want a cinematic transition (fade, dissolve) |
| When to Add Segments (Same Scene) |
|---|
| Continuous action exceeds 8 seconds |
| Same camera perspective continues |
| No narrative break needed |
Segment Calculation: segments_needed = ceil(scene_duration / 8)
| Scene Duration | Segments Needed |
|---|---|
| 1-8 seconds | 1 |
| 9-16 seconds | 2 |
| 17-24 seconds | 3 |
| 25-32 seconds | 4 |
CHECKPOINT: Get user approval before proceeding.
Create {output_dir}/pipeline.json:
Pipeline Schema v3.0:
{
"version": "3.0",
"project_name": "project-name",
"config": {
"segment_duration": 8
},
"metadata": {
"created_at": "ISO timestamp",
"philosophy_file": "philosophy.md",
"style_file": "style.json",
"scene_breakdown_file": "scene-breakdown.md"
},
"assets": {
"backgrounds": {
"<id>": {
"prompt": "Detailed description...",
"output": "assets/backgrounds/<id>.png",
"status": "pending"
}
},
"characters": {
"<id>": {
"prompt": "Detailed description...",
"output": "assets/characters/<id>.png",
"status": "pending"
}
}
},
"scenes": [
{
"id": "scene-01",
"title": "Scene Title",
"duration_target": 20,
"transition_to_next": "cut",
"first_keyframe": {
"prompt": "Detailed visual description for scene start...",
"output": "keyframes/scene-01-start.png",
"status": "pending"
},
"segments": [
{
"id": "seg-01-A",
"motion_prompt": "Motion description for first 8 seconds...",
"output_video": "scene-01/seg-A.mp4",
"status": "pending"
},
{
"id": "seg-01-B",
"motion_prompt": "Continuing motion for next 8 seconds...",
"output_video": "scene-01/seg-B.mp4",
"status": "pending"
},
{
"id": "seg-01-C",
"motion_prompt": "Final motion segment...",
"output_video": "scene-01/seg-C.mp4",
"status": "pending"
}
]
},
{
"id": "scene-02",
"title": "Different Scene",
"duration_target": 8,
"transition_to_next": null,
"first_keyframe": {
"prompt": "New visual context description...",
"output": "keyframes/scene-02-start.png",
"status": "pending"
},
"segments": [
{
"id": "seg-02-A",
"motion_prompt": "Motion description...",
"output_video": "scene-02/seg-A.mp4",
"status": "pending"
}
]
}
]
}
Schema Notes:
config.segment_duration: Flow Veo's max video length (8 seconds)scenes[].duration_target: Desired scene length → determines segment count: ceil(duration / 8)scenes[].transition_to_next: Transition to apply before next scene (cut, fade, dissolve, wipe, or null for last scene)scenes[].first_keyframe: Generated image to establish scene's visual contextscenes[].segments[]: Technical video chunks that chain seamlessly within the sceneMotion prompts for video segments MUST follow this official Veo structure:
Structure: [Cinematography] + [Subject] + [Action] + [Context] + [Style & Ambiance]
| Component | Description | Example |
|---|---|---|
| Cinematography | Camera movement, shot type, lens | "Slow dolly push forward", "Wide tracking shot", "Close-up with shallow depth of field" |
| Subject | Main visual focus with details | "A massive silver-blue warship with glowing cyan engines", "A young woman's face" |
| Action | ONE primary motion/change | "rotates its turrets into firing position", "looks out the window at passing lights" |
| Context | Setting, environment, surroundings | "against a backdrop of colorful nebula in deep space", "inside a bus at night during a rainstorm" |
| Style & Ambiance | Mood, lighting, visual quality | "Tense pre-battle atmosphere, dramatic rim lighting, photorealistic cinematic quality" |
Prompt Requirements:
Good Example:
Slow dolly push forward through a massive fleet formation in deep space. Sleek silver-blue warships with angular hulls drift majestically past camera, their cyan engines pulsing with rhythmic blue light. Turrets on the nearest destroyer slowly rotate into firing position as shield generators flicker to life with crackling blue energy. The ships hold perfect V-formation against a backdrop of distant stars and colorful nebula. Tense pre-battle atmosphere, epic cinematic scale, photorealistic sci-fi with dramatic rim lighting on metal hulls.
Bad Example (too many actions, vague camera):
Battle erupts in full fury. Blue and red laser beams crisscross the frame. A battleship fires broadsides. Explosions ripple. Fighters weave between ships. Debris scatters everywhere. Camera tracks through chaos.
↑ This has 6+ simultaneous actions and "camera tracks through chaos" is vague.
Fixed Version:
Dynamic tracking shot following a massive human battleship as it unleashes a devastating broadside. Blue energy bolts erupt from its flanking cannons, streaking across the void toward an enemy cruiser. Orange explosions bloom on the target's shields, rippling with impact energy. Debris and sparks scatter into space. The battleship's hull fills the foreground, weapon ports flashing in sequence. Intense combat lighting with contrasting blue and orange, chaotic but readable action, cinematic sci-fi blockbuster quality.
Common Mistakes to Avoid:
| Mistake | Problem | Fix |
|---|---|---|
| Multiple simultaneous actions | Veo can't render 5 things at once clearly | Focus on ONE primary action |
| Static descriptions | "Ships in space" describes an image, not video | Add motion: "Ships drift forward, engines pulsing" |
| Vague camera direction | "Camera moves dynamically" | Use specific: "Tracking shot following the ship" |
| Too short (30-50 words) | Lacks detail for quality output | Expand to 100-150 words |
| Missing style/mood | Generic output | Add atmosphere: "Tense, dramatic rim lighting" |
CHECKPOINT: Get user approval before proceeding.
First, read the agent instructions:
Read("references/asset-generator.md")
For each asset in pipeline.json, spawn a general-purpose sub-agent with embedded instructions:
Task(
subagent_type="general-purpose",
prompt='''
[Embed full contents of references/asset-generator.md here]
---
NOW EXECUTE THIS TASK:
{
"asset_id": "<asset_id>",
"prompt": "<asset_prompt>",
"output_path": "<full_output_path>",
"project_dir": "<project_directory>"
}
''',
description="Generate <asset_id> asset"
)
Parallel Execution: Assets are independent - spawn all sub-agents in parallel:
# All assets can run simultaneously (embed same instructions in each)
Task(subagent_type="general-purpose", prompt="[asset-generator.md] + asset1 task", description="Generate asset 1")
Task(subagent_type="general-purpose", prompt="[asset-generator.md] + asset2 task", description="Generate asset 2")
Task(subagent_type="general-purpose", prompt="[asset-generator.md] + asset3 task", description="Generate asset 3")
After each sub-agent returns:
CHECKPOINT: Review assets (read the image files), get user approval.
First, read the agent instructions:
Read("references/keyframe-generator.md")
For each scene in pipeline.json, spawn a general-purpose sub-agent with embedded instructions:
Task(
subagent_type="general-purpose",
prompt='''
[Embed full contents of references/keyframe-generator.md here]
---
NOW EXECUTE THIS TASK:
{
"scene_id": "<scene_id>",
"prompt": "<keyframe_prompt>",
"output_path": "<full_keyframe_path>",
"project_dir": "<project_directory>",
"style_context": {
"art_style": "<from style.json>",
"color_palette": "<from style.json>",
"lighting": "<from style.json>"
}
}
''',
description="Generate <scene_id> keyframe"
)
Parallel Execution: Keyframes are independent - spawn all in parallel:
Task(subagent_type="general-purpose", prompt="[keyframe-generator.md] + scene-01 task", description="Generate scene-01 keyframe")
Task(subagent_type="general-purpose", prompt="[keyframe-generator.md] + scene-02 task", description="Generate scene-02 keyframe")
After each sub-agent returns:
first_keyframe.status to "completed" or "error"CHECKPOINT: Review all scene keyframes (read the image files), get user approval.
First, read the agent instructions:
Read("references/segment-generator.md")
For each scene in pipeline.json: For each segment in scene.segments:
IMPORTANT: Segments within a scene MUST be sequential (frame chaining)
# Scene 1 segments - SEQUENTIAL
seg_A_result = Task(
subagent_type="general-purpose",
prompt='''
[Embed full contents of references/segment-generator.md here]
---
NOW EXECUTE THIS TASK:
{
"segment_id": "seg-01-A",
"scene_id": "scene-01",
"motion_prompt": "<motion_prompt>",
"start_frame_path": "<project_dir>/keyframes/scene-01-start.png",
"output_video_path": "<project_dir>/scene-01/seg-A.mp4",
"project_dir": "<project_directory>",
"extract_end_frame": true,
"end_frame_path": "<project_dir>/scene-01/extracted/after-seg-A.png"
}
''',
description="Generate seg-01-A"
)
# Wait for seg_A to complete, then use its extracted frame
seg_B_result = Task(
subagent_type="general-purpose",
prompt='''
[Embed full contents of references/segment-generator.md here]
---
NOW EXECUTE THIS TASK:
{
"segment_id": "seg-01-B",
"scene_id": "scene-01",
"motion_prompt": "<motion_prompt>",
"start_frame_path": "<project_dir>/scene-01/extracted/after-seg-A.png",
"output_video_path": "<project_dir>/scene-01/seg-B.mp4",
"project_dir": "<project_directory>",
"extract_end_frame": true,
"end_frame_path": "<project_dir>/scene-01/extracted/after-seg-B.png"
}
''',
description="Generate seg-01-B"
)
# Last segment - no extraction needed
seg_C_result = Task(
subagent_type="general-purpose",
prompt='''
[Embed full contents of references/segment-generator.md here]
---
NOW EXECUTE THIS TASK:
{
"segment_id": "seg-01-C",
"scene_id": "scene-01",
"motion_prompt": "<motion_prompt>",
"start_frame_path": "<project_dir>/scene-01/extracted/after-seg-B.png",
"output_video_path": "<project_dir>/scene-01/seg-C.mp4",
"project_dir": "<project_directory>",
"extract_end_frame": false,
"end_frame_path": null
}
''',
description="Generate seg-01-C"
)
Cross-Scene Parallelization: Different scenes can run in parallel since they don't share frames:
# Scene 1 and Scene 2 keyframes are ready - both scene segment chains can run in parallel
# (But segments WITHIN each scene must be sequential)
Execution Flow:
Scene 1 (3 segments) - Sequential chain:
seg-A: start=keyframe → generate → extract frame
seg-B: start=after-seg-A.png → generate → extract frame
seg-C: start=after-seg-B.png → generate → (no extraction)
Scene 2 (1 segment) - Can run in parallel with Scene 1:
seg-A: start=keyframe → generate → (no extraction)
After each sub-agent returns:
CHECKPOINT: Get user approval on videos.
This phase is handled by the main agent directly (not sub-agents).
Use the scripts/merge_videos.py script to concatenate videos. This script uses moviepy and handles resolution differences automatically.
Merge Script Location: scripts/merge_videos.py
Usage:
python scripts/merge_videos.py -o <output_file> <input1> <input2> [input3] ...
Step 1: Concatenate segments within each scene (seamless)
For each scene, merge its segments:
# Scene 1: combine segments
cd {output_dir}
python {skill_dir}/scripts/merge_videos.py -o scene-01/scene.mp4 scene-01/seg-A.mp4 scene-01/seg-B.mp4
# Scene 2: combine segments
python {skill_dir}/scripts/merge_videos.py -o scene-02/scene.mp4 scene-02/seg-A.mp4 scene-02/seg-B.mp4 scene-02/seg-C.mp4 scene-02/seg-D.mp4
# Scene 3: combine segments
python {skill_dir}/scripts/merge_videos.py -o scene-03/scene.mp4 scene-03/seg-A.mp4 scene-03/seg-B.mp4
Step 2: Combine all scenes into final video
Merge all scene videos into the final output:
python {skill_dir}/scripts/merge_videos.py -o output.mp4 scene-01/scene.mp4 scene-02/scene.mp4 scene-03/scene.mp4
Script Features:
Script Options:
| Option | Description |
|---|---|
-o, --output | Output video file path (required) |
--codec | Video codec (default: libx264) |
--fps | Output FPS (default: first video's FPS) |
--no-resize | Don't resize videos to match first |
Step 3: Clean up and finalize
Final output: {output_dir}/output.mp4
{output_dir}/
├── philosophy.md
├── style.json
├── scene-breakdown.md
├── pipeline.json
├── output.mp4 <- FINAL VIDEO (with transitions)
├── assets/
│ ├── characters/
│ └── backgrounds/
├── keyframes/
│ ├── scene-01-start.png <- Generated (scene 1 start)
│ └── scene-02-start.png <- Generated (scene 2 start)
├── scene-01/
│ ├── seg-A.mp4 <- Segment videos
│ ├── seg-B.mp4
│ ├── seg-C.mp4
│ ├── scene.mp4 <- Concatenated scene (intermediate)
│ └── extracted/ <- Internal extracted frames
│ ├── after-seg-A.png
│ └── after-seg-B.png
├── scene-02/
│ ├── seg-A.mp4
│ └── scene.mp4
└── ...
Key Points:
keyframes/ contains only generated keyframes (one per scene)scene-XX/extracted/ contains extracted frames (internal, for segment chaining)scene-XX/scene.mp4 is the intermediate concatenated scene (before transitions)1. Check MCP Playwright availability
2. Navigate to Flow and verify login
3. Create philosophy.md
4. Create style.json
5. Get user approval on philosophy
6. Create scene-breakdown.md (with scenes and segments)
7. Get user approval on scene breakdown
8. Create pipeline.json (v3.0 with nested segments)
9. Get user approval on pipeline
10. Spawn asset-generator sub-agents (parallel)
11. Update pipeline.json with asset results
12. Review assets, get user approval
13. Spawn keyframe-generator sub-agents (parallel)
14. Update pipeline.json with keyframe results
15. Review keyframes, get user approval
16. Spawn segment-generator sub-agents (sequential per scene, parallel across scenes)
17. Update pipeline.json with segment results
18. Get user approval on videos
19. Concatenate segments within each scene (ffmpeg)
20. Concatenate scenes with transitions into output.mp4
21. Provide final summary
When a sub-agent returns an error:
| Parameter | Value |
|---|---|
| Segment Duration | 8 seconds per generation (Flow Veo limit) |
| Image Resolution | Use the current UI's original download size |
| Video Resolution | Use the resolutions offered by the current UI/account |
| Rate Limiting | Report service errors shown by Flow |
| GPU Required | None (cloud-based) |
| Image Model | Nano Banana Pro |
| Video Model | Veo 3.1 - Quality |
| Outputs per Prompt | 1 |
Key Terminology:
| Issue | Solution |
|---|---|
| Sub-agent returns error | Check error message, retry with fresh sub-agent |
| Rate limited / Out of credits | Wait or upgrade subscription, then retry |
| Generation stuck | Sub-agent will timeout and return error |
| File not found | Check the actual download path and native Save completion |
| Pipeline out of sync | Re-read pipeline.json, update status fields |
| Not logged in | Guide user to log in at labs.google/fx/flow |
| Generation mode wrong | Verify the mode selector or the Agent's proposed settings and attached first frame |
assets/example-style.json (opens in a new tab)references/asset-generator.md (opens in a new tab)references/browser-generation.md (opens in a new tab)references/keyframe-generator.md (opens in a new tab)references/pipeline.md (opens in a new tab)references/prompt-engineering.md (opens in a new tab)references/segment-generator.md (opens in a new tab)references/style-systems.md (opens in a new tab)references/troubleshooting.md (opens in a new tab)scripts/extract_frame.py (opens in a new tab)scripts/merge_videos.py (opens in a new tab)scripts/requirements.txt (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub zysilm/video-producer-skill --plugin gemini-video-producerOther plugins' skills for the same job