Add reference video input analysis workflow

This commit is contained in:
calesthio
2026-04-04 10:01:11 -07:00
parent 87df43d39f
commit b0917d2d84
25 changed files with 2640 additions and 5 deletions
+34
View File
@@ -115,6 +115,40 @@ If a checkpoint exists with status `"awaiting_human"`:
2. Present the checkpoint data for review
3. Wait for approval before proceeding
### Sample Checkpoint (Reference-Driven Productions)
When a production is reference-driven (VideoAnalysisBrief exists), there is an
additional checkpoint between proposal approval and full production:
| Stage | checkpoint_required | human_approval_default | Notes |
|-------|--------------------|-----------------------|-------|
| `sample` | true | true | Always requires human approval |
The sample checkpoint:
1. Presents: rendered sample clip (10-15 seconds)
2. Cost: sample cost vs. projected full-video cost
3. Action: approve (→ proceed to script), revise (→ re-generate sample), abort
The sample checkpoint is NOT a pipeline stage — it's a sub-checkpoint within the
proposal stage. It does not produce a canonical artifact. It produces a rendered
preview clip stored at `projects/<name>/assets/sample/sample_v{N}.mp4`.
**Presentation format:**
```
## Sample Preview Ready
**Sample clip:** [path to sample_v1.mp4]
- Duration: [X] seconds (hook + 1 middle scene)
- Voice: [TTS provider + voice name]
- Visuals: [description — AI images, Remotion animations, etc.]
- Music: [source]
**Sample cost:** $[X.XX]
**Projected full video cost:** $[X.XX]
Does this feel right? I can adjust: voice, visual style, pacing, music, colors.
```
## Key Principles
1. **Always checkpoint completed work.** Even if `checkpoint_required: false`, consider checkpointing anyway if the stage took significant time or cost. Losing work is worse than an extra file on disk.
+20
View File
@@ -55,6 +55,26 @@ The intake_brief is passed as context to the research-director, not as a
formal artifact. It exists to prevent the research stage from inventing
intent that the user never expressed.
## Handling Reference Video Input
When the user provides a video URL or file as their starting point:
1. **Read the video-reference-analyst skill** (`skills/meta/video-reference-analyst.md`)
and follow its protocol. Do not proceed with standard creative intake.
2. The VideoAnalysisBrief replaces the need for most intake questions — it provides
tone, structure, pacing, audience signals, and style information directly from the
reference.
3. The remaining intake questions are:
- What topic/subject for YOUR version? (if different from reference)
- How long?
- Narration yes/no?
- Budget ceiling?
4. Do NOT ask "what should it feel like?" — the reference video IS the answer to that
question. Extract tone from the VideoAnalysisBrief instead.
## What NOT To Do
- Do not present a numbered survey. This is a conversation, not a form.
+11
View File
@@ -105,12 +105,23 @@ Based on the user's tier, present **3 ready-to-use prompts** they can copy right
> **Or:** "I recorded a founder update on my webcam — make it feel polished, confident, and premium without looking fake" *(Talking Head pipeline)*
**Reference-based prompts (all tiers):**
> **Have a video you love?** Paste a YouTube link and say "make me something like this"
> — I'll analyze the style, pacing, and structure, then propose 2-3 creative variants
> you can choose from. Works with YouTube, Shorts, Instagram Reels, and TikTok.
> All analysis runs locally and free — no API keys needed.
> **Got your own footage?** Drop in a video file and say "I want to make a video using
> this footage" — I'll transcribe it, detect scenes, and propose an edit plan.
**Rules for prompt suggestions:**
- Present exactly 3 prompts.
- The first prompt should be the most impressive thing their setup can produce.
- Each prompt should target a different pipeline or style.
- Include a brief note explaining what makes this prompt a good fit for their setup.
- Use blockquote formatting so prompts are visually distinct and easy to copy.
- Always include the reference-based prompts above — they work at every tier.
### Step 5: Explain the Workflow (Briefly)
+33
View File
@@ -117,6 +117,39 @@ Structure your review as:
| compose | Playability, duration accuracy, audio quality, pre-compose validation pass |
| publish | SEO quality, metadata completeness, export packaging |
## Reference Alignment Review
Run at **every stage** when a VideoAnalysisBrief exists (reference-driven production).
### Checks:
1. **Grounding check:** Does the output reference specific findings from the
VideoAnalysisBrief, or is it making things up about the reference?
- Proposal mentions "fast pacing" but reference pacing_style is "slow_contemplative" → **CRITICAL**
- Script claims reference has narration but VideoAnalysisBrief shows no narration → **CRITICAL**
2. **Differentiation check:** Does each concept/scene have a clear creative
difference from the reference, or is it a copy?
- Proposal is a carbon copy of the reference (same topic, same structure, same treatment) → **CRITICAL**
- At least one element per concept MUST differ from the reference → **SUGGESTION** if weak
- Creative differentiation seeds from the brief should be reflected in proposals
3. **Promise preservation:** Are the elements the user said they loved about the
reference still present in the output?
- User said "I love the pacing" but scene_plan has 2x longer scenes → **SUGGESTION**
- User said "keep the hook style" but script uses a different hook → **SUGGESTION**
4. **Cost alignment:** Is the cost estimate still accurate, or has scope crept?
- If actual spend exceeds estimate by >30% without user re-approval → **CRITICAL**
- If new assets were added beyond the approved proposal → **SUGGESTION**
### Severity:
- Factual errors about the reference video: **CRITICAL**
- Carbon copy with no differentiation: **CRITICAL**
- Weak differentiation (surface-level changes only): **SUGGESTION**
- User preference not honored: **SUGGESTION**
- Cost drift >30%: **CRITICAL**
## Slideshow Risk Review
Run at **scene_plan** and **edit** stages. Use `lib/slideshow_risk.py` to compute the score.
+243
View File
@@ -0,0 +1,243 @@
# Video Reference Analyst — Meta Skill
## When to Use
When the user provides a video URL (YouTube, Shorts, Instagram, TikTok, or any URL)
or a local video file as a REFERENCE — meaning "make me something like this," not
"edit this footage."
If the user says "edit this video" or "cut this into clips," route to the appropriate
footage-led pipeline (clip-factory, talking-head, hybrid) instead. This skill is for
REFERENCE-based production.
## Detection Signals
Trigger this skill when:
- User pastes a YouTube/Shorts/Instagram/TikTok URL
- User says "something like this," "inspired by," "in this style," "similar to"
- User uploads a video and says "I want one like this"
- User says "I saw this video and want to make something like it"
Do NOT trigger when:
- User provides footage and says "edit this" or "cut this" → use source_media_review
- User provides audio and says "make a video for this" → standard pipeline
- User just wants a transcript → use TranscriptFetcher directly
## Protocol
### Step 1: Analyze the Reference
Run VideoAnalyzer with `analysis_depth: "standard"`:
```python
video_analyzer.execute({
"source": "<url or path>",
"analysis_depth": "standard",
"max_keyframes": 20
})
```
Read the resulting VideoAnalysisBrief. Before proceeding, present a summary to the
user. This is NOT a raw dump. It's a conversational interpretation:
```
"I've watched the video. Here's what I see:
**Content:** [2-sentence summary of what the video is about]
**Style:** [1 sentence — pacing, visual treatment, energy]
**Structure:** [X scenes over Y seconds, pacing style]
**What makes it work:** [2-3 specific things — the hook technique, the pacing,
the visual transitions, the narration style]
Now let me check what I can do with your current setup..."
```
**Vision analysis:** After presenting the structural data, examine the extracted
keyframes yourself. You ARE a multimodal model — look at the keyframe images and
enrich the VideoAnalysisBrief with:
- Per-frame descriptions (subjects, text, composition, color)
- Cross-frame visual continuity and style consistency
- Genre classification and production quality assessment
- Color palette extraction (dominant colors across keyframes)
- Typography style if on-screen text is present
- Transition patterns visible between sequential keyframes
Update the brief's `content_analysis`, `style_profile`, and `replication_guidance`
fields with your visual observations. This is where the analysis becomes truly
comprehensive — the tools provide structure; your vision provides understanding.
### Step 2: Capability Audit
Run standard preflight:
```bash
python -c "from tools.tool_registry import registry; import json; registry.discover(); print(json.dumps(registry.support_envelope(), indent=2))"
python -c "from tools.tool_registry import registry; import json; registry.discover(); print(json.dumps(registry.provider_menu(), indent=2))"
python -c "from tools.tool_registry import registry; import json; registry.discover(); print(json.dumps(registry.capability_catalog(), indent=2))"
```
Map the reference video's requirements against available capabilities:
```
REFERENCE NEEDS YOUR CAPABILITIES GAP
───────────────────── ───────────────────── ──────────
Video clips (sci-fi) Video gen: 0/12 configured BLOCKED without key
Narration (deep male) TTS: ElevenLabs available READY
Background music Music: MusicGen available READY
Text animations Remotion: available READY
Fast-cut editing FFmpeg: available READY
```
Be honest about gaps. If video generation is needed but unavailable, say so clearly:
```
"This reference uses generated sci-fi footage. Right now you don't have any video
generation providers configured. Here are your options:
• Add FAL_KEY to .env → unlocks Kling 3.0, MiniMax, Wan (best for cinematic/sci-fi)
• Add REPLICATE_API_TOKEN → unlocks LTX Video (good for short clips)
• Proceed without video gen → I'll use stock footage + Remotion animations instead
(different feel, but still works)
Which would you prefer?"
```
Read install_instructions from the registry for each unavailable tool — do NOT
hardcode key names or setup URLs.
### Step 3: Ask Critical Questions
Before proposing, gather what the VideoAnalysisBrief doesn't tell you:
1. "Do you want narration in your version, or visuals-only with music?"
2. "How long should your video be? The reference is [X] seconds."
3. "Is there a specific topic/subject you want, or should I riff on the
same theme as the reference?"
4. "Any elements from the reference you specifically love or hate?"
Do NOT ask all at once. Lead with the most important gap. If the user's initial
message already answers some of these, skip those.
### Step 4: Creative Proposals (2-3 variants)
MANDATORY: The agent must NEVER propose a carbon copy. The reference is inspiration,
not a template. Each proposal must have clear creative differentiation.
Use this structure for each variant:
```
## Option [A/B/C]: "[Title]"
**Inspired by:** [what it keeps from the reference — pacing, structure, tone]
**Creative twist:** [what it changes — angle, subject, visual treatment, hook]
**Visual plan:**
- Playbook: [closest match + customizations]
- Visual treatment: [how visuals will be created — which tools, which providers]
- Motion: [Remotion animations / video gen clips / stock + Ken Burns / etc.]
**Audio plan:**
- Narration: [yes/no, which TTS provider, voice style]
- Music: [library track / generated / none]
- Sound design: [any special audio needs]
**Duration:** [X seconds]
**Estimated cost:** $[X.XX] breakdown:
- Image generation: $X.XX (N images × $X.XX each via [provider])
- Video generation: $X.XX (N clips × $X.XX each via [provider])
- TTS narration: $X.XX (N words via [provider])
- Music: $X.XX ([source])
- Total: $X.XX
**Honest assessment:** [What this will look like realistically — don't oversell]
```
**Differentiation patterns:**
| Pattern | Example |
|---------|---------|
| **Same structure, different subject** | Reference: "How black holes work" → Ours: "How neutron stars work" with same pacing |
| **Same subject, different angle** | Reference: "Kubernetes explained" → Ours: "Kubernetes from a security engineer's POV" |
| **Same tone, different visual treatment** | Reference: stock footage + voiceover → Ours: animated motion graphics + voiceover |
| **Same content, different platform** | Reference: 10-min YouTube → Ours: 60-sec Shorts version with faster pacing |
| **Counter-take** | Reference: "Why AI will replace jobs" → Ours: "Why AI won't replace YOUR job" |
**Cost transparency is mandatory.** Each concept must include:
- Itemized cost estimate at the user's requested duration
- Cost broken down by: image gen, video gen, TTS, music, total
- Provider names for each cost line
- Honest note about what the budget buys vs. doesn't buy
**Recommendation:** Always recommend one option with a brief reason why. Don't leave
the user paralyzed with equal choices.
### Step 5: Sample-First Production (MANDATORY)
After the user picks a variant, ALWAYS say:
```
"Great choice. Before I commit to the full [X]-second video, I'll produce a
10-15 second sample first — the opening hook + one middle scene. This lets you
hear the voice, see the visual style, and feel the pacing before we go all-in.
Estimated sample cost: $[X.XX]
Shall I proceed with the sample?"
```
The sample is NOT optional. Even if the user says "just do the whole thing," push
back gently:
```
"I'd really recommend the sample first — it's a tiny fraction of the cost and
lets us catch any style mismatches early. If you love it, I'll proceed to the
full video immediately."
```
Only skip the sample if the user insists after being advised.
**Sample contents:**
- 1-2 representative scenes (the hook + one middle scene)
- Actual TTS narration with chosen voice
- Actual generated/stock visuals
- Music bed snippet
- Subtitle style preview
**Sample checkpoint:**
Present the sample with: "Here's a preview. Does this feel right? Things I can
adjust: voice, visual style, pacing, music, colors."
Iterate on sample feedback until approved. Store samples at:
`projects/<name>/assets/sample/sample_v{N}.mp4`
### Step 6: Enter Pipeline
After sample approval, enter the appropriate pipeline with:
- VideoAnalysisBrief as grounding context in the research/proposal stage
- User's chosen variant as the approved direction
- Sample feedback incorporated into the brief
- All creative differentiation decisions recorded in the decision_log
The pipeline takes over from here. The VideoAnalysisBrief travels alongside the
standard artifacts, providing reference grounding at every stage.
## Multiple Reference Videos
When the user provides multiple reference URLs:
1. Analyze each video separately (run VideoAnalyzer on each)
2. Present a comparative summary: "Video A does X well, Video B does Y well"
3. In proposals, note which elements are inspired by which reference
4. The VideoAnalysisBrief for the primary reference travels with the pipeline;
secondary references are noted in the research_brief
## Error Handling
| Failure | Action |
|---------|--------|
| URL download fails | Report error, suggest: try another URL, provide local file, or proceed without reference |
| No captions available | Download video, transcribe with Whisper locally |
| Scene detection fails | Fall back to uniform frame sampling |
| All analysis fails | Ask user to describe the reference video verbally, proceed with standard creative intake |
Never silently skip analysis steps. If something fails, tell the user what happened
and what the impact is on the analysis quality.
@@ -22,6 +22,31 @@ Animation proposals have a unique dimension: **animation mode selection**. Unlik
## Process
### Step 0: Check for Reference Video Context
Before starting proposal work, check if a VideoAnalysisBrief exists for this project.
**When a VideoAnalysisBrief is present — Reference-Aware Animation Concept Design:**
**HARD RULE: No carbon copies.** Each concept option MUST:
1. Name at least ONE animation element it keeps from the reference (pacing, motion style, narrative structure)
2. Name at least ONE element it changes (animation mode, visual identity, topic angle)
3. Explain WHY the change makes the output more engaging or clearer
**Animation differentiation patterns:**
| Pattern | Example |
|---------|---------|
| **Same topic, different animation mode** | Reference: stock footage → Ours: Manim mathematical visualization |
| **Same style, different complexity** | Reference: simple diagrams → Ours: progressive build with layers |
| **Same pacing, different visual identity** | Reference: corporate blue → Ours: vibrant neon-on-black |
| **Same narrative, different interactivity** | Reference: linear → Ours: data-driven with animated charts |
**Mandatory Sample Protocol:** After concept approval, produce a 10-15 second sample
to validate the animation style before full production.
**When no VideoAnalysisBrief is present:** Skip this step and proceed normally.
### Step 1: Absorb the Research (or Direct Brief)
**If a `research_brief` artifact exists:** Read it thoroughly. Extract:
@@ -18,6 +18,40 @@ Animation videos differ from general explainers: the research must cover both **
## Process
### Step 0: Check for Reference Video Context
Before starting research, check if a VideoAnalysisBrief exists for this project. If it
does, this is a reference-driven production — the user provided a video they want to
riff on.
**When a VideoAnalysisBrief is present:**
1. Read it thoroughly. Extract:
- `content_analysis.topics` — research these topics for accuracy
- `content_analysis.key_claims` — verify these claims via web search
- `style_profile` — note the animation style (motion type, color palette, transitions)
- `structure_analysis.pacing_profile` — understand the rhythm
- `replication_guidance.creative_differentiation_seeds` — these are your concept seeds
- `replication_guidance.key_elements_to_replicate` — preserve these in proposals
2. Your research focus SHIFTS:
- Standard research: "What topic + animation technique fits?"
- Reference-driven research: "What animation approach would DIFFERENTIATE us from the
reference while keeping the elements the user loved?" + "What animation techniques
exist for this topic that the reference DIDN'T use?"
3. In the research_brief, add a `reference_context` section:
- The reference's animation style and technique
- What animation modes it used (motion graphics, manim, illustrative, etc.)
- Alternative animation approaches we could try instead
- What the reference did well vs. where we can improve
4. The `angles_discovered` should explicitly position against the reference:
- "The reference used X animation style. We could try Y which is [more engaging/clearer/
more novel] because [technique research finding]."
**When no VideoAnalysisBrief is present:** Skip this step and proceed normally.
### Step 1: Scope the Research
Before searching anything, establish boundaries:
@@ -20,6 +20,32 @@ You are the **Proposal Director** for a cinematic video (trailers, brand films,
## Process
### Step 0: Check for Reference Video Context
Before starting proposal work, check if a VideoAnalysisBrief exists for this project.
**When a VideoAnalysisBrief is present — Reference-Aware Cinematic Concept Design:**
**HARD RULE: No carbon copies.** Each concept option MUST:
1. Name at least ONE cinematic element it keeps from the reference (mood, pacing, color palette, shot language)
2. Name at least ONE element it changes (emotional arc, visual treatment, subject matter, sound design)
3. Explain WHY the change creates a different emotional impact
**Cinematic differentiation patterns:**
| Pattern | Example |
|---------|---------|
| **Same mood, different subject** | Reference: dark sci-fi mood → Ours: same darkness applied to deep ocean |
| **Same subject, different emotional arc** | Reference: tension→reveal → Ours: wonder→scale |
| **Same pacing, different visual language** | Reference: handheld raw → Ours: locked-off geometric |
| **Same color world, different lighting** | Reference: warm golden hour → Ours: warm but tungsten/interior |
**Mandatory Sample Protocol:** After concept approval, produce a 10-15 second cinematic
sample BEFORE full production. This is critical for cinematic work — mood mismatches are
expensive to fix downstream. Present with visual + audio + music.
**When no VideoAnalysisBrief is present:** Skip this step and proceed normally.
### Step 1: Absorb the Research
Read the `research_brief` thoroughly. Extract:
@@ -18,6 +18,40 @@ Unlike explainer research (which focuses on facts, data, and content gaps), cine
## Process
### Step 0: Check for Reference Video Context
Before starting research, check if a VideoAnalysisBrief exists for this project. If it
does, this is a reference-driven production — the user provided a video they want to
riff on.
**When a VideoAnalysisBrief is present:**
1. Read it thoroughly. Extract:
- `content_analysis.topics` — research these topics for accuracy
- `content_analysis.key_claims` — verify these claims via web search
- `style_profile` — note the cinematic language (color palette, camera movements, lighting)
- `structure_analysis.scenes` — understand the shot language and emotional arc
- `replication_guidance.creative_differentiation_seeds` — these are your concept seeds
- `replication_guidance.key_elements_to_replicate` — preserve these in proposals
2. Your research focus SHIFTS:
- Standard research: "What visual/emotional language fits this subject?"
- Reference-driven research: "What cinematic approach would DIFFERENTIATE us from the
reference while keeping the elements the user loved?" + "What mood/tone territory
is adjacent but unexplored?"
3. In the research_brief, add a `reference_context` section:
- The reference's cinematic language (shot types, pacing, color palette)
- What emotional territory it occupies
- Adjacent emotional territories we could explore instead
- How the reference's visual approach could be evolved or reinterpreted
4. The `angles_discovered` should explicitly position against the reference:
- "The reference uses X mood/palette/pacing. We could try Y which creates
[different emotional impact] because [research finding]."
**When no VideoAnalysisBrief is present:** Skip this step and proceed normally.
### Step 1: Classify the Brief
Before searching, extract from the user's request:
@@ -22,6 +22,36 @@ Think of yourself as a creative agency pitching to a client: you present concept
## Process
### Step 0: Check for Reference Video Context
Before starting proposal work, check if a VideoAnalysisBrief exists for this project.
**When a VideoAnalysisBrief is present — Reference-Aware Concept Design:**
**HARD RULE: No carbon copies.** Each concept option MUST:
1. Name at least ONE element it keeps from the reference (pacing, structure, tone, hook style)
2. Name at least ONE element it changes (topic angle, visual treatment, narration approach)
3. Explain WHY the change makes the output better, not just different
**Differentiation patterns:**
| Pattern | Example |
|---------|---------|
| **Same structure, different subject** | Reference: "How black holes work" → Ours: "How neutron stars work" with same pacing |
| **Same subject, different angle** | Reference: "Kubernetes explained" → Ours: "Kubernetes from a security engineer's POV" |
| **Same tone, different visual treatment** | Reference: stock footage + voiceover → Ours: animated motion graphics + voiceover |
| **Same content, different platform** | Reference: 10-min YouTube → Ours: 60-sec Shorts version with faster pacing |
| **Counter-take** | Reference: "Why AI will replace jobs" → Ours: "Why AI won't replace YOUR job" |
**Mandatory Sample Protocol:** After the user approves a concept, BEFORE entering the
script stage, produce a 10-15 second sample:
1. The opening hook (first 5-7 seconds) + one representative middle scene
2. Actual TTS voice, actual visual style, music bed snippet
3. Present with: "Here's a preview. Does this feel right?"
4. Iterate until approved, then proceed to full production
**When no VideoAnalysisBrief is present:** Skip this step and proceed normally.
### Step 1: Absorb the Research
Read the `research_brief` thoroughly. Extract:
@@ -18,6 +18,38 @@ This stage is what separates an OpenMontage video from generic AI slop. Without
## Process
### Step 0: Check for Reference Video Context
Before starting research, check if a VideoAnalysisBrief exists for this project. If it
does, this is a reference-driven production — the user provided a video they want to
riff on.
**When a VideoAnalysisBrief is present:**
1. Read it thoroughly. Extract:
- `content_analysis.topics` — research these topics for accuracy
- `content_analysis.key_claims` — verify these claims via web search
- `style_profile` — note this for the proposal stage (do not research style)
- `replication_guidance.creative_differentiation_seeds` — these are your concept seeds
- `replication_guidance.key_elements_to_replicate` — preserve these in proposals
2. Your research focus SHIFTS:
- Standard research: "What is interesting about this topic?"
- Reference-driven research: "What is interesting about this topic that the
reference video DIDN'T cover?" + "What would make our version DIFFERENT and BETTER?"
3. In the research_brief, add a `reference_context` section:
- What the reference covered
- What it missed (your differentiation opportunity)
- What claims it made that you can verify or update
- How the landscape has changed since the reference was published
4. The `angles_discovered` should explicitly position against the reference:
- "The reference took angle X. We could take angle Y which is [fresher/deeper/more
surprising] because [research finding]."
**When no VideoAnalysisBrief is present:** Skip this step and proceed normally.
### Step 1: Scope the Research
Before searching anything, establish boundaries: