optimize 是什么?
optimize 先测量用户感受到的性能问题,再按加载、渲染、动画、框架或网络方向定位瓶颈并实施最小有效修复。只有对比相同条件下的基线与修改后指标,才能说明是否改善。
中文说明由本站依据来源整理;英文原文保留在页面下方。
适合用在
- 页面加载慢、滚动卡顿、交互延迟、包体过大或 Core Web Vitals 指标欠佳,且可以提供目标场景。
这些情况不适合
- 没有实际症状就批量重写架构,或仅靠代码“看起来复杂”推断性能瓶颈。
怎么接入你的 Agent?
- 定位完整 Skill 目录
打开本项目来源,核对
SKILL.md及其引用的脚本和资料。 - 交给你正在用的 Agent
在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。
- 确认识别,再做具体任务
让 Agent 回报安装目录和识别到的名称
optimize,然后按本页使用示例提供材料。
展开并复制给 Codex 的安装指令
安装并检查 optimize
请在 Codex 的当前工作环境中安装并检查 optimize 这个 Skill。
项目身份:pbakaus/impeccable / optimize
来源:https://github.com/pbakaus/impeccable/blob/7670d1325ac731d6aa0190b003c1b8482dd0f619/.agents/skills/optimize/SKILL.md
已定位的源文件:.agents/skills/optimize/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 Claude Code 的安装指令
安装并检查 optimize
请在 Claude Code 的当前工作环境中安装并检查 optimize 这个 Skill。
项目身份:pbakaus/impeccable / optimize
来源:https://github.com/pbakaus/impeccable/blob/7670d1325ac731d6aa0190b003c1b8482dd0f619/.agents/skills/optimize/SKILL.md
已定位的源文件:.agents/skills/optimize/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 Cursor 的安装指令
安装并检查 optimize
请在 Cursor Agent 的当前工作环境中安装并检查 optimize 这个 Skill。
项目身份:pbakaus/impeccable / optimize
来源:https://github.com/pbakaus/impeccable/blob/7670d1325ac731d6aa0190b003c1b8482dd0f619/.agents/skills/optimize/SKILL.md
已定位的源文件:.agents/skills/optimize/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 当前 Agent 的安装指令
安装并检查 optimize
请在 当前 Agent 的当前工作环境中安装并检查 optimize 这个 Skill。
项目身份:pbakaus/impeccable / optimize
来源:https://github.com/pbakaus/impeccable/blob/7670d1325ac731d6aa0190b003c1b8482dd0f619/.agents/skills/optimize/SKILL.md
已定位的源文件:.agents/skills/optimize/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。装好以后,具体怎么用?
准备哪些材料
- 按来源建立 Impeccable 上下文;提供可运行页面、设备/网络条件和可观察的慢路径。
- 准备性能测量工具与当前基线,确认测试环境避免把生产用户数据暴露到调试输出。
会得到什么
- 具体瓶颈证据、对应优化及条件一致的前后测量结果。
实际使用顺序
- 记录加载、首屏、交互、动画帧率、内存、网络请求或相应 Core Web Vitals 指标;定位实际受影响人群和页面。
- 根据证据沿图片/资源、JavaScript、渲染、动画、框架和网络寻找瓶颈,避免一次改动多个原因。
- 实施针对性修复后,在相同设备和测试条件下复测;同时确认功能与视觉没有回归。
- 报告基线、修改、结果和误差/限制;缺少测量时只说明候选问题,不声称变快。
从一个具体任务开始
本站根据源文件编写的使用示例,未在本站实际运行。示例中的文件由你提供。
复制一个具体任务
教学示例:诊断本地商品详情页首屏图片显示慢。先在固定设备、网络和缓存条件下记录加载瀑布与图片体积,确认 LCP 元素;只处理证据指向的图片加载问题,再用同条件复测并检查画质和布局稳定性。不要把单次结果概括成用户整体体验提升。本站未运行本例。预期有可比较基线和复测;本站没有页面、设备或实际性能数据。
使用条件与边界
- Core Web Vitals 目标值和具体瓶颈应按当前标准和实测场景核对;源文本中的阈值可能随版本过时。
- 基准测试受缓存、网络、设备和样本影响;单次实验不能证明所有用户都受益。
常见问题
必须先有基准数据吗?
要支持性能改善结论就需要基线;没有基线可先做定位,但应保留“尚未证实改善”。
优化完本地跑得快就能上线吗?
本地表现只覆盖当前环境。部署后体验、真实用户网络和回归还需按项目流程验证。
来源原文与资料状态
- 来源版本
- 历史源文件(2026-04-10T11:18:06-07:00);原目录已变更,本页解释所链接的历史版本,不代表当前安装方式。
- 源文件
- 已保存 SKILL.md,抓取于 2026-11-17T10:54:36.759Z
- 中文使用说明
- 已针对下方源文件版本整理用途、用法和常见问题
- 安装与任务测试
- 本站未执行安装或任务测试
- 来源复核
- 本页中文用法已对照保存版本的完整 SKILL.md 阅读整理
展开 SKILL.md 原文、章节与历史收录资料
.agents/skills/optimize/SKILL.md · 抓取时间 2026-11-17T10:54:36.759Z
以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。
抓取成功不代表已完成安装或任务测试。
Diagnoses and fixes UI performance across loading speed, rendering, animations, images, and bundle size. Use when the user mentions slow, laggy, janky, performance, bundle size, load time, or wants a faster, smoother experience.
查看源文件章节 / Source sections
- 原文:Assess Performance Issues
- 原文:Optimization Strategy
- 原文:Loading Performance
- 原文:Rendering Performance
- 原文:Animation Performance
- 原文:React/Framework Optimization
- 原文:Network Optimization
- 原文:Core Web Vitals Optimization
- 原文:Largest Contentful Paint (LCP < 2.5s)
- 原文:First Input Delay (FID < 100ms) / INP (< 200ms)
- 原文:Cumulative Layout Shift (CLS < 0.1)
- 原文:Performance Monitoring
- 原文:Verify Improvements
原文:正文开头
Identify and fix performance issues to create faster, smoother user experiences.
原文: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 - **Bundle size**: JavaScript, CSS, image sizes - **Runtime performance**: Frame rate, memory usage, CPU usage - **Network**: Request count, payload sizes, waterfall 2. **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? Mobile only? Slow connections?) **CRITICAL**: Measure before and after. Premature optimization wastes time. Optimize what actually matters.
原文:Optimization Strategy
Create systematic improvement plan:
原文: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 ```html <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" /> ``` **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 ```javascript // 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 ```css @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 */ } ``` **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
原文:Rendering Performance
**Avoid Layout Thrashing**: ```javascript // ❌ 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 (react-window, react-virtualized) **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**: ```css /* ✅ 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**: ```javascript // Efficiently detect when elements enter viewport const observer = new IntersectionObserver((entries) => { entries.forEach(entry => { if (entry.isIntersecting) { // Element is visible, lazy load or animate } }); }); ```
文件 SHA256:02183edcc94de3f0208fd993fc4ac1e328c9f5a65f32a7439c964ea841acd1e0
仓库许可证记录:未提供;not-established,查看来源。
Diagnoses and fixes UI performance across loading speed, rendering, animations, images, and bundle size. Use when the user mentions slow, laggy, janky,…
这份历史简介在采集时已截断;完整用途和触发条件需打开来源核对。
历史收录数据
| Skill标识 | optimize |
|---|---|
| 来源仓库 | pbakaus/impeccable |
| 榜单快照 | 2026-07-28 |
| 榜单口径 | Skills.sh累计安装量 |
| 快照名次 | 255 |
| 快照累计安装量 | 82515 |
历史资料说明
- 所保留的来源简介在采集时已截断;完整触发条件、依赖及排除项须阅读源文件,本站不补写缺失部分。
- 安装量用于说明当时的收录次序,不是效果、可信度或当前可用性的证明。
此页用于识别项目与来源。安装入口可在该Skill的Skills.sh页面查看;当前目录是否仍存在、附带脚本和账户依赖尚需按具体版本确认。
