From claude-code-starter
Analyzes performance bottlenecks in web pages, APIs, builds and delivers prioritized fixes with baselines from Lighthouse, Chrome DevTools, cProfile, py-spy, clinic.js, EXPLAIN ANALYZE.
npx claudepluginhub lighthouse-strategy/claude-code-starterThis skill uses the workspace's default tool permissions.
帮用户找到性能瓶颈并给出具体的改进方案。核心原则:先测量,再优化,再验证。
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Guides agent creation for Claude Code plugins with file templates, frontmatter specs (name, description, model), triggering examples, system prompts, and best practices.
帮用户找到性能瓶颈并给出具体的改进方案。核心原则:先测量,再优化,再验证。
你想优化什么?
- 网页加载速度(首屏渲染慢、页面太大)
- 后端响应时间(API 慢、数据库查询慢)
- 构建速度(打包太慢)
- 内存或 CPU 占用
在做任何改动之前,用合适的工具记录当前性能数据作为基线:
前端性能测量:
npx lighthouse URL --output=json) — 获取 FCP、LCP、TBT、CLS 评分Python 后端:
cProfile — 内置分析器,快速定位耗时函数:python -m cProfile -s cumtime app.pypy-spy — 采样式分析器,可附加到运行中的进程,无需改代码:py-spy top --pid PIDline_profiler — 逐行分析特定函数耗时,适合定位热点代码Node.js 后端:
--inspect 标志 + Chrome DevTools — node --inspect app.js,然后在 Chrome 打开 chrome://inspectclinic.js — 自动诊断工具:npx clinic doctor -- node app.js数据库:
EXPLAIN ANALYZE — 在慢查询前加上,查看执行计划和实际耗时。重点关注全表扫描(Seq Scan)和嵌套循环记录基线数据:具体的数字(如"首页 LCP 3.2s"、"API 响应 P95 800ms"、"查询耗时 1.4s")。
根据测量结果,检查常见问题:
网页加载:
后端响应:
构建速度:
按投入产出比排序,给出具体建议:
性能分析报告
基线数据:[填入步骤 2 的测量结果]
高影响(优先做):
- [问题] 具体描述 -> [方案] 怎么改 -> [预期提升] 具体数字
中影响:
- ...
低影响(可选):
- ...
用户选择后,逐个执行优化。每个优化完成后,用步骤 2 相同的工具和条件重新测量,对比基线数据:
优化完成。主要改动:xxx。性能对比:[优化前数字] -> [优化后数字]。