--- name: paper2video description: Turn an arXiv paper into a narrated, fact-checked explainer video (1080p MP4) with animated 2D/3D scenes, subtitles and a verification report. Run with /paper2video [overrides]. argument-hint: [overrides] | short --plan | short disable-model-invocation: true license: MIT compatibility: Claude Code with a local shell. Needs Node 18+, Python 3.10-3.13, ~1 GB disk (voice model + headless Chromium). Tools install on first run. allowed-tools: Bash(${CLAUDE_SKILL_DIR}/p2v *) --- # paper2video Paper in, explainer video out. The user picks the paper; everything after that is this workflow, with **strict cross-checking instead of script approval**. The skill never publishes anything. Paper to process: **$ARGUMENTS** If the arguments start with `short`, this is a request for a vertical short of a finished job: skip the pipeline and follow **Shorts** below. `short ` with neither `--plan` nor a slug is an unattended request (`p2v run short `): plan, pick the angle with the strongest hook picture yourself, and build that one to the end. Every step runs through one command: `${CLAUDE_SKILL_DIR}/p2v ` (works from any directory). Always type that full path exactly as written here, not a shell variable or `cd` + `./p2v`: the pre-approved permission matches this exact command, so other spellings stop for a permission prompt. 1. Run `${CLAUDE_SKILL_DIR}/p2v doctor`. It prints the folders (skill, tools, jobs, videos). If it ends with `-> run: ... setup`, tell the user "first run: installing tools (~1 GB, a few minutes)" and run `${CLAUDE_SKILL_DIR}/p2v setup` once, with the Bash tool's maximum timeout (600000 ms). If it is cut off, run it again: finished parts are skipped. 2. Write job files in the **jobs** folder that doctor printed (`//`), never in the skill folder. Installed copies keep jobs and videos in `~/paper2video/`; a development clone keeps them in the repo. ## Input Only the arXiv link or id is required (`https://arxiv.org/pdf/2610.35607`, `.../abs/...v2`, `2610.35607`). Anything after it is an override (e.g. `3 min`, `voice am_michael`). Do not ask for more instructions. Run the whole pipeline below with these defaults: | Default | Value | User can override with | |---|---|---| | Length | 4-5 min, 10-14 scenes | "3 min" | | Language / voice | **English**, Kokoro `af_heart` | `ko` / `Korean` / `한국어` → Korean (Supertonic 3 voice `F1`); another voice id (Kokoro `am_michael`..., Supertonic `F1`-`F5`, `M1`-`M5`) | | Verification | step 9 always runs in a **fresh-context subagent**, all 5 layers; equations and derivations (not machine-checkable) are checked by the verifier against paper.txt with the evidence written in VERIFY.md | n/a (never skipped) | | Second review | step 10: a **different model** reads the verified job against the paper with a short adversarial brief. Who that is comes from `${CLAUDE_SKILL_DIR}/p2v models` (default: a subagent; the user can name a model or another command-line tool) | "reviewer codex", "reviewer agent:", "no second review" → `p2v models reviewer=...` (`off` to skip) | | Fix loop | fix and re-verify up to 3 rounds, at most 2 review rounds, then stop with BLOCKED and the open items | n/a | | Templates | if the skill folder is a git clone you can edit, move any new scene that would work for other papers into `engine/templates.js`; otherwise (plugin install, or an unattended run through `p2v run`, which may write only under the jobs folder) keep it in the job's `scenes.js` and list it as a template candidate in the report | n/a | | Publishing | never upload or post anywhere; the MP4 is the end product | n/a | | Git | do not commit; leave changes for review | "commit it" | Only stop to ask the user when blocked (license forbids the planned visuals, the PDF has no text layer, verification BLOCKED after 3 rounds, a review BLOCKER still open after 2 rounds, or a toolchain step fails twice). The commands carry the process, so it does not depend on remembering this page: `p2v check`, `p2v verify`, `p2v review` and `p2v render` each refuse to go on until the step before is done for the files as they are now, and say what to do next. When unsure where a job stands (a resumed session, a long fix loop): `${CLAUDE_SKILL_DIR}/p2v status `. ## Korean (or another language) When the overrides ask for Korean: - `script.json`: `"lang": "ko"`; write subtitles and every on-screen string in natural Korean (plain 해요체 for narration). Keep widely used technical terms in English the first time, with a Korean gloss ("BEV(위에서 내려다본 지도)"). - TTS text (2nd element of each sentence): spell out units and abbreviations the way they should be read ("142센티미터", "엠에이피", "에이치백"); digits and dates are read correctly by the engine. - `tts.py` picks Supertonic 3 automatically for non-English `lang` (first run downloads the model). - `claims.json` quotes stay verbatim English from the paper; claim `text` may be Korean. - Rendering needs a Korean font (macOS has Apple SD Gothic Neo; on Linux install Noto Sans CJK). ## Final report (always, at the end) Per step: done / failed + output path · VERIFY.md verdict and open items · REVIEW.md verdict, who reviewed (the `reviewer:` line), what was changed because of it and every MINOR item left as it is · video path in the videos folder + length · new templates added · wall-clock time · anything the user should look at first. Setup (`${CLAUDE_SKILL_DIR}/p2v setup`) installs Node packages, ffmpeg, Playwright Chromium, a Python 3.10-3.13 venv and the Kokoro voice model into the tools folder, which survives updates. If the default `python3` is 3.14+, it picks 3.13/3.12, or set `PYTHON=/path/to/python3.12`. ## Pipeline | # | Step | Command / output | |---|---|---| | 1 | Fetch paper + license | `${CLAUDE_SKILL_DIR}/p2v fetch ` → `//paper/{meta.json,paper.pdf,paper.txt}` and job skeleton | | 2 | Read + outline | Read `paper.txt` fully. Fill `//BRIEF.md` (license block first, outline that follows the paper's own logic, shot list) | | 3 | Script | `//script.json`: scenes → sentences `[subtitle, tts_text]`. Read `references/error-types.md` first: how these videos went wrong (facts, types 1-10) and what a first-time viewer stumbled over (types 11-13), as rules with before/after sentences. At most 2 numbers and 28 narration words per sentence, and the whole video within `"seconds"` (4-5 min by default; set it from the user's override). The length is a target: write for it, and do not cut or pad a sentence over the last 10 s (the check passes up to 10 s over). Every acronym, benchmark, metric and baseline name goes into `"terms"` with words that say what it is and what sets it apart (`"common"` when this audience knows it); they are said or, better, drawn (24 px or more) where the term first appears. Names of one kind (the baselines of a chart) share one entry and are shown once | | 4 | Claims | `//claims.json`: every factual statement and every on-screen number, with source; `used_in` lists every sentence (`.`) that says or shows it. A claim that backs a number lists the `conditions` the paper attaches to it (benchmark and split, model and size, setting, baseline, hardware; `[]` only when the paper attaches none) | | 5 | Mechanical check (script) | `${CLAUDE_SKILL_DIR}/p2v check ` → must be **FAIL 0, WARN 0** for subtitles, narration and claims (scene numbers are checked again in step 8). It also checks the load of every sentence and that every term is listed, and lists sentences "to rule on" (absolutes, unit phrases, metric directions) in `build/VERIFY_auto.md`: read each against the paper now and fix the ones that say more than the paper | | 6 | Scenes | `//scenes.js` (templates + custom), replacing the starter scene. See `references/scene-authoring.md` | | 7 | Narration + timing | `${CLAUDE_SKILL_DIR}/p2v tts ` → `build/narration.wav`, `build/timing.json` | | 8 | Preview QA + check | `${CLAUDE_SKILL_DIR}/p2v preview ` → `build/preview_*.jpg` and `build/onscreen.json` (every string drawn). Look at every sheet (overflow, overlap, blank, legibility, camera inside geometry), then `${CLAUDE_SKILL_DIR}/p2v check ` again: FAIL 0, WARN 0 now includes numbers drawn by scenes, every condition of a number and every term's gloss (in the sentence, or on screen in its scene), the labels of derived and opinion claims (really drawn where the claim is used), the end card (license, "not affiliated with the authors", narration voice) and the length measured from the narration | | 9 | Independent verification | `${CLAUDE_SKILL_DIR}/p2v verify ` writes `build/VERIFY_brief.md` (every claim next to its sentences, the rows to rule on, the id of the files judged) and stops with exit 5: spawn the verifier it describes, with the prompt it prints and nothing more → `//VERIFY.md`. Run the command again: exit 0 = PASS for these files. Otherwise fix what the report requires, re-run 5-8 for what changed, and run the command again: it rewrites the brief and prints the message to send to the same verifier, which appends a round. At most 3 rounds | | 10 | Second review | `${CLAUDE_SKILL_DIR}/p2v review ` hands a copy of the verified job to another model. A command-line reviewer is run by the command itself; for a subagent it stops with exit 5 and the prompt to spawn it with, then run the command again → `//REVIEW.md`. Exit 0 (`review: OK` or `MINOR`) goes on. Exit 1 (`BLOCKER`): check each BLOCKER against `paper.txt`; if it is right, fix it, re-run 5-8, then 9 and 10 again; if the files already match the paper, say why in `//REVIEW_reply.md` and run 10 again. At most 2 rounds. Details: `references/verification.md` | | 11 | Render | `${CLAUDE_SKILL_DIR}/p2v render ` → `/_[_ko].mp4` (shortcut to `build/.mp4`) + `build/contact.jpg` (no Playwright: `render --manual`, open the URL in any browser). It refuses until steps 9 and 10 passed for exactly these files | | 12 | Final checks | `${CLAUDE_SKILL_DIR}/p2v check ` once more (the render records every frame's text, so it sees more than the preview). Must be FAIL 0, WARN 0. Watch `contact.jpg`; for a closer look at one moment, `${CLAUDE_SKILL_DIR}/p2v frames --at ` (or `--scene `) → `build/frames_extract/` | | 13 | Report | Final report (below). If `local/*.md` exists in the skill folder, follow those personal add-on steps after this one | Re-runs: steps 7, 8, 11, 12 are idempotent. Any change to `script.json`, `claims.json` or a scene file after step 9 → re-run 5, 7, 8, then 9 and 10 (both name the files they judged, so the render notices an edit made after them). ## Who writes, who verifies, who reviews `${CLAUDE_SKILL_DIR}/p2v models` shows the three roles and the tools on this machine that can review; `p2v models reviewer=` (or `verifier=`, `writer=`) sets one, in `/p2v.config.json`. - **Writer**: the session's model (for `p2v run`: `writer=`). The checks, the generated briefs and the two readers are what keep a cheaper writer's video correct; what a cheaper writer costs is more fix rounds and plainer custom scenes. - **Verifier**: always a subagent of the session (it opens the preview sheets). `verifier=agent:` names its model. - **Reviewer**: `agent` or `agent:` (a subagent), `claude:`, `codex`, `gemini`, `grok` (that tool, run read-only in a copy of the files), `cmd:` (any other tool; `{dir}`, `{prompt}` and `{out}` are filled in), or `off`. When spawning a reader, pass the model the command names; if the spawn fails with that model, spawn without one and say so in the report. A reader on the writer's own model still helps (fresh context, a different brief), but less: pick another model where one is available, and never ask the user to choose mid-run. Name both readers in the final report. ## Shorts (`short --plan`, `short `) A short is a 45-60 s vertical video (1080x1920) on one angle of a job whose `VERIFY.md` ends in `overall: PASS`. It is re-rendered for a phone, never cropped from the 16:9 video, and it only uses claims the job's `claims.json` already has. It opens on a picture (a result figure of the paper, or an original animation), not on a number: the number is the payoff later. Its background is plain black: the frame holds the subject, its labels and the captions, and only text, numbers and captions have to stay inside the safe area (a picture may run to the edges). Read `references/shorts.md` first: it has the script rules, the frame, the rules for paper figures and the templates. | # | Step | Command / output | |---|---|---| | 1 | Brief | `${CLAUDE_SKILL_DIR}/p2v short --plan` → claims, registered figures, payoffs already taken, plan schema (exit 4 when there is no plan yet) | | 2 | Plan | Write `//shorts/plan.json`: one colour for the paper (`accent`, from its figures or its subject, never a brand colour) and 2-3 angles (slug, hook sentence of at most 10 words, what the first two seconds show, payoff sentence and its claims, claim ids, figures, estimated length). An angle may name a paper figure that is not registered yet (`p2v figures ` lists the candidates and writes nothing). Write nothing else at this stage | | 3 | Show | `${CLAUDE_SKILL_DIR}/p2v short --plan` again → checked plan. With `--plan`, stop here and show the angles to the user | | 4 | One angle | `${CLAUDE_SKILL_DIR}/p2v short ` creates the skeleton (exit 4). Write `shorts//script.json` and `scenes.js` (6-9 sentences: picture hook first, the payoff number later, "full video" pointer last). For a paper figure: `${CLAUDE_SKILL_DIR}/p2v figures ` lists and extracts the PDF's images (a plot or diagram drawn as vector graphics: `--page N --render`, then `--rect X,Y,W,H`); register the ones used in `//figures.json`, check what else is in each picture and under which terms (simulator, dataset, another model: the `third_party` record, `references/shorts.md` rule 8). `figures.json` is the record of figure use; the build writes the credits to `build/CREDITS.md` | | 5 | Build | `${CLAUDE_SKILL_DIR}/p2v short ` → check FAIL 0 / WARN 0, narration, 45-60 s, preview sheets, check again. Fix what it reports until it stops with exit 5. Look at every `build/preview_*.jpg` and `preview_safe_*.jpg`: text inside the yellow box, nothing overlaps | | 6 | Verify | Fresh-context verifier subagent, given only `build/VERIFY_brief.md` to follow → `shorts//VERIFY.md` (qualifiers kept, nothing new, hook and payoff, screen, end card, paper figures). Fix, build again and send it back to the same verifier, which appends a round to `VERIFY.md`; at most 3 rounds, then BLOCKED | | 7 | Render | `${CLAUDE_SKILL_DIR}/p2v short ` → `/