motion · oakoss — скилл для Claude Code: что делает и как установить
Скилл обучает ИИ-агента правильно применять библиотеку Motion (framer-motion) в React и Next.js. Помогает настроить жесты, скролл-эффекты и избежать просадок FPS.
MIT 176 установок ★ 29 обновлён 2026-08-17
npx skills add oakoss/agent-skills --skill motion -a claude-codeЧто делает motion
Скилл даёт агенту правила работы с библиотекой motion (ранее framer-motion) для React 18.2+, React 19 и Next.js App Router. Он ориентирует модель на правильные импорты из motion/react вместо устаревших пакетов. Агент узнаёт проверенные паттерны для жестов перетаскивания, отрисовки SVG через pathLength, задержек в списках и переходов страниц через AnimatePresence.
Внутри описаны схемы гибридного движка: WAAPI для сдвигов и прозрачности, а также ScrollTimeline для эффектов прокрутки. Полный бандл весит 34 KB. Чтобы не раздувать сборку, скилл предлагает ужимать её до 4.6 KB связкой LazyMotion и domAnimation или брать хук useAnimate на 2.3 KB. Прямое изменение width или height блокируется правилом в пользу свойства layout и аппаратного ускорения через GPU.
Конфликт классов Tailwind transition-* с анимациями Motion приводит к рывкам кадров, поэтому скилл требует их убирать. Для простого добавления элементов в список инструмент избыточен: вместо него рекомендуется легковесный AutoAnimate на 3.28 KB.
Какие задачи решает
- настроить плавное удаление компонентов через AnimatePresence с уникальными ключами
- уменьшить размер бандла анимаций до 4.6 KB с помощью LazyMotion
- создать эффект параллакса и индикатор прокрутки через useScroll
- устранить конфликты между классами переходов Tailwind и свойствами Motion
Примеры запросов агенту
- Сделай модальное окно на Next.js с плавной анимацией закрытия через AnimatePresence и motion/react.
- Настрой индикатор чтения статьи с привязкой к useScroll и scaleX.
- Оптимизируй анимацию карточек в каталоге, подключив LazyMotion вместо полного бандла.
Как установить motion
1Через Skills CLI (Vercel)
npx skills add oakoss/agent-skills --skill motion -a claude-code2Вручную: положить файлы
~/.claude/skills/motion/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/motion/
1Через Skills CLI (Vercel)
npx skills add oakoss/agent-skills --skill motion -a codex2Вручную: положить файлы
.agents/skills/motion/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add oakoss/agent-skills --skill motion -a cursor2Вручную: положить файлы
.cursor/skills/motion/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install oakoss/agent-skills skills/motion2Вручную: положить файлы
.github/skills/motion/SKILL.md1Через Skills CLI (Vercel)
npx skills add oakoss/agent-skills --skill motion -a gemini-cli2Командой платформы
gemini skills install https://github.com/oakoss/agent-skills --path skills/motionВручную: положить файлы
.devin/skills/motion/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add oakoss/agent-skills --skill motion -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о motion
Как установить motion в Claude Code?
Выполните команду npx skills add oakoss/agent-skills --skill motion -a claude-code в терминале.
Для каких задач скилл не рекомендует использовать Motion?
Для 3D-графики автор советует применять Three.js или React Three Fiber. Для базовой вставки и удаления элементов из списков лучше взять AutoAnimate весом 3.28 KB.
Как скилл решает проблему с размером бандла?
Полный пакет весит 34 KB, поэтому скилл переводит проект на компонент m с LazyMotion и domAnimation, что снижает размер до 4.6 KB, либо использует хук useAnimate на 2.3 KB.
Исходный текст
SKILL.md · MIT
---
name: motion
description: |
Web animations with Motion (formerly Framer Motion) for React -- gestures, scroll effects, spring physics, layout animations, SVG, micro-interactions, loading states.
Use when: drag-and-drop, scroll animations, modals, carousels, parallax, page transitions, hover effects, staggered lists, loading spinners, number counters.
Troubleshoot: AnimatePresence exit, list performance, Tailwind conflicts, Next.js "use client", layout in scaled containers.
license: MIT
metadata:
author: oakoss
version: '1.0'
source: 'https://motion.dev/docs'
user-invocable: false
---
# Motion
## Overview
Motion (package: `motion`, formerly `framer-motion`) is the standard React animation library. Import from `motion/react`. Provides declarative props for gestures, scroll-linked animations, layout transitions, SVG path drawing, and spring physics. Uses a hybrid animation engine (WAAPI for transforms/opacity, ScrollTimeline for scroll-linked effects). Bundle ranges from 2.3 KB (useAnimate mini) to 34 KB (full), optimizable to 4.6 KB with LazyMotion. Compatible with React 18.2+, React 19, Next.js App Router, and Vite.
Do NOT use Motion for simple list add/remove animations (use AutoAnimate instead at 3.28 KB). Do NOT use for 3D (use Three.js / React Three Fiber).
## Quick Reference
| Pattern | API / Props |
| ---------------------- | ------------------------------------------------------- |
| Fade in on mount | `initial`, `animate`, `transition` |
| Exit animations | `AnimatePresence` + `exit` prop (unique `key` required) |
| Staggered list | `variants` with `staggerChildren` |
| Hover / tap / focus | `whileHover`, `whileTap`, `whileFocus` |
| Drag | `drag`, `dragConstraints`, `dragElastic` |
| Scroll-triggered | `whileInView`, `viewport={{ once: true }}` |
| Scroll-linked/parallax | `useScroll` + `useTransform` |
| Progress indicator | `scrollYProgress` + `scaleX` |
| Layout animation | `layout` prop (FLIP technique) |
| Shared element | `layoutId` (same ID across views) |
| Layout group | `LayoutGroup` wrapping sibling lists |
| Page transition | `AnimatePresence` + `key={pathname}` |
| SVG path drawing | `pathLength` on `motion.path` |
| Animated counter | `useSpring` + `useTransform` |
| Imperative control | `useAnimate` hook returns `[scope, animate]` |
| Custom components | `motion.create(Component)` wraps any component |
| Bundle optimization | `LazyMotion` + `domAnimation` + `m` component (4.6 KB) |
| Reduced motion | `MotionConfig reducedMotion="user"` |
## Common Mistakes
| Mistake | Correct Pattern |
| --------------------------------------------------------- | ----------------------------------------------------------------- |
| AnimatePresence inside a conditional | Keep AnimatePresence mounted; place conditional content inside it |
| Missing unique `key` on AnimatePresence children | Add unique `key` to each direct child for exit animations |
| Tailwind `transition-*` classes with Motion animate props | Remove Tailwind transition classes to avoid stuttering |
| Importing from `framer-motion` | Use `import { motion } from "motion/react"` (renamed late 2024) |
| Animating 50+ items without virtualization | Use react-window or @tanstack/react-virtual for large lists |
| Full 34 KB bundle for simple animations | Use LazyMotion + domAnimation (4.6 KB) or useAnimate (2.3 KB) |
| Missing `"use client"` in Next.js App Router | Add directive or use `motion/react-client` import |
| Animating `width`/`height` directly | Use `layout` prop or `transform: scale` for GPU acceleration |
| No `prefers-reduced-motion` handling | Wrap app in `MotionConfig reducedMotion="user"` |
## Delegation
- **Audit animation performance and bundle size**: Use `Explore` agent to find heavy imports, missing LazyMotion, and reflow-triggering properties
- **Build complex multi-step animations**: Use `Task` agent for scroll-linked parallax, shared layout transitions, and staggered sequences
- **Plan animation architecture for a new project**: Use `Plan` agent to evaluate Motion vs AutoAnimate vs CSS-only based on requirements
> If the `design-system` skill is available, delegate animation token definitions and motion design guidelines to it.
## References
- [Core Patterns](references/core-patterns.md) -- Animation patterns: fade, exit, stagger, gestures, modal, accordion, tabs, scroll, layout, drag, SVG, loading
- [Scroll Animations](references/scroll-animations.md) -- useScroll, useTransform, scroll-triggered, parallax, progress indicators, offset configuration
- [Performance](references/performance.md) -- LazyMotion, useAnimate, hardware acceleration, virtualization, production checklist
- [Next.js Integration](references/nextjs-integration.md) -- App Router patterns, motion/react-client, Pages Router, known issues
- [Accessibility & CSS](references/accessibility-css.md) -- prefers-reduced-motion, MotionConfig, useReducedMotion, CSS keyframes, Tailwind animations
- [Library Selection Guide](references/library-selection.md) -- Motion vs AutoAnimate decision guide with feature comparison and use-case recommendations
- [Troubleshooting](references/troubleshooting.md) -- AnimatePresence bugs, Tailwind conflicts, layout glitches, React 19 issues, naming migration
© oakoss · MIT · oakoss/agent-skills
Похожие скиллы
Все скиллы по теме «Фронтенд и UI» →Сначала — motion от других авторов.