Communitygithub.com

Desesbraker/agentes-vip

审计并修复动画性能问题,包括布局抖动、合成器属性、滚动关联动画和模糊效果。当动画卡顿、过渡不平滑或需要审查 CSS/JS 动画性能时使用。

agentes-vip 是什么?

该技能用于诊断和修复 Web 动画性能问题,例如布局抖动(layout thrashing)、滚动关联动画(scroll-linked motion)以及模糊/滤镜动画。它提供了一套清晰的规则,按优先级从“禁止模式”(critical)到“工具边界”(critical)列出,帮助开发者避免常见的性能陷阱。该技能指导使用 transform 和 opacity 进行动画(合成器属性),避免触发布局或绘制(paint/layout),并给出了具体的修复代码示例(CSS 和 JavaScript)。它还建议使用 Scroll Timelines 或 IntersectionObserver 替代基于 scroll 事件的动画,并控制模糊半径和层提升(layer promotion)的使用。支持在 Claude Code、Cursor、Codex 等 AI 编码工具中使用,适合审查和优化任何 UI 动画工作。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Desesbraker/agentes-vip/tree/HEAD/full%20skill/plugins/antigravity-awesome-skills-claude/skills/fixing-motion-performance

在你喜欢的 AI 中提问

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

文档

fixing-motion-performance

修复动画性能问题。

使用方法

  • /fixing-motion-performance 将以下约束应用于本次对话中的所有 UI 动画工作。

  • /fixing-motion-performance <文件> 根据以下所有规则审查文件,并报告:

    • 违规内容(引用确切的行或代码片段)
    • 为何重要(一句简短说明)
    • 具体修复方案(代码级建议)

除非明确要求,否则不要迁移动画库。在现有技术栈内应用规则。

何时使用

在以下场景参考这些指南:

  • 添加或更改 UI 动画(CSS、WAAPI、Motion、rAF、GSAP)
  • 重构卡顿的交互或过渡效果
  • 实现滚动关联动画或滚动至显示效果
  • 对布局、滤镜、蒙版、渐变或 CSS 变量进行动画
  • 审查使用了 will-change、transform 或测量(measurement)的组件

渲染步骤术语表

  • composite(合成):transform、opacity
  • paint(绘制):color、borders、gradients、masks、images、filters
  • layout(布局):size、position、flow、grid、flex

按优先级分类的规则类别

优先级类别影响
1禁止模式严重
2选择机制严重
3测量高
4滚动高
5绘制中高
6层中
7模糊与滤镜中
8视图过渡低
9工具边界严重

快速参考

1. 禁止模式(严重)

  • 不要在同一个帧内交错执行布局读取和写入操作。
  • 不要在大面积或有意义的表面(surface)上持续动画化布局属性。
  • 不要通过 scrollTop、scrollY 或 scroll 事件驱动动画。
  • 不要使用没有停止条件的 requestAnimationFrame 循环。
  • 不要混用多个各自测量或改变布局的动画系统。

2. 选择机制(严重)

  • 默认使用 transform 和 opacity 进行运动。
  • 仅在交互需要时使用 JavaScript 驱动动画。
  • 绘制(paint)或布局(layout)动画仅允许在小型、孤立的表面上使用。
  • 一次性效果比持续运动更可接受。
  • 优先选择降低技术方案而不是完全移除动画。

3. 测量(高)

  • 测量一次,然后通过 transform 或 opacity 进行动画。
  • 在所有 DOM 写入操作之前批量执行所有 DOM 读取。
  • 不要在动画过程中反复读取布局属性。
  • 对于类似布局的效果,优先使用 FLIP 风格的过渡。
  • 优先选择能批量执行测量和写入的方案。

4. 滚动(高)

  • 当可用时,优先使用 Scroll 或 View Timelines 实现滚动关联动画。
  • 使用 IntersectionObserver 检测可见性并暂停动画。
  • 不要轮询 scroll 位置来驱动动画。
  • 当元素不可见时暂停或停止动画。
  • 滚动关联动画不得在大面积表面上触发持续的布局或绘制。

5. 绘制(中高)

  • 触发绘制(paint)的动画仅允许在小型、孤立的元素上使用。
  • 不要在大容器上动画化绘制密集型属性。
  • 不要对 transform、opacity 或 position 使用 CSS 变量进行动画。
  • 不要动画化继承的 CSS 变量。
  • 将动效 CSS 变量限定在局部作用域,避免继承。

6. 层(中)

  • 合成器(compositor)运动需要提升(promote)层,不要假定会自动提升。
  • 仅在必要时临时且精确地使用 will-change。
  • 避免使用多个或大面积提升的层。
  • 在性能至关重要时使用工具验证层的行为。

7. 模糊与滤镜(中)

  • 保持模糊动画较小(<=8px)。
  • 模糊仅用于短时一次性效果。
  • 永远不要持续动画化模糊效果。
  • 永远不要在大面积表面上动画化模糊效果。
  • 优先使用 opacity 和 translate 而非 blur。

8. 视图过渡(低)

  • 仅在导航级别变更时使用视图过渡(view transitions)。
  • 避免在交互密集的 UI 中使用视图过渡。
  • 当需要中断或取消时避免使用视图过渡。
  • 将尺寸变化视为可能触发布局(layout)的行为。

9. 工具边界(严重)

  • 除非明确要求,否则不要迁移或重写动画库。
  • 在现有动画系统内应用这些规则。
  • 永远不要在同一组件内部分迁移 API 或混用不同风格。

常见修复示例

/* 布局抖动:使用 transform 替代 width 进行动画 */
/* 之前 */ .panel { transition: width 0.3s; }
/* 之后 */  .panel { transition: transform 0.3s; }

/* 滚动关联:使用 scroll-timeline 替代 JS */
/* 之前 */ window.addEventListener('scroll', () => el.style.opacity = scrollY / 500)
/* 之后 */  .reveal { animation: fade-in linear; animation-timeline: view(); }
// 测量:先批量读取再写入(FLIP)
// 之前 — 布局抖动
el.style.left = el.getBoundingClientRect().left + 10 + 'px';
// 之后 — 测量一次,通过 transform 动画
const first = el.getBoundingClientRect();
el.classList.add('moved');
const last = el.getBoundingClientRect();
el.style.transform = `translateX(${first.left - last.left}px)`;
requestAnimationFrame(() => { el.style.transition = 'transform 0.3s'; el.style.transform = ''; });

审查指导

  • 首先执行严重规则(禁止模式、工具边界)。
  • 选择与意图匹配的最便宜的渲染工作。
  • 对于任何非默认选择,说明证明其合理性的约束条件(表面大小、持续时间或交互需求)。
  • 审查时,优先给出可操作的建议和具体替代方案,而非纯粹的理论讨论。

Individual skills in this repo

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

Desesbraker/agentes-vip

Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory.

Desesbraker/agentes-vip

Advanced JavaScript animation library skill for creating complex, high-performance web animations.

Desesbraker/agentes-vip

Internationalization and localization patterns. Detecting hardcoded strings, managing translations, locale files, RTL support.

Desesbraker/agentes-vip

AI-powered animation tool for creating motion in logos, UI, icons, and social media assets.

Desesbraker/agentes-vip

CRITICAL: Use for Makepad animation system. Triggers on: makepad animation, makepad animator, makepad hover, makepad state, makepad transition, "from: { all: Forward", makepad pressed, makepad 动画, makepad 状态, makepad 过渡, makepad 悬停效果

Desesbraker/agentes-vip

Best practices for Remotion - Video creation in React

Desesbraker/agentes-vip

Generate walkthrough videos from Stitch projects using Remotion with smooth transitions, zooming, and text overlays

Desesbraker/agentes-vip

Seek and analyze video content using Memories.ai Large Visual Memory Model for persistent video intelligence

Desesbraker/agentes-vip

Three.js animation - keyframe animation, skeletal animation, morph targets, animation mixing. Use when animating objects, playing GLTF animations, creating procedural motion, or blending animations.

Desesbraker/agentes-vip

Automate TikTok tasks via Rube MCP (Composio): upload/publish videos, post photos, manage content, and view user profiles/stats. Always search tools first for current schemas.

Desesbraker/agentes-vip

Video and audio perception, indexing, and editing. Ingest files/URLs/live streams, build visual/spoken indexes, search with timestamps, edit timelines, add overlays/subtitles, generate media, and create real-time alerts.

Desesbraker/agentes-vip

Upload, stream, search, edit, transcribe, and generate AI video and audio using the VideoDB SDK.

Desesbraker/agentes-vip

Automate YouTube tasks via Rube MCP (Composio): upload videos, manage playlists, search content, get analytics, and handle comments. Always search tools first for current schemas.

Desesbraker/agentes-vip

Extract transcripts from YouTube videos and generate comprehensive, detailed summaries using intelligent analysis frameworks

Desesbraker/agentes-vip

Generates high-converting Next.js/React landing pages with Tailwind CSS. Uses PAS, AIDA, and BAB frameworks for optimized copy/components (Heroes, Features, Pricing). Focuses on Core Web Vitals/SEO.

Desesbraker/agentes-vip

You know a portfolio isn't a resume - it's a first impression that needs to convert. You balance creativity with usability. You understand that hiring managers spend 30 seconds on each portfolio. You make those 30 seconds count. You help people stand out without being gimmicky.

相关技能