Install the skill above, then run this in your AI tool:
/motion-foundations <your description>
About
The base layer of the motion system. Defines every value, constraint, and
rule that downstream skills (`motion-patterns`, `motion-advanced`) inherit.
Load this skill before any animation work begins.
Source
What gets added to your project
Preview every file this package writes on install before you run the command above.
Summary
js using motion/react. Foundation layer — all other motion skills depend on this.
Skill instructions
Motion Foundations
The base layer of the motion system. Defines every value, constraint, and
rule that downstream skills (motion-patterns, motion-advanced) inherit.
Load this skill before any animation work begins.
When to Activate
Starting any animated component from scratch
Setting up tokens, spring presets, or easing values
Implementing prefers-reduced-motion support
Debugging hydration mismatches from animation initial states
Evaluating whether an animation should exist at all
Outputs
This skill produces:
A shared motionTokens object (duration, easing, distance, scale)
A shared springs preset map (5 named configs)
A shouldAnimate() gate used by all components
Accessibility-compliant animation defaults via useReducedMotion
SSR-safe initial states with zero hydration warnings
Principles
Motion must do at least one of the following or it must be removed:
Guide attention
Communicate state
Preserve spatial continuity
Responsiveness always outranks smoothness. A 60 fps animation that causes
input delay is worse than no animation.
Rules
These are non-negotiable. They apply to every component in the system.
Use motion/react only. Never import from framer-motion. Never mix the two in the same tree.
initial must match server output. If the server renders opacity: 1, the initial prop must also be opacity: 1. No exceptions.
Reduced motion overrides everything. When useReducedMotion() returns true or prefersReduced is true, all transforms are disabled. Opacity-only fades at ≤ 0.2s are the only permitted fallback.
Never animate layout properties.width, height, top, left, margin, padding are banned from animate. Use transform and opacity only.
All token values come from motionTokens. Hardcoded durations and easings in component files are forbidden.
All spring configs come from the springs map. Inline stiffness/damping values are forbidden.
"use client" is required on every file that imports from motion/react.
Never read window or navigator at module level. Always guard with typeof window !== "undefined".
Decision Guidance
Choosing a duration
Token
Use when
instant
Tooltip show/hide, focus ring, badge update
fast
Button feedback, icon swap, chip toggle
normal
Modal open, card expand, page element enter
slow
Hero entrance, full-page transition
crawl
Deliberate storytelling; use sparingly
Choosing a spring
Preset
Use when
snappy
Default UI — buttons, chips, nav items
gentle
Cards, modals, panels landing softly
bouncy
Playful moments — empty states, onboarding
instant
Tooltips, popovers, dropdowns
release
Drag release — natural physics feel
When to disable animation entirely
Disable (make shouldAnimate() return false) when:
prefersReduced is true
isLowEnd is true and the animation is non-essential
The element is off-screen and will never enter the viewport
The animation is purely decorative with no UX purpose
Motion design decisions (when to animate, what to emphasize) — that is a design concern, not a code constraint
Anti-Patterns
Anti-pattern
Rule violated
Fix
import { motion } from "framer-motion"
Rule 1
Use motion/react
initial={{ opacity: 0 }} on SSR component
Rule 2
Add mount guard
Skipping useReducedMotion check
Rule 3
Use useSafeMotion hook
animate={{ width: "100%" }}
Rule 4
Use scaleX transform instead
transition={{ duration: 0.4 }} inline
Rule 5
Use motionTokens.duration.normal
{ stiffness: 300, damping: 30 } inline
Rule 6
Use springs.snappy
Missing "use client" directive
Rule 7
Add to top of file
navigator.hardwareConcurrency at module level
Rule 8
Wrap in typeof navigator !== "undefined"
Related Skills
motion-patterns — consumes tokens and springs defined here to build button, modal, stagger, page transition, and scroll patterns. Does not redefine any values.
motion-advanced — consumes tokens and springs defined here for drag, SVG, text, and gesture patterns. Adds useAnimate sequences and custom hooks on top of this foundation.
Add this badge to a GitHub README so readers can open the package page and install the same version.
[](https://www.aipm-registry.com/skills/affaan-m/motion-foundations/1.0.0?utm_source=github&utm_medium=readme&utm_campaign=package_badge)
This imported publisher has not claimed its AIPM account. A connected account confirms account control, but it does not guarantee that a package is safe.
AI assistant context
What this skill is for
@affaan-m/motion-foundations@1.0.0 is an AIPM skill package for All tools. Use it when a project needs the reusable AI behavior described as: Motion tokens, spring presets, performance rules, device adaptation, accessibility enforcement, and SSR safety for React / Next.js using motion/react. Foundation layer — all other motion skills depend on this. Use when setting up motion...
Preview a UI component mockup in a local browser canvas where the human directly edits it (move, resize, edit text, delete, restyle), switches mobile/desktop/custom viewports, tests it, chats with you, and clicks Save and Finish. You the...
Run aipm add @affaan-m/motion-foundations@1.0.0 in a project that has AIPM initialized.
Supported tools
@affaan-m/motion-foundations@1.0.0 supports All tools.
Before installing
AIPM skills can add files to your project. Review the package name, target, description, license, and publisher before installing. Use a clean branch when trying a new skill.