Communitygithub.com

AlessandroFare/fluxychat

審計並修復動畫效能問題,包括佈局抖動、合成器屬性、滾動關聯動畫與模糊效果。適用於動畫卡頓、過渡不流暢,或在審查 CSS/JS 動畫效能時使用。

fluxychat 是什麼?

這是一款針對 UI 動畫效能進行審計與修復的 AI 工具,專門處理佈局抖動 (layout thrashing)、合成器屬性濫用、滾動關聯動畫 (scroll-linked motion) 以及模糊效果等常見效能瓶頸。它提供一套以優先級分類的規則(從「絕對禁止模式」到「工具邊界」),涵蓋測量、滾動、繪製、圖層與模糊濾鏡等面向,並附帶具體的程式碼修復範例(CSS 與 JavaScript)。該工具支援 Cursor、Claude Code 等 AI 程式碼編輯器,可在對話中使用指令 `/fixing-motion-performance` 開啟約束,或針對特定檔案進行審查。其核心優勢在於確保動畫僅消耗最低必要的渲染成本,並避免跨動畫系統的衝突或部分遷移,適合開發者在進行 UI 動畫新增、重構或效能除錯時使用。

相容平台~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 或測量的元件

渲染步驟詞彙表

  • 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 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.

相關技能