/infermatrix-copilot:explainer-videofrom infermatrix-copilot
Builds short narrated explainer videos (30-120s MP4) from HTML/JS animation, edge-tts voiceover, Playwright frame capture, and ffmpeg. For project intros, launch videos, or animated walkthroughs.
Ships in infermatrix-copilot. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
The video is a deterministic web page. renderAt(t) draws the exact frame for time t, so the browser preview and the captured frames are identical. By default, the voiceover drives the timeline: each scene lasts as long as its narration needs, or its min_len, whichever is longer. For a strict duration limit, budget the scenes first and fit narration to that budget (see §3).
flowchart LR
A[narration.json] -->|tts.py| B[audio/*.mp3 + timeline.json]
B --> C[stage/timeline.js]
C --> D[stage: renderAt t]
D -->|render.py stills| E[QA frames]
D -->|render.py seg K| F[segs/seg_KK.mp4]
F -->|render.py final| G[concat + mix audio → MP4]
Templates live in templates/ next to this file. Copy them into a new project directory; do not edit the templates for one project.
accepted = false; a PR that is still Open described as "integration in progress", not "integrated".Resolve <skill-dir> to the directory containing this SKILL.md, whether installed by a plugin or copied into a host's skill directory. Copy its templates into a new project directory.
macOS / Linux:
cp -R "<skill-dir>/templates" "<project-dir>"
python3 -m venv "<project-dir>/.venv"
"<project-dir>/.venv/bin/python" -m pip install "edge-tts==7.3.1" playwright
"<project-dir>/.venv/bin/python" -m playwright install chromium
Windows PowerShell:
Copy-Item -LiteralPath "<skill-dir>/templates" -Destination "<project-dir>" -Recurse
py -3 -m venv "<project-dir>/.venv"
& "<project-dir>/.venv/Scripts/python.exe" -m pip install "edge-tts==7.3.1" playwright
& "<project-dir>/.venv/Scripts/python.exe" -m playwright install chromium
Run the remaining commands from the project directory, using that environment's interpreter wherever python is shown. These dependencies are needed only for video generation. The pinned edge-tts version was verified with the service's v2 handshake; investigate compatibility before changing it.
Requires ffmpeg and ffprobe on PATH.
For a revision, inspect the existing JS, active script imports, timeline and assets before copying; unreferenced scene files may contain unfinished edits. Work in a new directory and preserve the source. Reuse an existing working environment rather than creating another venv or reinstalling dependencies; the setup commands above are for a missing environment. Prove one real frame and a short encoded sample before a full render. Keep the new project's assets local where practical so it does not depend on mutable sibling-project paths.
narration.json: voice, rate, output, and scenes[] with unique id, min_len, and lines[] of {say, cap}. Duplicate IDs stop TTS before any audio cache is written. say is spoken text (write numbers and English the way they should sound); cap is the on-screen caption.
stage/scenes/<id>.js: one file per scene, registered with scene(id, build, render, tint). render receives scene-local t; meta.lines[i].start gives absolute narration cue times. Add each file to stage/index.html before boot.js.
stage/core.js: helpers span, ease, enter, typeHTML, countTo, el, place, rand. Only use time t for motion; never Date.now(), Math.random(), or CSS transitions, or capture will not match preview.
Voices: list with edge-tts --list-voices. Pick the voice in the narration language; captions and voice must use the same language.
Music (optional): set music to an mp3 path relative to the project and music_lufs to the bed loudness (default -30). final measures the track, applies the gain needed to reach music_lufs, fades it in over 2 s and out over 3 s, and ducks it about 10 dB under the voice with sidechaincompress. Leave music empty for voice only.
https://assets.mixkit.co/music/<id>/<id>.mp3). Record the track id and license in the report.music_lufs, not a fixed gain. Around -30 the voice stays clear; preview 10 s before the full mix.python tts.py .
build/audio/<scene>_<i>.mp3 and build/timeline.json, and prints each scene's start and length.say, voice and rate. Changing any of these, or using an older cache without metadata, regenerates that line. Caption-only edits reuse the audio.atempo adjustment only if speech stays clear. Measure the fitted audio with ffprobe, retain lead/tail space, and require every line to end within its scene. The supplied tts.py uses narration-driven lengths; fixed-budget timing needs a project-local adaptation, not just smaller min_len values. Update audio cues, captions and JS animation timings together..part.mp3, requires complete FFmpeg decoding before renaming it to the final MP3, and removes partial output on failure or cancellation. Reused audio is also decoded; an invalid cache stops the run so it can be removed and regenerated.WSServerHandshakeError: 403 is a rejected handshake, not a rate limit; it does not alone prove a client-version problem. Check the installed client against current upstream releases before retrying. The 2026-10 v2 handshake change requires edge-tts 7.3.0 or later; 7.3.1 also fixes locale-dependent server-date parsing. After an authorized dependency fix, verify real new speech and decode it before declaring recovery. Bound online calls with a timeout; do not loop retries on 403 or upgrade unrelated dependencies. Invalidate partial audio from a failed call.stage/index.html in a browser for live playback, or index.html?t=12.5 to freeze one moment. A short animated preview can establish composition and motion for a substantial structural change; apply only the approval gate established in §1.python render.py . stills 3.2 12.5 24 ... → build/still_*.png.document.fonts.ready and image decoding. Check both columns and the reserved caption/footer area; a theme change must also update scene-local hardcoded colors. An iteration overview and a results thumbnail strip can share a scene when that preserves readability. For embedded video, setting currentTime alone is insufficient: await the seek before capture, or recreate the replay deterministically from source images and measured timings. Save a contact sheet when useful for review.python render.py . count # number of segments
python render.py . seg 0 # repeat for each remaining segment; stop on failure
python render.py . final
SEG = 300 frames rendered by its own browser and encoder, so memory is released between segments. A full single-pass render of ~1900 frames ran out of memory on the first use..part.mp4 and replaced only on success, then receives a .sha256 sidecar recording its render inputs. Re-running skips a segment only when that signature matches the full timeline, stage files, renderer and capture/encode settings. Keep render assets under stage/ so they are included in the signature. Changes conservatively invalidate all segments; older segments without signatures are regenerated. final rejects stale or unverified segments instead of mixing them with current narration. Keep inputs unchanged during each render command; delete a .part.mp4 left by a crash.tail in Bash, use pipefail so an encoder failure is not hidden.scale = 1.0 (1280×720), ffmpeg lanczos upscale to 1920×1080, -preset medium -crf 17. On the first use this cut a segment from ~37 min (1.5× capture, slow) to ~4 min with no visible difference. Raise scale only when the machine is idle and small text looks soft.FPS in render.py for a different frame rate; capture, encoding and the page's HUD timecode use that value, injected as window.TL.fps.final joins them with stream copy. Changing render settings invalidates the saved segments; re-run all segment commands before final.ffprobe -v error -show_entries format=duration:stream=codec_type,width,height,nb_frames,duration -of compact <out.mp4>
ffmpeg -v error -i <out.mp4> -f null -
ffmpeg -v error -i <out.mp4> -vf "select='eq(n\,299)+eq(n\,300)+eq(n\,599)+eq(n\,600)',scale=480:-1,tile=4x1" -frames:v 1 seams.jpg
int(total * fps); audio duration must match video within one AAC frame (~0.03 s).build/segs/ only while more edits are expected, including the signature sidecars needed for resuming an unchanged render. Close task-owned browsers and processes.templates/narration.json (opens in a new tab)templates/render.py (opens in a new tab)templates/stage/boot.js (opens in a new tab)templates/stage/core.js (opens in a new tab)templates/stage/index.html (opens in a new tab)templates/stage/scenes/s1_title.js (opens in a new tab)templates/stage/scenes/s2_points.js (opens in a new tab)templates/tts.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub infermatrixlab/infermatrixcopilot --plugin infermatrix-copilot9 skills in this plugin
/imcifixFix a GitHub issue with InferMatrixCopilot context. Use when the user invokes /imcifix or $imcifix, asks to fix an issue, or wants an issue-to-patch workflow./imcodingImplement a feature, refactor, or existing design as working code in a target repository using InferMatrixCopilot knowledge. Use when the user invokes /imcoding or $imcoding, or asks InferMatrixCopilot to implement a change. Design-only requests belong to imdesign; GitHub issue-to-patch requests belong to imcifix./imdesignCo-design a change, feature, API, architecture, or implementation plan with repository context. Use when the user invokes /imdesign or $imdesign, asks for co-design, or wants a design before coding./imkbinitBootstrap a repository's InferMatrixCopilot knowledge base with `kb init`, one reviewed stage at a time (skeleton, feature-discovery, modules, knowledge, deepen, pr-history, harvest-calibration). Use when the user invokes /imkbinit or $imkbinit, asks to initialise or onboard a repository's knowledge base, or wants the next kb init stage or an existing knowledge base widened or deepened./imlearnDistill reusable lessons from a completed local task and grade the project knowledge actually used, through InferMatrixCopilot. Use when the user invokes /imlearn or $imlearn, asks to learn from the current task, or another InferMatrixCopilot skill reaches its completion step./imreviewReview a PR or local changes with InferMatrixCopilot Direct mode. Use when the user invokes imreview.Other plugins' skills for the same job