Communitygithub.com

pbakaus/optimize

診斷並修復 UI 效能問題,涵蓋載入速度、渲染、動畫、圖片與套件大小。當使用者提到慢、延遲、卡頓、效能、套件大小、載入時間,或想獲得更快、更流暢的體驗時使用。

optimize 是什麼?

這是一個專為 AI 代理工具(如 Claude Code、Cursor、Codex 等)設計的效能優化技能。它能主動診斷並修復使用者介面(UI)的各種效能瓶頸,包括載入速度緩慢、渲染卡頓、動畫不流暢、圖片載入過久以及 JavaScript 套件體積過大等問題。此技能支援多種開發平台,並透過分析頁面載入時間、幀率(FPS)、網路請求及記憶體使用量等關鍵指標來定位問題根源。一旦偵測到常見的效能關鍵字(如 slow、laggy、janky 或 bundle size),該技能即可自動給出最佳化建議或直接執行程式碼修改。其運作方式基於標準的 SKILL.md 文件中所描述的最佳實踐,例如對圖片進行懶載入(lazy loading)、減少不必要的 DOM 操作、使用 CSS 變換代替重排(reflow)等策略,讓開發者能夠快速提升應用的流暢度與使用者體驗。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/pbakaus/impeccable/tree/main/skills/optimize

在你喜歡的 AI 中提問

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

說明文件

optimize 是做什麼的?

診斷並修復 UI 效能問題,涵蓋載入速度、渲染、動畫、圖片與套件大小。當使用者提到慢、延遲、卡頓、效能、套件大小、載入時間,或想獲得更快、更流暢的體驗時使用。

功能

  • 載入速度:分析並最佳化頁面初次載入時間,包括資源壓縮、快取策略與非同步載入。
  • 渲染與動畫:偵測並修復因 JavaScript 阻塞主執行緒或強制重排(forced reflow)導致的卡頓動畫,建議使用 requestAnimationFrame 與 CSS 硬體加速。
  • 圖片最佳化:壓縮圖片、實作懶載入(lazy loading)與使用現代格式(如 WebP)。
  • 套件大小:分析 JavaScript 與 CSS 的傳輸大小,建議 tree shaking、程式碼拆分與長效快取策略。

使用方式

當你遇到以下任一情況時,即可呼叫此技能:

  • 應用程式載入緩慢
  • 頁面或元件渲染時出現明顯卡頓
  • 動畫無法維持 60fps 的流暢度
  • 使用者報告「卡卡的」或「反應慢」
  • 構建輸出顯示套件體積過大

此技能會根據目前專案的技術棧自動選擇最佳化策略,並提供具體的程式碼修改建議。

支援平台

  • Claude Code
  • Cursor
  • Codex
  • 其他相容的 AI 代理工具

運作原理

技能透過分析以下指標來診斷問題:

  1. 載入時間:使用 performance.timing API 與 Lighthouse 報告。
  2. 幀率:監控 requestAnimationFrame 回呼頻率。
  3. 網路請求:檢查資源大小與請求數量。
  4. 記憶體使用量:監控 performance.memory。

根據診斷結果,技能會提供或實作最佳化策略,例如:

  • 圖片壓縮並轉換為 WebP 格式
  • 對非關鍵資源啟用 loading="lazy"
  • 使用 IntersectionObserver 實作視口懶載入
  • 採用 CSS 變換(transform)代替 top/left 動畫以避免重排
  • 對大型元件執行程式碼拆分(dynamic import)

授權

MIT

Individual skills in this repo

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

pbakaus/adapt

Adapt designs to work across different screen sizes, devices, contexts, or platforms. Implements breakpoints, fluid layouts, and touch targets. Use when the user mentions responsive design, mobile layouts, breakpoints, viewport adaptation, or cross-device compatibility.

pbakaus/animate

Review a feature and enhance it with purposeful animations, micro-interactions, and motion effects that improve usability and delight. Use when the user mentions adding animation, transitions, micro-interactions, motion design, hover effects, or making the UI feel more alive.

pbakaus/arrange

Improve layout, spacing, and visual rhythm. Fixes monotonous grids, inconsistent spacing, and weak visual hierarchy. Use when the user mentions layout feeling off, spacing issues, visual hierarchy, crowded UI, alignment problems, or wanting better composition.

pbakaus/audit

Run technical quality checks across accessibility, performance, theming, responsive design, and anti-patterns. Generates a scored report with P0-P3 severity ratings and actionable plan. Use when the user wants an accessibility check, performance audit, or technical quality review.

pbakaus/bolder

Amplify safe or boring designs to make them more visually interesting and stimulating. Increases impact while maintaining usability. Use when the user says the design looks bland, generic, too safe, lacks personality, or wants more visual impact and character.

pbakaus/clarify

Improve unclear UX copy, error messages, microcopy, labels, and instructions to make interfaces easier to understand. Use when the user mentions confusing text, unclear labels, bad error messages, hard-to-follow instructions, or wanting better UX writing.

pbakaus/colorize

Add strategic color to features that are too monochromatic or lack visual interest, making interfaces more engaging and expressive. Use when the user mentions the design looking gray, dull, lacking warmth, needing more color, or wanting a more vibrant or expressive palette.

pbakaus/critique

Evaluate design from a UX perspective, assessing visual hierarchy, information architecture, emotional resonance, cognitive load, and overall quality with quantitative scoring, persona-based testing, automated anti-pattern detection, and actionable feedback. Use when the user asks to review, critique, evaluate, or give feedback on a design or component.

pbakaus/delight

Add moments of joy, personality, and unexpected touches that make interfaces memorable and enjoyable to use. Elevates functional to delightful. Use when the user asks to add polish, personality, animations, micro-interactions, delight, or make an interface feel fun or memorable.

pbakaus/distill

Strip designs to their essence by removing unnecessary complexity. Great design is simple, powerful, and clean. Use when the user asks to simplify, declutter, reduce noise, remove elements, or make a UI cleaner and more focused.

pbakaus/extract

Extract and consolidate reusable components, design tokens, and patterns into your design system. Identifies opportunities for systematic reuse and enriches your component library. Use when the user asks to create components, refactor repeated UI patterns, build a design system, or extract tokens.

pbakaus/frontend-design

frontend-design — an installable skill for AI agents.

pbakaus/harden

Make interfaces production-ready: error handling, empty states, onboarding flows, i18n, text overflow, and edge case management. Use when the user asks to harden, make production-ready, handle edge cases, add error states, design empty states, improve onboarding, or fix overflow and i18n issues.

pbakaus/impeccable

Use when the user wants to design, redesign, shape, critique, audit, polish, clarify, distill, harden, optimize, adapt, animate, colorize, extract, or otherwise improve a frontend interface. Covers websites, landing pages, dashboards, product UI, app shells, components, forms, settings, onboarding, and empty states. Handles UX review, visual hierarchy, information architecture, cognitive load, accessibility, performance, responsive behavior, theming, anti-patterns, typography, fonts, spacing, layout, alignment, color, motion, micro-interactions, UX copy, error states, edge cases, i18n, and reusable design systems or tokens. Also use for bland designs that need to become bolder or more delightful, loud designs that should become quieter, live browser iteration on UI elements, or ambitious visual effects that should feel technically extraordinary. Not for backend-only or non-UI tasks.

pbakaus/layout

Improve layout, spacing, and visual rhythm. Fixes monotonous grids, inconsistent spacing, and weak visual hierarchy. Use when the user mentions layout feeling off, spacing issues, visual hierarchy, crowded UI, alignment problems, or wanting better composition.

pbakaus/normalize

Audits and realigns UI to match design system standards, spacing, tokens, and patterns. Use when the user mentions consistency, design drift, mismatched styles, tokens, or wants to bring a feature back in line with the system.

pbakaus/onboard

Designs and improves onboarding flows, empty states, and first-run experiences to help users reach value quickly. Use when the user mentions onboarding, first-time users, empty states, activation, getting started, or new user flows.

pbakaus/overdrive

Pushes interfaces past conventional limits with technically ambitious implementations — shaders, spring physics, scroll-driven reveals, 60fps animations. Use when the user wants to wow, impress, go all-out, or make something that feels extraordinary.

pbakaus/polish

Performs a final quality pass fixing alignment, spacing, consistency, and micro-detail issues before shipping. Use when the user mentions polish, finishing touches, pre-launch review, something looks off, or wants to go from good to great.

pbakaus/quieter

Tones down visually aggressive or overstimulating designs, reducing intensity while preserving quality. Use when the user mentions too bold, too loud, overwhelming, aggressive, garish, or wants a calmer, more refined aesthetic.

相關技能