Agent Skillst4t5/rencal › performance-analysis

performance-analysis

GitHub

用于分析前端性能录制文件,识别渲染帧、脚本执行及CPU热点瓶颈。通过读取源码提出排序后的优化建议(如缓存、算法优化),并在用户实施后对比验证效果,以提升应用交互性能。

.agents/skills/performance-analysis/SKILL.md t4t5/rencal

Trigger Scenarios

用户希望优化缓慢的交互体验 用户提供Chrome或Safari的性能轨迹数据

Install

npx skills add t4t5/rencal --skill performance-analysis -g -y
More Options

Non-standard path

npx skills add https://github.com/t4t5/rencal/tree/main/.agents/skills/performance-analysis -g -y

Use without installing

npx skills use t4t5/rencal@performance-analysis

指定 Agent (Claude Code)

npx skills add t4t5/rencal --skill performance-analysis -a claude-code -g -y

安装 repo 全部 skill

npx skills add t4t5/rencal --all -g -y

预览 repo 内 skill

npx skills add t4t5/rencal --list

SKILL.md

Frontmatter
{
    "name": "performance-analysis",
    "description": "Analyze frontend performance recordings and propose ranked optimizations. Use when the user wants to optimize a slow interaction or analyze a Chrome\/Safari performance trace."
}

You are helping the user optimize the performance of a specific part of the app.

Workflow

  1. Ask for a recording: Ask the user to do a Chrome DevTools performance recording (in Safari Web Inspector or Chrome) of the interaction they want to optimize. They should save the recording JSON file in the recordings/ directory.

  2. Analyze the recording: Run just analyze recordings/<filename>.json to get a breakdown of rendering frames, layout events, script events, and CPU profile hotspots.

  3. Identify bottlenecks: Look at:

    • Longest rendering frames — anything over 16ms breaks 60fps
    • Top script executions — which events take the most time
    • CPU self-time — which functions are burning the most CPU (especially in src/)
    • CPU total time — which call trees are the most expensive
  4. Read the relevant source code: Based on the CPU profile hotspots, read the source files to understand what the code is doing and why it's slow.

  5. Propose optimizations: Present concrete, ranked optimization ideas to the user. Common patterns:

    • Caching/memoizing repeated computations
    • Replacing heavy library calls (e.g. date-fns) with lightweight arithmetic
    • Reducing algorithmic complexity (e.g. pre-indexing instead of O(n*m) loops)
    • Avoiding unnecessary object allocations (especially Date objects)
  6. Let the user choose: Don't implement anything until the user picks which optimizations to pursue.

  7. After implementing: Ask the user to do another recording so you can compare before/after with just analyze and verify the improvements.

Version History

  • 22a53df Current 2026-07-05 10:46

Same Skill Collection

.agents/skills/add-astro-icon/SKILL.md
.agents/skills/add-icon/SKILL.md
.agents/skills/generate-release-notes/SKILL.md

Metadata

Files
0
Version
22a53df
Hash
7b106b9c
Indexed
2026-07-05 10:46

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-09 22:05
浙ICP备14020137号-1 $Гость$