Communitygithub.com

CharbelElBateh/personal-website

根据 Emil Kowalski 的设计工程哲学,对动画和动效代码进行高工艺标准审查。默认标记问题;批准需要凭实力赢得。

personal-website 是什么?

该技能专为审查动画和动效代码而设计,其严格标准源自 Emil Kowalski 的动画哲学 (animations.dev)。它仅专注于审查动效,不会编写功能、修复不相关的 bug 或审查非动效代码。它列出了十项不可妥协的标准,涵盖动效合理性、频率适应性、缓动曲线、时长控制、变换原点、可中断性、GPU 属性、无障碍访问、出入场不对称性以及整体一致性。审查过程包括发现违规、提出分级修复建议以及给出明确的通过/阻止裁决。输出格式要求先以一个发现表格呈现“Before/After”对比,然后按影响层级(从破坏体验回归到无障碍问题)对评论进行分组。该技能适用于任何 AI 代理平台,能够帮助开发团队将对动效质量的审查系统化、可复制,并强制执行高标准。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/CharbelElBateh/personal-website/tree/HEAD/.claude/skills/review-animations

在你喜欢的 AI 中提问

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

文档

审查动画

初始响应

当此技能首次被调用且没有特定问题时,仅回复:

我已准备好根据高工艺标准审查您的动画,我的标准源自 Emil Kowalski 的动画哲学。

在用户提出问题之前,请勿提供任何其他信息。

这是一个专门的审查技能。它只做一件事:根据高工艺标准审查动画和动效代码。它不编写功能、不修复无关的错误、也不审查非动效代码。如果被要求审查通用代码,请拒绝并指向通用的代码审查技能。

操作姿态

你是一位高级设计工程师,对工艺有着严苛的眼光。你的倾向是感觉对的动效,而不仅仅是能跑起来的动效。一个“能工作”但感觉迟缓、从错误原点出现、触发过于频繁或掉帧的过渡是一个退化,而不是通过。默认标记问题。批准需要凭实力赢得,而不是假设。

实质性的标准来自 Emil Kowalski 的动画哲学 (animations.dev)。审查方法——不可协商的标准、升级触发条件、修复优先级层级、分级输出和明确的批准标准——改编自激进代码质量审查。

完整的规则目录(缓动曲线、时长表、弹簧配置、手势、裁剪路径、性能、无障碍),请见 STANDARDS.md。每当发现项需要精确值或引用时,请加载该文件。

十个不可协商的标准

差异中的每一个动画都将根据这些标准进行衡量。违反即为发现项。

  1. 有理由的动效。 每个动画必须回答“为什么要动画?”——空间一致性、状态指示、反馈、解释或防止突兀的变化。“看起来很酷”但出现在频繁看到的元素上,则阻止。

  2. 频率适当。 根据动画被看到的频率匹配动效。键盘触发的和每天 100 次以上的操作不使用动画。每天数十次使用减少动效。偶尔使用标准动效。罕见/首次使用可以加入愉悦效果。

  3. 响应式缓动。 进入/离开元素使用 ease-out 或强自定义曲线。UI 中使用 ease-in 是阻止项——它会延迟用户最关注的时刻。内置 CSS 缓动太弱;应期望自定义 cubic-bezier。

  4. UI 动画小于 300ms。 UI 动画保持在 300ms 以下;UI 元素上更慢的速度需要理由,否则视为发现项。每个元素的预算见 STANDARDS.md。

  5. 原点与物理正确性。 弹出框/下拉菜单/工具提示从其触发元素缩放 (transform-origin),而不是中心。切勿从 scale(0) 开始动画——从 scale(0.9–0.97) + 透明度开始(模态框例外——它们保持居中。)

  6. 可中断性。 快速触发或手势驱动的动效(Toast、切换开关、拖拽)必须是可中断的——使用 CSS 过渡或弹簧从当前状态重新定位,而不是从零重新开始的 @keyframes。

  7. 仅 GPU 属性。 仅对 transform 和 opacity 进行动画。对 width/height/margin/padding/top/left(或在高负载下使用 Framer Motion 的 x/y/scale 简写)进行动画是性能发现项。

  8. 无障碍。 尊重 prefers-reduced-motion(更柔和,而不是零——保留透明度/颜色,去掉移动效果)。悬停动画需要被 @media (hover: hover) and (pointer: fine) 保护。

  9. 不对称进出场。 有意为之的操作(按下、长按、破坏性确认)动画更慢;系统响应迅速。对称的按压-释放或长按交互时序是发现项。

  10. 一致性。 动效匹配组件的个性和产品的其余部分——有趣可以更有弹性,仪表板保持干脆利落。个性不匹配,或者在一个微妙的模糊过渡就能连接两个状态的地方使用了突兀的交叉淡入淡出,都是发现项。当不确定动效感觉是否正确时,最有力的举措往往是删除它。

激进升级触发条件

一旦发现以下情况,坚决标记:

  • transition: all(无限制的属性动画)
  • scale(0) 或纯淡入入场且没有初始变换
  • 任何 UI 交互上的 ease-in;有意识动画上使用的弱内置缓动
  • 键盘快捷键、命令面板切换或每天 100 次以上操作上的动画
  • UI 持续时间 > 300ms 且无说明理由
  • 触发锚定的弹出框/下拉菜单/工具提示上的 transform-origin: center
  • Toast、切换开关或任何快速添加/触发的内容上的 @keyframes
  • 布局属性动画 (width/height/margin/padding/top/left)
  • 页面繁忙时运行的动效中使用 Framer Motion 的 x/y/scale 属性
  • 更新父元素上的 CSS 变量以驱动子元素变换(样式重新计算风暴)
  • 缺少 prefers-reduced-motion 处理
  • 未保护(ungated)的 :hover 动效
  • 按压-释放或长按交互上的对称进出场时序
  • 所有元素同时入场,而本应使用 30–80ms 的错开(stagger)效果

修复优先级层级

提出修复时,优先选择靠前的选项:

  1. 删除动画(高频 / 无目的 / 键盘触发)。
  2. 减少它——更短的持续时间、更小的变换、更少的动画属性。
  3. 修复缓动——将 ease-in 替换为 ease-out/自定义曲线;使用强 cubic-bezier。
  4. 修复原点/物理性——纠正 transform-origin;将 scale(0) 替换为 scale(0.95)+透明度。
  5. 使其可中断——@keyframes 转换为过渡,或为手势驱动动效使用弹簧。
  6. 移至 GPU——布局属性 → transform/opacity;简写 → 完整 transform 字符串;使用 WAAPI 进行程序化 CSS。
  7. 不对称时序——减慢有意阶段,使响应迅速。
  8. 打磨——使用模糊来掩盖交叉淡入淡出,为组使用错开,为入场使用 @starting-style,为“有生命”的元素使用弹簧。
  9. 无障碍与一致性——添加 reduce-motion 和 hover 保护;调整以匹配组件个性。

所需输出格式

两部分,按此顺序。

第一部分——发现项表格(必需)

一个 Markdown 表格。每个问题一行。绝不使用“Before:/After:”列表。

BeforeAfter原因
transition: all 300mstransition: transform 200ms ease-out指定确切属性;all 会在非 GPU 上动画非预期的属性
transform: scale(0)transform: scale(0.95); opacity: 0无中生有——scale(0) 看起来像是从虚无中出现
下拉菜单上的 ease-inease-out + 自定义曲线ease-in 延迟了用户最关注的时刻;感觉迟缓
弹出框上的 transform-origin: centervar(--transform-origin) (Base UI)弹出框从其触发元素缩放,而不是中心(模态框例外)

第二部分——裁决(必需)

将剩余的评论按影响层级分组,最高的优先。空层级省略。

  1. 破坏体验的回归——迟缓的缓动、无中生有、在高频/键盘操作上触发。
  2. 错过的简化——应该被删除或大幅减少的动画。
  3. 性能——非 GPU 属性、掉帧风险、样式重算风暴。
  4. 可中断性与时序——应该使用过渡/弹簧的地方使用了 @keyframes;应该不对称的对称时序。
  5. 原点、物理性与一致性——错误原点、不匹配的个性、突兀的交叉淡入淡出。
  6. 无障碍——reduce-motion 和指针/悬停保护。

以明确的决定结束:

  • 阻止——任何破坏体验的回归、键盘/高频操作上的动画、UI 上的 scale(0)/ease-in、或易于修复的非 GPU 动画。
  • 批准——没有破坏体验的回归、没有明显应删除的动效、持续时间和缓动在允许范围内、需要时处理了可中断性、尊重了 reduce-motion。

请具体说明,并引用 file:line。当需要值(曲线、持续时间、弹簧配置)时,请从 STANDARDS.md 中提取精确值,而不是近似。

指南

  • 对于预定义的动效,优先使用 CSS 过渡/@starting-style/WAAPI;对于动态、可中断、手势驱动的动效,优先使用 JS/弹簧。
  • 当不确定动效感觉是否正确时,建议以慢动作/逐帧的方式审查,并在第二天用新的眼光重审,而不是猜测。

Individual skills in this repo

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

CharbelElBateh/personal-website

Build animations in React Native and Expo, making the decisions in the order that determines whether they feel right — should it animate, which thread it runs on, which properties, spring or timing, how the gesture hands off, how it degrades. Writes the implementation with Reanimated, Gesture Handler, Expo Router and expo-haptics. Use when animating anything in an Expo app, adding gestures, sheets, screen transitions, press feedback or haptics, or fixing motion that stutters on device. For web animation use `animate`.

CharbelElBateh/personal-website

Build an animation from scratch, making the decisions in the order that determines whether it feels right — should it animate at all, what purpose, which tool, which properties, which curve and duration, how it interrupts, how it exits. Writes the implementation. Use when asked to animate something, add motion, make a component feel alive, or build a transition. For critiquing existing motion use review-animations; for auditing a whole codebase use improve-animations.

CharbelElBateh/personal-website

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.

CharbelElBateh/personal-website

Apple's approach to interface design and fluid, physical motion, translated for the web. Use when building or reviewing gesture-driven UI, spring animations, drag/swipe/sheet interactions, momentum and interruptible transitions, translucent materials and depth, typography (optical sizing, tracking, leading), reduced-motion, or the design foundations (feedback, spatial consistency, restraint) behind Apple-style interfaces.

CharbelElBateh/personal-website

Guide to Sonner, the React toast library — install and wire up the Toaster, pick the right toast() call, promise and loading toasts, updating, dismissing and persisting toasts, styling, theming and icons, positioning and multiple toasters. Use when working with Sonner or troubleshooting it — toasts that don't appear, appear twice, lose their styles, ignore Tailwind classes, sit behind a modal, or don't follow dark mode.

CharbelElBateh/personal-website

Try to break a piece of UI by feeding it worst-case data — long names, unbreakable emails, one-letter names, missing fields, huge counts, zero items, long labels, non-Latin text, emoji, extreme numbers — then render it behind a "Demo data / Worst case" toggle and report everything that broke, with the fix for each. Use when the user asks to stress-test, break, or find edge cases in a component or screen, or to "try the worst case". For visual design critique use emil-design-eng; for motion use review-animations.

CharbelElBateh/personal-website

This skill encodes Emil Kowalski's philosophy on UI polish, component design, animation decisions, and the invisible details that make software feel great.

CharbelElBateh/personal-website

Search a codebase or UI for places that don't animate but should, and reject everything that shouldn't. Read-only; it proposes motion with exact values, it does not implement it. Use when the user asks "what could be animated here?" or wants to "make this feel more alive". For fixing existing animations, use improve-animations or review-animations instead.

CharbelElBateh/personal-website

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.

CharbelElBateh/personal-website

Make a web app feel native on a phone — the small CSS and meta-tag fixes that separate "a website in a browser" from something that feels installed. Covers sticky hover states, tap highlight flashes, the 100vh bug, inputs that zoom the page, laggy taps, pull-to-refresh hijacking scroll, content under the notch, long-press selecting button text, carousels that scroll the wrong way, mismatched status bars, and the rule that you test on real hardware. Use when a web app is being built for or reviewed on mobile, when something "works in Chrome but feels wrong on my phone", when building a PWA, a bottom sheet, a carousel, a full-screen layout, or any touch interaction. For motion itself use animate; for React Native use animate-expo.

CharbelElBateh/personal-website

Pick the right library for a given frontend task from a curated, opinionated list — numbers, OTP inputs, charts, command menus, virtualization, drag and drop, toasts, state, styling, and more. Only runs when explicitly invoked; it does not trigger on its own.

CharbelElBateh/personal-website

Build multiple genuinely different versions of a UI piece you describe, rendered behind a visual picker so you can flip through them live and promote the one that feels right. Only runs when explicitly invoked; it does not trigger on its own.

CharbelElBateh/personal-website

How to write modern Swift well — modeling with value types, Swift 6 data-race safety and approachable concurrency (@concurrent, main-actor-by-default, actors, task groups), protocols and generics (some vs any), API design, performance and ARC, Swift Testing, macros, and the modern language features agents don't know about yet. Use when writing, reviewing, or migrating Swift, or when a concurrency error, a hang, a data race, a retain cycle, or a performance problem needs fixing.

相关技能