Wiki/Pipeline.md
Pipeline — Demo Factory
Last updated: 2026-05-04 Source: Spec v1.1 Section 4, D2, D3, D13
State machine
init → captured → synopsized → scripted → rendered → done
Each state transition writes to run.json in the vault workspace. Every gate is:
- Resumable — user can rerun a stage without restarting from scratch
- Bypassable — --yolo flag skips all gate approvals
Step -1 — Scope & Angle Selection (mandatory)
Before the pipeline starts, the orchestrator skill runs scope selection: - What angle to take (feature showcase, problem/solution, CTA-focused, etc.) - Who the audience is (technical, business, mixed) - Which focus keywords to surface
Output: angle_slug + focus_keywords → embedded in run workspace name and script prompt.
Stage 1 — Capture
Script: scripts/capture.ts (deterministic)
Gate: User reviews screenshots, prunes bad ones, re-shoots if needed.
Two modes:
- Replay (default): if Products/<slug>/capture.yaml exists → Playwright replays it
- Record (first run): user drives a real browser; skill records every navigation/click/screenshot → auto-generates capture.yaml for future replays
Output: CaptureManifest — array of scenes with id, label, screenshot (base64 data URI), timestamp_ms.
State advance: init → captured
Stage 2 — Synopsis (LLM-1)
Skill: skills/synopsis/SKILL.md — Sonnet
Gate: User reviews/edits synopsis; provenance shown (which vault docs were read).
Input: Products/<slug>/ vault docs + repo README/CLAUDE.md, filtered by angle_slug + focus_keywords.
Doc selection: list → score → read top-N within token budget. Source code is never read.
Output: synopsis.md (2–3 paragraphs, angle-filtered).
State advance: captured → synopsized
Stage 3 — Script (LLM-2)
Skill: skills/script-writer/SKILL.md — Opus
Gate: User reviews/edits script; 30–60s budget enforced (engine flags if total_duration_ms > 60000).
Input: synopsis.md + CaptureManifest
Output: script.json — multi-track structured object:
{
"total_duration_ms": 42000,
"structure": "hook-problem-demo-cta",
"beats": [
{
"id": "b1",
"role": "hook",
"start_ms": 0,
"duration_ms": 8000,
"screen_ref": "scene-01",
"text_overlay": "Scaffold crawlers in minutes"
},
{
"id": "b2",
"role": "demo",
"start_ms": 8000,
"duration_ms": 18000,
"screen_ref": "scene-02",
"vo": "Crawler Factory automates it end-to-end"
}
]
}
Three parallel tracks per beat (all optional):
- text_overlay → rendered by Remotion (TextOverlayLayer)
- vo → fed to 11Labs (VoiceProvider)
- avatar_line → fed to Heygen (AvatarProvider)
State advance: synopsized → scripted
Stage 4 — Render
Script: scripts/render.ts (deterministic — Remotion CLI wrapper)
Gate: User reviews video; re-render if needed.
Input: script.json + CaptureManifest (screenshots as base64) + brand profile
Active tracks selected via --tracks flag:
- text — silent kinetic text (no external API)
- vo,text — with 11Labs audio
- vo,text,avatar — full stack with Heygen avatar
Formats: --format=9:16 (default) | 16:9 | 1:1 | all
Output: MP4 per format at binaries/<slug>/<run-id>/renders/<format>/demo.mp4
State advance: scripted → rendered
Stage 5 — Upload
Script: scripts/upload.ts (deterministic — StorageProvider)
Uploads final MP4(s) to Google Drive. Returns shareable URL.
Vault Runs/INDEX.md updated with run metadata + URL.
State advance: rendered → done
Track modes
| Mode | Tracks active | APIs needed | Use case |
|---|---|---|---|
--tracks text |
TextOverlayLayer only | None | Quick test, LinkedIn silent autoplay |
--tracks vo,text |
VO + text overlay | ELEVENLABS_API_KEY |
YouTube, narrated explainer |
--tracks vo,text,avatar |
VO + text + avatar | 11Labs + Heygen | LinkedIn founder-voice, premium |
Per-product workspace layout
Vault:
Projects/Video-Editing/
Products/<slug>/
capture.yaml # replay script (created on first record)
brand.yaml # brand override vs base profile
Runs/<run-id>/
run.json # { status, product, angle_slug, run_id, ... }
synopsis.md
script.json
render-manifest.json
Local disk:
~/AI-Development/Video_Editing/binaries/<slug>/<run-id>/
captures/ # screenshots
audio/ # 11Labs MP3
renders/9-16/demo.mp4