Token导航 LogoToken导航

Agent Skill · 研究检索

optimize(参数优化)

用于辅助界面设计、视觉规范、排版、配色、布局和交互体验优化。它适合让 Agent 根据产品场景整理页面结构、生成 UI 方案、检查视觉一致性或改进组件层级。使用时需要结合现有品牌、设计系统和用户任务,不应只堆装饰元素;涉及真实页面改动时,应通过截图或浏览器预览检查文本溢出、对齐和响应式表现。

optimize 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 49,774。

总安装 636周安装 26GitHub Stars 14下载 206核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:optimize(参数优化)
来源仓库:https://github.com/aladicf/better-web-ui
仓库路径:skills/optimize
安装命令:
npx skills add https://github.com/aladicf/better-web-ui --skill optimize
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/aladicf/better-web-ui --skill optimize

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

optimize 用于识别并修复性能问题,提升网页加载速度和交互流畅度,适用于前端性能调优场景。适合处理图像优化、文本布局预测、核心 Web 指标(LCP、INP、CLS)改进等具体性能瓶颈。使用时需结合现有代码和设计系统,优先调用内置工具而非手动实现,避免重复造轮子。

安装方式:github,命令为 npx skills add https://github.com/aladicf/better-web-ui --skill optimize。注意:需先加载 $frontend-design 上下文,确保有设计原则支持后再进行性能优化决策。

来源仓库内路径:skills/optimize

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/aladicf/better-web-ui --skill optimize;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

optimize 怎么安装?

在终端执行 npx skills add https://github.com/aladicf/better-web-ui --skill optimize。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

optimize 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

optimize 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

optimize 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

optimize 用的人多吗?

公开数据是累计安装 636 次,近一周安装 26 次,下载 206 次,GitHub 14 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

optimize 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
optimize

参数优化 · 本页

63614操作浏览器未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Identify and fix performance issues to create faster, smoother user experiences.

Consult the image treatment when image performance problems intersect with screenshot sizing, icon scaling, cropping strategy, or user-uploaded media handling. Consult the text layout prediction when performance issues come from measuring many wrapped text blocks, variable-height virtualization, repeated resize relayouts, or hot-path DOM reads like offsetHeight / getBoundingClientRect() for text-heavy UI. Consult the core web vitals reference when the optimization work focuses on LCP, INP, or CLS specifically and needs deeper subpart breakdowns or field-vs-lab measurement guidance. When a project needs virtualization for very long lists and the stack is still open, prefer TanStack Virtual as the default headless virtualization layer across the supported React, Vue, Angular, Solid, and Svelte ecosystems. If the project already uses another virtualization layer, preserve that first.

MANDATORY PREPARATION

Users start this workflow with /optimize. Once this skill is active, load $frontend-design — it contains design principles, anti-patterns, and the Context Gathering Protocol. Follow that protocol before proceeding — if no design context exists yet, you MUST load $setup first. Additionally gather: the target devices, performance constraints, and which user interactions feel slow.

Assess Performance Issues

Understand current performance and identify problems:

  1. Measure current state:

- Core Web Vitals: LCP, FID/INP, CLS scores - Load time: Time to interactive, first contentful paint

  • Interaction latency: Response time for filters, search, save, open-panel, autocomplete, and other repeated actions
  • Bundle size: JavaScript, CSS, image sizes
  • Runtime performance: Frame rate, memory usage, CPU usage
  • Network: Request count, payload sizes, waterfall
  1. Identify bottlenecks:

- What's slow? (Initial load? Interactions? Animations?) - What's causing it? (Large images? Expensive JavaScript? Layout thrashing?) - How bad is it? (Perceivable? Annoying? Blocking?)

  • Who's affected? (All users? Narrow-layout users? Slow connections?)

CRITICAL: Measure before and after. Premature optimization wastes time. Optimize what actually matters.

Optimization Strategy

Create systematic improvement plan:

Doherty Threshold for Interaction Speed

Routine interactions should preserve flow. Aim for users to see acknowledgment immediately and, when possible, feel the interaction resolve within roughly 400ms.

When work will exceed that window:

  • show instant feedback within ~100ms (pressed, active, loading, optimistic state)
  • stream or reveal partial content early instead of waiting for everything
  • prefetch likely next screens or data for common paths
  • prefer skeletons, optimistic UI, and progressive rendering over blank waits and generic spinners

Don't rely on a spinner as the main experience for high-frequency actions if the interface could instead acknowledge intent and keep momentum alive.

Loading Performance

Optimize Images:

  • Use modern formats (WebP, AVIF)
  • Proper sizing (don't load 3000px image for 300px display)
  • Lazy loading for below-fold images
  • Responsive images (srcset, picture element)
  • Compress images (80-85% quality is usually imperceptible)
  • Use CDN for faster delivery
<img
  src="hero.webp"
  srcset="hero-400.webp 400w, hero-800.webp 800w, hero-1200.webp 1200w"
  sizes="(max-width: 400px) 400px, (max-width: 800px) 800px, 1200px"
  loading="lazy"
  alt="Hero image"
/>

Modern image format strategy (AVIF and WebP):

AVIF typically delivers 30-50% smaller files than WebP at equivalent visual quality. WebP has broader baseline support. Use both with fallback:

<picture>
  <source srcset="hero.avif" type="image/avif">
  <source srcset="hero.webp" type="image/webp">
  <img src="hero.jpg" alt="Hero image" loading="lazy">
</picture>

Practical rules:

  • generate AVIF for hero images, large backgrounds, and photo-heavy galleries where the size savings matter most
  • keep WebP as the fallback for broader browser coverage
  • do not serve AVIF for tiny icons or simple graphics where encoding overhead outweighs savings
  • use an image CDN that handles format negotiation automatically when possible
  • test AVIF decode speed on low-end devices; the format is smaller but can be slower to decode than WebP

Reduce JavaScript Bundle:

  • Code splitting (route-based, component-based)
  • Tree shaking (remove unused code)
  • Remove unused dependencies
  • Lazy load non-critical code
  • Use dynamic imports for large components
// Lazy load heavy component
const HeavyChart = lazy(() => import('./HeavyChart'));

Optimize CSS:

  • Remove unused CSS
  • Critical CSS inline, rest async
  • Minimize CSS files
  • Use CSS containment for independent regions

Optimize Fonts:

  • Use font-display: swap or optional
  • Subset fonts (only characters you need)
  • Preload critical fonts
  • Use system fonts when appropriate
  • Limit font weights loaded
@font-face {
  font-family: 'CustomFont';
  src: url('/fonts/custom.woff2') format('woff2');
  font-display: swap; /* Show fallback immediately */
  unicode-range: U+0020-007F; /* Basic Latin only */
}

Font subsetting strategy:

Subsetting removes unused glyphs and dramatically reduces file size. A full Latin font may be 200KB; the same font subsetted to Basic Latin can be 20-30KB.

Approaches:

  • Static subsetting: generate separate font files per language or script (Latin, Cyrillic, CJK) and serve only what the page needs via unicode-range
  • Dynamic subsetting: use a service like Google Fonts or a self-hosted subsetter that generates slices on demand
  • Critical glyph subsetting: for above-the-fold hero text, subset to only the characters used in the headline and preload that file
/* Latin-only subset for body text */
@font-face {
  font-family: 'CustomFont';
  src: url('/fonts/custom-latin.woff2') format('woff2');
  font-display: swap;
  unicode-range: U+0020-007F, U+00A0-00FF;
}

/* Extended subset for other scripts, loaded only when needed */
@font-face {
  font-family: 'CustomFont';
  src: url('/fonts/custom-cyrillic.woff2') format('woff2');
  font-display: swap;
  unicode-range: U+0400-04FF;
}

Tools for subsetting:

  • pyftsubset (fonttools) for precise manual subsetting
  • subfont for automatic subsetting at build time
  • glyphhanger for extracting only the glyphs used in your HTML/CSS

Critical CSS extraction:

Extract the CSS needed for above-the-fold content and inline it in the HTML <head>. Load the remaining CSS asynchronously.

Why it matters:

  • render-blocking CSS is often the biggest contributor to slow First Contentful Paint
  • inlining critical CSS eliminates the network request for the initial view
  • non-critical CSS can load after the page is interactive

How to implement:

  • use critical (npm package) or Penthouse to extract above-the-fold CSS automatically
  • or identify critical CSS manually: header styles, hero layout, initial typography, and above-the-fold component styles
  • inline the critical CSS in a <style> tag in the <head>
  • load the full stylesheet asynchronously:
<head>
  <style>
    /* Critical CSS inlined here */
  </style>
  <link rel="preload" href="/styles.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
  <noscript><link rel="stylesheet" href="/styles.css"></noscript>
</head>

Caveats:

  • do not inline more than ~14KB of CSS (gzippped) to stay within single TCP round-trip budgets
  • critical CSS must be kept in sync with the actual above-the-fold content; regenerate it when layouts change
  • for SPAs, consider route-level critical CSS rather than page-level

Optimize Loading Strategy:

  • Critical resources first (async/defer non-critical)
  • Preload critical assets
  • Prefetch likely next pages
  • Service worker for offline/caching
  • HTTP/2 or HTTP/3 for multiplexing

Container queries for component-level responsiveness:

Container queries let components adapt to their own container size rather than the viewport. This reduces the need for page-wide breakpoint overrides and makes components more reusable.

When to use:

  • a component appears in multiple contexts (sidebar, main column, modal)
  • the component layout should depend on the space it has, not the device width
  • you want to reduce breakpoint proliferation at the page level

Consult the container queries reference for syntax, practical patterns, and browser support.

Performance note:

  • container queries add minimal runtime cost; they run on the compositor like media queries
  • prefer container-type: inline-size over size unless you genuinely need both dimensions
  • avoid creating containment contexts on every element; only where the component needs to query its container

Rendering Performance

Avoid Layout Thrashing:

// ❌ Bad: Alternating reads and writes (causes reflows)
elements.forEach(el => {
  const height = el.offsetHeight; // Read (forces layout)
  el.style.height = height * 2; // Write
});

// ✅ Good: Batch reads, then batch writes
const heights = elements.map(el => el.offsetHeight); // All reads
elements.forEach((el, i) => {
  el.style.height = heights[i] * 2; // All writes
});

Optimize Rendering:

  • Use CSS contain property for independent regions
  • Minimize DOM depth (flatter is faster)
  • Reduce DOM size (fewer elements)
  • Use content-visibility: auto for long lists
  • Virtual scrolling for very long lists — prefer TanStack Virtual when the architecture is still open; preserve the existing virtualization stack first if the project already has one
  • For text-heavy variable-height lists or cards, prefer predictive text measurement over repeated live DOM height reads when wrapping is the real bottleneck

Reduce Paint & Composite:

  • Use transform and opacity for animations (GPU-accelerated)
  • Avoid animating layout properties (width, height, top, left)
  • Use will-change sparingly for known expensive operations
  • Minimize paint areas (smaller is faster)

Animation Performance

GPU Acceleration:

/* ✅ GPU-accelerated (fast) */
.animated {
  transform: translateX(100px);
  opacity: 0.5;
}

/* ❌ CPU-bound (slow) */
.animated {
  left: 100px;
  width: 300px;
}

Smooth 60fps:

  • Target 16ms per frame (60fps)
  • Use requestAnimationFrame for JS animations
  • Debounce/throttle scroll handlers
  • Use CSS animations when possible
  • Avoid long-running JavaScript during animations

Intersection Observer:

// Efficiently detect when elements enter viewport
const observer = new IntersectionObserver((entries) => {
  entries.forEach(entry => {
    if (entry.isIntersecting) {
      // Element is visible, lazy load or animate
    }
  });
});

React/Framework Optimization

React-specific:

  • Use memo() for expensive components
  • useMemo() and useCallback() for expensive computations
  • Virtualize long lists
  • Code split routes
  • Avoid inline function creation in render
  • Use React DevTools Profiler

Framework-agnostic:

  • Minimize re-renders
  • Debounce expensive operations
  • Memoize computed values
  • Lazy load routes and components

Network Optimization

Reduce Requests:

  • Combine small files
  • Use SVG sprites for icons
  • Inline small critical assets
  • Remove unused third-party scripts

Optimize APIs:

  • Use pagination (don't load everything)
  • GraphQL to request only needed fields
  • Response compression (gzip, brotli)
  • HTTP caching headers
  • CDN for static assets

Optimize for Slow Connections:

  • Adaptive loading based on connection (navigator.connection)
  • Optimistic UI updates
  • Request prioritization
  • Progressive enhancement

Core Web Vitals Optimization

Largest Contentful Paint (LCP < 2.5s)

  • Optimize hero images
  • Inline critical CSS
  • Preload key resources
  • Use CDN
  • Server-side rendering

First Input Delay (FID < 100ms) / INP (< 200ms)

  • Break up long tasks
  • Defer non-critical JavaScript
  • Use web workers for heavy computation
  • Reduce JavaScript execution time

Cumulative Layout Shift (CLS < 0.1)

  • Set dimensions on images and videos
  • Don't inject content above existing content
  • Use aspect-ratio CSS property
  • Reserve space for ads/embeds
  • Avoid animations that cause layout shifts
/* Reserve space for image */
.image-container {
  aspect-ratio: 16 / 9;
}

Performance Monitoring

Tools to use:

  • Chrome DevTools (Lighthouse, Performance panel)
  • WebPageTest
  • Core Web Vitals (Chrome UX Report)
  • Bundle analyzers (webpack-bundle-analyzer)
  • Performance monitoring (Sentry, DataDog, New Relic)

Key metrics:

  • LCP, FID/INP, CLS (Core Web Vitals)
  • Time to Interactive (TTI)
  • First Contentful Paint (FCP)
  • Total Blocking Time (TBT)
  • Bundle size
  • Request count

IMPORTANT: Measure on real devices with real network conditions. Desktop Chrome with fast connection isn't representative.

NEVER:

  • Optimize without measuring (premature optimization)
  • Sacrifice accessibility for performance
  • Break functionality while optimizing
  • Use will-change everywhere (creates new layers, uses memory)
  • Lazy load above-fold content
  • Optimize micro-optimizations while ignoring major issues (optimize the biggest bottleneck first)
  • Forget about constrained-browser performance (often slower hardware, tighter CPU budgets, slower connections)

Verify Improvements

Test that optimizations worked:

  • Before/after metrics: Compare Lighthouse scores
  • Real user monitoring: Track improvements for real users
  • Different devices: Test on low-power touch-capable hardware and mainstream laptop/desktop browsers
  • Slow connections: Throttle to 3G, test experience
  • No regressions: Ensure functionality still works
  • User perception: Does it *feel* faster?

Remember: Performance is a feature. Fast experiences feel more responsive, more polished, more professional. Optimize systematically, measure ruthlessly, and prioritize user-perceived performance.

平台分布

Codex

32.74%
按下载量换算67

Claude

31.4%
按下载量换算65

Cursor

20.18%
按下载量换算42

Gemini CLI

10.07%
按下载量换算21

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills