What is the motion foundations skill?
Motion foundations is a skill in the affaan-m/ECC repo for React and Next.js animation with motion/react. It defines duration, easing, distance and scale tokens, five named springs, a shouldAnimate gate, reduced-motion handling and SSR-safe initial states that the other motion skills build on.
Motion foundations is the base layer of a small motion system in the ECC repository. Its description says every other motion skill depends on it, so the agent loads it before any animation work begins.
It targets React and Next.js code that uses the motion/react package. The skill fixes the values and rules once, so components stop carrying their own durations, easings and spring numbers.
What changes in your agent's output
- Durations, easings, distances and scales come from one motionTokens object, not from numbers typed inside components.
- Spring configs come from a five-entry map named snappy, gentle, bouncy, instant and release.
- Only transform and opacity are animated. Width, height, top, left, margin and padding are banned from animate.
- Reduced motion turns transforms off and leaves only opacity fades of 0.2 seconds or less.
- Initial states match what the server rendered, which avoids hydration warnings.
Who it is for
Best for
- React or Next.js projects that want one consistent motion language across components.
- Teams that have been burned by hydration mismatches from animated initial states.
- Projects where reduced-motion and low-end device behavior must be enforced, not optional.
Not for
- CSS-only animation, Tailwind animate classes without motion/react, or GSAP and anime.js work, which it lists as non-goals.
- Deciding what to animate. The skill calls that a design concern, not a code constraint.
- Components such as modals or drag handlers. Those live in the companion motion skills.
Use it with UiChemy
Motion foundations governs animation in a React codebase. For a WordPress site, UiChemy Composer writes HTML, CSS and JS into the page, so this skill would not apply there. Click Get Started on uichemy.com.
How to install Motion Foundations Skill: Tokens and Springs for React Animation
npx [email protected] setupSetup can be rerun later to update ECC or change scope. A manual route is also described in the README: clone the repository and copy the skill folder you want.Check the prerequisites
The README asks for Node.js 18 or newer. The Claude Code plugin route also needs Git and Claude Code 2.1 or newer on your PATH.
Run the guided setup
Run
npx [email protected] setupand follow the prompts. It installs the ECC plugin, which carries the whole skill library, not this skill on its own.Choose one install method
The README warns against stacking install methods in the same harness, because that can duplicate skills, commands and hooks. Pick the plugin route or a manual route, not both.
Other agents
For Codex or Kimi Code run
npx [email protected] install --guided. It lets you pick the harnesses and shows each destination before writing.Use the skill
Ask your agent to load motion foundations before it builds any animated component, then to create the motion tokens and springs files.
Check that it loaded
Ask the agent to list its skills and look for motion-foundations, or have it create a motionTokens file and check the values against the skill.
Key features
- Three-reason testMotion must guide attention, communicate state or preserve spatial continuity, or it is removed. Responsiveness outranks smoothness, so a smooth animation that delays input is worse than none.
- Eight hard rulesThe rules cover motion/react only, matching initial states, reduced motion overriding everything, no layout properties, tokens for values, spring presets, a use client directive and no window reads at module level.
- Duration tokensFive named durations run from 0.08 seconds for instant tooltips and focus rings to 1.0 second for deliberate storytelling, with a table saying when each applies.
- Easing and distanceFour easing curves, five distances from 4 to 48 pixels and three scale values for subtle, press and pop states give components a shared vocabulary.
- Spring presetsSnappy is the default for buttons and nav, gentle suits cards and panels, bouncy suits playful moments, instant suits popovers, and release suits drag. Inline stiffness and damping are forbidden.
- shouldAnimate gateA runtime function returns false for reduced motion and, for non-essential animation, on devices reporting four or fewer logical cores.
- Reduced-motion priorityThe order is the reduced-motion preference first, low-end detection second and design preference last. Motion must degrade without layout shift or lost orientation.
- SSR safetyA mount guard keeps initial equal to the server output. The skill shows the wrong and the correct version side by side.
- Anti-pattern tableEight common mistakes, such as importing from framer-motion or animating width, are mapped to the rule they break and the fix.
Frequently asked questions
What is motion foundations?
It is a skill in the affaan-m/ECC repository for React and Next.js animation using motion/react. It defines motion tokens, five spring presets, a shouldAnimate gate, reduced-motion handling and SSR-safe initial states, and it is the base the companion motion-patterns and motion-advanced skills build on.
How do I install motion foundations?
Install ECC, since the skill ships inside it. The README recommends npx [email protected] setup with Node.js 18 or newer. Pick one install method per agent and do not stack a plugin install with a manual one, which the README says can duplicate skills.
Does it use framer-motion or motion/react?
It requires motion/react only. Rule one says never import from framer-motion and never mix the two in one tree. If your project still uses the older package name, the agent would need to migrate imports before following the skill.
How does it handle prefers-reduced-motion?
Reduced motion overrides everything. When useReducedMotion returns true, transforms are disabled and only opacity fades of 0.2 seconds or less remain. The skill supplies a useSafeMotion hook and a CSS media query pattern, and shows a Tailwind motion-safe example.
Which spring should I choose?
Snappy is the default for buttons, chips and navigation. Gentle suits cards and modals landing softly, bouncy suits empty states and onboarding, instant suits tooltips and dropdowns, and release suits drag release. The skill forbids typing stiffness or damping inline.
Can it work with other animation libraries?
No. Third-party libraries such as GSAP and anime.js are listed as non-goals. For those, see GSAP Performance. For accessibility-focused motion rules in general, Accessible Motion is a related page, and Motion System covers duration and easing tokens.
Does it work with Claude Code, Cursor and Codex?
The ECC README says it works best with Claude Code, has native Codex and Qoder plugin paths, and ships capability-limited adapters for Cursor, OpenCode, Gemini and others. This skill is plain Markdown guidance, but check the README support matrix before assuming parity.


