Communitygithub.com

ComeOnOliver/skillshub

修復動畫效能問題。

skillshub 是什麼?

這個技能幫助開發者識別並修復 UI 動畫中的效能問題,專注於確保流暢的渲染與互動效能。它涵蓋 CSS、WAAPI、Motion、rAF、GSAP 等常見動畫技術,並提供一套層級化的規則來指導動畫實作。技能會根據渲染階段(複合、繪製、版面配置)與影響程度(從關鍵到低)分類建議,並包含詳細的審查指南。支援 Claude Code、Cursor、Codex 等平台,使用者可以透過 `/fixing-motion-performance` 指令觸發審查,或附加檔案進行逐行分析。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/aiskillstore/marketplace/ibelick/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(版面配置):尺寸、位置、流動、網格、彈性

規則類別(依優先順序)

優先順序類別影響程度
1禁止模式關鍵
2選擇機制關鍵
3測量高
4捲動高
5繪製中高
6圖層中
7模糊與濾鏡中
8檢視轉場低
9工具邊界關鍵

快速參考

1. 禁止模式(關鍵)

  • 不要在同一個影格中交錯進行版面配置的讀取與寫入
  • 不要在大型或重要的表面上連續進行版面配置動畫
  • 不要透過 scrollTop、scrollY 或捲動事件驅動動畫
  • 不要使用沒有停止條件的 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 或混用風格

審查指南

  • 優先執行關鍵規則(禁止模式、工具邊界)
  • 選擇與意圖相符且渲染成本最低的方式
  • 對於任何非預設的選擇,說明使其合理的限制條件(表面大小、持續時間或互動需求)
  • 審查時,優先提供可操作的備註和具體的替代方案,而非理論說明

Individual skills in this repo

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

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

相關技能