Communitygithub.com

plugin87/performance

根據 Core Web Vitals(LCP、INP、CLS)最佳化 UI 效能,包含載入/程式碼分割策略、佈局偏移預防與動畫效能規則。當使用者想要提升速度、修復卡頓或佈局偏移、達成 Web Vitals 預算,或讓 UI 在低階裝置上感覺流暢時使用。

performance 是什麼?

這個「效能」技能專注於讓 UI 變得快速且穩定,將效能視為可及性問題——緩慢卡頓的 UI 會先讓低階裝置失效。它支援所有主流開發平台(包括 React、Astro、Qwik 等),透過診斷 Core Web Vitals 預算(LCP ≤ 2.5s、INP ≤ 200ms、CLS ≤ 0.1)並在中階手機設定(慢速 4G + 4× CPU 降速)上進行測量來運作。技能指導使用者依序執行:首先讀取效能工作流程文件,然後根據預算進行診斷,接著實施載入最佳化(SSR/Server Components、依路由與重量級元件進行程式碼分割、延遲載入摺疊以下/互動後的內容、預載一種關鍵字型、使用現代響應式圖片)、消除佈局偏移(骨架圖保留最終尺寸、使用 aspect-ratio 保留媒體空間、絕不在既有內容上方注入新元素),以及動畫最佳化(僅使用 transform/opacity、謹慎使用 will-change、控制時長在 100–300ms、尊重 prefers-reduced-motion、偏好 CSS 狀態樣式而非 JS 以降低 INP)。最終驗證標準為 Lighthouse/實測資料必須達到上述預算,首次互動在模擬慢速環境下保持回應,且骨架圖與媒體內容在載入時零 CLS。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/plugin87/ux-ui-agent-skills/tree/main/.claude/skills/performance

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

技能:效能

讓 UI 快速且穩定。將效能視為可及性問題——緩慢/卡頓的 UI 會先讓低階裝置失效。

步驟

  1. 閱讀 workflows/performance.md(Core Web Vitals 目標、載入策略、佈局偏移、動畫效能、設計系統執行時期成本)。
  2. 根據預算進行診斷:LCP ≤ 2.5 秒、INP ≤ 200 毫秒、CLS ≤ 0.1。在中階手機設定上進行測量(慢速 4G + 4× CPU 降速)。
  3. 載入:先渲染摺疊以上內容(SSR/Server Components),依路由 + 重量級小工具進行程式碼分割,延遲載入摺疊以下/互動後的內容(Astro islands / Qwik),預載一種關鍵字型粗細,使用現代響應式圖片。
  4. 消除佈局偏移:骨架圖保持與最終尺寸相同,透過 aspect-ratio 保留媒體空間(tokens/sizing.json),絕不在現有內容上方注入新內容。
  5. 動畫:僅使用 transform/opacity,謹慎使用 will-change,時長控制在 100–300 毫秒(tokens/motion.json),尊重 prefers-reduced-motion。偏好 CSS 狀態樣式而非 JS 以降低 INP;透過樹搖(tree-shake)與按元件匯入。

驗證(完成定義)

  • Lighthouse/實測資料必須在中階手機上達到 LCP ≤ 2.5 秒、INP ≤ 200 毫秒、CLS ≤ 0.1。
  • 在慢速 4G + 4× CPU 降速下,首次互動仍保持回應。
  • 骨架圖 + 媒體保留空間(載入時 CLS 為零);無任何非合成層動畫在迴圈中執行。

Individual skills in this repo

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

plugin87/design-tokens

Generate, extend, or audit design tokens in DTCG format with the 3-tier architecture (primitive → semantic → component). Use when the user wants a color palette, type scale, spacing/shadow/radius/motion tokens, multi-brand theming, or wants to validate token files. Covers colors, typography, spacing, shadows, borders, breakpoints, motion, gradients, opacity, blur, sizing, states, theming.

plugin87/governance

Govern how the design system evolves — SemVer for tokens/components, the contribution workflow, deprecation policy, and change communication. Use when the user wants to add/promote/deprecate a component or token, decide a version bump, set up a contribution process, or keep the system from fragmenting.

plugin87/image-to-code

Turn a reference image, screenshot, or mockup into token-driven, accessible code — infer the design system from the reference (palette, type scale, spacing, radius, layout archetype), map it to the 3-tier tokens, rebuild it, then verify with the kit's gates. Use when the user provides a design/screenshot and wants matching UI code.

plugin87/prototype

Move an idea up the fidelity ladder (content-first → wireframe → low-fi → high-fi → code) with a validation plan at each level, plus user-journey mapping and usability-testing scripts. Use when the user wants to prototype, wireframe, map a user flow, or plan/run usability testing.

plugin87/redesign

Upgrade an existing website or app to premium quality without breaking functionality — audit the current design, identify generic/AI tells, then apply taste and system rules surgically. Use when the user wants to improve, modernize, polish, or "make better" an existing UI/codebase.

plugin87/token-build

Set up or run the token build pipeline — transform the DTCG tokens/*.json (source of truth) into platform artifacts (CSS variables, Tailwind @theme, JS/TS, iOS Asset Catalog, Android, Compose) with Style Dictionary / Tokens Studio / W3C DTCG export. Use when the user wants to generate platform theme files from tokens, wire token CI, or multi-platform token output.

plugin87/ux-writing

Write or review UI copy — buttons, errors, empty states, microcopy, notifications, labels — using the voice & tone system (clear, concise, useful, human, honest) with the what→why→how error formula and inclusive-language rules. Use when the user needs interface copy, error messages, empty-state text, or a copy review.

相關技能