Communitygithub.com

Desesbraker/agentes-vip

審計並修復動畫效能問題,包括佈局抖動、合成器屬性、滾輪聯動動畫及模糊效果。當動畫卡頓、轉場不順,或審查 CSS/JS 動畫效能時使用。

agentes-vip 是什麼?

此技能(Desesbraker/agentes-vip)旨在協助開發者診斷並修復 Web 動畫的效能問題,重點關注常見的效能殺手,如佈局抖動(layout thrashing)、合成器屬性誤用、滾輪聯動動畫以及模糊效果。它提供了一套結構化的規則類別,按優先級排列(從「禁止模式」到「工具邊界」),幫助審查程式碼中的動畫實作。技能支援多種平台與動畫庫(CSS、WAAPI、Motion、requestAnimationFrame、GSAP),並可透過 `/fixing-motion-performance` 指令啟動,對指定檔案進行審查,報告違規行、影響說明及具體修復建議。其核心哲學是偏好使用 transform 與 opacity 這類僅觸發合成的屬性,盡可能避免觸發繪製(paint)或佈局(layout),並強調批次測量與寫入(如 FLIP 技術)。

相容平台~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 將這些限制套用至此對話中的所有 UI 動畫工作。

  • /fixing-motion-performance <檔案> 根據以下所有規則審查該檔案,並回報:

    • 違規(引用確切行數或片段)
    • 為何重要(一句簡短說明)
    • 具體修正(程式碼層級的建議)

除非明確要求,否則不要遷移動畫庫。在現有技術棧內套用規則。

使用時機

在下列情況參考這些準則:

  • 新增或修改 UI 動畫(CSS、WAAPI、Motion、rAF、GSAP)
  • 重構卡頓的互動或轉場
  • 實作滾輪聯動動畫或捲動顯示效果
  • 對佈局、濾鏡、遮罩、漸層或 CSS 變數進行動畫
  • 審查使用了 will-change、transform 或尺寸測量的元件

渲染步驟詞彙表

  • 合成(composite):transform、opacity
  • 繪製(paint):顏色、邊框、漸層、遮罩、圖片、濾鏡
  • 佈局(layout):尺寸、位置、流向、網格、flex

規則類別(依優先級)

優先級類別影響
1禁止模式重大
2選擇機制重大
3測量高
4滾輪高
5繪製中高
6圖層中
7模糊與濾鏡中
8視圖轉場低
9工具邊界重大

快速參考

1. 禁止模式(重大)

  • 禁止在同一畫面中交錯執行佈局讀取與寫入
  • 禁止連續對大型或有影響的區域進行佈局動畫
  • 禁止使用 scrollTop、scrollY 或 scroll 事件驅動動畫
  • 禁止沒有停止條件的 requestAnimationFrame 迴圈
  • 禁止混用多個各自會測量或改變佈局的動畫系統

2. 選擇機制(重大)

  • 預設使用 transform 和 opacity 進行動畫
  • 僅在互動需要時使用 JS 驅動的動畫
  • 繪製或佈局動畫僅可在小型、孤立的元素上使用
  • 一次性效果比連續動畫更能被接受
  • 優先降級技術而非完全移除動畫

3. 測量(高)

  • 測量一次,然後透過 transform 或 opacity 進行動畫
  • 在寫入前批次處理所有 DOM 讀取
  • 動畫期間不要重複讀取佈局
  • 對佈局效果優先使用 FLIP 風格的轉場
  • 優先使用能批次處理測量與寫入的方法

4. 滾輪(高)

  • 若可用,優先使用 Scroll 或 View Timelines 進行滾輪聯動動畫
  • 使用 IntersectionObserver 處理可見性與暫停
  • 不要為了動畫輪詢滾輪位置
  • 離開畫面時暫停或停止動畫
  • 滾輪聯動動畫不得在大型區域上觸發連續的佈局或繪製

5. 繪製(中高)

  • 僅允許對小型、孤立的元素進行觸發繪製的動畫
  • 不要在大型容器上對繪製密集型屬性進行動畫
  • 不要對 transform、opacity 或位置的 CSS 變數進行動畫
  • 不要對繼承的 CSS 變數進行動畫
  • 將動畫使用的 CSS 變數設為區域變數,避免繼承

6. 圖層(中)

  • 合成器動畫需要提升圖層,切勿假設它已自動提升
  • 暫時且精確地使用 will-change
  • 避免建立大量或大型的提升圖層
  • 當效能重要時,使用工具驗證圖層行為

7. 模糊與濾鏡(中)

  • 保持模糊動畫的範圍小(<=8px)
  • 僅將模糊用於短暫的一次性效果
  • 永遠不要連續對模糊進行動畫
  • 永遠不要在大型區域上對模糊進行動畫
  • 優先使用 opacity 和 translate 而非模糊

8. 視圖轉場(低)

  • 僅在導覽層級的變更中使用視圖轉場
  • 避免在高互動性的 UI 中使用視圖轉場
  • 當需要中斷或取消時,避免使用視圖轉場
  • 將尺寸變更視為可能觸發佈局的行為

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.

相關技能