Communitygithub.com

ComeOnOliver/skillshub

修复动画性能问题。

skillshub 是什么?

该技能专注于诊断和修复UI动画中的性能问题。它提供了一套全面的规则和指南,适用于CSS、WAAPI、Motion、rAF和GSAP等多种动画技术。技能的核心是确保动画通过合成器(transform和opacity)高效运行,避免不必要的绘制或布局触发,从而提升用户体验。它支持Claude Code、Cursor、Codex等主要AI代理平台,通过可执行的命令如`/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或测量属性的组件

渲染步骤词汇表

  • 合成:transform、opacity
  • 绘制:颜色、边框、渐变、蒙版、图像、滤镜
  • 布局:尺寸、位置、流式布局、网格、弹性布局

规则类别(按优先级)

优先级类别影响
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或position使用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

相关技能