# How to Add the Video Production Skill to Your AI Agent

Category: Video

Use when the user requests a video longer than 15 seconds, a multi-scene video, or any production requiring scene planning, narration, or clip merging. End-to-end guide for producing long-form videos from short clips: covers scene decomposition, per-model clip duration limits (confirm each model's maximum by reading its input schema), the image-first animation pipeline for character consistency, composition assembly for multi-asset videos or a media-editing merge for simple concatenation (optional fade/dissolve), audio narration synchronization, and cost estimation.

Raw file: https://spiral.ai/skills/video-production/SKILL.md

## Tools Video Production uses

- [HTML Video Renderer](https://spiral.ai/tools/spiral/render-video)

## How to add Video Production to your agent

Pick the way that suits you. Each takes about two minutes.

### Save SKILL.md into your agent's skills

1. **Download the skill**: Claude Code, and other agents that read Agent Skills, load it from this folder when they start.

```bash
mkdir -p ~/.claude/skills/video-production
curl -fsSL https://spiral.ai/skills/video-production/SKILL.md -o ~/.claude/skills/video-production/SKILL.md
curl -fsSL https://spiral.ai/skills/video-production/model-reference.md -o ~/.claude/skills/video-production/model-reference.md
```

2. **Connect Spiral**: The skill runs its tools through Spiral. Send your agent this message once to set it up.

```
set up https://spiral.ai/SKILL.md
```

### Use the Spiral CLI

1. **Install and sign in**: Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

```bash
npx -y spiral-cli@latest init
```

2. **Read the skill**: Built-in skills are on for every organization: the CLI prints this one with all its files.

```bash
spiral agent-skills get video-production --json
```

### Read it from the Spiral API

1. **Create an API key**: In the console, under API keys.

2. **Fetch the skill**: The answer holds SKILL.md and every other file of the skill, in path order.

```bash
curl https://api.spiral.ai/v1/skills/video-production \
  -H "Authorization: Bearer $SPIRAL_API_KEY"
```

Then ask your agent for the task: it loads Video Production when a request matches the skill's description.

## Instructions (SKILL.md)

# Video Production

## The Core Constraint

Single clips are short: most models cap at 10–15 seconds and the longest reach about 30 seconds (read each model's maximum from its input schema). When a user asks for a "5-minute video", you MUST decompose it into clips and assemble them.

### Discovering Model Capabilities

Before planning a video production:

1. Load the **model-recommendations** Skill to pick a video model for your use case (cinematic, UGC, product, cartoon, etc.)
2. **Read its input schema** — check the `duration` field's options to find max clip length
3. **Estimate the cost** of representative clip inputs to get the cost per clip

### Duration Math

To estimate the number of clips needed:

```
Total duration / max clip duration per model = number of clips
```

ALWAYS present this math to the user in the plan, and wait for approval, BEFORE generating. Long videos are expensive.

Check the scene plan against each model's minimum duration too. If scenes shorter than the minimum, or scene count × minimum, exceed the requested runtime, the brief and the model conflict. Ask the user before generating: extend the runtime, combine scenes into one multi-shot clip, or shorten scenes or lines. Never resolve it by trimming generated clips below their spoken lines. Estimate each line's spoken length (about 150 words per minute) and give it a scene long enough to finish.

When one character speaks in several independently generated clips, each clip's native audio picks its own voice. Keep one voice: generate the character's lines with one fixed TTS voice and lip-sync them (see model-recommendations), or tell the user the voice may drift before generating.

When user-supplied audio drives the video (a song or voiceover the performer must sing or speak), follow "Supplied audio that a person must visibly perform" in model-recommendations: measure the track first and plan around its real duration and silent regions.

### Scenes that follow a song's lyrics

Use this when scenes must illustrate the lines of a song that plays under them (a story music video, a lyric video), whether or not anyone sings on camera.

- **Time the words, not blocks.** Get per-word start and end times for the track from a word-timing transcription tool ("Getting word timing" in the **hyperframes-video** Skill's `captions.md`). Here it is a timing source only: show no captions unless the user asked for on-screen lyrics, and ask no caption style question. A timestamped transcription starts a new line only at a pause, so over continuous vocals one "line" can span a minute: it cannot place scenes. When the user supplied the lyrics, align their lines to the caption words (normalise case and punctuation, then sequence-match), which gives each lyric line its start time. When the sung words drop or change lines the user wrote, name those lines and, before any paid render, ask the user to choose whether to regenerate the song (with its cost) or continue with it as sung. On-screen lyrics show the words as sung.
- **Scene windows come from the lines.** Each scene starts at the first line it illustrates and ends where the next scene starts. Snap a cut to the nearest beat only when one is within about 0.3 s. Never give every scene the model's maximum clip length and join them end to end: the picture then drifts away from the words.
- **Plan in order.** The plan can estimate scene count and cost from the track length before the timing exists. After the timing step, rebuild the scene list from the windows, and request each clip at the shortest supported duration that covers its window. Split a window longer than the model's maximum into several shots, and give a line shorter than the model's minimum to the scene before or after it. When that changes the total, update the plan before generating.
- **Assemble on the master timeline.** Trim each clip to its window and place it at its window start under the unmodified song, so the video length equals the song length. Crossfades take time from neighbouring windows; recompute every later position or use straight cuts.
- **Check before you claim it.** Measure the cuts in the delivered file (scene-change detection, or stills on both sides of each planned window start) and compare them with the planned window starts; a cut more than about 0.5 s off its line is a defect to fix before delivery. Say the scenes are timed to the lyrics only when the windows came from word timings.

## Production Pipeline

Follow these phases IN ORDER. Show the user the full plan and wait for approval before starting.

### Phase 1: Script & Planning

1. **Write the script** -- Draft the script directly using this Skill's video-production guidance:
   - Scene-by-scene narration text
   - Estimated duration per scene (150 words per minute for narration)
   - Voice selection from available ElevenLabs voices
   - Visual descriptions per scene

2. **Plan scenes** -- Map the script to video clips:
   - Each scene = 1 video clip (max duration per model)
   - If a scene needs longer than the clip limit, split it into sub-scenes
   - Note which scenes share characters, settings, or visual elements

3. **Show the plan** -- Give the user:
   - Total scene count
   - Estimated cost (clips + narration + merging), built by estimating the cost once per generation step
   - Clip duration and model choice
   - Wait for user approval before proceeding

### Phase 2: Visual Foundation (Character & Scene References)

Do NOT skip this phase.

1. **Generate character reference images** -- For each unique character:
   - Generate a detailed reference image using an image model
   - Store the URL -- this becomes the character reference input for ALL video clips featuring this character (confirm the input field by reading its input schema)
   - Verify the reference looks correct before proceeding

2. **Generate scene keyframe images** -- For each scene:
   - Generate a static image that represents the scene's starting frame
   - Use the character reference URL if the character appears in the scene
   - Include style brief keywords (color palette, lighting, mood) in every prompt
   - Generate independent scene images in parallel, one run per image, all started at once

3. **Review & approve** -- Show the user the reference images and scene keyframes before generating expensive video clips. One wrong reference cascades into many wrong clips.

### Phase 3: Video Clip Generation

For each scene, generate the video clip using the image-to-video pipeline:

1. **Use image-to-video** (NOT text-to-video) -- Pass the scene keyframe image as the model's start-frame input (confirm the field by reading its input schema). This ensures:
   - Visual consistency with the keyframe
   - Character appearance matches the reference
   - Scene composition starts exactly as planned

2. **Match parameters across all clips:**
   - SAME model for all clips (do NOT mix different video models in one production)
   - SAME aspect ratio (16:9 for landscape, 9:16 for vertical)
   - SAME resolution (a merge pads mismatched clips with black bars to the planned output size)
   - Include consistent environment details in every prompt

3. **Run independent clips in parallel** -- For clips that don't depend on each other (most scenes are independent), run them in parallel, one run per clip, all started at once.

4. **Handle end frames** -- For smooth transitions, set the end frame of clip N to match the start frame of clip N+1. Read the model's input schema for an `end_image_url` (or equivalent) field — not every video model supports it.

### Phase 4: Audio & Narration

1. **Generate narration** -- Pick a TTS model from the model-recommendations Skill ("Speech / narration / TTS") and generate one clip per scene:
   - Use the SAME voice across all scenes
   - Match narration duration to clip duration (if narration is longer than the clip, split narration or extend the clip)
   - Generate narration clips in parallel, one run per clip

2. **Duration mismatch handling:**
   - If narration is shorter than video: video will have silent sections (acceptable)
   - If narration is longer than video: either shorten the narration text or generate a longer video clip (use a model with higher max duration, or split the scene into two clips)
   - Target: narration duration <= clip duration for each scene

3. **Assembly as a composition** (the **hyperframes-video** Skill, rendered with `spiral/render-video`) — use this for multi-asset videos with narration, captions, audio mixing, transitions, or any overlays: one HTML document places every clip, its narration, the captions and the background music on one timeline, rendered in ONE call.

   **CRITICAL: every clip and audio duration MUST be the actual duration** obtained from generation tool responses or by probing the file. NEVER hardcode, guess, or assume these values. See the **hyperframes-video** Skill's `durations-and-assets.md` for details.

   What a composition handles that stream-copy concatenation cannot:
   - Audio mixing (narration + background music at independent volumes)
   - Word-level caption overlays

4. **Assembly with a merge** (media-editing Skill) — use this for simple concatenation with no overlays, no audio mixing, and no captions:
   - To attach narration per clip BEFORE concatenation, replace each clip's audio (media-editing Skill), then merge the results. Better: render a composition end-to-end and skip the per-clip merge step.
   - The merge recipe normalizes the clips in the command, takes as many inputs per run as its schema allows (merge longer lists in batches), and joins with cuts, fades or dissolves

5. **Background music / sound effects** (optional):
   - In a composition: one looping `<audio>` element at a low `data-volume` (the **hyperframes-video** Skill)
   - With a merge: pick a music model from the **model-recommendations** Skill ("Music generation"), then mix it under the final video (media-editing Skill). Prefer a composition when the production also needs narration, captions, or transitions — it handles the full mix in one call.

6. **Final review** -- Present the composed video to the user. If scenes are inconsistent, offer to regenerate specific clips.

## Extend Strategy (Alternative to Merging Clips)

Some video models support extending an existing clip in place (find a tool that is an "extend" variant, or read its input schema for a `video_url` input field). This gives smoother continuity than merging discrete clips.

## Critical Rules for Video Production

1. **ALWAYS show the plan and wait for approval** for any video over 15 seconds. Show the user clip count, model, and total cost.
2. **NEVER promise exact durations** -- video generation is approximate. "5-minute video" may end up as 4:45 or 5:15.

## Video Model Decision Tree

Before generating ANY video, determine the correct model category:

```
What does the user want?
│
├─ Animate a scene/landscape/action → IMAGE-TO-VIDEO
│  (Generate a keyframe image first, then animate it)
│
├─ A person speaking/presenting → LIPSYNC
│  (Generate portrait + audio, then lipsync)
│
├─ Cinematic footage from text → TEXT-TO-VIDEO
│  (No reference image available)
│
├─ Extend an existing clip → VIDEO EXTEND (find a tool that is an extend variant of your video model)
│
└─ Multiple scenes for a long video → IMAGE-TO-VIDEO per scene
   (Each scene gets its OWN unique keyframe → its OWN unique video)
```

LIPSYNC produces a talking head from a SINGLE photo. It does NOT create scene-specific visual content. If different scenes show different places/events/actions, you MUST use IMAGE-TO-VIDEO, not LIPSYNC.

## Verification Gates Between Phases

Do NOT proceed to the next phase until the current phase passes verification.

### After Phase 2 (Visual Foundation):

- [ ] Each scene has its OWN unique keyframe image (different URLs)
- [ ] Character reference image exists if characters appear
- [ ] All images use consistent style/aspect ratio

### After Phase 3 (Video Clips):

- [ ] Each video call used a DIFFERENT image_url (check the parallel run inputs)
- [ ] All videos use the SAME model, resolution, and aspect ratio
- [ ] The number of video clips matches the number of scenes in the plan

### After Phase 4 (Audio):

- [ ] Each audio clip has a UNIQUE URL (if two URLs match, one was overwritten — regenerate it)
- [ ] Each audio merge or composition pairs the CORRECT video with its CORRESPONDING audio
- [ ] Audio count matches video count (1:1 mapping)

If any check fails, STOP and fix before proceeding. Do not pay for later phases built on broken earlier phases.

## Worked Example: News Broadcast

User: "Create a 2-minute video of an anchor reporting 5 news stories"

**Phase 1 — Script:**

- Scene 1 (intro): Anchor at desk, introduces broadcast (10s)
- Scenes 2-6: Five news stories with B-roll visuals (20s each)
- Scene 7 (outro): Anchor wraps up (10s)

**Phase 2 — Visual Foundation:**

- Generate anchor portrait (1 image) → used for intro/outro
- Generate 5 UNIQUE scene keyframes: war zone, market crash, Fed meeting, oil refinery, diplomacy summit

**Phase 3 — Video Clips:**

- Intro: image-to-video using ANCHOR portrait + "anchor speaks to camera" prompt
- Scene 2: image-to-video using WAR ZONE keyframe + "missiles, explosions" prompt
- Scenes 3–6: the same pattern, each with its own keyframe (market crash, Fed meeting, oil refinery, diplomacy)
- Outro: image-to-video using ANCHOR portrait + "anchor nods, signs off" prompt

Each scene uses its OWN keyframe. NOT lipsync. NOT the same image repeated.

**Phase 4 — Audio & Assembly:**

- Generate 7 narration clips (one per scene, different text each)
- Verify: 7 unique audio URLs
- For each clip, replace its audio with the narration (media-editing Skill) — OR (preferred) skip this step and render a composition end-to-end
- Merge all clips in order with fade transitions (media-editing Skill)

## Other files

- [model-reference.md](https://spiral.ai/skills/video-production/model-reference.md)

## More skills

- [Character Films](https://spiral.ai/skills/character-films)
- [Frame Chaining](https://spiral.ai/skills/frame-chaining)
- [Gemini Omni Video](https://spiral.ai/skills/gemini-omni-video)
- [HyperFrames Animation](https://spiral.ai/skills/hyperframes-animation)

## Questions about Video Production

### Video Production

**What does the Video Production skill do?**

Use when the user requests a video longer than 15 seconds, a multi-scene video, or any production requiring scene planning, narration, or clip merging. End-to-end guide for producing long-form videos from short clips: covers scene decomposition, per-model clip duration limits (confirm each model's maximum by reading its input schema), the image-first animation pipeline for character consistency, composition assembly for multi-asset videos or a media-editing merge for simple concatenation (optional fade/dissolve), audio narration synchronization, and cost estimation.

**Which tools does Video Production use?**

It runs HTML Video Renderer through Spiral, each at the price on its tool page.

**Does the Video Production skill cost anything?**

The skill is free. The tools it runs are billed pay-as-you-go from your Spiral balance at each tool's stated price, with no plan.

**How does my agent know when to use Video Production?**

An agent reads each skill's description and loads its instructions when a request matches it.

**How do I add Video Production to Claude Code?**

Save its files into ~/.claude/skills/video-production/ with the commands on this page; Claude Code loads it when it starts.

**Can I use Video Production in other agents?**

Yes. Any agent that reads Agent Skills folders loads the same files, and any other agent reads the skill with `spiral agent-skills get video-production --json` or the Spiral API.

**Is Video Production on for my Spiral organization?**

Yes. Built-in skills are on for every organization; an admin can turn Video Production off on the console's Skills page.

**Where is the Video Production SKILL.md file?**

At https://spiral.ai/skills/video-production/SKILL.md, with no key needed. On the console's Skills page, Customize saves a copy you can edit as your organization's own skill.

