.agents/skills/motion/SKILL.md
# Motion (Framer Motion) — Skill **Name:** `motion` **Purpose:** Implement smooth, accessible animations with `motion/react` in React. Use this skill whenever adding animations, gestures, or layout transitions. **Applies when:** Using `motion/react` (`motion`, `AnimatePresence`, `useScroll`, etc.). **Do not use when:** No animations are needed or the component is strictly server-rendered. ## Rules - **Client-only boundary:** Motion requires `'use client'`; keep client islands small. - **Star
npx skillsauth add asymmetric-al/core .agents/skills/motionInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Name: motion
Purpose: Implement smooth, accessible animations with motion/react in React.
Use this skill whenever adding animations, gestures, or layout transitions.
Applies when: Using motion/react (motion, AnimatePresence, useScroll, etc.).
Do not use when: No animations are needed or the component is strictly server-rendered.
'use client'; keep client islands small.AnimatePresence for enter/exit, layout for layout, whileHover/whileTap for gestures.useReducedMotion().LazyMotion for larger motion surfaces.'use client' boundary.'use client' only where neededAnimatePresence wraps conditional UIlayout"use client";
import { AnimatePresence, motion } from "motion/react";
export function Toast({
open,
children,
}: {
open: boolean;
children: React.ReactNode;
}) {
return (
<AnimatePresence>
{open ? (
<motion.div
initial={{ opacity: 0, y: 8 }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: 8 }}
transition={{ duration: 0.18 }}
>
{children}
</motion.div>
) : null}
</AnimatePresence>
);
}
"use client";
import { motion } from "motion/react";
export function Expander({ open }: { open: boolean }) {
return (
<motion.div layout className="overflow-hidden rounded-md border p-3">
<div className="font-medium">Title</div>
{open ? <div className="mt-2 text-sm">More content...</div> : null}
</motion.div>
);
}
"use client";
import { motion, useReducedMotion } from "motion/react";
export function FadeIn({ children }: { children: React.ReactNode }) {
const reduce = useReducedMotion();
return (
<motion.div
initial={reduce ? false : { opacity: 0, y: 6 }}
animate={reduce ? { opacity: 1 } : { opacity: 1, y: 0 }}
transition={{ duration: 0.2 }}
>
{children}
</motion.div>
);
}
AnimatePresence (exit animations never run)layoutdevelopment
Use when working with Payload CMS projects (payload.config.ts, collections, fields, hooks, access control, Payload API). Use when debugging validation errors, security issues, relationship queries, transactions, or hook behavior.
testing
Use when CI tests fail on main branch after PR merge, or when investigating flaky test failures in CI environments
tools
Use when new translation keys are added to packages to generate new translations strings
data-ai
Pointer to the canonical agent instruction and skill system for this monorepo