Skillquality 0.46

video-gen

Video generation via fal.ai -- from quick one-off clips to multi-scene productions with keyframes, state tracking, and assembly. 10+ models including Kling 3.0, Veo 3.1, Sora 2, LTX-2.3. Two modes: light (fire-and-forget) and project (structured pipeline with gates).

Price
free
Protocol
skill
Verified
no

What it does

video-gen

Video generation and multi-scene production via fal.ai. Two modes: light (fire-and-forget) and project (interactive pipeline with gates).

Scripts: ./scripts/generate.py, ./scripts/preview.py, ./scripts/project_init.py, ./scripts/project_state.py, ./scripts/decompose.py, ./scripts/keyframe.py, ./scripts/clip.py, ./scripts/assemble.py, ./scripts/character_sheet.py Output dir: ./output/

Setup

export FAL_KEY="your-fal-ai-key"
  • Claude Code: copy this skill folder into .claude/skills/video-gen/
  • Codex CLI: append this SKILL.md content to your project's root AGENTS.md

For the full installation walkthrough (prerequisites, API keys, verification, troubleshooting), see references/installation-guide.md.

Credential management

Three tiers for managing the FAL_KEY environment variable:

  1. Vault skill (recommended): If you have a vault or secret-management skill, store the key there and export it before running scripts. Example: export FAL_KEY=$(vault get FAL_KEY)
  2. Custom secret manager: Use your team's preferred secret manager (1Password CLI, AWS Secrets Manager, etc.)
  3. Plain export: export FAL_KEY='your-fal-ai-key' in your shell profile

For project mode (keyframes + character sheets): also need image-gen peer skill.

Staying Updated

This skill ships with an UPDATES.md changelog and UPDATE-GUIDE.md for your AI agent.

After installing, tell your agent: "Check UPDATES.md in the video-gen skill for any new features or changes."

When updating, tell your agent: "Read UPDATE-GUIDE.md and apply the latest changes from UPDATES.md."

Follow UPDATE-GUIDE.md so customized local files are diffed before any overwrite.


Decision Tree

Need video?
├── Quick one-off clip? ─────────── Light Mode (generate.py)
│   Single prompt, single output, no state
│
└── Multi-scene story/production? ── Project Mode
    ├── New project? ─────────────── project_init.py → G0
    ├── Existing project? ────────── project_state.py --status
    └── Resume at gate? ──────────── Check state, pick up where left off

Quick Reference

Light Mode

# Generate with default model (ltx-2.3)
python ./scripts/generate.py \
  --prompt "A red fox running through snow" \
  --output ./output/

# Generate with specific model and settings
python ./scripts/generate.py \
  --prompt "Tokyo skyline at sunset with dramatic clouds" \
  --model kling-v3 \
  --mode t2v \
  --duration 10 \
  --resolution 1080p \
  --aspect 16:9

# Image-to-video generation
python ./scripts/generate.py \
  --prompt "The character starts walking forward" \
  --mode i2v \
  --image ./path/to/keyframe.png \
  --model veo-3

# Quick preview (uses LTX fast, cheapest)
python ./scripts/preview.py \
  --prompt "Test scene" \
  --mode t2v

Project Mode

# Initialize new project
python ./scripts/project_init.py \
  --name noir-detective \
  --scenes 5 \
  --output-dir ./projects \
  --style "cinematic, moody, film noir" \
  --tier standard \
  --logline "A detective investigates in a cyberpunk city"

# Check project status
python ./scripts/project_state.py --project ./projects/noir-detective

# Generate keyframe for scene
python ./scripts/keyframe.py \
  --project ./projects/noir-detective \
  --scene 1 \
  --style-keywords "cinematic, moody"

# Generate video clip for scene
python ./scripts/clip.py \
  --project ./projects/noir-detective \
  --scene 1 \
  --model kling-v3 \
  --duration 8

# Assemble final video
python ./scripts/assemble.py \
  --clips-dir ./projects/noir-detective/scenes \
  --output ./projects/noir-detective/output/final.mp4

Light Mode

Model Selection

What do you need?
├── Fast drafts + budget? ──────────── ltx-2.3 (fast) $0.04/s
├── Cinematic quality? ─────────────── kling-v3 $0.168/s
├── Dialogue/lip sync? ─────────────── veo-3 $0.20-0.40/s
├── Long clips (>10s)? ─────────────── sora-2 (up to 25s)
├── Budget with audio? ─────────────── wan $0.05-0.10/s
├── Anime/stylized? ────────────────── hailuo $0.045-0.08/s
└── Physics accuracy? ──────────────── cosmos $0.20/video
Use CaseModelCost/5sWhy
Fast draftsltx-2.3$0.20Open source, 4K capable, fastest iteration
Cinematickling-v3$0.84Multi-shot narratives, character consistency
Dialogue/lip syncveo-3$2.00Best-in-class audio sync, natural performances
Long clipssora-2$2.50Up to 25s duration, complex scenes
Budget with audiowan$0.50Cheapest audio option, social media
Anime/stylizedhailuo$0.40Anime support, micro-expressions
Physicscosmos$0.20RL-trained on physics, simulation-accurate

Script Reference: generate.py

FlagDefaultDescription
--modelltx-2.3Model alias: ltx-2.3, kling-v3, veo-3, sora-2, wan, hailuo, cosmos, pixverse, grok
--modet2vt2v (text-to-video) or i2v (image-to-video)
--promptrequiredVideo description
--imagenoneSource image path or URL (required for i2v)
--duration8Duration in seconds
--resolution1080p720p, 1080p, 1440p, 4k
--aspect16:916:9, 9:16, 1:1
--fps24Frames per second
--seednoneReproducibility seed
--output./output/Output directory or file path
--no-previewfalseSkip macOS QuickLook preview
--no-audiofalseDisable audio generation
--qualitystandardfast, standard, pro
--dry-runfalseCost estimate only, no API call
--timeout300Queue timeout in seconds
--negative-promptnoneWhat to exclude from generation
--jsonfalseOutput JSON only (suppress stderr logs)

Script Reference: preview.py

# Preview existing video file
python ./scripts/preview.py /path/to/video.mp4

# Generate and preview (uses LTX fast, $0.04/s)
python ./scripts/preview.py \
  --prompt "Quick test scene" \
  --mode t2v \
  [--image path] \
  [--output path]

Output JSON Contract

{
  "success": true,
  "file": "/abs/path/to/20260308-143052-t2v-red-fox-snow.mp4",
  "model": "ltx-2.3",
  "mode": "t2v",
  "duration_sec": 8,
  "resolution": "1080p",
  "cost_usd": 0.32,
  "seed": 42,
  "fal_request_id": "abc123"
}

Duration Constraints

ModelValid DurationsNotes
LTX-2.32, 4, 6, 8, 10sFixed increments only
Kling V3/2.65, 10sTwo options only
Veo 3.15-8sAny value in range
Sora 25-20s (std), 5-25s (pro)Any value in range
Hailuo4-6sAny value in range
Wan3-5sAny value in range
Cosmos5-9sAny value in range

Cost Quick Reference

ModelVideo OnlyWith Audio4K Available
ltx-2.3 (fast)$0.04/s$0.04/sYes ($0.16/s)
ltx-2.3 (std)$0.06/s$0.06/sYes ($0.24/s)
wan$0.05/s$0.10/sNo
hailuo$0.045/sN/ANo
kling-v3$0.168/s$0.336/sNo
veo-3 (fast)$0.10/s$0.15/sNo
veo-3 (std)$0.20/s$0.40/sNo
sora-2 (720p)$0.30/sincludedNo
sora-2 (1080p)$0.50/sincludedNo

Project Mode

Gate Pipeline (G0-G5)

GateStageWhatScriptsJSON Output
G0Project SetupInitialize project structure, manifest, stateproject_init.pyproject_dir, manifest, state paths
G1Shot PromptsStory decomposition into scene promptsdecompose.pyLLM prompt for story breakdown
G2Reference ImagesGenerate keyframe images per scenekeyframe.pykeyframe image paths, costs
G3Sequence ReviewReview and lock shot sequenceproject_state.py --lock-sequencesequence lock confirmation
G4Video GenerationGenerate video clips per sceneclip.pyvideo clip paths, costs
G5AssemblyCombine clips into final videoassemble.pyfinal video path, metadata

Detailed Gate Instructions

G0 - Project Setup: Use project_init.py to create project folder with scenes/, characters/, audio/, output/ subdirectories, manifest.md template, and state.json tracking file. Define style, tier, budget, aspect ratio.

G1 - Shot Prompts: Use decompose.py to generate LLM prompt for story decomposition. Coordinator runs this against LLM to get scene-by-scene breakdown. Update state.json with scene prompts.

G2 - Reference Images: Run keyframe.py for each scene to generate keyframe images. These anchor the visual style and serve as I2V inputs. Requires image-gen peer skill.

G3 - Sequence Review: Use project_state.py --lock-sequence to freeze the shot sequence. No more scene additions/deletions after this gate. Review keyframes before locking.

G4 - Video Generation: Run clip.py for each scene to generate video clips using keyframes as I2V input. Outputs shot_NN.mp4 files in scenes/NN-name/ directories.

G5 - Assembly: Use assemble.py to discover clips and combine them with ffmpeg. Supports crossfades, audio overlay, and story.json metadata for timing.

Script Reference: project_init.py

FlagDefaultDescription
--namerequiredProject name (kebab-case)
--scenesrequiredNumber of scenes (int >= 1)
--output-dirrequiredParent directory for project
--aspect16:916:9, 9:16, 1:1
--stylecinematicStyle keywords (comma-separated)
--tierstandardbudget, standard, premium, ultra
--loglinenoneOne-line story description
--budget50.0Max spend in USD

Script Reference: project_state.py

# Display status table
python ./scripts/project_state.py --project /path/to/project

# Update gate status
python ./scripts/project_state.py \
  --project /path \
  --scene 1 \
  --gate prompt \
  --status locked \
  --path scenes/01-intro/prompt.md

# Add new scene
python ./scripts/project_state.py \
  --project /path \
  --add-scene \
  --scene-name climax \
  --scene-number 6

# Lock sequence (G3)
python ./scripts/project_state.py --project /path --lock-sequence

# Invalidate downstream gates
python ./scripts/project_state.py \
  --project /path \
  --scene 1 \
  --invalidate prompt

Script Reference: decompose.py

FlagDefaultDescription
--idearequiredStory concept description
--stylerequiredVisual style keywords
--aspect-ratio16:9Video aspect ratio
--duration30Total target duration (seconds)
--tierstandardGeneration tier
--outputnoneSave LLM prompt to file

Script Reference: keyframe.py

FlagDefaultDescription
--projectrequiredProject directory path
--scenerequiredScene number
--style-keywordsnoneOverride style keywords
--modelfrom tierImage generation model
--no-state-updatefalseDon't update state.json

Script Reference: clip.py

FlagDefaultDescription
--projectrequiredProject directory path
--scenerequiredScene number
--modelfrom tierVideo generation model
--duration6Clip duration in seconds
--qualitystandardfast, standard, pro
--bridgefalseUse temporal bridging
--seednoneReproducibility seed
--no-state-updatefalseDon't update state.json

Script Reference: assemble.py

FlagDefaultDescription
--clips-dirrequiredDirectory containing scene clips
--outputrequiredOutput video file path
--storynonestory.json for timing metadata
--audiononeVoiceover track path
--musicnoneBackground music path
--crossfade0.5Crossfade duration between clips

Script Reference: character_sheet.py

FlagDefaultDescription
--character-jsonrequiredCharacters definition file
--character-idrequiredCharacter ID from JSON
--output-dirrequiredOutput directory for images
--viewsfront,profile,three_quarterComma-separated view list
--tierstandardImage generation tier

File Structure

project-name/
├── manifest.md                    # Human-readable project summary
├── state.json                     # Machine state tracking (G0-G5)
├── story.json                     # Scene decomposition (G1 output)
├── characters.json                # Character definitions
├── scenes/
│   ├── 01-intro/
│   │   ├── prompt.md              # Scene description
│   │   ├── keyframe.png           # Reference image (G2)
│   │   └── shot_01.mp4           # Generated clip (G4)
│   ├── 02-conflict/
│   │   ├── prompt.md
│   │   ├── keyframe.png
│   │   └── shot_02.mp4
│   └── ...
├── characters/                    # Character reference sheets
│   ├── detective-front.png
│   ├── detective-profile.png
│   └── ...
├── audio/                         # Voiceover and music
└── output/                        # Final assembled videos
    └── final.mp4

Token Efficiency Rules

  1. Coordinator context management: Load only current gate's requirements, not full project history
  2. Scene isolation: Each scene script operates independently with minimal cross-references
  3. State checkpoints: Use state.json as single source of truth, not file system scanning
  4. Selective loading: Scripts load only required JSON sections, not entire project state

Going Back / Cascade Rules

  • Upstream change: Invalidates all downstream gates automatically
  • Prompt change (G1): Invalidates G2 (keyframes), G4 (clips), G5 (assembly)
  • Keyframe change (G2): Invalidates G4 (clips), G5 (assembly)
  • Sequence lock (G3): Prevents scene additions/deletions, allows content changes
  • Clip regeneration (G4): Invalidates G5 (assembly) only

Style Control (3 Layers)

  1. Project tier: Maps to default models (budget→ltx-2.3, standard→kling-v3, premium→kling-v3, ultra→veo-3)
  2. Project style keywords: Applied to all keyframes and clips automatically
  3. Per-scene overrides: --style-keywords flag on keyframe.py/clip.py for scene-specific variations

Dependencies

Required for Light Mode

  • Python 3.10+
  • requests library: pip install requests
  • fal.ai API key (FAL_KEY environment variable)

Required for Project Mode (additional)

  • ffmpeg + ffprobe (video assembly): install via system package manager
  • image-gen peer skill (keyframes + character sheets)

Image-gen Peer Resolution

Scripts resolve image generation dependency in this order:

  1. Environment override: IMAGE_GEN_SCRIPT=/path/to/generate.py (explicit path)
  2. Auto-discovery: ../image-gen/scripts/generate.py (peer skill in fieldwork layout)
  3. Actionable error: "Image generation requires the image-gen skill. Install it as a peer skill or set IMAGE_GEN_SCRIPT env var."

Anti-Patterns

Anti-patternWhy it failsDo this instead
Using produce.py when interactive mode is appropriateSkips human review gates, produces lower qualityUse project mode (G0-G5 pipeline) for quality work
Skipping style checkpoint on first keyframeInconsistent visual style across scenesReview and approve keyframe style before generating remaining scenes
Generating video before locking prompts and imagesWasted generation costs on changing requirementsComplete G1-G3 (prompts, keyframes, sequence lock) before G4
Hardcoding model without considering budgetCost overruns, especially with Sora/VeoUse --dry-run first, choose model based on budget and use case
Generating clips out of orderBreaks temporal bridging between scenesGenerate clips sequentially: scene 1, 2, 3...
Loading full prompts into coordinator contextToken waste, context overflowLoad only current gate requirements, use state.json for coordination
Using --duration 4 with LTXAPI validation error (LTX minimum is 6s)Use --duration 6 or higher for LTX model
Forgetting --image flag for i2v modeGeneration fails with validation errorAlways provide --image path/URL for image-to-video
Using Kling for 15s clipsModel constraint violation (max 10s)Use Sora 2 for clips longer than 10s
Skipping --lock-sequence before G4Scene changes invalidate expensive video generationLock sequence at G3 before generating any videos

Error Handling

ErrorCauseFix
FAL_KEY not setMissing API credentialexport FAL_KEY='your-fal-ai-key'
Image-gen not foundMissing peer skill dependencyInstall image-gen skill or set IMAGE_GEN_SCRIPT env var
ffmpeg not foundMissing video assembly dependencyInstall ffmpeg: brew install ffmpeg (macOS) or apt install ffmpeg (Linux)
Duration validation failureInvalid duration for modelCheck duration constraints table, use valid values
HTTP 429: Rate limitToo many requestsWait 30s and retry, or switch to different model
HTTP 402: No creditsfal.ai account balanceTop up fal.ai account balance
API timeoutModel overloaded or network issueIncrease --timeout or try --quality fast variant
No video URL in resultMalformed API responseCheck fal.ai status, try different model
Downloaded file is emptyNetwork interruption during downloadRetry generation, check network stability
Model not availableModel endpoint changed or deprecatedCheck references/models.md for current endpoints
Invalid aspect ratioUnsupported ratio for modelUse 16:9, 9:16, or 1:1 (universally supported)
Project directory existsName collisionChoose different --name or remove existing directory
Sequence already lockedTrying to add scenes after G3Use project_state.py --unlock-sequence or work with existing scenes
Clip discovery failedAssembly can't find generated clipsCheck clip naming pattern shot_NN.mp4 in scenes/*/ directories

Bundled Resources Index

PathWhatWhen to Load
./scripts/generate.pyCore video generation scriptEvery light mode generation task
./scripts/preview.pyQuick preview wrapper (LTX fast)Quick tests and iteration
./scripts/project_init.pyProject structure initializationStarting new multi-scene project (G0)
./scripts/project_state.pyState management and status displayManaging project gates, checking progress
./scripts/decompose.pyStory decomposition LLM promptBreaking story into scenes (G1)
./scripts/keyframe.pyKeyframe image generationCreating visual references (G2)
./scripts/clip.pyScene video generationGenerating video clips (G4)
./scripts/assemble.pyFinal video assembly via ffmpegCombining clips into final video (G5)
./scripts/character_sheet.pyMulti-view character reference sheetsCharacter consistency across scenes
./references/models.mdComplete model catalog with capabilities and pricingModel selection and optimization
./references/model-kling.mdKling 3.0 detailed reference cardKling-specific generation parameters
./references/model-veo.mdVeo 3.1 detailed reference cardVeo-specific features and audio capabilities
./references/model-sora.mdSora 2 detailed reference cardSora-specific parameters and remix features
./references/model-ltx.mdLTX-2.3 detailed reference cardLTX-specific modes and 4K capabilities
./references/model-wan.mdWan 2.5/2.6 detailed reference cardWan-specific features and budget optimization
./references/model-hailuo.mdHailuo-02 detailed reference cardHailuo anime/stylization capabilities
./references/fal-api.mdfal.ai queue API referenceAPI integration and debugging
./references/pricing.mdCost per model per second with scenariosBudget planning and cost optimization
./references/prompt-guide.mdVideo prompt engineering best practicesWriting effective video prompts
./references/camera-vocabulary.mdCamera movement and angle terminologyCinematic prompt construction
./references/style-keywords.mdVisual style keyword referenceStyle consistency across scenes
./references/story-schema.mdJSON schema for story.json structureStory decomposition validation
./references/scene-schema.mdJSON schema for scene objectsScene data structure validation
./references/shot-schema.mdJSON schema for shot objectsShot-level metadata validation
./references/character-schema.mdJSON schema for character objectsCharacter definition validation
./references/consistency-guide.mdVisual consistency techniques across scenesMulti-scene project quality
./references/cost-reference.mdCost estimation for project mode workflowsProject budget planning
./references/model-selection.mdModel selection guide for project modeChoosing optimal models per scene
./references/prompt-assembly.mdHow prompts are assembled from componentsUnderstanding prompt construction
./prompts/enhance-animated.mdLLM prompt template for animation enhancementAnimated content optimization
./prompts/enhance-cinematic.mdLLM prompt template for cinematic enhancementFilm-quality content optimization
./prompts/enhance.mdGeneral LLM prompt enhancement templateGeneral prompt improvement
./prompts/decompose.mdLLM prompt template for story decompositionStory-to-scenes breakdown

Capabilities

skillsource-buildoakskill-video-gentopic-agent-skillstopic-ai-agentstopic-ai-toolstopic-automationtopic-browser-automationtopic-claude-codetopic-claude-skillstopic-codex

Install

Installnpx skills add buildoak/fieldwork-skills
Transportskills-sh
Protocolskill

Quality

0.46/ 1.00

deterministic score 0.46 from registry signals: · indexed on github topic:agent-skills · 15 github stars · SKILL.md body (22,200 chars)

Provenance

Indexed fromgithub
Enriched2026-04-22 19:06:33Z · deterministic:skill-github:v1 · v1
First seen2026-04-18
Last seen2026-04-22

Agent access