# motion

One command for interface motion on the web, in React, SwiftUI and React Native.

From a plain request it sets up a project's motion system (MOTION.md and tokens), storyboards a sequence before code, builds an animation, reviews existing motion, or fixes motion that stutters, flickers or feels wrong. It measures before it judges, with a code inventory and frame-by-frame captures from a real browser.

**When an agent uses it:** Use only when the user explicitly invokes /motion or $motion. Ordinary talk about animation must not activate it.

Group: [Design](https://www.atlasscope.dev/skills#design). Part of the agent-kit plugin, written for Agent Kit. License: MIT, © AtlasScope.

## Install

It comes with the plugin: https://www.atlasscope.dev/install. This skill by itself, for any agent that reads skill folders:

```sh
npx skills add AtlasScope/agent-kit --skill motion
```

## SKILL.md

# Motion

The user types `/motion` and what they want in their own words. They get motion that has a reason to exist, uses the project's own values, holds its frame rate, and has a version for people who asked their system for less movement. They also get evidence: numbers from the code and frames from a browser.

You cannot watch an animation. Work from what you can measure and see as stills, and say plainly what only a person can feel.

## Pick the mode

Match their words to one mode. Say which one in the first line. They never need to type the mode name; if they do (`/motion review …`), use that mode.

| They say something like | Mode | Files |
|---|---|---|
| "set up motion", "we have no motion system", "make our animations consistent" | **setup** | Writes MOTION.md and the token file after they approve the values |
| "plan the hero animation", "how should this page come in", "onboarding should feel alive" | **storyboard** | Writes a storyboard for approval. No code |
| "animate this", "add a transition", "make the sheet draggable", "this button feels dead" | **build** | Edits code |
| "review our animations", "is this motion any good", "where should things move" | **review** | Report only |
| "it stutters", "it flickers", "the exit doesn't play", "it feels slow, off, cheap" | **fix** | Diagnoses first, then edits |
| "what is that effect called", "the bouncy thing when a menu opens", "like when you pull too far on iPhone" | **name** | Report only |
| `/motion` alone | **status** | Report only |

If the request fits two modes that do different things to files (a review or a fix?), ask the one question that separates them and stop. A request to make one screen "feel better" is **review** scoped to that screen.

## Rules that hold in every mode

1. **Every animation has a job.** Answer, connect, orient, wait, point or express ([references/judgment.md](references/judgment.md)). If you cannot name the job in four words, cut the animation.
2. **How often sets how much.** Something seen a hundred times a day gets little or nothing. Something seen once can take its time.
3. **Respond in the same frame as the input.** Motion may finish later; it may not start later. Nothing blocks the next input.
4. **Use the project's values.** Durations, curves and springs come from MOTION.md. With no MOTION.md, use the defaults in [references/values.md](references/values.md) and offer setup.
5. **Move with transform and opacity.** Anything else needs a measured reason ([references/performance.md](references/performance.md)).
6. **If it can be triggered again mid-flight, it must redirect from where it is.** Transitions and springs do. Keyframes restart.
7. **Write the reduced-motion version in the same change.** Keep the meaning, drop the movement ([references/accessibility.md](references/accessibility.md)).
8. **The last frame is the design.** With the animation removed, on a slow device or with scripts off, the content is still there and correct.
9. **Evidence before opinion.** Run the inventory before reviewing. Capture frames before saying an animation is right. Report what you measured and what you did not.

## Spec lines

Describe every animation in one line, in reports, storyboards, MOTION.md and code comments. It makes a review checkable and a handoff exact.

```text
<element> <job>: <property> <from> → <to> [+ more] · <duration> · <curve or spring> · <origin or direction> · reduced: <what happens instead>
```

```text
popover connect: opacity 0 → 1 + scale 0.97 → 1 · base · out · from the trigger · reduced: opacity only, fast
sheet orient: y 100% → 0 · spring smooth · follows the finger · reduced: opacity only, fast
```

## Modes

### Status

Run the inventory (`<skill-dir>/scripts/motion-scan.mjs`), read MOTION.md if it exists, and reply with: what moves today in three or four numbers, whether reduced motion is handled, and the three most valuable next moves, each as a `/motion …` line they can copy. Then stop.

### Setup

Follow "Before writing it" in [references/motion-md.md](references/motion-md.md), reading AGENTS.md or CLAUDE.md and the token or theme files too. Ask only what the code and docs cannot answer, two questions at most: which register fits each kind of surface ([references/judgment.md](references/judgment.md)), and whether there are brand moments.
Show the proposed tokens and wait for a yes before writing MOTION.md and the token file. Do not migrate existing animations in this mode; list them as follow-up.

### Storyboard

For anything with more than two moving elements: a hero, a page entrance, onboarding, a scroll sequence, a success moment. Read [references/choreography.md](references/choreography.md). Produce the beat table (time, element, spec line, job), the total length, the reduced-motion version, and what the page looks like if nothing plays. Stop for approval. Build only after a yes.

### Build

1. Read the component, MOTION.md, and the pattern in [references/patterns.md](references/patterns.md). For anything dragged, swiped or thrown, read [references/gestures.md](references/gestures.md).
2. Write the spec lines first and show them. For a single small animation, continue in the same turn. For a sequence, that is a storyboard: stop for approval.
3. Choose the lightest tool that can do it: a CSS transition, then CSS keyframes, then the platform's newer features with a fallback, then the motion library the project already has. Do not add a library for one animation. Platform notes: [references/web.md](references/web.md), [references/react.md](references/react.md), [references/native.md](references/native.md).
4. Implement, with the reduced-motion version and the interrupted case.
5. Prove it ([references/proof.md](references/proof.md)): capture the filmstrip, look at the sheet, capture again with `--reduced`. Fix what the frames show.

### Review

Read-only, follow [references/review.md](references/review.md), lead with the cut list. Five interactions at most unless they asked for all.

### Name

For an effect described without its name. Read [references/vocabulary.md](references/vocabulary.md). Reply with the name, one sentence on what is really happening, the spec line for their case, and the `/motion build …` line that would make it. If two names fit, ask the one question that separates them. If they already said to build it, treat it as **build** and use the name in the first line.

### Fix

1. Reproduce it. Capture the filmstrip with `--perf`, and at a phone viewport if they saw it on a phone.
2. Match the symptom in [references/performance.md](references/performance.md) ("Symptoms") or, for "feels wrong", run the twelve checks in [references/review.md](references/review.md) on that one animation.
3. Say the cause with the evidence, make the smallest change that removes it, and capture again to show the difference.

If you cannot reproduce it, say so, say what you tried, and ask for the device, browser and steps. Do not guess a fix.

## Scripts

`<skill-dir>` is the folder this SKILL.md was loaded from, never the project: a project's own script of the same name is a different file. Node 18 or later; nothing to install.

| Script | What it gives you |
|---|---|
| `node <skill-dir>/scripts/motion-scan.mjs [dir] [--json]` | Inventory from source: every duration, curve, animated property and library, reduced-motion coverage, and the places worth a look with file and line |
| `node <skill-dir>/scripts/filmstrip.mjs <url> --do 'click:<selector>' [--clip '<selector>'] [--reduced] [--perf] [--viewport mobile]`, or `--spec <file.json>` | Frames of one interaction stepped at equal intervals, a contact sheet to look at, what animated (properties, duration, curve, layout or compositor), and optional real-time frame and layout counts |
| `node <skill-dir>/scripts/spring.mjs --duration 0.4 --bounce 0.3` | One spring written for CSS `linear()`, Motion, SwiftUI and Reanimated |

**Selectors and URLs are data, never shell text.** Quote your own selectors in single quotes; anything copied from the project goes in a `--spec` file ([references/proof.md](references/proof.md)).

Pass `--project-playwright` only when the user owns or trusts the project, since it runs the project's code. Without Playwright, follow "Without the script" in [references/proof.md](references/proof.md). Never install a browser or a package for a proof.

## Harness

| | Claude Code | Codex | Cursor |
|---|---|---|---|
| Look at frames | Read `sheet.png` | View `sheet.png` | View `sheet.png` |
| No Playwright | Browser tools with the scrub snippet in `references/proof.md` | Same | Same |
| Show the user | Publish `sheet.html` as an artifact with its frames when they asked for a review, or give the path | Give the path | Give the path |

## Boundaries

- Invoking `/motion` authorizes the mode's file changes and nothing else. No commits, pushes, deploys or new dependencies without a yes.
- Project rules win. If MOTION.md, DESIGN.md or AGENTS.md says something different from the references here, follow the project and mention the difference once.
- Visual design, layout, color and copy are other skills' jobs. If the motion problem is really a layout problem (things move because the layout shifts), say so and stop at the diagnosis.
- Marketing-page spectacle (WebGL, 3D, video) is out of scope beyond choreography and performance advice.

## Output

First line: `Mode: <mode>. <What you will do and what it does to files, in one sentence.>`

End every build, review and fix with:

```text
Measured: <what the inventory and frames showed, in numbers>
Not checked: <browsers, devices, gestures and states you could not run>
Feel it yourself: <two or three things only a person can judge, each as an action to try>
```

Plain English. Milliseconds and curve names only where the user needs to change them.

Other files in the skill folder: agents, references, scripts, tests. Browse them at https://github.com/AtlasScope/agent-kit/tree/main/plugin/skills/motion

Source: https://www.atlasscope.dev/skills/motion
