К основному содержанию
скилл CX Codex

nextjs-framer-motion-animations — скилл для Claude Code

Скилл nextjs-framer-motion-animations помогает агенту внедрять и отлаживать Motion for React в Next.js: жесты, выходы, layout, общие элементы, скролл и переходы между маршрутами.

MIT 183 установок ★ 4 обновлён 2026-09-14

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add tristanmanchester/agent-skills --skill nextjs-framer-motion-animations -a claude-code
Открыть на GitHub

Что делает nextjs-framer-motion-animations

Скилл разбирает конкретный компонент, тип роутера (App или Pages), lockfile и конфиг сборки, а потом выбирает механизм под задачу: motion-элемент для локального твига, variants со stagger для группы детей, AnimatePresence для выхода удаляемого блока, layout и layoutId для перестановки и общих элементов, useScroll для значений, привязанных к прокрутке. Для простой смены цвета агент отправит вас к CSS, а для перехода между маршрутами — к view transitions, которые поддерживает Next.js.

Новый код пишется через motion/react. В серверном компоненте motion/react-client даёт motion-элементы, но хуки и колбэки всё равно уезжают в маленький клиентский компонент, а пропсы через эту границу должны проходить сериализацию React. Готового переписывания импортов и каркаса проекта в скилле нет: если в репозитории лежит старый framer-motion, миграцию на motion делают отдельно — пакет, импорты, lockfile и тесты меняются вместе.

Проверка идёт на реальной сборке: typecheck, lint, build, потом браузер с быстрыми кликами, кнопкой назад, медленными данными и reduced motion. Анимация не становится границей транзакции: платёж или удаление не должны зависеть от того, доиграл ли переход.

Какие задачи решает

  • сделать exit-анимацию при удалении карточки из списка
  • переставить блоки с layout-анимацией без прыжков
  • связать прогресс-бар со скроллом страницы
  • учесть prefers-reduced-motion в сложных эффектах
  • перевести проект с framer-motion на пакет motion

Примеры запросов агенту

  • Добавь появление карточек через Motion в app/page.tsx, семантические теги оставь.
  • Почему в App Router не проигрывается exit у AnimatePresence при смене маршрута? Разбери через nextjs-framer-motion-animations.
  • Переведи сетку на layoutId и проверь, что при reduced motion всё остаётся читаемым.

Как установить nextjs-framer-motion-animations

1Через Skills CLI (Vercel)

npx skills add tristanmanchester/agent-skills --skill nextjs-framer-motion-animations -a claude-code

2Вручную: положить файлы

~/.claude/skills/nextjs-framer-motion-animations/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/nextjs-framer-motion-animations/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о nextjs-framer-motion-animations

Как установить nextjs-framer-motion-animations в Claude Code?

Выполните npx skills add tristanmanchester/agent-skills --skill nextjs-framer-motion-animations -a claude-code. Файл скилла появится в ~/.claude/skills/nextjs-framer-motion-animations/SKILL.md.

Что делает nextjs-framer-motion-animations?

Помогает агенту выбрать механизм анимации под задачу в Next.js и провести правку до рабочего состояния: от локального твига и выхода элемента до layout, общих элементов и скролла.

Какие версии Motion и Next.js нужны?

Текущий пакет motion и те версии React, Next.js и рантайма, которые поддерживает проект. Перед правками агент смотрит lockfile и тип роутера.

Исходный текст

SKILL.md · MIT
---
name: nextjs-framer-motion-animations
description: >-
  Implement and debug Motion for React in Next.js: local interaction, presence,
  layout, shared elements, scroll, reduced motion, and router integration. Use for
  explicit Motion/Framer Motion work or interactions that need it; prefer CSS for
  simple effects and framework-native view transitions for supported route cases.
license: MIT. See LICENSE.txt
compatibility: Use the current motion package and the app's supported React/Next.js/runtime versions. Inspect locked versions and router type. No legacy import-rewriting wrapper or automatic project scaffolding is provided.
metadata:
  version: "5.0.0"
  reviewed: "2026-09-13"
---

# Purposeful Motion in Next.js

Choose motion to explain state or improve interaction, not to add a mandatory
layer to every page. Keep existing design tokens and semantic controls. For a
small colour/focus/hover transition, CSS may avoid unnecessary client JavaScript.

## Inspect before choosing the boundary

Read the actual component, router (App or Pages), package/lockfiles, installed
Motion API, and build configuration. Identify who owns mounting, state, focus,
scroll, and navigation. Distinguish a local reveal from a route transition.
A filename/token scanner cannot prove these relationships or build compatibility.

For modernised/new Motion code, use `motion/react`. In a Server Component, the
supported `motion/react-client` entry point exposes motion elements; it does not
turn hooks or arbitrary callbacks into server-safe code. Put interactive/hooks
in the smallest Client Component, keeping fetching and secrets server-side.
Server-rendered children can pass through a client wrapper without moving their
implementation into the client bundle. Props across that boundary must meet
React's actual serialisation contract.

For an existing framer-motion project, inspect its installed version and decide
whether migration is in scope. A deliberate migration updates package, imports,
lockfile, tests, and any changed APIs together. Do not mix runtimes or mechanically
rewrite namespace imports from motion/react-m into a different module. This skill
ships no compatibility branch or automatic import rewriting.

## Choose the mechanism

| Need | Start with | Essential condition |
| --- | --- | --- |
| Small local tween/gesture | motion element | Preserve semantic element and disabled/focus behaviour |
| Several coordinated children | variants and stagger | Stable identity and a bounded delay budget |
| Local removal | AnimatePresence | It survives and observes the removed keyed child |
| Layout change | layout / layout="position" | Correct measurement and retained identity |
| Shared element within a live tree | layoutId / LayoutGroup | Unique, intentionally scoped IDs |
| Visibility reveal | whileInView | Correct scroll root and progressive visibility |
| Scroll-linked value | useScroll plus motion values | Correct target/container and reduced-motion policy |
| Imperative sequence | useAnimate | Scoped targets and cancellation/cleanup |
| Bundle-sensitive region | LazyMotion with m | Feature set covers the used layout/drag APIs |
| Route/shared-view transition | Framework-supported ViewTransition | Actual Next/React/browser contract, not a pathname wrapper |

Read [component patterns](references/COMPONENTS.md) for implementation decisions
and [router integration](references/ROUTING.md) for route changes. Do not assume
one package-wide provider or one animation duration fits every interaction.

## Presence and application state

A persistent AnimatePresence is necessary for its own exits but is not sufficient
to control a router-owned subtree. Keying a wrapper by pathname does not establish
that outgoing route content is retained unchanged. Do not freeze private router
context, intercept every click, or delay all navigation to make an exit demo work.
Use the supported framework route mechanism or an honest enter-only enhancement.

An animation callback is not a transaction boundary. Do not make a payment,
delete, navigation confirmation, or other application outcome depend on whether
an animation happened to finish. Cancellation, interruption, remount, and reduced
motion must preserve the same logical outcome.

## Accessibility and rendering

Use MotionConfig reducedMotion="user" where it fits the existing tree, plus local
useReducedMotion decisions for scroll, autoplay, and bespoke effects. Opacity-only
animations and independent CSS/view-transition paths need their own policy; one
Motion provider is not a universal motion switch.

Use real buttons/links/dialogs. Preserve keyboard paths, visible focus, logical
reading order, and an equivalent to drag-only interaction. Exiting invisible
controls must not remain focusable or intercept input. A visual modal shell is
not focus management, Escape behaviour, a label, or background inertness.

Do not server-render critical text permanently invisible and depend on successful
hydration/intersection observation to reveal it. Keep layout boxes stable and
handle font/image loading, viewport changes, and no-JavaScript/failure behaviour
where required. Use transform/opacity where suitable, but measure actual paint,
layout, compositing, and bundle costs before claiming a speed improvement.

## Validate the actual change

Run the project's existing typecheck/lint/build as authorised; do not assume its
scripts are named npm run lint/build. Test in the browser with rapid interactions,
back/forward navigation, slow data, interruptions, reduced motion, keyboard use,
and multiple copies of shared-layout components. Check console/hydration errors,
scroll restoration, focus, and usable nonanimated fallback. Unit mocks are not a
browser performance or router-lifetime test.

Deliver the patch, chosen boundary/mechanism, actual verification, and remaining
browser checks. The old generic scanners, generated plans, all-assets scaffolder,
and their golden-output pack are removed; real integration evidence is the goal,
not reproducing a heuristic's preferred output.

## Sources and maintenance

Reviewed 2026-09-13: [Motion installation](https://motion.dev/docs/react-installation),
[AnimatePresence](https://motion.dev/docs/react-animate-presence),
[Next templates](https://nextjs.org/docs/app/api-reference/file-conventions/template),
and [Next view transitions](https://nextjs.org/docs/app/guides/view-transitions).
[Evaluation cases](evals/scenarios.json) describe required checks, not tests run.

© tristanmanchester · MIT · tristanmanchester/agent-skills

Похожие скиллы

Все скиллы по теме «Фронтенд и UI» →
framer-motion Mindrally С правилами построения анимаций на Motion (бывший Framer Motion) в React-проектах. Охватывает производительность, доступность и типовые паттерны. CX Codex +1 3 100установок motion-framer freshtechbro Скилл motion-framer помогает агенту добавлять анимации Motion и Framer Motion в React-интерфейсы: от эффектов наведения до переходов между состояниями. CX Codex +1 6 800установок framer-motion-react C-Jeril Скилл framer-motion-react по Framer Motion для React и Next.js: AnimatePresence, layout-анимации, useAnimation и обход проблем с SSR. CX Codex +1 930установок framer-motion-animator patricio0312rev Скилл framer-motion-animator помогает создавать анимации и микроинтерфейсы на Framer Motion: от переходов между страницами до жестов свайпа и скролла. Пригодится при вёрстке интерактивных React-компонентов. CX Codex +1 11 700установок framer-motion-skills podo Пакет из пяти скиллов по Framer Motion: варианты, прокрутка, жесты, layout-переходы и связка с React и Next.js. Ставится одной командой, работает в Claude, Codex и Cursor. CX Codex +1 264установок motion-dev-animations Motion Dev Standards Скилл motion-dev-animations генерирует GPU-анимации на Motion.dev для React, Next.js, Svelte и Astro. Помогает настроить физику пружин, скролл-эффекты и жесты с учётом prefers-reduced-motion. CX Codex +1 714установок

Из того же набора9

designing-beautiful-websites Скилл designing-beautiful-websites для проектирования и правки интерфейсов сайтов и веб-приложений: структура, адаптив, визуальный язык и состояния элементов. CX Codex +1 2 800установок styling-nativewind-v4-expo Скилл styling-nativewind-v4-expo помогает настроить NativeWind v4 и Tailwind CSS v3 в Expo, устранить ошибки сборки Metro и правильно верстать мобильные компоненты. CX Codex +1 423установок animating-react-native-expo Скилл animating-react-native-expo для ИИ-агента, который помогает писать и отлаживать анимации в React Native и Expo на Reanimated 4 и Gesture Handler 3. CX Codex +1 423установок react-native-skia Скилл react-native-skia ведёт агента через работу со Skia в React Native: рисование канвасов, шейдеры, анимация, отладка и профилирование того, что вышло на экране. CX Codex +1 133установок relationship-science-coach Скилл relationship-science-coach помогает обдумать разговоры о доверии, конфликтах, свиданиях и близости с учётом согласия. При страхе или принуждении он ставит безопасность выше совместных упражнений. CX Codex +1 111установок track17 Скилл track17 для Claude Code регистрирует и отслеживает посылки через 17TRACK API, сохраняет события доставки и принимает вебхуки. Интегрирует трекинг посылок через 17TRACK в агента. CX Codex +1 104установок ios-simulator Запускает приложение в iOS Simulator и помогает проверять интерфейс и автоматизацию через accessibility. CX Codex +1 103установок auditing-appstore-readiness Скилл auditing-appstore-readiness для Claude Code проверяет готовность iOS-приложения к отправке в App Store или TestFlight. Разбирает исходники, архив, поведение приложения и настройки App Store Connect. CX Codex +1 100установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой