--- name: analyze description: Analyze a screen recording of an animation to characterize its motion — timing, easing, transforms, and sequencing — so it can be recreated as web code. Use when the user drops or points at a video of an animation (.mp4/.mov/.webm/.mkv/.m4v/.avi/.gif) and says things like "I want this animation on my site", "recreate this motion", "how is this animated", or runs /motiscope:analyze. argument-hint: "[path-to-video] [notes]" allowed-tools: Bash, Read, AskUserQuestion user-invocable: true --- # motiscope: analyze Turn a screen recording of an animation into a precise, target-agnostic **animation spec** you can hand to `/motiscope:recreate`. A bundled Python pipeline measures the motion (a dense per-frame motion-energy curve + ffmpeg signal analysis — this is the source of truth for timing and easing) and extracts a small set of curated PNG keyframes for you to *see*. You combine the two into the spec. ## Resolve the scripts directory (do this first) Every command below runs a bundled script. Set `SCRIPTS`: ```bash SCRIPTS="${CLAUDE_PLUGIN_ROOT:-}/scripts" # Fallback for harnesses that don't export CLAUDE_PLUGIN_ROOT: this SKILL.md lives at # /skills/analyze/SKILL.md, so scripts are two levels up. Use the absolute # path of the directory containing the SKILL.md you just Read. if [ ! -f "$SCRIPTS/ingest.py" ]; then SCRIPTS="/../../scripts" fi if [ ! -f "$SCRIPTS/ingest.py" ]; then echo "ERROR: cannot find ingest.py — check the plugin install." >&2; exit 1 fi ``` On **Windows** use `python` instead of `python3` in every command below. ## Step 0 — preflight (silent on success) ```bash python3 "$SCRIPTS/mvsetup.py" --check ``` Exit 0 → proceed silently. Non-zero → `ffmpeg`/`ffprobe` are missing; hand off to `/motiscope:doctor` (don't try to analyze without them). ## Step 1 — resolve the input video - If the user gave a path (in `$1` or their message), use it. - Otherwise scan the drop folder and project root: ```bash ls -t animations/*.{mp4,mov,webm,mkv,m4v,avi,gif} *.{mp4,mov,webm,mkv,m4v,avi,gif} 2>/dev/null | head ``` - Several candidates → ask the user (`AskUserQuestion`) which one. - Exactly one → use it. - None → tell the user to drop a recording into `animations/` (or pass a path) and stop. **Local files only.** motiscope does not download URLs. If the user pastes a URL, ask them to screen-record it and drop the file in. ## Step 2 — run the pipeline ```bash python3 "$SCRIPTS/ingest.py" "