profiling-performance — скилл для Claude Code: функции и установка
Скилл запускает профилирование CPU во встроенном браузере через инструменты MCP. Он находит медленные функции и помогает устранить зависания интерфейса.
npx skills add spencerpauly/awesome-cursor-skills --skill profiling-performance -a claude-codeЧто делает profiling-performance
Скилл автоматизирует замер производительности веб-приложений через MCP-сервер cursor-ide-browser. Агент переходит на нужный локальный адрес, вызывает инструмент browser_profile_start, выполняет клики или скролл и останавливает запись через browser_profile_stop.
Данные сохраняются в каталог ~/.cursor/browser-logs/ в виде сырого профиля Chrome DevTools в формате JSON и краткой сводки в Markdown. По числу сэмплов hitCount и именам функций агент выявляет синхронные блокировки главного потока, частые ререндеры или тяжёлые вызовы внешних библиотек.
Для работы требуется запущенный локальный сервер проекта. Замеры в режиме разработки React могут искажаться из-за служебного оверхенда, поэтому для точных цифр стоит профилировать собранный production-билд. Резюме в Markdown пропускает тонкие детали вызовов — сырой JSON нужно проверять в первую очередь.
Какие задачи решает
- найти блокирующие вызовы в главном потоке браузера
- собрать профиль CPU при кликах и скролле страницы
- выявить лишние ререндеры компонентов React
- сравнить сэмплы выполнения функций до и после оптимизации
Примеры запросов агенту
- Запусти профилирование CPU на странице со списком заказов и проверь, почему тормозит скролл.
- Сними профиль взаимодействия с формой поиска и найди медленные функции.
- Проанализируй сырой JSON профиля в browser-logs и предложи оптимизации для ререндеров.
Как установить profiling-performance
1Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill profiling-performance -a claude-code2Вручную: положить файлы
~/.claude/skills/profiling-performance/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/profiling-performance/
1Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill profiling-performance -a codex2Вручную: положить файлы
.agents/skills/profiling-performance/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill profiling-performance -a cursor2Вручную: положить файлы
.cursor/skills/profiling-performance/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install spencerpauly/awesome-cursor-skills profiling-performance2Вручную: положить файлы
.github/skills/profiling-performance/SKILL.md1Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill profiling-performance -a gemini-cli2Командой платформы
gemini skills install https://github.com/spencerpauly/awesome-cursor-skills --path resources/profiling-performanceВручную: положить файлы
.devin/skills/profiling-performance/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill profiling-performance -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о profiling-performance
Как установить profiling-performance в Claude Code?
Для установки выполните команду npx skills add spencerpauly/awesome-cursor-skills --skill profiling-performance -a claude-code.
Что делает profiling-performance?
Скилл записывает профиль CPU в формате Chrome DevTools во время работы браузера, находит медленные участки кода и формирует отчёт с рекомендациями по ускорению.
Почему рекомендуется профилировать production-билд?
Режим разработки React добавляет собственный оверхенд при рендеринге. Сборка для продакшена показывает реальную нагрузку на CPU без лишних служебных проверок.
Исходный текст
SKILL.md · CC0-1.0
---
name: profiling-performance
description: Profile a running web application's CPU performance using Cursor's built-in browser profiler. Captures call stacks, identifies slow functions, and suggests optimizations. Use when a page feels slow or janky.
---
# Performance Profile
Use this skill when a web application feels slow, janky, or unresponsive. Cursor's built-in browser has CPU profiling tools that capture real call stacks and timing data.
## How It Works
The `cursor-ide-browser` MCP provides `browser_profile_start` and `browser_profile_stop` tools that capture Chrome DevTools-format CPU profiles. Profile data is written to `~/.cursor/browser-logs/` as both raw JSON and a human-readable summary.
## Steps
1. **Ensure the app is running** — start the dev server if it isn't already running.
2. **Navigate to the slow page**:
```
Tool: browser_navigate
Arguments: { "url": "http://localhost:3000/slow-page" }
```
3. **Start profiling**:
```
Tool: browser_profile_start
```
4. **Reproduce the slow interaction** — use browser tools to trigger the slow behavior:
- Click buttons, scroll, type in inputs, navigate between pages
- Use `browser_click`, `browser_scroll`, `browser_fill` to interact
- Wait a few seconds for the interaction to complete
5. **Stop profiling**:
```
Tool: browser_profile_stop
```
This writes two files to `~/.cursor/browser-logs/`:
- `cpu-profile-{timestamp}.json` — raw Chrome DevTools profile
- `cpu-profile-{timestamp}-summary.md` — human-readable summary
6. **Analyze the results** — read both files. Key things to look for in the raw JSON:
- `profile.nodes[].hitCount` — how many samples hit each function
- `profile.nodes[].callFrame.functionName` — the function names
- `profile.samples.length` — total number of samples collected
Cross-reference with the summary to identify:
- Functions consuming the most CPU time
- Unexpected re-renders or layout thrashing
- Expensive third-party library calls
- Synchronous operations blocking the main thread
7. **Suggest fixes** — based on the profile data, recommend specific optimizations:
- Memoize expensive computations
- Debounce rapid event handlers
- Move heavy work to a Web Worker
- Lazy-load components or routes
- Virtualize long lists
## Notes
- Always read the raw `.json` profile to verify the summary — the summary can miss nuances.
- Profile in development mode first, but be aware that React dev mode adds overhead. For accurate measurements, profile a production build.
- Short profiles (2-5 seconds of interaction) are usually more useful than long ones.
- Compare before/after profiles to verify your optimization actually helped.
© spencerpauly · CC0-1.0 · spencerpauly/awesome-cursor-skills