Agent skill

Frontend Performance Optimization

by ProgrammerAnthony in ProgrammerAnthony/Expert-Coding-Harness

A skill your agent uses when 用户需要优化前端性能、提升页面加载速度、减少白屏时间、优化交互流畅度、进行性能排查时。触发场景:前端性能优化、页面加载慢、白屏时间长、卡顿、LCP/FID/CLS指标优化、前端性能分析、打包体积优化。

MITAuto-check passedFrontend & Design

Install Frontend Performance Optimization

skills CLI
$ npx skills add ProgrammerAnthony/Expert-Coding-Harness --skill frontend-performance-optimization -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ProgrammerAnthony/Expert-Coding-Harness frontend-performance-optimization --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ProgrammerAnthony/Expert-Coding-Harness.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/frontend-performance-optimization .claude/skills/frontend-performance-optimization && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
frontend-performance-optimization
GitHub stars
235
Token cost
~701 tokens
SKILL.md length
94 words
Files
6 (incl. references)
Skills in repo
23
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when 用户需要优化前端性能、提升页面加载速度、减少白屏时间、优化交互流畅度、进行性能排查时。触发场景:前端性能优化、页面加载慢、白屏时间长、卡顿、LCP/FID/CLS指标优化、前端性能分析、打包体积优化。

  • Works in 6 steps: 资源体积优化 → 资源加载策略优化 → 首屏性能优化 → …
  • 用户需要优化前端性能、提升页面加载速度、减少白屏时间、优化交互流畅度、进行性能排查时。触发场景:前端性能优化、页面加载慢、白屏时间长、卡顿、LCP/FID/CLS指标优化、前端性能分析、打包体积优化
  • SKILL.md covers 模式识别, 工作流, 优化方案体系(按收益从高到低排序) and 输出规范, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Frontend Performance Optimization is an agent skill from ProgrammerAnthony/Expert-Coding-Harness. Use when 用户需要优化前端性能、提升页面加载速度、减少白屏时间、优化交互流畅度、进行性能排查时。触发场景:前端性能优化、页面加载慢、白屏时间长、卡顿、LCP/FID/CLS指标优化、前端性能分析、打包体积优化。

Its SKILL.md is about 700 tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including reference files (for example `README.md`, `references/bundle-optimization-checklist.md` and `references/lighthouse-performance-guide.md`).

It sits in Frontend & Design, covering Web performance and Performance optimization. The repository describes itself as: 生产级 AI Agent 技能集,辅助AI Harness应用于企业开发,覆盖代码审查、代码安全审计、TDD、需求工程、实施计划与子代理编排、架构设计、调试、前端开发与技能创建全流程。 The licence is MIT.

When your agent uses it

  • 用户需要优化前端性能、提升页面加载速度、减少白屏时间、优化交互流畅度、进行性能排查时。触发场景:前端性能优化、页面加载慢、白屏时间长、卡顿、LCP/FID/CLS指标优化、前端性能分析、打包体积优化
  • Tasks that involve Web performance
  • Tasks that involve Performance optimization

Example prompts

  • “/frontend-performance-optimization”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. 资源体积优化
  2. 资源加载策略优化
  3. 首屏性能优化
  4. JS执行优化
  5. 渲染性能优化
  6. 内存优化

What it can do on your machine

Read from SKILL.md and the folder at commit ab0b827. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Frontend Performance Optimization loads about 701 tokens when it runs, and up to ~4.6k if it reads all its reference files. Until then it costs about 36 tokens; SKILL.md has 94 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~36
When it runs · the whole SKILL.md, loaded when a task matches
~701
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ProgrammerAnthony/Expert-Coding-Harness at commit ab0b827, republished under its MIT licence (© ProgrammerAnthony). 94 words, ~701 tokens.

Download SKILL.mdSave it as .claude/skills/frontend-performance-optimization/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
frontend-performance-optimization
description
Use when 用户需要优化前端性能、提升页面加载速度、减少白屏时间、优化交互流畅度、进行性能排查时。触发场景:前端性能优化、页面加载慢、白屏时间长、卡顿、LCP/FID/CLS指标优化、前端性能分析、打包体积优化。

前端性能优化专家

铁律:先量化分析性能瓶颈,再给出针对性优化方案,禁止无依据的盲目优化。所有优化建议必须标注收益和成本,让用户可以按需选择。

模式识别

启动时识别用户场景:

你的需求是:
1. 性能问题排查 — 页面加载慢/卡顿,需要定位瓶颈
2. 性能指标优化 — 提升LCP/FID/CLS等核心Web Vital指标
3. 打包体积优化 — 减少构建产物大小,提升加载速度
4. 全项目性能优化 — 对整个前端项目进行系统性性能优化

工作流

阶段一:性能诊断

优先要求用户提供性能数据,或指导用户采集数据:

需要你提供以下信息以便精准定位问题:
1. 页面性能报告(Lighthouse报告、Chrome Performance面板截图)
2. 核心Web Vital指标数据(LCP、FID、CLS、FCP、TTI)
3. 打包产物分析报告(webpack-bundle-analyzer、rollup-visualizer输出)
4. 网络请求情况(瀑布图、接口响应时间、资源大小)

如果没有数据,先指导用户采集:

  • 使用Lighthouse运行全页面性能分析
  • 使用Chrome DevTools Performance面板录制页面加载/交互过程
  • 使用打包分析工具生成体积分析报告
阶段二:瓶颈定位

根据数据分析,按优先级定位瓶颈:

  1. 资源加载瓶颈:大资源未压缩、未缓存、请求数量过多
  2. 渲染瓶颈:JS执行时间过长、重渲染过多、重绘回流频繁
  3. 运行时瓶颈:长任务阻塞主线程、内存泄漏、大列表渲染卡顿

优化方案体系(按收益从高到低排序)

一、加载性能优化
1. 资源体积优化
  • JS/CSS压缩、混淆、Tree Shaking移除无用代码
  • 代码分割(路由懒加载、组件懒加载)
  • 第三方依赖优化(替换大体积库、按需引入、CDN引入)
  • 图片优化(格式转换为webp/avif、压缩、响应式图片、懒加载)
  • 字体优化(字体子集化、预加载、系统字体 fallback)
2. 资源加载策略优化
  • 关键资源预加载(preload)、非关键资源预获取(prefetch)
  • 静态资源CDN加速、合理设置缓存策略(Cache-Control)
  • 减少HTTP请求数(合并小资源、雪碧图、内联小资源)
  • 启用HTTP/2或HTTP/3提升并行加载能力
  • 按需加载非首屏资源(组件、路由、图片懒加载)
3. 首屏性能优化
  • 服务端渲染(SSR/SSG/ISR)提升首屏渲染速度
  • 骨架屏、Loading状态提升感知性能
  • 内联首屏关键CSS,避免阻塞渲染
  • 延迟加载非首屏JS/CSS资源
  • 优化关键路径,减少首屏需要加载的资源数量
二、运行时性能优化
1. JS执行优化
  • 避免长任务,大计算任务使用Web Worker离线处理
  • 防抖节流优化高频事件(scroll、resize、input、mousemove)
  • 优化React/Vue重渲染:减少不必要的组件更新、合理使用useMemo/useCallback
  • 避免同步阻塞操作,使用异步API处理大计算量任务
2. 渲染性能优化
  • 减少重绘回流:批量修改DOM、使用CSS transform/opacity做动画
  • 大列表使用虚拟滚动,只渲染可视区域内容
  • 合理使用will-change提示浏览器提前优化
  • 避免在滚动/动画事件中做复杂计算
3. 内存优化
  • 避免内存泄漏:及时清理定时器、事件监听、全局引用
  • 避免闭包滥用导致的内存无法释放
  • 大对象及时销毁,避免长时间持有引用
  • 合理使用缓存,避免缓存无限增长
三、核心Web Vital指标专项优化
LCP(最大内容绘制)优化
  • 提前加载LCP资源
  • 优化LCP资源的体积和加载优先级
  • 减少服务器响应时间(TTFB)
  • 避免LCP资源被其他资源阻塞
FID(首次输入延迟)优化
  • 减少主线程阻塞时间,拆分长任务
  • 延迟执行非关键JS代码
  • 预加载关键路径资源,减少输入时的JS执行
CLS(累积布局偏移)优化
  • 为图片/视频/iframe设置固定宽高比
  • 避免动态插入内容到现有内容上方
  • 优先使用transform做动画,避免触发布局变化
  • 提前为动态内容预留空间

输出规范

markdown
### 📊 性能瓶颈诊断
- 核心问题:[主要性能瓶颈点]
- 影响指标:[受影响的性能指标]
- 当前表现:[当前指标数值,目标数值]

### 🚀 优化方案(按优先级排序)
#### 高收益低成本(优先实施)
- [优化项]:[具体做法]
- 预期收益:[指标提升幅度,如LCP从3.2s降到1.5s]
- 实施成本:[低/中/高,改动范围描述]

#### 中收益中成本(次优先实施)
- [优化项]:[具体做法]
- 预期收益:[指标提升幅度]
- 实施成本:[低/中/高,改动范围描述]

#### 低收益高成本(可选实施)
- [优化项]:[具体做法]
- 预期收益:[指标提升幅度]
- 实施成本:[低/中/高,改动范围描述]

### ✅ 验证方法
- 优化后使用[工具名称]重新检测,对比指标变化
- 核心指标达标要求:LCP < 2.5s,FID < 100ms,CLS < 0.1

参考资源

  • references/web-vitals-optimization-guide.md — Web Vital指标优化指南
  • references/bundle-optimization-checklist.md — 打包体积优化检查清单
  • references/runtime-performance-best-practices.md — 运行时性能最佳实践
  • references/lighthouse-performance-guide.md — Lighthouse性能优化指南

© ProgrammerAnthony, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (references) in skills/frontend-performance-optimization of ProgrammerAnthony/Expert-Coding-Harness.

  • SKILL.md
  • README.md
  • references/bundle-optimization-checklist.md
  • references/lighthouse-performance-guide.md
  • references/runtime-performance-best-practices.md
  • references/web-vitals-optimization-guide.md

Open the folder on GitHubat commit ab0b827

Compare with similar skills

Frontend Performance Optimization next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Frontend Performance Optimization compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Frontend Performance Optimization this skillProgrammerAnthony/Expert-Coding-Harness235—~701Automated safety check: PassMIT
Performancemidudev/100cosas.dev1146 repos~2.3kAutomated safety check: PassMIT
Web Performancemozilla/firefox-devtools-mcp468—~1.2kAutomated safety check: PassCustom licence
Optimizing PerformanceCloudAI-X/claude-workflow-v21.4k1 repos~1.5kAutomated safety check: PassMIT
Performance Optimizationsanity-io/sanity6.4k7 repos~3.1kAutomated safety check: PassMIT
Optimize Loadtextura-agency/next16-claude-starter132—~4.6kAutomated safety check: NotesUnlicense

Similar skills

  • Performance

    midudev/100cosas.dev

    Optimize web performance for faster loading and better user experience.

    114 GitHub starsUsed in 6 repos~2.3k tokens
    Frontend & DesignAuto-check passed
  • Web Performance

    mozilla/firefox-devtools-mcp

    Find and fix why a website is slow by capturing and analyzing a Firefox performance profile, or by analyzing a profile the user already has (a saved file or a profiler.firefox.com share link).

    468 GitHub stars~1.2k tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • Optimizing Performance

    CloudAI-X/claude-workflow-v2

    Analyzes and optimizes application performance across frontend, backend, and database layers.

    1.4k GitHub starsUsed in 1 repo~1.5k tokens
    Frontend & DesignAuto-check passed
  • Performance Optimization

    sanity-io/sanity

    Official

    Optimizes application performance. An agent skill from sanity-io/sanity.

    6.4k GitHub starsUsed in 7 repos~3.1k tokens
    Frontend & DesignAuto-check passed
  • Optimize Load

    textura-agency/next16-claude-starter

    Get a page into Lighthouse's green zone on desktop and mobile, for people AND for the robot form crawlers get — build it, audit all four categories (Performance, Accessibility, Best Practices, SEO)…

    132 GitHub stars~4.6k tokensUpdated today
    Frontend & DesignAuto-check: notes
  • Performance Profiling

    xenitV1/Antigravity-Workflows

    Performance profiling principles. An agent skill from xenitV1/Antigravity-Workflows.

    130 GitHub starsUsed in 7 repos~772 tokens
    Frontend & DesignAuto-check: notes

More from ProgrammerAnthony/Expert-Coding-Harness

All 23 skills in this repo
  • Architecture Advisor

    ProgrammerAnthony/Expert-Coding-Harness

    A skill your agent uses when 用户需要设计新系统架构、评审或优化已有系统架构、选择技术方案时。触发场景:架构分析、架构设计、系统设计、architecture、架构优化、系统架构、架构评审、架构咨询、技术方案、技术设计、如何组织代码结构、模块划分、服务拆分、数据库选型、微服务设计。

    235 GitHub stars~673 tokensUpdated 4 mo ago
    Auto-check passed
  • Code Review Expert

    ProgrammerAnthony/Expert-Coding-Harness

    A skill your agent uses when 用户要求审查代码、评估代码质量、提交 PR 前检查、发现代码有潜在问题时。触发场景:代码审查、code review、审查代码、review、检查代码、代码检查、代码质量、代码评审、这段代码有问题吗、帮我看看代码、合并前检查。

    235 GitHub stars~806 tokensUpdated 4 mo ago
    Auto-check passed
  • Code Security Audit

    ProgrammerAnthony/Expert-Coding-Harness

    A skill your agent uses when 用户需要对代码进行安全审计、发现安全漏洞、上线前安全评估、检查代码是否存在安全风险时。触发场景:代码安全审计、安全审计、白盒审计、安全扫描、漏洞检测、漏洞挖掘、SQL注入、命令注入、XSS、SSRF、反序列化、认证绕过、越权、代码安全检查、security audit、code…

    235 GitHub stars~1.6k tokensUpdated 4 mo ago
    Auto-check passed
  • Debug Expert

    ProgrammerAnthony/Expert-Coding-Harness

    A skill your agent uses when 程序出现错误、异常、崩溃,或行为与预期不符,或测试失败,或无法定位问题根因时。触发场景:调试、debug、报错、错误、异常、bug、问题排查、故障排查、不工作、崩溃、无法运行、出错了、为什么不生效、运行报错、跑不起来、程序挂了。

    235 GitHub stars~986 tokensUpdated 4 mo ago
    Auto-check passed
  • Frontend Code Review

    ProgrammerAnthony/Expert-Coding-Harness

    A skill your agent uses when 用户需要审查前端代码(React/Vue/Next.js/TypeScript/Tailwind等)、检查代码质量、性能问题、可维护性、安全漏洞、最佳实践落地时。触发场景:前端代码评审、前端代码优化、React/Vue代码检查、TypeScript代码审查、前端性能优化、前端安全审计、前端代码规范检查。

    235 GitHub stars~614 tokensUpdated 4 mo ago
    Auto-check passed
  • Prd Engineer

    ProgrammerAnthony/Expert-Coding-Harness

    A skill your agent uses when 用户需要编写产品需求文档、整理功能需求、拆解 GitHub Issues 或制定实施计划时。触发场景:写PRD、产品需求、需求文档、prd、需求分析、功能设计、产品设计、需求评审、需求拆解、issue拆解、帮我写需求、整理功能点、我有个想法要落地、新功能规划。

    235 GitHub stars~624 tokensUpdated 4 mo ago
    Auto-check passed

Questions about Frontend Performance Optimization

What does Frontend Performance Optimization do?

A skill your agent uses when 用户需要优化前端性能、提升页面加载速度、减少白屏时间、优化交互流畅度、进行性能排查时。触发场景:前端性能优化、页面加载慢、白屏时间长、卡顿、LCP/FID/CLS指标优化、前端性能分析、打包体积优化。. Frontend Performance Optimization is an agent skill from ProgrammerAnthony/Expert-Coding-Harness.

When should I use Frontend Performance Optimization?

Frontend Performance Optimization fits situations like: 用户需要优化前端性能、提升页面加载速度、减少白屏时间、优化交互流畅度、进行性能排查时。触发场景:前端性能优化、页面加载慢、白屏时间长、卡顿、LCP/FID/CLS指标优化、前端性能分析、打包体积优化; tasks that involve Web performance; tasks that involve Performance optimization.

How do I install Frontend Performance Optimization in Claude Code?

Run `npx skills add ProgrammerAnthony/Expert-Coding-Harness --skill frontend-performance-optimization -a claude-code`. Or copy the skill folder (skills/frontend-performance-optimization in ProgrammerAnthony/Expert-Coding-Harness) into .claude/skills/frontend-performance-optimization in your project. Claude Code loads it when a task matches its description.

How do I install Frontend Performance Optimization in Codex?

Run `npx skills add ProgrammerAnthony/Expert-Coding-Harness --skill frontend-performance-optimization -a codex`. Or copy the skill folder (skills/frontend-performance-optimization in ProgrammerAnthony/Expert-Coding-Harness) into .agents/skills/frontend-performance-optimization in your project. Codex loads it when a task matches its description.

Can I use Frontend Performance Optimization in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ProgrammerAnthony/Expert-Coding-Harness --skill frontend-performance-optimization -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/frontend-performance-optimization, .gemini/skills/frontend-performance-optimization, .github/skills/frontend-performance-optimization and .opencode/skills/frontend-performance-optimization in your project.

What does Frontend Performance Optimization need to run?

SKILL.md names no scripts, command-line tools or credentials: Frontend Performance Optimization is instructions for the agent only.

Does Frontend Performance Optimization access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Frontend Performance Optimization safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Frontend Performance Optimization use?

Frontend Performance Optimization is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Frontend Performance Optimization use?

About 701 tokens (SKILL.md is roughly 2.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.9k tokens, read only when the agent opens those files.

What are the alternatives to Frontend Performance Optimization?

Skills that share tags, products or a category with Frontend Performance Optimization: Performance (midudev/100cosas.dev, 114 stars), Web Performance (mozilla/firefox-devtools-mcp, 468 stars), Optimizing Performance (CloudAI-X/claude-workflow-v2, 1.4k stars) and Performance Optimization (sanity-io/sanity, 6.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Frontend Performance Optimization?

ProgrammerAnthony (a GitHub user) maintains it in ProgrammerAnthony/Expert-Coding-Harness, which has 235 GitHub stars. The repository holds 23 skills in this directory. The repository was last updated on May 11, 2026.

Source: ProgrammerAnthony/Expert-Coding-Harness on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.