Kai video production

From cgallic/kai-cmo-harness · View interactive version

Kai video production is an AI agent skill from the GitHub repository cgallic/kai-cmo-harness. Full-stack video production from script to rendered video. Combines script generation (optimized for TikTok/YouTube/Reels) with AI-powered video rendering using Remotion, AI voiceovers (Qwen3-TTS/ElevenLabs), music generation (ACE-Step), and browser-based demo recording. Multi-session project tracki

How to use this skill

Skill file

Video Production Pipeline

Kai root note: knowledge/, harness/, and scripts/ paths in this skill live in the Kai install, not the user's project. Resolve them against the first ancestor directory of this SKILL.md that contains a knowledge/ folder (the Kai plugin root, ~/.claude/kai, or the kai-cmo-harness repo). MARKETING.md, memory/, and any output files live in the current project. If a referenced scripts/ command is not available in this install, say so, skip it, and continue with the file-based guidance — never fabricate its output.

Studio-grade motion spots (a code-rendered hype launch spot, a walkthrough from real screenshots, or pain-point videos for a site, with the drop cut to the reveal) use /kai-motion-spot. This skill covers Remotion template production.

Complete video production from concept to final MP4. Combines two capabilities:

  1. Script generation - Platform-optimized scripts (TikTok, YouTube, Reels)
  2. Video production - AI-powered rendering with voiceovers, music, transitions

Prerequisites Check

Required:

Recommended for AI features:

Run /video-setup for interactive configuration.


Part 1: Script Generation (existing kai-video skill)

Phase 0: Load Product Context

Check if MARKETING.md exists in the project root (same directory as CLAUDE.md, README.md, package.json).

If it exists: Read it — skip product discovery questions.

If it does NOT exist: Auto-explore the codebase to create it in the project root (next to CLAUDE.md). Do NOT ask the user what the product is. Read CLAUDE.md, README.md, PROJECT.md, package.json, landing pages, and any project files. Search for email/ad/analytics config. Then create MARKETING.md using the template from /kai-email-system. Present draft to user for confirmation.

Phase 1: Video Discovery

Read from MARKETING.md. Only ask about things not covered there:

  1. Topic/product — what's the video about?
  2. Platform(s) — TikTok, YouTube Shorts, Reels, YouTube long-form?
  3. Format — talking head, screen recording, b-roll, animation, slides?
  4. Length — short-form (15-60s) or long-form (5-15min)?
  5. Goal — awareness, education, conversion, engagement?
  6. Production — script only, or full video render?

Phase 2: Script Production

Load these before writing:

Use hook formulas, quality gates from existing kai-video skill.

Output scripts to workspace/video/scripts/


Part 2: Video Production (new capability)

Production Options

  1. Script only - Stop after Phase 2, user records manually
  2. Automated production - Continue to render pipeline
  3. Hybrid - Generate some assets (voiceover, slides), user provides demos

Video Templates

Available templates:

Template structure:

projects/{name}/
├── project.json          # Project state, scenes, assets
├── VOICEOVER-SCRIPT.md   # Full narration script
├── src/
│   ├── Root.tsx          # Remotion composition
│   ├── scenes/           # Scene components
│   └── config/           # Timing, brand, assets
├── public/
│   ├── audio/            # Voiceovers, music, SFX
│   ├── demos/            # Screen recordings
│   ├── images/           # Screenshots, graphics
│   └── videos/           # External video clips
└── CLAUDE.md             # Auto-generated status

Production Pipeline

Preflight Variant Lab

Before asset creation or rendering, generate lightweight variants and score them as a dry run:

Write results to workspace/video/projects/{name}/PREFLIGHT-VARIANTS.md.

Use this scoring table:

| Factor | Score | Question |

|--------|-------|----------|

| Hook strength | 1-5 | Does the opening create immediate attention? |

| Message clarity | 1-5 | Is the core idea obvious after one watch? |

| Proof density | 1-5 | Are claims supported by demo, quote, data, or source? |

| Production fit | 1-5 | Can this be made with available assets and timeline? |

| Brand safety | 1-5 | Does it avoid fake authority, risky claims, or unclear rights? |

Pick one winner for production and keep rejected variants in the same file as the kill list. User approval is required before moving from variant lab to full render.

Step 1: Scene Planning

Decompose script into scenes:

{
  "scenes": [
    {
      "id": 1,
      "type": "title",
      "duration": 5,
      "visual": "slide",
      "narration": "Introducing KaiCalls...",
      "status": "ready"
    },
    {
      "id": 2,
      "type": "demo",
      "duration": 20,
      "visual": "demos/call-flow.mp4",
      "narration": "Watch how it handles incoming calls...",
      "status": "asset-needed"
    }
  ]
}

Scene types:

Step 2: Asset Creation

For each scene requiring assets:

Slide assets (auto-generated):

Demo assets (user/AI created):

```bash

/record-demo

# Opens browser, user performs actions, saves MP4

```

```bash

/record-demo --script demo-script.md --auto

```

Image assets:

```bash

python tools/flux2.py --prompt "Tech background" --cloud modal

```

```bash

python tools/image_edit.py --input photo.jpg --style cyberpunk

```

Step 3: Audio Production

Voiceover generation:

Option 1: AI voiceover (Qwen3-TTS, free)

python tools/voiceover.py --provider qwen3 \\
  --speaker Ryan --script VOICEOVER-SCRIPT.md \\
  --scene-dir public/audio/scenes --json

9 speakers available:

Option 2: ElevenLabs (premium)

python tools/voiceover.py --provider elevenlabs \\
  --voice-id {ID} --script VOICEOVER-SCRIPT.md

Option 3: Voice cloning (custom brand voice)

/voice-clone
# Records sample, creates cloned voice, saves to brand

Music generation:

Option 1: ACE-Step (free, precise control)

python tools/music_gen.py --preset corporate-bg \\
  --duration 120 --bpm 90 --key "D Minor"

8 scene presets:

Option 2: ElevenLabs music

python tools/music.py --prompt "Upbeat corporate" --duration 120

Sound effects:

python tools/sfx.py --preset whoosh  # Transitions
python tools/sfx.py --preset pop     # UI interactions
python tools/sfx.py --preset success # Completion
Step 4: Scene Review

Launch Remotion Studio for visual verification:

cd projects/{name}
npm run studio  # Opens localhost:3000

Review checklist per scene:

Iterative refinement:

Step 5: Design Polish

For slide-based scenes:

Load knowledge/frameworks/design/frontend-design.md and refine:

Run design review:

/design --scene {scene-id}
# Opens focused design session with frontend-design skill
Step 6: Rendering

Preview render (fast, lower quality):

npm run render -- --quality=low

Final render (production quality):

npm run render
# Outputs: out/{name}.mp4

Render options:

Step 7: Post-Production Utilities

Add music to existing video:

python tools/addmusic.py --input video.mp4 \\
  --prompt "Subtle ambient" --output final.mp4

Redub with different voice:

python tools/redub.py --input video.mp4 \\
  --voice-id {ID} --output dubbed.mp4

Remove watermarks:

python tools/dewatermark.py --input video.mp4 \\
  --preset sora --output clean.mp4 --cloud modal

Upscale resolution:

python tools/upscale.py --input video.mp4 \\
  --scale 2x --output hd.mp4 --cloud modal

Multi-Session Project Tracking

Project Lifecycle

planning → assets → review → audio → editing → rendering → complete

project.json Schema

{
  "name": "kaicalls-demo-v1",
  "template": "product-demo",
  "brand": "kaicalls",
  "created": "2026-03-28T15:00:00Z",
  "updated": "2026-03-28T16:30:00Z",
  "phase": "audio",
  "scenes": [
    {
      "id": 1,
      "type": "title",
      "duration": 5,
      "visual": "slide",
      "narration": "Introducing KaiCalls",
      "status": "ready"
    },
    {
      "id": 2,
      "type": "demo",
      "duration": 20,
      "visual": "demos/call-handling.mp4",
      "narration": "Watch how it handles calls...",
      "status": "asset-present"
    }
  ],
  "audio": {
    "voiceover": {
      "file": "audio/voiceover.mp3",
      "status": "present",
      "provider": "qwen3",
      "speaker": "Ryan"
    },
    "music": {
      "file": "audio/background.mp3",
      "status": "needed",
      "preset": "corporate-bg"
    }
  },
  "estimates": {
    "totalDurationSeconds": 90
  },
  "sessions": [
    {
      "date": "2026-03-28",
      "phase": "planning",
      "summary": "Created project, defined scenes"
    },
    {
      "date": "2026-03-28",
      "phase": "assets",
      "summary": "Recorded demo video"
    }
  ]
}

Intent vs Reality Reconciliation

On project resume:

  1. Scan filesystem - Check what assets actually exist
  2. Compare to intent - What does project.json expect?
  3. Update statuses:
  1. Flag discrepancies - Alert user to missing/unexpected files
  2. Regenerate CLAUDE.md - Auto-generated status document

CLAUDE.md example:

# Project: kaicalls-demo-v1

**Template:** product-demo | **Brand:** kaicalls | **Phase:** audio
**Last Updated:** 30 minutes ago

## Current Status

All demo assets are present. Voiceover generated. Ready for final review.

## Scenes

| # | Scene | Type | Visual | Status |
|---|-------|------|--------|--------|
| 1 | Title | title | slide | ✅ Ready |
| 2 | Demo | demo | demos/call-handling.mp4 | ✅ Present |
| 3 | Stats | stats | slide | ✅ Ready |
| 4 | CTA | cta | slide | ✅ Ready |

## Audio

- Voiceover: ✅ Generated (Qwen3-TTS, Ryan voice)
- Music: ⬜ Optional background music

## Next Actions

1. **Preview in Remotion Studio**
   ```bash
   cd projects/kaicalls-demo-v1 && npm run studio
   ```

2. **Render final video**
   ```bash
   npm run render
   ```

## Session History

- 2026-03-28: Created project, defined scenes (planning)
- 2026-03-28: Recorded demo video (assets)
- 2026-03-28: Generated voiceover (audio)

Session Continuity

First session: Planning + scene definition

Second session: Asset creation

Third session: Audio generation

Fourth session: Review + polish

Fifth session: Final render

Between sessions:


Brand Integration

Brand Profiles

brands/{brand}/
├── brand.json       # Colors, fonts, typography
├── voice.json       # Voice settings (speaker, style)
└── assets/          # Logo, backgrounds, graphics

brand.json Example

{
  "name": "KaiCalls",
  "colors": {
    "primary": "#3B82F6",
    "secondary": "#10B981",
    "background": "#111827",
    "text": "#F9FAFB"
  },
  "fonts": {
    "heading": {
      "family": "Inter",
      "weight": 700
    },
    "body": {
      "family": "Inter",
      "weight": 400
    }
  },
  "logo": "assets/logo.svg",
  "style": "modern-tech"
}

voice.json Example

{
  "provider": "qwen3",
  "speaker": "Ryan",
  "tone": "professional-warm",
  "pace": "moderate",
  "elevenlabs": {
    "voice_id": "YOUR_VOICE_ID",
    "stability": 0.75,
    "similarity_boost": 0.75
  }
}

Auto-application:


Transition Library

7 custom transitions + 4 Remotion official:

| Transition | Description | Use Case |

|------------|-------------|----------|

| glitch() | Digital distortion + RGB shift | Tech/glitch aesthetic |

| rgbSplit() | Chromatic aberration | Energetic transitions |

| zoomBlur() | Radial motion blur | Dramatic reveals |

| lightLeak() | Cinematic lens flare | Professional polish |

| clockWipe() | Radial sweep reveal | Time-based content |

| pixelate() | Digital mosaic | Retro/8-bit style |

| checkerboard() | Grid-based reveal (9 patterns) | Clean, geometric |

| slide() | Slide in/out (official) | Standard transitions |

| fade() | Crossfade (official) | Subtle transitions |

| wipe() | Directional wipe (official) | Directional flow |

| flip() | 3D flip (official) | Playful transitions |

Usage in scenes:

import { glitch, slide } from '@/lib/transitions';

<Sequence from={0} durationInFrames={150}>
  <Title />
</Sequence>
<Sequence from={150} durationInFrames={600}>
  <Demo transition={glitch({ duration: 30 })} />
</Sequence>

Cloud GPU Integration

Modal (Recommended)

Setup:

/video-setup
# Deploys all tools automatically
# $30/month free compute on Starter plan

Tools deployed:

Typical monthly cost: $1-3 for a few videos (within free tier)

RunPod (Alternative)

Setup:

python tools/qwen3_tts.py --setup
python tools/flux2.py --setup
# ... repeat for each tool

Pay-per-second, no minimums


Quality Gates

Before rendering:

  1. [ ] Script approved - Hooks strong, no AI slop
  2. [ ] All assets present - No missing demos/images
  3. [ ] Timing validated - Scene durations match narration
  4. [ ] Audio synced - Voiceover aligns with visuals
  5. [ ] Brand consistent - Colors, fonts, logo correct
  6. [ ] Transitions smooth - No jarring cuts
  7. [ ] Text readable - Contrast sufficient, size appropriate
  8. [ ] Preview reviewed - Remotion Studio walkthrough complete

After rendering:

  1. [ ] Resolution correct - 1080p or as specified
  2. [ ] Audio levels balanced - Voiceover audible over music
  3. [ ] File size reasonable - Under platform limits
  4. [ ] Format compatible - Works on target platform

Output Organization

workspace/video/
├── _video-projects.md              # Index of all projects
├── projects/
│   ├── kaicalls-demo-v1/
│   │   ├── project.json
│   │   ├── VOICEOVER-SCRIPT.md
│   │   ├── CLAUDE.md
│   │   ├── src/
│   │   ├── public/
│   │   └── out/
│   │       └── kaicalls-demo-v1.mp4
│   └── tropibot-launch/
│       └── ...
├── scripts/                         # Script-only outputs
│   ├── tiktok/
│   ├── youtube/
│   └── reels/
└── _production-guide.md

Commands Integration

/kai-video (entry point)

Script only:

/kai-video script --platform tiktok --topic "KaiCalls demo"
# Generates script, stops

Full production:

/kai-video produce --template product-demo --brand kaicalls
# Full pipeline: script → assets → audio → render

Resume project:

/kai-video resume kaicalls-demo-v1
# Picks up where left off

/video-setup (one-time)

/video-setup
# Interactive setup:
# 1. Cloud GPU provider (Modal/RunPod)
# 2. API keys (ElevenLabs optional)
# 3. Tool deployment
# 4. Verification

/record-demo (asset creation)

/record-demo --url https://app.kaicalls.com --output call-demo
# Opens browser, records interactions, saves MP4

/generate-voiceover (audio creation)

/generate-voiceover --project kaicalls-demo-v1
# Reads VOICEOVER-SCRIPT.md, generates audio per scene

/scene-review (quality check)

/scene-review --project kaicalls-demo-v1
# Opens Remotion Studio, walks through each scene

/design (visual refinement)

/design --scene 3 --project kaicalls-demo-v1
# Focused design session for specific scene

/voice-clone (brand voice)

/voice-clone --brand kaicalls
# Records sample, creates cloned voice

Cost Estimates

Full video production (60-90 seconds):

| Component | Tool | Cost |

|-----------|------|------|

| Script generation | Claude | ~$0.10 |

| Voiceover (AI) | Qwen3-TTS | ~$0.01 |

| Music (AI) | ACE-Step | ~$0.05 |

| Images (if needed) | FLUX.2 | ~$0.04 |

| Rendering | Local (Remotion) | $0.00 |

| Total | | ~$0.20 |

With premium features:

Free tier covers: 100+ videos/month on Modal Starter plan ($30 free compute)


Examples & Templates

Load these when starting production:

For product demos:

For explainers:

For social shorts:

All examples include:


Key Principles

  1. Script first, production second - Never skip script quality for production speed
  2. Multi-session by default - Projects span days/weeks, track state meticulously
  3. Intent vs reality - Filesystem is truth, reconcile on every resume
  4. Brand consistency - Auto-apply brand profiles, don't re-specify colors/fonts
  5. Quality gates mandatory - Review before render, verify after
  6. Cost-conscious - Prefer free/cheap AI tools, Modal free tier sufficient
  7. Platform-optimized - Different outputs for TikTok vs YouTube vs Reels

Evolution

This skill combines:

Continuous improvement:

Feedback loop:


Integration with Other Skills

Combines with:

Feeds into:

Example workflow:

# 1. Plan content
/kai-content-calendar --month April

# 2. Produce video
/kai-video produce --template product-demo --brand kaicalls

# 3. Repurpose for social
/kai-repurpose --source projects/kaicalls-demo-v1/out/video.mp4

# 4. Schedule posts
/kai-social --schedule --video

# 5. Track performance
/kai-analytics --video-performance

Troubleshooting

"Asset not found" error:

"Audio out of sync":

"Render fails":

"Tool timeout on Modal":

"Brand colors not applied":


Next Steps After This Skill

When user says "create video":

  1. Clarify scope:
  1. Choose path:
  1. For production:
  1. Track progress:
  1. On resume:

This skill is the union of script generation (marketing focus) and video production (technical execution). Use the appropriate parts based on user needs. Always start with script quality — production amplifies good scripts, it doesn't fix bad ones.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.