Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计通过

nextjs-framer-motion-animationsNext.js Framer motion animations 搜索

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

1,297

周安装

53

GitHub Stars

公开资料未说明

下载量

416
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:nextjs-framer-motion-animations(Next.js Framer motion animations 搜索)
来源仓库:https://github.com/tristanmanchester/agent-skills
仓库路径:skills/nextjs-framer-motion-animations
安装命令:
npx skills add https://github.com/tristanmanchester/agent-skills --skill nextjs-framer-motion-animations
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/tristanmanchester/agent-skills --skill nextjs-framer-motion-animations

简介

用于在 Next.js 项目中集成 Framer Motion 动画效果。

  • 适合创建流畅的用户界面过渡与交互反馈。
  • 提供组件封装示例与性能优化建议。
  • 需确保客户端加载,避免 SSR 环境下出现 hydration 错误。
  • nextjs-framer-motion-animations 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Next.js + Motion/Framer Motion

Mission

Build small, purposeful, accessible animations in Next.js using Motion for React (the current package) or legacy framer-motion, without breaking server/client boundaries, performance, or usability.

Use this skill for

  • First-render reveals and section entrances
  • Hover, tap, and focus feedback on buttons, links, cards, tabs, and navigation
  • Scroll-triggered reveals and modest scroll-linked effects
  • Modals, drawers, dropdowns, accordions, tabs, and other enter/exit UI
  • Layout and shared-element transitions with layout and layoutId
  • Reorderable lists and light route-content transitions
  • Debugging Motion behaviour in Next.js

Do not use this skill for

  • GSAP-style timelines or cinematic sequences
  • Canvas, WebGL, Three.js, or Lottie-led animation systems
  • Heavy parallax or scroll-jacking storytelling
  • Large creative-direction rewrites
  • Pure CSS effects that do not justify client JavaScript, unless Motion is explicitly requested

Non-negotiables

  • Prefer the lightest Motion API that solves the task.
  • Preserve repo consistency. Do not mix motion and framer-motion imports in the same diff unless the task is an explicit migration.
  • Keep animated logic in the smallest possible Client Component boundary.
  • Respect reduced motion globally with MotionConfig reducedMotion="user" and locally with useReducedMotion() when behaviour must change.
  • Prefer reusable primitives, variants, and motion tokens over repeated inline animation objects.
  • Do not add a global provider, root-layout Client Component, or route-wide animation system unless the request genuinely needs it.

Default workflow

1) Audit the codebase first

Inspect:

  • Router type: app/, pages/, or both.
  • Current package: motion, framer-motion, or neither.
  • Existing animation patterns and design-system components.
  • Candidate transition boundaries: app/layout.tsx, app/template.tsx, pages/_app.tsx, shared UI shells.
  • Whether the change is local animation, mount/unmount animation, layout animation, shared-element animation, reorder, or scroll-linked animation.

If shell access is available, run:

node scripts/audit-nextjs-motion.mjs --root /path/to/repo
node scripts/inspect-motion-target.mjs path/to/target-file.tsx --root /path/to/repo
node scripts/plan-motion-change.mjs --root /path/to/repo --target path/to/target-file.tsx --task "user request"

For broad skill iteration or repo-health checks, also run:

node scripts/check-motion-antipatterns.mjs --root /path/to/repo

2) Choose a package strategy

Default rules:

  • New work or modernised motion layer: prefer the current motion package with imports from motion/react.
  • Existing repo already on framer-motion: stay consistent unless the task explicitly includes migration.
  • Passive App Router component with no hooks or client-only logic: motion/react-client can be appropriate, but it is an exception, not the default.
  • Leaf animations with hooks, route state, presence, reorder, or interactivity: use a small Client Component boundary.

See references/MIGRATION.md and references/DECISION_TREE.md.

3) Choose the lightest correct API

Use this decision rule:

  • Simple local animation: motion.*
  • Bundle-sensitive shared shell: m.* with LazyMotion
  • Repeated parent/child orchestration: variants plus stagger
  • Mount/unmount or route exits: AnimatePresence
  • Layout changes from React re-render: layout
  • Shared-element transition: layoutId
  • Sibling layout coordination or namespaced shared layout IDs: LayoutGroup
  • Simple scroll reveal: whileInView
  • Scroll-linked progress or parallax: useScroll plus motion values
  • Imperative sequence or external trigger: useAnimate
  • Design-system component wrapper: motion.create() with ref forwarding

See references/EXPERT_PLAYBOOK.md and references/DECISION_TREE.md.

4) Wire it correctly for the router

App Router

  • Passive, hook-free animation in a server-friendly file: consider motion/react-client.
  • Interactive or hook-driven UI: create a small Client Component leaf and keep data fetching server-side.
  • Client wrapper around server-rendered children: useful for modal shells, drawers, and local visibility wrappers.
  • Route enter/exit choreography: mount a persistent Client shell from a layout so AnimatePresence stays mounted.
  • Segment replay on navigation: template.tsx is useful when you want remount semantics at a specific segment boundary.

See references/APP_ROUTER.md.

Pages Router

  • Keep AnimatePresence stable in pages/_app.tsx for route transitions.
  • Key routed children by a stable value that changes when you actually want a transition. For dynamic routes, router.asPath is usually safer than router.route.
  • Do not rewrite _app.tsx for a one-off local animation.

See references/PAGES_ROUTER.md.

5) Apply the motion budget

Default ranges unless the user or design system says otherwise:

  • Micro-interactions: 0.12s to 0.22s, scale no larger than 1.03, travel no more than 4px.
  • Reveal / list entrance: 0.18s to 0.35s, travel 8px to 24px.
  • Page / route transition: 0.22s to 0.45s, mostly opacity plus small Y translation.
  • Layout animation: prefer Motion springs or layout; do not fake these with large manual transforms.

See references/EXPERT_PLAYBOOK.md and references/PERFORMANCE.md.

6) Validate before finishing

Always check:

  • No server/client boundary mistakes
  • Reduced motion works
  • Focus is preserved for interactive UI
  • No unnecessary layout shift or stretched content
  • No duplicate or conflicting route wrappers
  • Project still builds

Run repo checks when available:

npm run lint
npm run build

For repo audits or skill iteration, also run:

node scripts/check-motion-antipatterns.mjs --root /path/to/repo

Use references/CHECKLIST.md before finalising. When improving the skill itself, use references/EVALUATION.md and node scripts/run-evaluation-pack.mjs.

Implementation rules

  • Prefer animating transform and opacity. Avoid animating top, left, large filters, and large shadows on big surfaces.
  • When possible, turn the existing root element into a Motion element instead of adding a new wrapper. Extra wrappers often break layout, refs, selectors, or spacing.
  • If using m plus LazyMotion, use:

- domAnimation for standard animations, variants, exit, hover, tap, and focus. - domMax only when you need layout animations or drag/pan.

  • Use AnimatePresence initial={false} for app-level wrappers unless first-load animation is explicitly desired.
  • Use AnimatePresence mode="wait" only when a single child should fully exit before the next enters.
  • Never key exit-sensitive children by array index.
  • Start with layout before manual height choreography. If content stretches, add layout to the affected children or switch to layout="position" for aspect-ratio changes.
  • If the scroll container is not the window, configure viewport.root or use useInView with the correct root.
  • When animating next/image or image wrappers, preserve the layout box and animate transform or opacity rather than intrinsic size.
  • When wrapping design-system components, call motion.create() outside render and make sure the wrapped component forwards its ref.
  • If the user did not explicitly ask for Motion and the effect is just a tiny hover or focus style on a static server-rendered element, CSS may be the cleaner answer.

Scripts

  • scripts/audit-nextjs-motion.mjs - inspects a repo, ranks likely target files, and emits JSON recommendations.
  • scripts/inspect-motion-target.mjs - inspects one file and recommends boundary, import path, risks, and likely pattern fit.
  • scripts/plan-motion-change.mjs - combines repo audit, target inspection, and task wording into a structured expert plan.
  • scripts/check-motion-antipatterns.mjs - scans a repo for common Motion and Framer Motion anti-patterns and emits JSON findings.
  • scripts/run-evaluation-pack.mjs - runs the bundled fixture-and-golden evaluation pack for skill iteration.
  • scripts/scaffold-motion-primitives.mjs - copies template components from assets/ into a target directory, with optional import rewriting for legacy framer-motion.

Reference map

  • references/EXPERT_PLAYBOOK.md - API selection, heuristics, motion tokens, anti-patterns
  • references/DECISION_TREE.md - fast pattern and boundary selection
  • references/APP_ROUTER.md - App Router boundaries, route shells, template.tsx, and server-friendly patterns
  • references/PAGES_ROUTER.md - _app.tsx, keys, dynamic route nuances
  • references/RECIPES.md - copy/paste implementations
  • references/PERFORMANCE.md - bundle size, LazyMotion, layout and scroll performance
  • references/ACCESSIBILITY.md - reduced motion, focus, modal guidance
  • references/MIGRATION.md - framer-motion to motion package strategy
  • references/TROUBLESHOOTING.md - failure modes and fixes
  • references/CHECKLIST.md - final review before finishing
  • references/EVALUATION.md - trigger tests, scenario fixtures, anti-pattern scans, and golden-output review

Output expectations

When modifying a repo, finish with:

  1. The files changed
  2. The Motion API and pattern chosen
  3. Boundary strategy and package migration decision, if any
  4. Reduced-motion handling
  5. Performance or bundle-size choices, if relevant
  6. Manual validation notes or commands run
  7. Any caveats the developer should know

Typical request mapping

  • "Make this button feel better" -> micro-interaction recipe
  • "Animate cards in on scroll" -> reveal recipe; variants if staggered
  • "Add a smooth route transition in App Router" -> persistent layout-mounted shell or content wrapper, not a root rewrite by default
  • "Animate this accordion or tab underline" -> layout / layoutId / LayoutGroup
  • "Make this drag list reorder smoothly" -> Reorder.Group / Reorder.Item
  • "This breaks in App Router" -> inspect boundary and import path before editing
  • "Modernise our Framer Motion setup" -> audit first, then use references/MIGRATION.md

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

32.56%
按下载量换算135

Claude

27.48%
按下载量换算114

Cursor

20.9%
按下载量换算87

Gemini CLI

10.13%
按下载量换算42

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/tristanmanchester/agent-skills --skill nextjs-framer-motion-animations 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills