ai-infrastructure-hugg…
Hugging Face Inference SDK patterns for TypeScript/Node.js — InferenceClient setup, chat completion, text generation, streaming, embeddings, image generation,…
Motion (formerly Framer Motion) patterns - motion components, variants, AnimatePresence, gestures, layout animations, scroll-linked motion, reduced-motion handling
$ npx -y skills add agents-inc/skills --skill web-animation-framer-motion --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/web-animation-framer-motionContext preview
The summary Claude sees to decide when to auto-load this skill.
Motion (formerly Framer Motion) patterns - motion components, variants, AnimatePresence, gestures, layout animations, scroll-linked motion, reduced-motion handling
name: web-animation-framer-motion description: Motion (formerly Framer Motion) patterns - motion components, variants, AnimatePresence, gestures, layout animations, scroll-linked motion, reduced-motion handling
> **Quick Guide:** `motion.*` components take `initial`, `animate`, `exit` and `transition` props; > variants lift those states into named sets a parent can orchestrate; `AnimatePresence` is what > keeps a removed component mounted long enough to animate out; `layout` and `layoutId` run FLIP > animations over layout changes; `useScroll` and `useInView` drive motion from scroll position. > Animate `x`, `y`, `scale`, `rotate` and `opacity`, and set `MotionConfig reducedMotion="user"` at > the root.
> **Import:** `import { motion } from "motion/react"` — the package was renamed from `framer-motion` > at v11.
**Detailed Resources:**
---
and a `key` on it; follow [examples/core.md](examples/core.md).
after and animates the difference; follow [examples/layout.md](examples/layout.md).
travel into the other; follow [examples/layout.md](examples/layout.md).
one-shot trigger; follow [examples/scroll.md](examples/scroll.md).
`useAnimation` gives the imperative handle; follow [examples/sequences.md](examples/sequences.md).
---
<critical_requirements>
**Wrap anything that animates on removal in `AnimatePresence`.** React unmounts the node the instant its condition goes false, so `exit` has nothing left to run against without the wrapper holding the node in the tree until the animation finishes.
**Give every direct child of `AnimatePresence` a stable, unique `key`.** The key is what `AnimatePresence` matches the departing element against; an index key re-points to a different item when the list changes and animates the wrong element out.
**Animate `x`, `y`, `scale`, `rotate` and `opacity`.** Motion writes these to `transform` and `opacity`, which the compositor owns; `height`, `width` and `marginTop` re-run layout on each frame instead.
**Set `MotionConfig reducedMotion="user"` at the app root.** Transform and layout animations then disable themselves for users who asked their OS for reduced motion, while opacity and colour keep working — so state changes stay legible rather than becoming instant.
</critical_requirements>
---
**Auto-detection:** motion/react, framer-motion, motion.div, AnimatePresence, MotionConfig, LayoutGroup, LazyMotion, layoutId, whileHover, whileTap, whileDrag, whileInView, useAnimation, useScroll, useTransform, useMotionValue, useSpring, useInView, usePageInView, useReducedMotion, useDragControls, staggerChildren, delayChildren, Variants
**Applies to:**
**Handled elsewhere:**
or moves. The styling layer settles those without a component wrapper
component states
---
<philosophy>
Motion animates state rather than time. A component declares what it looks like in each state, and Motion works out the interpolation, the interruption and the velocity carried across it — which is why a spring interrupted mid-flight continues from where it was rather than restarting.
</philosophy>
---
<decision_framework>
Motion is worth the component wrapper and the bundle when at least one is true:
interrupted spring
None of those true means the motion is a state change with both ends known in advance, which needs no runtime.
Reach for variants once more than one element shares the animation, or once the parent needs to control child timing — `staggerChildren` and `delayChildren` only exist on the variant path, and children inherit the parent's variant name without being passed anything. A single element with two states is clearer with `initial`/`animate` written inline.
</decision_framework>
---
<patterns>
The official skills marketplace for Agents Inc. 150+ skills covering everything from React and Prisma to Redis, ElevenLabs, and infrastructure tooling. Pick the skills that match your stack and install them via Claude Code. Need more control?
Repo: agents-inc/skills
Hugging Face Inference SDK patterns for TypeScript/Node.js — InferenceClient setup, chat completion, text generation, streaming, embeddings, image generation,…
LiteLLM proxy server setup, TypeScript client patterns via OpenAI SDK, model routing, fallbacks, load balancing, spend tracking, virtual keys, and production…
Serverless GPU compute platform for AI model deployment — web endpoints, GPU functions, model serving, and TypeScript client patterns
Local LLM inference with the Ollama JavaScript client -- chat, streaming, tool calling, vision, embeddings, structured output, model management, and…
Replicate SDK patterns for TypeScript/Node.js -- client setup, predictions, streaming, webhooks, file handling, model versioning, deployments, and training
Together AI SDK patterns for TypeScript — client setup, chat completions, streaming, structured output, function calling, embeddings, image generation,…