Reverse-engineer a supplied video into a shot-by-shot generation specification, timestamped evidence frames, and paired Chinese-English prompt packages (T2V, I2V, FLF2V). Use for requests such as 视频反推提示词, 视频转提示词, 从视频生成提示词, 逐镜头反推, 分镜拆解, 借运镜与剪辑节奏, 根据生成视频修词, or video-to-prompt; supports generic, Seedance (即梦), MiniMax (海螺), Veo, Kling (可灵), Wan (万相), Sora, and both interactive repair and bounded optimization loops. Do not use for ordinary video summaries or basic transcription.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of video-prompt-reverse?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/lunarxuan-video-prompt-reverse)
---
name: video-prompt-reverse
description: "Reverse-engineer a supplied video into a shot-by-shot generation specification, timestamped evidence frames, and paired Chinese-English prompt packages (T2V, I2V, FLF2V). Use for requests such as 视频反推提示词, 视频转提示词, 从视频生成提示词, 逐镜头反推, 分镜拆解, 借运镜与剪辑节奏, 根据生成视频修词, or video-to-prompt; supports generic, Seedance (即梦), MiniMax (海螺), Veo, Kling (可灵), Wan (万相), Sora, and both interactive repair and bounded optimization loops. Do not use for ordinary video summaries or basic transcription."
---
# Video Prompt Reverse
Turn a reference video into an executable, evidence-linked generation package. Distinguish semantic recreation from exact reconstruction: a text prompt preserves scene logic, action, camera language, pacing, and style, but cannot guarantee frame-identical output. Escalate to I2V/FLF2V keyframes or control signals when identity, geometry, or motion fidelity matters.
## Invocation cues
Treat “视频反推提示词” and equivalents (“视频转提示词”, “从视频生成提示词”, “视频逆向提示词”, “逐镜头反推”, “分镜拆解并生成提示词”, “借运镜/节奏”, “对照生成视频修词”, “video-to-prompt”) as direct requests to use this skill. The user may specify a target model (`seedance`/即梦, `minimax`/海螺, `veo`, `kling`/可灵, `wan`/万相, `sora`, or `generic`) and a generation mode (`t2v`, `i2v`, or `flf2v`).
## Choose the intent & generation mode
1. **Task intent (`intent.task_mode`)**:
- **Recreate (`recreate`, default)**: Preserve subject logic, scene, motion, camera choreography, pacing, and visual style.
- **Transfer (`transfer`)**: Borrow camera choreography, editing rhythm, lighting, or visual style for a new subject/story; strip original people, brands, logos, copyrighted dialogue, and story facts.
- **Interactive Repair (`repair`)**: When a user brings back a generated video (e.g., from Seedance, Kling, Veo, or Hailuo web UI) alongside the reference and previous prompt, probe both clips, inspect matching timestamps side by side, pinpoint the 1–2 root-cause shot/motion/camera deviations, preserve working clauses, and emit surgical prompt revisions without rewriting from scratch.
- **Bounded Automated Optimization (`optimize`)**: When callable CLI generator and evaluator adapters are authorized, run `scripts/closed_loop.py` per [references/optimization-loop.md](references/optimization-loop.md).
2. **Generation mode (`intent.generation_mode` / `--mode`)**:
- **`t2v` (default)**: Full text-to-video prompt including scene, appearance anchors, lighting, motion, camera, and audio.
- **`i2v`**: Image-to-video from an opening frame — export per-shot opening keyframes (`keyframes/S01_first.jpg`) and write **motion-first** prompts without wasting tokens repeating static appearance.
- **`flf2v`**: First-last-frame-to-video — export opening and closing keyframes per shot and focus the prompt on transition trajectory, intermediate beats, camera path, and pacing.
If the target model is absent, use `generic`. If the requested fidelity is unclear, default to semantic and cinematic similarity, not pixel reconstruction.
## Synergy with `$image-prompt-reverse` (optional I2V handoff)
When the user wants to **swap subjects or restyle a video while keeping high visual and camera fidelity**, recommend the two-skill I2V pipeline:
1. Run `$video-prompt-reverse` with `--mode i2v` (or `flf2v`) to split shots, extract clean `keyframes/S01_first.jpg`, and produce a motion-first prompt.
2. Hand the opening keyframe to `$image-prompt-reverse` (style or composition transfer) to generate a clean, original opening frame.
3. Feed that new opening frame + this skill's `i2v` prompt into the target video generator.
## Analyze the source
1. Inspect the source without altering it. Record its SHA-256, duration, frame rate, resolution, audio presence, and sampling timestamps. Run `scripts/probe_video.py` with `--contact-sheet` when `ffprobe` and `ffmpeg` are available:
```text
python scripts/probe_video.py VIDEO.mp4 --output-dir work/probe --contact-sheet
```
2. Use the generated timestamped contact sheet(s) and `shot_intervals` to map scene cuts, pacing, and motion trajectories efficiently. Select a concise final evidence set (4–12 unedited source frames by default, covering opening states, key action/expression/camera changes, transitions, and ending states; use contact sheets when >12 frames are essential). For videos longer than 30 seconds, analyze scene-aligned chunks; use short 3–10 second subclips for dense action, then reconcile into one timeline.
3. Inspect enough frames to distinguish subject motion from camera motion. Use `--extract-audio` or a transcript when dialogue, SFX, or music beats drive cuts.
4. Build the structured record per [references/analysis-contract.md](references/analysis-contract.md). Write fluent, generator-ready Chinese prose into `chinese_prompt` (optional but preferred over mechanical stitching) and semantically aligned English prose into `english_prompt`. Never inject meta-disclaimers or empty field labels into the video prompt text. Validate with `scripts/validate_spec.py` before compiling.
5. Mark uncertain or inferred attributes explicitly. Never fabricate focal length, lighting rigs, off-screen action, or dialogue when evidence does not support them.
## Compile the deliverables
Read [references/model-adapters.md](references/model-adapters.md) only for requested target models (`generic`, `seedance`, `minimax`, `veo`, `kling`, `wan`, `sora`). Run:
```text
python scripts/compile_prompt.py SPEC.json --target generic --mode t2v --output-dir OUTPUT
```
Check `supports_negative_prompt` in `references/model_profiles.json`:
- For targets that support dedicated negative prompts (`kling`, `wan`, `generic` when tool supports it), populate targeted `negative_constraints` grouped by failure risk (`identity`, `anatomy`, `wardrobe_props`, `environment`, `motion_physics`, `camera_editing`, `rendering`) plus aligned `english_prompt.negative`.
- For targets without a dedicated negative prompt input (`seedance`, `minimax`, `veo`, `sora`), fold critical stability guards into positive visible descriptions and leave `negative_constraints` empty unless the user explicitly asks for negative prompts.
For every request, return:
- a chronological shot table (exact interval, size, angle, composition, camera motion, action/expression, lighting, audio cue, transition, confidence);
- narrative and pacing logic, visual invariants, and shot-to-shot continuity anchors;
- an inline visual-evidence gallery placed immediately before the prompt blocks, displaying every curated frame (or contact sheet) with shot ID, timestamp, and absolute compiled path;
- for `i2v` / `flf2v`, list the exported keyframe paths in `keyframes/`;
- exactly two directly copyable fenced blocks in order: first the Chinese block (`prompt_zh.txt`), then the English block (`prompt_en.txt`), keeping each language's positive and optional negative prompt together;
- a reproducibility summary referencing `reproducibility.json` (hashes, target/profile version, generation mode, duration, aspect ratio, and unresolved uncertainties).
Do not claim that a prompt is the source video's original prompt. Call it a reverse-engineered generation specification.
## Optimize against a target model
- **Web-UI / Interactive Repair**: Compare frames from the reference and generated `.mp4` at aligned timestamps, diagnose 1–2 concrete gaps (e.g., reversed pan direction, cut-off subject, slow pacing), keep working clauses intact, and return the patched prompt.
- **Automated Bounded Loop**: Read [references/optimization-loop.md](references/optimization-loop.md) before running `scripts/closed_loop.py`. Lock one target model/version and explicit generator/evaluator command adapters. Preserve every candidate and score. Stop on target score, max iterations, plateau, or adapter failure; escalate to keyframes or control workflows when text-only optimization plateaus.