framer-motion · mindrally — скилл для Claude Code: анимации в React без тормозов
Задаёт агенту правила анимаций на Motion: что анимировать, а что ломает раскладку. Пригодится, когда в проекте уже есть React и TypeScript.
npx skills add Mindrally/skills --skill framer-motion -a claude-codeЧто делает framer-motion
Скилл превращает агента в инструктора по Motion (бывший Framer Motion) для React и TypeScript. Он настаивает на импорте из motion/react, потому что старый путь framer-motion устарел, и требует анимировать только x, y, scale, rotate и opacity — эти свойства идут через GPU и не пересчитывают раскладку. Анимация width, height, top, left, margin и padding в правилах прямо названа источником дёргания.
Внутри — готовые шаблоны кода: варианты для сложных сцен со staggerChildren, layoutId для переходов общего элемента, пружинные переходы вместо длительности, AnimatePresence для выхода элементов, useScroll с useTransform для параллакса. Отдельные блоки про willChange, мемоизацию вариантов и колбэков через useMemo и useCallback, а также про useReducedMotion — анимации не должны игнорировать системную настройку уменьшенного движения.
Есть и раздел про отладку: React DevTools для лишних ререндеров, вкладка Performance в Chrome DevTools для поиска рывков, проверка на реальных устройствах. Целевой ориентир — 60 fps, на экранах с высокой частотой обновления 120 fps. Если в проекте анимации на CSS или другой библиотеке, правила будут спорить с текущим кодом — это повод проверить, стоит ли вообще подключать скилл.
Какие задачи решает
- переписать импорт с
framer-motionнаmotion/react - убрать рывки при анимации раскладки
- сделать переход между страницами через
AnimatePresence - собрать параллакс на
useScrollиuseTransform - учесть
prefers-reduced-motionв компоненте
Примеры запросов агенту
- добавь анимацию появления списка с задержкой между элементами
- почему модалка дёргается при закрытии — посмотри по правилам framer-motion
- переделай переход между страницами на Motion с учётом reduced motion
Как установить framer-motion
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill framer-motion -a claude-code2Вручную: положить файлы
~/.claude/skills/framer-motion/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/framer-motion/
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill framer-motion -a codex2Вручную: положить файлы
.agents/skills/framer-motion/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill framer-motion -a cursor2Вручную: положить файлы
.cursor/skills/framer-motion/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills framer-motion2Вручную: положить файлы
.github/skills/framer-motion/SKILL.md1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill framer-motion -a gemini-cli2Командой платформы
gemini skills install https://github.com/Mindrally/skills --path framer-motionВручную: положить файлы
.devin/skills/framer-motion/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill framer-motion -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Из того же набора168
Другие версии framer-motion
Похожие
Рядом в теме «Фронтенд и UI»
Всё по теме «Фронтенд и UI» →Вопросы о framer-motion
Как установить framer-motion в Claude?
Выполните npx skills add Mindrally/skills --skill framer-motion -a claude-code. Файл скилла окажется по пути ~/.claude/skills/framer-motion/SKILL.md.
Что делает скилл framer-motion?
Даёт агенту набор правил по анимациям в React: какие свойства анимировать, как строить варианты, жесты, скролл и выход элементов. Плюс подсказывает, как искать лишние ререндеры и рывки.
Почему в правилах motion/react, а не framer-motion?
Библиотеку переименовали из Framer Motion в Motion, и старый путь импорта считается устаревшим. Скилл требует использовать актуальный API.
Исходный текст
SKILL.md · Apache-2.0
---
name: framer-motion
description: Expert guidelines for building performant animations with Framer Motion/Motion library in React applications
metadata:
maintainer: Mindrally
source: https://github.com/Mindrally/skills
---
# Framer Motion / Motion Animation Guidelines
You are an expert in Framer Motion (now Motion), React, and TypeScript. Follow these guidelines when creating animations.
## Core Principles
### Import from the Correct Package
- Use `import { motion } from "motion/react"` for React projects (not "framer-motion" - this is outdated)
- The library was renamed from Framer Motion to Motion
- Always use the latest Motion API
### Performance-First Approach
- Animate transform properties (`x`, `y`, `scale`, `rotate`) and `opacity` for best performance
- These properties can be hardware-accelerated and don't trigger layout recalculations
- Avoid animating properties that cause layout shifts like `width`, `height`, `top`, `left`, `margin`, `padding`
## Hardware Acceleration
### Use will-change Properly
```tsx
// When animating transforms
<motion.div
style={{ willChange: "transform" }}
animate={{ x: 100, y: 50, scale: 1.2 }}
/>
// When animating other GPU-accelerated properties
<motion.div
style={{ willChange: "opacity, transform" }}
animate={{ opacity: 0.5, x: 100 }}
/>
```
### Properties to Add to willChange
- `transform` - for x, y, scale, rotate, skew
- `opacity` - for opacity animations
- `filter` - for blur, brightness, etc.
- `clipPath` - for clip-path animations
- `backgroundColor` - for background color transitions
## Animation Best Practices
### Use Variants for Complex Animations
```tsx
const containerVariants = {
hidden: { opacity: 0 },
visible: {
opacity: 1,
transition: {
staggerChildren: 0.1
}
}
};
const itemVariants = {
hidden: { y: 20, opacity: 0 },
visible: { y: 0, opacity: 1 }
};
```
### Use layoutId for Shared Element Transitions
```tsx
<motion.div layoutId="shared-element" />
```
### Prefer spring Animations
```tsx
// Springs feel more natural than duration-based animations
<motion.div
animate={{ x: 100 }}
transition={{ type: "spring", stiffness: 300, damping: 30 }}
/>
```
## React Integration
### Memoization for Performance
```tsx
// Memoize animation variants
const variants = useMemo(() => ({
hidden: { opacity: 0 },
visible: { opacity: 1 }
}), []);
// Memoize callbacks
const handleAnimationComplete = useCallback(() => {
// handler logic
}, []);
```
### Avoid Inline Style Objects
```tsx
// Bad - creates new object on every render
<motion.div style={{ willChange: "transform" }} />
// Good - define outside or memoize
const style = { willChange: "transform" };
<motion.div style={style} />
```
## Accessibility
### Respect Reduced Motion Preferences
```tsx
import { useReducedMotion } from "motion/react";
function Component() {
const shouldReduceMotion = useReducedMotion();
return (
<motion.div
animate={{ x: shouldReduceMotion ? 0 : 100 }}
transition={{ duration: shouldReduceMotion ? 0 : 0.3 }}
/>
);
}
```
## Gesture Animations
### Use Gesture Props Correctly
```tsx
<motion.button
whileHover={{ scale: 1.05 }}
whileTap={{ scale: 0.95 }}
transition={{ type: "spring", stiffness: 400, damping: 17 }}
/>
```
## Scroll Animations
### Use useScroll for Scroll-Linked Animations
```tsx
import { useScroll, useTransform, motion } from "motion/react";
function ParallaxComponent() {
const { scrollYProgress } = useScroll();
const y = useTransform(scrollYProgress, [0, 1], [0, -100]);
return <motion.div style={{ y }} />;
}
```
## Exit Animations
### Use AnimatePresence for Exit Animations
```tsx
import { AnimatePresence, motion } from "motion/react";
<AnimatePresence mode="wait">
{isVisible && (
<motion.div
key="modal"
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
/>
)}
</AnimatePresence>
```
## Common Patterns
### Staggered List Animation
```tsx
<motion.ul
initial="hidden"
animate="visible"
variants={{
visible: { transition: { staggerChildren: 0.07 } }
}}
>
{items.map((item) => (
<motion.li
key={item.id}
variants={{
hidden: { opacity: 0, y: 20 },
visible: { opacity: 1, y: 0 }
}}
/>
))}
</motion.ul>
```
### Page Transitions
```tsx
const pageTransition = {
initial: { opacity: 0, x: -20 },
animate: { opacity: 1, x: 0 },
exit: { opacity: 0, x: 20 },
transition: { duration: 0.3 }
};
```
## Performance Debugging
- Use React DevTools to inspect re-renders
- Use Chrome DevTools Performance tab to identify animation jank
- Target 60fps minimum, 120fps on high refresh rate displays
- Test on actual devices, especially mid-range Android phones
© Mindrally · Apache-2.0 · Mindrally/skills