Communitygithub.com

motioncheck

Inspect how a UI animation works and rebuild the idea as an original animation, verified with the MotionCheck CLI. Use when the user wants to understand or match the timing, easing, stagger, transforms or opacity of a local page, MP4 or GIF; asks why their motion feels different from a reference; or wants a motion spec, a CSS or Web Animations export, or a motion regression check.

What is motioncheck?

motioncheck is a Claude Code agent skill that inspect how a UI animation works and rebuild the idea as an original animation, verified with the MotionCheck CLI. Use when the user wants to understand or match the timing, easing, stagger, transforms or opacity of a local page, MP4 or GIF; asks why their motion feels different from a reference; or wants a motion spec, a CSS or Web Animations export, or a motion regression check.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/shajikfrancis/motioncheck/tree/HEAD/skills/motioncheck

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

What does motioncheck do?

Learn how the reference moves, apply that to the user's own design, and show with numbers how close it is. The deliverable is original code plus evidence.

Rules

  • Permission first. Only analyze material the user made or may use. Recreate timing and structure with the user's own design. Do not copy another product's code, assets, fonts, copy or branding. If asked for a copy of a brand's interface, say what you will not copy and offer to match the motion on the user's design.
  • Never upgrade a label. Report values as measured, estimated (with its ± and confidence) or unavailable. Never present an estimated easing as the original one.
  • Local only. MotionCheck captures local files and localhost. For a remote reference, ask the user for a screen recording they are allowed to share. Do not work around this.
  • Do not loosen tolerances to pass. Report what still differs.

0. Set up

motioncheck below means the installed command, or node <motioncheck repo>/dist/cli/main.js. Needs Node 22+, FFmpeg for media, and Playwright's Chromium (npm run setup:browser in the MotionCheck repo). Check with motioncheck --version; ask the user for the repo path if needed. Work in .motioncheck/<name>/ in the user's project and suggest ignoring it in Git.

State the target (which elements, which trigger, which time range), the destination files, and the project's existing animation stack. Ask only if two readings would lead to different work.

1. Inspect the reference

Local page (prefer this when there is a choice; it can be measured):

motioncheck analyze path/to/reference.html --out .motioncheck/name/ref --end 1500ms
motioncheck analyze http://localhost:5173/route --trigger hover --target "<selector>" --out .motioncheck/name/ref

Add data-motion="name" to the elements, or pass --track "<selector>" (repeatable).

MP4 or GIF:

motioncheck analyze clip.mp4 --start 200ms --end 1400ms --region x,y,w,h --out .motioncheck/name/ref

Then:

  • Read motion.json, including every warnings, unavailable, notes and fit.
  • Look at the frames in frames/: first, last, and several during movement. For video, confirm each el-N is the thing you think it is (compare bounds). Pixel analysis can merge, miss or invent shapes on busy footage. If it did, crop tighter and rerun.
  • Rerun with --end raised if animations were still running.

2. Write the motion spec

Create .motioncheck/name/spec.md:

elementtriggerpropertyfrom → todelaydurationeasingprovenance

Add stagger steps and order, what stays still, and an Unknown list: everything unavailable or low confidence, plus how you chose a value for it. Mark your own choices as authored. Describe the reduced-motion behavior here too.

3. Build an original animation

  • Use the user's components, design tokens and animation library.
  • Give animated elements data-motion names, ideally matching the spec.
  • Move only what the spec says. Prefer translate, scale, rotate and opacity.
  • Scale distances to the new element sizes if that suits the design, and record it.
  • motioncheck export <ref> gives a starting point in CSS or WAAPI. Treat estimated exports as a draft: check selectors, round sensibly, and delete tracks that are noise.
  • Always ship reduced motion. Start from the exported variant and read docs/reduced-motion.md in the MotionCheck repo. If a removed effect carried meaning, add a still cue instead.

4. Verify

Capture your build with the same trigger, viewport, fps and range:

motioncheck analyze <your page> --out .motioncheck/name/candidate --end 1500ms
motioncheck compare .motioncheck/name/ref .motioncheck/name/candidate --motion-only --out .motioncheck/name/report

--motion-only ignores pixels and resting layout, which differ in an original design. Without it, use it only when the candidate is meant to look identical.

If ids differ (video gives el-N), pair them: --match el-1=hero-card --match el-2=hero-title. If distances were scaled on purpose, value errors are expected: judge the timing rows and say so.

Exit code 0 is a match, 1 means differences or inconclusive, 2 is an error. Read report.md: check that capture settings agree, fix the largest difference first, and capture again. For a video reference, a pass means "within the estimate's uncertainty", not "identical". Also capture with --reduced-motion reduce and confirm only short fades remain. To let the user judge by eye: motioncheck view <ref> <candidate> (long-running; give them the printed URL).

Stop after about five rounds. If something still differs, report it with its numbers.

5. Report

  • Files changed and how to trigger the motion.
  • The spec table, with provenance.
  • The final compare verdict, the command used, the tolerances, and the remaining differences. Say if the comparison was motion-only.
  • What is unavailable or assumed, and the reduced-motion behavior.

Related Skills