技能 performance-profiling
📊

performance-profiling

安全

使用 Lighthouse 进行网页性能分析

此技能帮助开发者使用 Lighthouse 审核和浏览器开发者工具来测量和优化网页应用的性能。它提供了一个结构化的工作流程,用于识别性能瓶颈并提升 Core Web Vitals 分数。

支持: Claude Codex Code(CC)
📊 71 充足
1

下载技能 ZIP

2

在 Claude 中上传

前往 设置 → 功能 → 技能 → 上传技能

3

开启并开始使用

测试它

正在使用“performance-profiling”。 Run Lighthouse audit on my website

预期结果:

Performance Score: 78/100

Key Findings:
- LCP: 2.8s (Needs improvement)
- CLS: 0.05 (Good)
- INP: 180ms (Good)

Recommendations:
1. Eliminate render-blocking resources
2. Properly size images
3. Reduce JavaScript execution time

正在使用“performance-profiling”。 What are the Core Web Vitals thresholds?

预期结果:

Core Web Vitals Thresholds:

| Metric | Good | Poor |
|-------|------|------|
| LCP | < 2.5s | > 4.0s |
| INP | < 200ms | > 500ms |
| CLS | < 0.1 | > 0.25 |

安全审计

安全
v1 • 2/24/2026

Evaluated 11 static security findings. All patterns detected are false positives. The subprocess.run call uses list arguments (not shell=True), preventing command injection. Temp file operations use the safe tempfile module. Documentation examples in SKILL.md are not executable code. The 'cryptographic algorithm' alerts were misidentified keywords. This is a legitimate performance profiling skill with no security concerns.

2
已扫描文件
226
分析行数
5
发现项
1
审计总数

高风险问题 (2)

Subprocess Execution
subprocess.run called at line 22 to execute lighthouse CLI. Arguments passed as list (not shell=True), preventing command injection. User input (URL) is safely passed as direct argument.
Cryptographic Algorithm Detection
Scanner flagged 'measure, analyze, optimize' keywords as cryptographic algorithms. This is a false positive from keyword pattern matching.
中风险问题 (2)
File System Operations
Temp file creation and cleanup using os module. Legitimate use for storing Lighthouse report output.
Documentation Shell Examples
Backtick syntax in documentation showing example commands. These are documentation, not executable code.
低风险问题 (1)
Hardcoded URL in Documentation
URL string appears in docstring as usage example. Not actual network code.
审计者: claude

质量评分

45
架构
100
可维护性
87
内容
50
社区
73
安全
91
规范符合性

你能构建什么

前端开发者优化加载速度

前端开发者希望提升其网页应用的加载性能。他们使用此技能运行 Lighthouse 审核,识别最大的性能瓶颈,并应用有针对性的优化措施。

DevOps 工程师设置 CI 性能检查

DevOps 工程师希望在其 CI/CD 流水线中添加自动化性能测试。他们使用此技能的 Lighthouse 脚本在每次部署时运行审核,并使低于性能阈值的构建失败。

全栈开发者排查运行时问题

全栈开发者注意到其网页应用上的交互很慢。他们使用此技能来分析运行时性能,识别长任务,并使用 DevTools 内存面板查找内存泄漏。

试试这些提示

基础 Lighthouse 审核
使用 performance-profiling 技能对 https://example.com 运行 Lighthouse 性能审核。显示性能分数和主要建议。
分析 Core Web Vitals
使用 performance-profiling 技能,解释 Core Web Vitals(LCP、INP、CLS)衡量什么,并提供改善每个指标的技巧。
包优化分析
使用 performance-profiling 技能分析大型 JavaScript 包。我应该查找哪些常见问题,以及推荐的优化措施是什么?
性能工作流程实施
使用 performance-profiling 技能的 4 步分析工作流程(基线、识别、修复、验证),帮助我优化一个慢的网页应用。从建立基线开始。

最佳实践

  • 在进行任何更改之前,始终建立性能基准
  • 优先关注最大的瓶颈,而不是微优化
  • 通过重复测量验证改进,以考虑差异

避免

  • 在未进行性能分析的情况下猜测性能问题
  • 在确定实际瓶颈之前优化代码
  • 忽略真实用户数据,只依赖合成测试

常见问题

此技能使用哪些工具?
此技能使用 Lighthouse 进行性能审核,使用浏览器 DevTools 进行运行时分析。Lighthouse CLI 必须单独安装。
我需要安装任何依赖项吗?
是的,您需要全局安装 Lighthouse CLI:npm install -g lighthouse
此技能可以分析本地网站吗?
是的,您可以对 localhost 或任何本地运行的治疗服务器运行 Lighthouse。
什么是 Core Web Vitals?
Core Web Vitals 是 Google 的标准化指标:最大内容绘制(LCP)、下一绘制交互(INP)和累积布局偏移(CLS)。
我应该多久运行一次性能审核?
在开发期间、部署前以及在生产环境中定期使用真实用户监控(RUM)运行性能审核。
如果我的性能分数很低怎么办?
使用 4 步工作流程:建立基线,识别最大的瓶颈,进行一次有针对性的修复,然后在进入下一个问题之前验证改进效果。

开发者详情

文件结构