Communitygithub.com

programmatic-video

Build code-driven videos with Remotion (React/TypeScript), Hyperframes (HTML/CSS/GSAP), or FFmpeg (trim, stitch, overlay, audio mux). Use for motion graphics, UI demos, captions, and rendering MP4s from code. Not for casual edits in a GUI editor.

What is programmatic-video?

programmatic-video is a Claude Code agent skill that build code-driven videos with Remotion (React/TypeScript), Hyperframes (HTML/CSS/GSAP), or FFmpeg (trim, stitch, overlay, audio mux). Use for motion graphics, UI demos, captions, and rendering MP4s from code. Not for casual edits in a GUI editor.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/0ne4rif/programmatic-video/tree/HEAD

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Programmatic Video Builder

Detailed engine rules live in references/. Read only the file for the engine you are using:

  • references/remotion.md: Remotion project rules, fonts, audio, props
  • references/hyperframes.md: Hyperframes CLI loop and timeline rules
  • references/ffmpeg.md: FFmpeg recipes (trim, concat, overlay, mux, captions, preview)
  • references/captions.md: producing and exporting .srt files

1. Pre-Flight Intake

Check whether the user has already given the four parameters below. If the brief covers them, skip this step. If any are missing, ask for them in one concise message:

  1. Format & Resolution: 16:9 (1920x1080), 9:16 (1080x1920), or 1:1 (1080x1080). Default 30fps (60fps for UI screen captures).
  2. Duration: Target runtime in seconds (durationInFrames = seconds * fps).
  3. Engine: Remotion (React/TypeScript motion graphics, UI demos), Hyperframes (HTML/CSS/GSAP/Lottie compositions), or FFmpeg (CLI trims, stitching, overlays, audio muxing).
  4. Audio / Captions: Silent, a background audio file path, or a spoken voiceover script that needs .srt subtitles.

2. Scene Blueprint

Before creating files, output a compact frame-budget table:

SceneFrame Range (Seconds)Visual Action & MotionOn-Screen Text / Audio
10–90 (0.0–3.0s)Hook animationHeadline + SFX

Wait for the user to confirm the blueprint before scaffolding. Skip the wait if the user said to go ahead without approval (for example "just build it"); in that case state the blueprint and continue.

3. Styling & Platform Safe Zones

Apply these defaults unless the user gives brand rules:

  • Color Palette:
    • Canvas: #0A0A0A (dark) or #FAFAFA (light)
    • Primary text: #FAFAFA on dark, #111111 on light
    • Muted / secondary: #71717A
    • Accent: #3B82F6
  • Typography: Inter (500, 700) for UI and headlines; JetBrains Mono (400) for code and technical callouts.
  • Safe-Zone Margins:
    • 16:9: minimum 80px on all sides.
    • 9:16: keep captions and key visuals inside 180px top, 380px bottom (platform UI), 140px right (engagement icons), 60px left.

4. Implementation Rules (all engines)

  • Centralize timing constants: keep FPS, WIDTH, HEIGHT, and DURATION_IN_FRAMES in one config file. Never hardcode magic frame numbers inside scenes.
  • Parameterize content: expose copy, colors, and media paths through typed props (Remotion) or a JSON config / data-* attributes (Hyperframes), so variations render without code edits.
  • Deterministic motion only: every frame must be a pure function of time. Engine-specific rules are in the reference files.
  • Load fonts before rendering any frame: the method differs per engine (see the reference files).

5. Preview & Render Protocol

  • Preview first: run the engine's preview so the user can check pacing and safe zones.
    • Remotion: npx remotion studio
    • Hyperframes: npx hyperframes preview (run npx hyperframes lint first)
    • FFmpeg: render a low-res preview clip (see references/ffmpeg.md)
  • Render only on explicit request. Run the final encode only when the user asks to export:
    • Remotion: npx remotion render <CompositionId> out/video.mp4 --codec=h264 --pixel-format=yuv420p
    • Hyperframes: npx hyperframes render --output out/video.mp4
    • FFmpeg: see references/ffmpeg.md
  • Captions: whenever narration or dialogue is included, also output a synchronized .srt file. See references/captions.md.
  • Verify the output: after a render, confirm resolution, fps, duration, and audio streams with ffprobe before reporting success.

Related Skills