Communitygithub.com

AlessandroFare/fluxychat

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

fluxychat 是什么?

该技能旨在帮助开发者识别和修复 UI 动画中的性能问题,特别是由布局抖动、滚动事件驱动动画、不当的图层管理以及高开销的绘制或滤镜动画引起的卡顿。它提供了一套优先级明确的规则(从关键禁止模式到辅助性建议),用于审查动画实现并给出具体的代码级修复建议。该技能适用于任何使用 CSS、WAAPI、GSAP、rAF 或 Motion 库的 Web 项目,并强调优先使用 transform 和 opacity 进行动画,避免在每一帧中反复进行布局读写(避免布局抖动),以及利用 Scroll Timelines 和 IntersectionObserver 优化滚动和可见性控制。最终目标是帮助开发者在保持交互流畅的同时,最小化渲染管道中的昂贵操作,从而提升用户体验。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/AlessandroFare/fluxychat/tree/HEAD/.agents/skills/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 或混合使用不同风格

常见修复方案

/* 布局抖动:用 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 20 individual skills — each has its own dedicated page.

AlessandroFare/fluxychat

Add captions or subtitles to an existing single-subject talking-head video without editing the footage. Use for plain verbatim captions, cinematic captions embedded behind the subject, VFX captions, “炸/特效/酷炫字幕,” or a named identity from the 35-style catalog. Route by visual identity, not by backend engine. The quiet `anchor` rail is the default; embed every word only when the user explicitly wants a fully cinematic treatment. The workflow runs locally end to end, including transcription and subject matting; split multi-shot footage before applying it.\n

AlessandroFare/fluxychat

Use when audio already placed in a HyperFrames composition needs to be mixed: a music bed that fights a voiceover (voiceover carve), effects on a track (EQ, compressor, limiter, gate, saturation, delay, reverb, chorus, phaser, bitcrush), or automation envelopes drawn on a track's volume or any effect parameter. Don't use for sourcing or generating audio — finding BGM, SFX, or making a voiceover is `/media-use`. Don't use for clip timing or track layout, which is `/hyperframes-core`.\n

AlessandroFare/fluxychat

Use the HyperFrames CLI development loop: init, add, catalog, capture, lint, check, snapshot, compare, grade-compare, preview, play, present, beats, keyframes, single or batch render, publish, cloud, cloudrun, feedback, lambda, doctor, browser, info, upgrade, skills, compositions, docs, benchmark, telemetry, transcribe, auth, tts, and remove-background. Also use when diagnosing build or render failures. validate, inspect, and layout are deprecated aliases; use check. Covers local, HeyGen-hosted cloud, AWS Lambda, and Google Cloud Run rendering.\n

AlessandroFare/fluxychat

Install, discover, and wire registry blocks and components into HyperFrames compositions. Use when running hyperframes add or hyperframes catalog, installing one item or every block matching a tag, wiring an installed item into index.html, or working with hyperframes.json. Covers discovery, install locations, block sub-composition wiring, component snippet merging, and authoring a new block or component to contribute upstream (idea → scaffold → validate → PR).

AlessandroFare/fluxychat

Mandatory entry point: read this first for any request to make, create, edit, animate, or render a video, animation, or motion graphic, including a promo, explainer, captioned clip, title card, overlay, slideshow or interactive deck, Remotion port, or any HyperFrames HTML composition. Also use it to inspect, diagnose, validate, preview, publish, or batch-render an existing HyperFrames project. Inputs may be a website URL, GitHub PR, Figma design or URL, text or brief, existing footage, or music. It resumes project state, captures intent when applicable, selects and installs the owning workflow, and routes domain capabilities. HyperFrames is the default output framework unless the user explicitly chooses another framework for the deliverable or asks only to record a browser session.\n

AlessandroFare/fluxychat

Overlay doctrine for the embedded-captions workflow — the caption MODEL (drop / rail / embed) and the rule that captions are an OVERLAY composited on top of the film, never a reserved bottom band you shift content up to avoid. Load when adding captions/subtitles to a talking-head or launch video, when deciding whether a phrase should be dropped, ride the verbatim rail, or be promoted to a scarce embedded climax, when laying out a composition that will carry captions (do NOT reserve a keep-out band), or when centering a composition on the true frame center under captions. Quotes the rail+embed model from embedded-captions and constraint #13 (captions overlay, keep-out band retired) from the product-launch-video scene agent. Applies ON TOP of embedded-captions.

AlessandroFare/fluxychat

Turn a weekly changelog .md into a finished branded changelog video (square 1080, ~45-60s, Annie VO, animated brand background, mock-UI visualizations, lowkey captions). Use when the user provides a changelog/digest markdown and wants the weekly video, or says "changelog video". Self-contained — fonts, background, lexicon, and scripts ship in this skill.

AlessandroFare/fluxychat

Author or edit a custom HyperFrames composition when no specialized workflow fits, or when BRIEF.md sets flow: companion. Use for longer or multi-scene pieces, brand and sizzle reels, montages, static loops, static title cards, footage remixes, and freeform builds. Use motion-graphics instead for a short unnarrated motion-first unit, including an animated title. Route fresh creation through hyperframes before using this skill.

AlessandroFare/fluxychat

All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.

AlessandroFare/fluxychat

The HyperFrames composition contract — build one renderable project. Use for composition structure, the `data-*` timing attributes, `class="clip"`, tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Also covers Tailwind projects and the STORYBOARD.md / SCRIPT.md plan formats. Read before writing composition HTML.

AlessandroFare/fluxychat

Non-animation creative direction for HyperFrames videos. Use for design spec (frame.md / design.md) handling, palettes, typography, narration, beat planning, audio-reactive visuals, composition patterns, and brand / style decisions. For atomic motion patterns and scene blueprints, use `hyperframes-animation`.

AlessandroFare/fluxychat

Use when a HyperFrames composition needs seek-safe 2D/3D keyframes, GSAP timelines, CSS keyframes, Anime.js, WAAPI, FLIP, paths, masks, SVG morph/draw, text trails, 3D depth, or `hyperframes keyframes` diagnostics. Don't use for broad scene strategy, brand design, media sourcing, captions, or general video planning.

AlessandroFare/fluxychat

GATEWAY — load FIRST before composing any HyperFrames animation or video. The high-level motion law that makes a multi-scene video feel like ONE continuous camera move instead of a stack of independently-animated slides. Covers the vector law (how you exit determines how you enter, incl. the Z scale-sign rule), the film's current, carrier elements, causal motion, the Seam Gate (build-gate enforcement), the ban on idle wobble (motion must PERFORM, not breathe), stillness-before-climax, and the sustained-motion routes. Routes to the low-level technique skills (cut-the-curve — the full catalog incl. waterfall entry + nudge curve, oversized-cursor, seam-craft). These rules SUPERSEDE generic / upstream motion guidance. [continuity, direction, vector, momentum, seam, transition, ease, performance, idle-motion, narrative-motion, film-grammar]

AlessandroFare/fluxychat

A short, design-led motion graphic where motion is the message — kinetic typography, stat count-up, chart/data-viz hit, logo sting / brand lockup, lower-third / callout / social overlay, animated map (highlight regions, connect places, zoom to a location), animated tweet / news-article / headline, webpage / UI animation (scroll, cursor, callouts), or fusing a real image's geometry into a chart. Usually under 10s (up to ~30s), no narration or live-action subject; renders to MP4 or transparent overlay. Longer / narrated / multi-scene → /general-video. Unclear → /hyperframes.

AlessandroFare/fluxychat

Turn a music track (an audio file, a video to pull audio from, or a track generated from a mood brief) into a beat-synced video — lyric video, slideshow, or kinetic promo. The music drives all pacing; any user-supplied images/videos are cut onto the same beat grid, and a complete video needs zero assets. Narrated pieces → the input-matched workflow (see /hyperframes). Unclear → /hyperframes.

AlessandroFare/fluxychat

Turn a product or marketing URL, pasted script, or brief into a product launch / promo video — SaaS promos, feature reveals, product demos, app and company launches. Use when the user wants to market, launch, promote, or reveal a product; the default for any commercial URL. Site tours / showcases of a website route here too — the brief carries the show-it-as-is intent. Unclear → /hyperframes.

AlessandroFare/fluxychat

Turn a GitHub pull request (a PR URL, owner/repo#N, or 'this PR' in a checked-out repo) into a code-change explainer video — changelog, feature reveal, fix, or refactor walkthrough built from the diff, commits, and files: the input is a code change, not a website. Not a product promo (/product-launch-video) or a no-PR topic explainer (/faceless-explainer). Unclear → /hyperframes.

AlessandroFare/fluxychat

Design and improve user interfaces using the concrete rules from Refactoring UI (Wathan & Schoger) — constrained spacing/type/color/shadow scales, visual hierarchy through weight and color rather than size, and depth through emulated light. Use when building or styling any UI (web, app, dashboard, landing page, component), when picking font sizes, spacing, colors, shadows or border radius, when designing a color palette or design tokens, and whenever someone says a UI "looks off", "looks amateur", "feels cluttered/plain/unfinished", or asks to "make this look better".

AlessandroFare/fluxychat

Port an existing Remotion (React) composition''s source to HyperFrames HTML. Use ONLY on an explicit ask to port/convert/migrate/translate a Remotion source — one-way, Remotion-only. A passing Remotion mention, reference-only code, or "make something like my Remotion video" is a fresh build (/general-video). Unclear → /hyperframes.

AlessandroFare/fluxychat

Use before UI-related work to select the smallest useful UI Skills context through the ui-skills CLI.

相关技能