Communitygithub.com

Asymmetric-al/core

从头构建动画,按顺序做出决定,以确保感觉正确——是否应该动画、目的、工具、属性、曲线和持续时间、如何中断、如何退出。实现代码。当被要求制作动画、添加动效、让组件生动起来或构建过渡时使用。对于审查现有动效,使用 review-animations;对于审核整个代码库,使用 improve-animations。仅在显式调用时运行;不会自动触发。

core 是什么?

该技能是一个用于实现Web动效的专业构建工具,遵循Emil Kowalski的动画哲学和严格的运动契约。它通过一个七步决策序列引导开发者:首先判断是否应该动画(高频操作不动画)、明确动画目的(反馈、空间一致性等)、选择最便宜的工具(CSS过渡/动画 → WAAPI → Motion库)、使用transform/opacity属性、选择正确的缓动曲线和持续时间、处理中断和退出动画,以及处理减少动效和悬停门控。技能提供了详细的硬规则、频率表、工具选择树、缓动曲线表、持续时间表和“永不交付”检查清单。它支持所有CSS动画平台(Web),并与其他技能如review-animations(审查动效)和improve-animations(代码库审计)明确区分。核心原则是:有时不写动画是最大的成功,并且所有决策都基于代码库现有令牌,从不用近似值。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Asymmetric-al/core/tree/HEAD/.agents/skills/animate

在你喜欢的 AI 中提问

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

文档

构建动画

本仓库 (Asymmetric-al/core)

在 Core 的设计工程和操作运动契约之后,使用此技能实现 Web 动效。在上游刷新后,在运行 bun run skills:sync 之前协调此覆盖层。

触发条件

  • 构建或重写 Web 动画、过渡或微交互。
  • 不要用于 Expo/React Native (animate-expo)、代码库审计 (improve-animations) 或严格的纯动效审查 (review-animations)。

工作流程

  1. 首先加载 docs/ai/skills/emil-design-engineering/SKILL.md 和 docs/ai/skills/anim/SKILL.md。
  2. 重用现有的 Core 运动令牌和 Base UI 原语。不要复刻持续时间、缓动或引入 Radix API。
  3. 在 packages/ui/styles/globals.css 中的全局基线中保持减少动效。
  4. 如果任务需要 toast、抽屉、菜单或下拉菜单,重用 @asym/ui / Base UI。除非用户明确询问使用哪个库,否则不要调用 pick-ui-library。

检查清单

  • 动画有目的,并尽可能使用 transform/opacity。
  • Core 令牌、Base UI 和 anim 优先于说明性上游值。
  • 共享工具函数和 @asym/lib/motion-presets 优先于新的时间常量。

一个构建技能。它只做一件事:将对动效的请求转化为能够通过严格审查的实现。它不审计代码库(那是 improve-animations),不审查差异(那是 review-animations),不寻找可以动画的地方(那是 find-animation-opportunities),也不为 React Native 构建(那是 animate-expo)。

操作姿态

你是一位正在自己构建动画的高级设计工程师。标准是 Emil Kowalski 的动画哲学——与 review-animations 执行的标准相同。编写代码使其能够一次性通过审查。

两种失败模式,第一种更糟:

  1. 对不应该动画的东西进行动画。 下面的门控有时会产生零行代码。这是成功,不是逃避。
  2. 用错误的成分动画正确的东西——在进入时使用 ease-in,scale(0),在 toast 上使用关键帧,使下拉菜单感觉迟钝的持续时间。

永远不要将动效选项作为菜单呈现。做出决定,用一行说明推理,然后编写代码。

硬性规则

  1. 按顺序运行序列。 第 1 步和第 2 步是所有一切的门控。在你知道是否应该动画之前,不要考虑曲线。
  2. 没有近似值。 每个曲线、持续时间和弹簧配置来自下面的表格。永远不要因为看起来很熟悉而发明 cubic-bezier(0.4, 0, 0.2, 1)。
  3. 扩展代码库的令牌,不要复刻它们。 如果 --ease-out-soft 或持续时间令牌已存在于 packages/ui/styles/globals.css 中,请使用它。添加并行系统是一种缺陷。
  4. 减少动效和悬停门控与动画一起发布,而不是作为后续。
  5. 最便宜的有效工具。 不要为淡入效果安装动效库。

构建序列

1. 这个应该动画吗?

频率决策
每天 100+ 次(键盘快捷键,命令面板切换)永远不要动画。在此停止。
每天数十次(悬停效果,列表导航)仅近乎不可察觉——快速而微妙,或者没有
偶尔(模态框,抽屉,提示框)标准动画
罕见/首次(引导,成功,庆祝)愉悦预算在此处

键盘发起的操作是取消资格,而不是判断。 Raycast 没有打开/关闭动画——这对于每天打开数百次的东西是正确的。

如果请求未通过此门控,请直说并不要编写动画。提供无动效替代方案(即时状态更改,静态提示)。

2. 目的是什么?

在继续之前,用以下词语之一命名它:

  • 反馈 — 确认界面听到了用户的指令
  • 空间一致性 — 显示某物来自何处或去往何处
  • 状态指示 — 使状态变化可辨认
  • 防止突兀变化 — 桥接否则会瞬间移动的内容
  • 解释 — 演示某物如何工作(仅限营销/引导)
  • 愉悦 — 仅允许在罕见/首次层级

无法命名?就不要构建。

Individual skills in this repo

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

Asymmetric-al/core

Build animations for Expo and React Native only, using Reanimated, Gesture Handler, Expo Router, and expo-haptics. Use when the target runtime is an Expo or React Native app. Do not use it for Core Next.js web motion; use `animate` for web. Only runs when explicitly invoked; it does not trigger on its own.

Asymmetric-al/core

Reverse-lookup glossary that turns a vague description of a web animation or motion effect into its exact term ("the bouncy thing when a popover opens" → Pop in; "the iOS rubber-band scroll" → Rubber-banding). Use when the user asks "what's it called when…", or describes a motion effect without knowing its name and wants the right word to prompt an AI or designer with. For naming an effect, not designing or building one.

Asymmetric-al/core

Inspect a Core UI or code surface for a small number of justified motion opportunities and explicitly identify what should remain static. Use when asked what should animate, where motion would improve feedback or comprehension, how to make an interface feel more alive without over-animating it, or whether a proposed animation is worth adding. Read-only; do not use to review or fix existing motion code or to implement animations.

Asymmetric-al/core

Survey a codebase's animation and motion code as a senior motion advisor, then produce a prioritized audit and self-contained implementation plans for other agents (or cheaper models) to execute. Read-only on source code — it plans improvements, it does not apply them. Use when the user asks to "improve the animations", "audit the motion", "make this app feel better", or wants a roadmap of animation fixes rather than a review of a single diff.

Asymmetric-al/core

Implement smooth, accessible animations with motion/react (Framer Motion) in React. Use when adding animations, gestures, or layout transitions with motion, AnimatePresence, useScroll, and related APIs. Requires a 'use client' boundary; not for strictly server-rendered components or when no animation is needed.

Asymmetric-al/core

Best practices for Remotion - Video creation in React

Asymmetric-al/core

Reviews animation and motion code against a high craft bar derived from Emil Kowalski's design engineering philosophy. Default to flagging; approval is earned.

相关技能