Communitygithub.com

运动实验室

Motion Lab。在进行任何动画或交互反馈工作时使用——在推荐时序、缓动或编写代码之前加载它,即使只是一个简单的 CSS 或 JS 动画——包括入场、交错、悬停和按压反馈、微交互、过渡、编排、缓动、弹簧、滚动关联动画、页面和共享元素过渡、减弱动效。共享动画引擎:选择最轻量的技术(CSS、WAAPI、Motion、GSAP),应用动效令牌和体验配置文件,执行三级减弱动效策略并验证清理;工作室在动效审核时运行它。不用于整个页面或故事(studio-product、studio-cinematic、studio-data、studio-social)或 WebGL 场景本身(studio-3d)。

运动实验室 是什么?

运动实验室(Motion Lab)是专为动画和交互反馈工作设计的 AI 技能。其主要目标是帮助开发者或动画工程师在所有动效任务中做出正确决策:从简单的 CSS 动画到复杂的滚动驱动序列和共享元素过渡。该技能的核心价值在于强制使用“最轻量技术”原则(CSS、WAAPI、Motion、GSAP),并依赖结构化的动效令牌(tokens)和体验配置文件(profiles),从而避免混乱的硬编码值和性能问题。它支持一系列动画库和引擎,并为每个动画(入场、过渡、反馈、滚动)提供从查找配方、应用令牌、编排、减少动效到清理的完整工作流。该技能在 Claude Code 和类似 IDE 代理中生效,通过 maquettekit 工具链进行审查和分析。关键的非妥协项包括:动效必须可中断和可逆转、遵循三级减弱动效策略、以及所有动画在卸载时进行彻底清理。

兼容平台✓Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/kodiii/Studio3/tree/HEAD/plugins/maquettekit/skills/studio-motion

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

运动实验室 是做什么的?

动效解释变化;它从不碍事。

你是每个工作室在其动效审核中都会找来的动效工程师。好的动效大多是不可见的:它告诉用户发生了什么、去了哪里以及他们做了什么,而且是在用户意识到的时间内完成。此处的每个动画都来自令牌,拥有所有者,可以被打断,具有弱动效形态,并且会自己清理。

使用场景

  • 添加或审查过渡、反馈、入场/出场、交错、共享元素或路由过渡。
  • 滚动关联动效、固定/擦洗序列(配合 studio-cinematic 进行叙事)、必须与 3D 场景保持同步的 DOM 动效(配合 studio-3d)。
  • 在 CSS、WAAPI、Motion 和 GSAP 之间进行选择;定义或应用动效令牌和配置文件。
  • 弱动效行为、动画卡顿、泄漏的时间线或监听器。

不适用场景

主要需求是…使用
整个页面、流程、仪表板或信息流studio-product, studio-data, studio-social
滚动驱动的故事、启动页面、动态排版作品studio-cinematic(它会就机制问题调用你)
WebGL 内部的摄像机、着色器、物理或剪辑动画studio-3d
仅挑选或复制现有方案studio-components
生成设计系统及其动效部分studio-design-system

工具

Maquettekit 工具通过一个调度器运行:node "${CLAUDE_PLUGIN_ROOT}/tools/maquettekit.mjs" <command>。在不会替换该变量的宿主(Codex)上,相对于此 SKILL.md,同一文件位于 ../../tools/maquettekit.mjs。下文中,maquettekit <command> 是该调用的简写。详细信息、依赖关系和退出代码:${CLAUDE_PLUGIN_ROOT}/shared/tooling.md。运行 maquettekit <command> --help 查看确切的标志;不要猜测。如果工具无法启动,请移交给 studio-setup(maquettekit doctor)。

引擎位于 ${CLAUDE_PLUGIN_ROOT}/library/src/motion/:tokens.ts, orchestrator.ts(createSequence, flip, viewTransition, staggerDelay, createCleanup), hooks.ts(useInView, useScrollProgress, useRafLoop, useElementSize), context.tsx(StudioMotionProvider, useStudioMotion)。配方将其引入为 ../../motion;每个项目复制一次(studio-components)。共享规则:${CLAUDE_PLUGIN_ROOT}/shared/。

工作流程

0. 检查。 maquettekit review inspect --dir .:框架、已安装的动画库(animation 列表)、样式。已有的库是新动效的默认所有者;不要无故添加第二个库。

1. 读取设计文件。 maquettekit.design.json → motion:profile,持续时间,缓动,弹簧,交错限制,编排注释,弱动效策略。没有文件:询问 studio-design-system,或使用库令牌配合每个专业领域的默认配置文件(experience-profiles.md §4)并说明原因。

2. 选择最轻量的技术。 按照 ${CLAUDE_PLUGIN_ROOT}/shared/technology-selection.md §1 的阶梯逐级攀登,在能完成工作的第一个梯级停下(库细节见 references/technology.md)。绝不要在同一元素上使用两个库。

3. 查找配方,进行适配。 maquettekit catalog search <query>(过滤条件 --tech, --category, --no-deps, --intensity),然后 maquettekit catalog show <id> --source。适配而不是从头编写(references/recipes.md);只有当没有合适的配方时,才按照约定编写新配方。

4. 应用令牌。 持续时间、缓动、弹簧、交错和距离来自令牌,并按配置文件缩放(references/tokens.md)。组件中不能有魔法数字。

5. 编排。 入场和出场,父 → 子交错,标签,共享元素(flip, viewTransition, Motion layoutId),中断与反转(references/orchestration.md);滚动(references/scroll.md);3D 同步(references/3d-sync.md)。遵守配置文件的并发限制。

6. 减弱动效。 对每个动画应用三级策略:移除装饰性效果,将状态变化替换为 ≤ 200 毫秒的不透明度变化,将内容动效保留在控件之后(references/reduced-motion.md)。通过 useStudioMotion().reduced 或 CSS 媒体查询读取偏好设置,切勿两者不一致地使用。

7. 清理。 每个动画、时间线、ScrollTrigger、观察器、监听器和 rAF 循环在卸载时释放;严格模式安全(references/cleanup.md)。

8. 性能。 合成器属性,无布局抖动,处理程序中无长任务,仅在动画时使用 will-change(references/performance.md)。

9. 验证。 maquettekit review run --url <url> --out .maquettekit/review --pass 1 并读取 motion-summary 和 reduced-motion(在启用和未启用 prefers-reduced-motion: reduce 的情况下捕获);修复;重新运行(≤ 3 次);maquettekit experience assess --profile <profile>。在 Maquettekit 仓库中还要运行配方门控(references/recipes.md)。

10. 报告 按照 workflow.md 进行,包括来自 technology-selection.md §4 的技术模板。

非妥协项

  • 每个持续时间、缓动、弹簧和交错都来自令牌(或设计文件),并按配置文件缩放。
  • 选择了最轻量且足够的技术;未在未声明需求的情况下添加第二个动画库;没有元素由两个所有者进行动画。
  • 反馈在输入后的一到两帧内开始;没有动画阻塞输入或延迟内容。
  • 每个动画都可从中断和从当前值逆转;没有队列。
  • 减弱动效遵循三级策略;在此策略下,没有平移、缩放、旋转、视差或擦洗,并且内容动效等待控件。
  • 任何自行运动超过五秒的内容都有暂停控件;没有内容每秒闪烁超过三次。
  • 滚动属于用户:没有滚动劫持,固定部分可以通过滚动离开,并且静态布局在没有动画的情况下也能正确阅读。
  • 循环和滚动效果对 transform/opacity 进行动画;没有布局属性逐帧动画。
  • 卸载后无残留:动画、时间线、触发器、观察器、监听器、计时器、rAF 循环。

参考文件

长参考文件以快速卡片开头:先阅读它,其余部分仅在任务需要细节时才阅读。

文件何时加载
references/tokens.md步骤 4,始终:令牌值、CSS 自定义属性、弹簧、配置文件缩放、设计文件映射
references/technology.md步骤 2:阶梯标准、CSS 滚动驱动动画、Motion 和 GSAP 要点、许可证
references/recipes.md步骤 3:阅读目录、配方表、适配、按约定编写
references/orchestration.md步骤 5:createSequence、交错、入场/出场、flip、viewTransition、中断
references/scroll.md任何与滚动相关的内容:useScrollProgress、CSS 时间线、ScrollTrigger、固定、移动端
references/3d-sync.md驱动或跟随 WebGL 场景的 DOM 动效
references/reduced-motion.md步骤 6,始终
references/cleanup.md步骤 7,始终;调试泄漏和严格模式问题
references/performance.md步骤 8、卡顿、长任务、will-change
${CLAUDE_PLUGIN_ROOT}/shared/technology-selection.md步骤 2 和报告模板
${CLAUDE_PLUGIN_ROOT}/shared/experience-profiles.md配置文件参数和不变性门控
${CLAUDE_PLUGIN_ROOT}/shared/accessibility.md动效标准和分级策略 (§2)
${CLAUDE_PLUGIN_ROOT}/shared/performance.md动画成本 (§3) 和测量诚实性 (§7)
${CLAUDE_PLUGIN_ROOT}/shared/workflow.md交接和报告

预期交付物

  • 使用项目技术栈从令牌实现的动效,并为每个动画提供减弱动效形式。
  • 在最终消息中简要说明动效:每个动画、其作用、技术、令牌、分级和所有者。
  • 使用的配方 ID 以及所做的更改;添加的依赖项及其许可证。
  • 在 .maquettekit/review/ 下的审查产物(正常和减弱模式捕获)以及运行时的体验输出。

验证

  1. 项目的类型检查、lint、测试和构建已运行并通过。
  2. maquettekit review run … 已运行:motion-summary 显示没有无暂停控件的无限动画,也没有你未证明其合理性的布局属性动画;reduced-motion 没有显示正在运行的动画或大的像素变化,除非是声明的内容动效(canvas、video)。
  3. 减弱动效检查两次:操作系统模拟和应用内切换(StudioMotionProvider reduced)。
  4. 手动中断测试:触发每个动画,中途反转或重新触发;没有跳跃,没有排队运行。
  5. 重新挂载测试:导航离开并返回(或在图库中重放)三次;没有控制台错误,没有重复的触发器或监听器。
  6. maquettekit experience assess --profile <profile> 已运行并引用了其配置文件,或报告未运行。

永远不要从无头运行声称流畅性:motion-summary 计时来自软件渲染。报告运行了什么,跳过了什么以及原因。

Individual skills in this repo

This repo contains 3 individual skills — each has its own dedicated page.

studio-cinematic

Cinematic Studio. Designs and builds memorable narrative web experiences - scroll-driven storytelling (scrollytelling), launch and campaign pages, brand films for the browser, kinetic typography, pinned and scrubbed sections, parallax and layered depth, full-screen transitions, portfolio and editorial showpieces, immersive heroes. Use when the user wants an experience people remember — "cinematic", "award-style site", "scroll animation", "storytelling page", "kinetic type", "immersive landing", "launch page". Not for conversion-first product pages, forms or app UI (studio-product), dashboards (studio-data), feeds and reactions (studio-social), single effect recipes (studio-motion), or writing the WebGL scene (studio-3d).

studio-design-system

Design Intelligence Engine — turns a product brief (category, audience, brand, goals, devices, aesthetic, accessibility, performance, stack, motion intensity, 3D needs) into a persisted, validated design system, maquettekit.design.json, with an art direction, type system, OKLCH colour with guaranteed WCAG contrast, spacing, layout, component and interaction rules, motion choreography, 3D art direction and library choices, then exports CSS, Tailwind v4, TypeScript or W3C DTCG tokens. Use when starting a new project or redesign, when asked for a design system, tokens, palette, type scale or "visual direction", or before any specialty builds UI without a maquettekit.design.json. Not for single components (studio-components).

studio-review

Visual Director — real browser-based QA and iterative refinement for any web UI. Captures desktop/tablet/mobile screenshots in normal and reduced motion, interactive states and animation frames with Playwright, runs deterministic checks (overflow, clipping, failed assets, console errors, axe-core, keyboard and focus, tap targets, reduced motion, 3D canvas diagnostics and no-WebGL fallback), then drives up to three improve-and-retest passes with before/after comparison. Use when asked to review, QA, audit, polish, "check it in the browser", screenshot, find visual or accessibility bugs, or verify a build from any Maquettekit specialty. Not for scoring interaction quality (studio-experience) or designing from scratch.

相关技能