为 React/Next.js 动效系统建立规范基座,统一令牌、弹簧预设、性能与无障碍规则。
整体看这是一个纯 prompt-only 的开源技能描述,没有密钥、远程端点或本机执行迹象,风险较低。主要需要留意的是其动画/SSR 规范会影响前端行为,但这属于正常能力范围,不构成高风险。
未声明任何密钥、token 或环境变量;材料显示“无”,因此没有凭证泄露或滥用风险证据。
未列出任何远程端点 host,也未描述向外部服务传输用户数据的行为。
材料属于 prompt-only 技能,本身不展示起进程或执行代码;但其规则指导前端在本机使用 motion/react,属于工具常规能力,需按实际集成审查。
未声明读取或写入特定文件/资源;但规则涉及 SSR、`window`/`navigator` 与动画初始状态,说明会影响前端运行时数据/状态处理,需正常留意。
来源为 GitHub 开源仓库,且社区 star 很高(210k+),可审计性与可信度较好;但许可证未声明、维护状态未知,供应链仍需常规检查。
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "motion-foundations" 技能: 1. 下载 https://raw.githubusercontent.com/affaan-m/ECC/main/skills/motion-foundations/SKILL.md 2. 保存为 ~/.claude/skills/motion-foundations/SKILL.md 3. 装好后重载技能,告诉我可以用了
请为 React/Next.js 项目设计一套 motion foundation,使用 motion/react,包含 motion tokens、spring presets、性能约束、响应式设备适配、reduced motion 无障碍支持,以及 SSR 安全注意事项。请输出可复用的配置结构与实施建议。
一套可复用的动效基础层方案,含配置建议、规则说明与工程落地要点。
请审查下面的 React 动效实现是否符合基础规范:检查动画属性选择、弹簧参数是否合理、是否会引发重排、是否支持 prefers-reduced-motion、在 SSR/水合阶段是否安全,并给出修改建议。
一份问题清单与优化建议,指出性能、无障碍和 SSR 风险及对应修复方式。
请基于 motion/react 为我生成一个基础层代码示例:包含动效令牌定义、通用 spring presets、设备分级策略、reduced motion 处理、SSR 安全封装,以及组件调用示例。代码风格适合 Next.js 项目直接集成。
一组可直接集成的基础代码模板,展示统一动效配置与组件用法。
The base layer of the motion system. Defines every value, constraint, and
rule that downstream skills (motion-patterns, motion-advanced) inherit.
Load this skill before any animation work begins.
prefers-reduced-motion supportThis skill produces:
motionTokens object (duration, easing, distance, scale)springs preset map (5 named configs)shouldAnimate() gate used by all componentsuseReducedMotionMotion must do at least one of the following or it must be removed:
Responsiveness always outranks smoothness. A 60 fps animation that causes input delay is worse than no animation.
These are non-negotiable. They apply to every component in the system.
motion/react only. Never import from framer-motion. Never mix the two in the same tree.initial must match server output. If the server renders opacity: 1, the initial prop must also be opacity: 1. No exceptions.useReducedMotion() returns true or prefersReduced is true, all transforms are disabled. Opacity-only fades at ≤ 0.2s are the only permitted fallback.width, height, top, left, margin, padding are banned from animate. Use transform and opacity only.motionTokens. Hardcoded durations and easings in component files are forbidden.springs map. Inline stiffness/damping values are forbidden."use client" is required on every file that imports from motion/react.window or navigator at module level. Always guard with typeof window !== "undefined".| Token | Use when |
|---|---|
instant | Tooltip show/hide, focus ring, badge update |
fast | Button feedback, icon swap, chip toggle |
normal | Modal open, card expand, page element enter |
slow | Hero entrance, full-page transition |
crawl | Deliberate storytelling; use sparingly |
| Preset | Use when |
|---|---|
snappy | Default UI — buttons, chips, nav items |
gentle | Cards, modals, panels landing softly |
bouncy | Playful moments — empty states, onboarding |
instant | Tooltips, popovers, dropdowns |
release | Drag release — natural physics feel |
Disable (make shouldAnimate() return false) when:
prefersReduced is trueisLowEnd is true and the animation is non-essential// lib/motion-tokens.ts
export const motionTokens = {
duration: {
instant: 0.08,
fast: 0.18,
normal: 0.35,
slow: 0.6,
crawl: 1.0,
},
easing: {
smooth: [0.22, 1, 0.36, 1],
sharp: [0.4, 0, 0.2, 1],
bounce: [0.34, 1.56, 0.64, 1],
linear: [0, 0, 1, 1],
},
distance: {
xs: 4,
sm: 8,
md: 16,
lg: 24,
xl: 48,
},
scale: {
subtle: 0.98,
press: 0.95,
pop: 1.04,
},
}
export const springs = {
snappy: { type: "spring", stiffness: 300, damping: 30 },
gentle: { type: "spring", stiffness: 120, damping: 14 },
bouncy: { type: "spring", stiffness: 400, damping: 10 },
…
调用最新框架与库文档,快速回答配置、API与代码示例问题
帮助开发者掌握 SwiftUI 架构模式、状态管理与性能优化实践
帮助用户核查短信与私信、找回近期验证码并明确已检查的消息来源。
帮助开发者在 Node.js 与 TypeScript 中正确使用以太坊 Keccak-256 哈希。
接入并理解视频音频内容,支持检索片段、编辑处理与实时事件告警。
依据C++核心指南辅助编写、审查与重构更现代安全的C++代码。
帮助你为 React/Next.js 产品实现可复用的界面动效与过渡方案。
帮助你在 React/Next.js 中实现高级动效、手势交互与动画编排。
提供适用于 React/Next.js 的高质量动画模式,快速实现常见交互动效。
为 React 项目生成准确的 Motion 动画代码与正确导入配置
将滚动动效需求转成可验证规范,并编译为确定性的 GSAP/CSS 实现
帮助用户将动效设计原则转化为适用于界面与 AI 代理的可执行规范