Communitygithub.com

motion-extractor

Analyze the animations and interactions of a reference website with playwright-cli. Captures sequential screenshots while scrolling, computed styles and DOM state, and technology signals (GSAP, ScrollTrigger, ScrollSmoother, Lenis, Motion, CSS scroll timelines). The agent then interprets the motion and writes a MOTION.md with visual descriptions, evidence, equivalent implementations and performance/accessibility notes. Use when asked to analyze, document or learn from the motion, scroll effects, parallax, pinned sections, text reveals or microinteractions of a URL, or to produce MOTION.md.

motion-extractor 是什么?

motion-extractor is a Claude Code agent skill that analyze the animations and interactions of a reference website with playwright-cli. Captures sequential screenshots while scrolling, computed styles and DOM state, and technology signals (GSAP, ScrollTrigger, ScrollSmoother, Lenis, Motion, CSS scroll timelines). The agent then interprets the motion and writes a MOTION.md with visual descriptions, evidence, equivalent implementations and performance/accessibility notes. Use when asked to analyze, document or learn from the motion, scroll effects, parallax, pinned sections, text reveals or microinteractions of a URL, or to produce MOTION.md.

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/gonzavh17/web-design-studio/tree/HEAD/skills/internal/motion-extractor

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Motion Extractor

The tooling captures. You interpret. The scripts collect evidence: screenshots, measured values and technology signals. Naming the effects, explaining them and proposing implementations is your job, done by looking at the frames.

Requirements: playwright-cli on PATH and Node ≥ 18.

Ground rules

  1. Label what you write:

    • fact: measured, or read from a live runtime object.
    • detected: technology evidence.
    • hypothesis: your interpretation or a suggestion.

    The original implementation is "unknown" unless the runtime evidence shows it.

  2. Never copy site code. Record parameters (durations, offsets, eases, "top 80%"-style config). Write any suggested snippet yourself.

  3. Page code stays in the browser. Scripts are only string-searched inside the page. Nothing from the site runs in Node or the shell.

  4. Write only to the destination you choose (--out), normally inside the client project, for example <project>/references/motion/<site>/. Never write to global directories.

Workflow

Let SKILL be this skill's directory.

  1. Capture, which takes about 3–5 minutes for a long page:
    node "$SKILL/scripts/mx.mjs" run <url> --out <dest>
    
    The capture runs these stages: detect, idle (reload, first 6s), inventory, scroll sweep with screenshots, runtime config, hover probe and a mobile pass. It then writes <dest>/EVIDENCE.md. Useful options:
    • --settle 1200 for heavily smoothed sites;
    • --step-vh 0.33 for finer steps;
    • --skip idle,hover,mobile for a quick pass;
    • --keep-open to keep the browser session open for manual follow-ups;
    • help lists every option.
  2. Read <dest>/EVIDENCE.md. It lists technologies, ScrollTrigger rows, the intro table, the elements that changed while scrolling (each with frame references), hover changes and the mobile comparison. Check "Scroll capture" first: if the offsets are unreliable, rerun with a larger --settle.
  3. Look at the frames cited for the most significant elements, usually 6–12 frames in total. Skip the rest. Compare consecutive scroll-NNN.png frames to see what moves.
  4. Interpret. Group the elements into effects and name each one with references/patterns.md. When a number is ambiguous, follow the reading rules in references/methodology.md, or drive playwright-cli directly for a targeted check. The methodology reference includes examples.
  5. Write <dest>/MOTION.md following references/motion-md-template.md. For each effect, cover: the visual description, the elements, the trigger, the timing, the relation to scroll, the evidence, the suggested equivalent implementation, and performance and accessibility.

Output layout

<dest>/
├── MOTION.md      # written by you
├── EVIDENCE.md    # generated digest (facts + frame index)
├── frames/        # scroll-NNN.png, idle-NNNNNms.png, mobile-NNN.png
└── data/          # raw JSON from each probe (large; query with node -e, don't read whole)

To refresh the digest after a targeted re-run (mx.mjs sweep|hover|runtime|... <url> --out <dest>), run mx.mjs digest --out <dest>.

Limits

  • Canvas, WebGL, video and Lottie content is opaque: only the element box is tracked.
  • Values are sampled at discrete scroll positions. Durations are lower bounds. Easing is what you judge from the frames and samples, unless the runtime shows it.
  • Elements that mount later, or only gain transforms later, may not be tracked. Re-run with --keep-open and inspect them manually.
  • Analyzing a site is for learning its craft. Build something original; do not clone it.

Methodology credit: NOTICE.md.

相关技能