workers-profiling — скилл для Claude Code: профилирование Workers
Скилл для анализа использования CPU и памяти в развёрнутых Cloudflare Workers и Durable Objects. Помогает найти узкие места в коде и предложить оптимизацию.
npx skills add cloudflare/skills --skill workers-profiling -a claude-codeЧто делает workers-profiling
Скилл проводит вас через процесс профилирования: сначала определяет симптом (высокая нагрузка CPU, задержки, утечки памяти), потом с помощью CLI cf или API захватывает pprof-файл профиля. Анализирует результаты, ищет горячие точки в функциях и памяти, сопоставляет их с исходным кодом.
Если исходные коды не картографированы, скилл предложит включить source maps и переснять профиль. Дальше подготовит минимальные изменения кода, которые решат найденные проблемы, и покажет, как проверить эффект оптимизации.
Работает с Workers и Durable Objects; требует доступа к развёрнутому коду и учётной записи Cloudflare с правами на чтение профилей.
Какие задачи решает
- найти функции, которые жрут CPU в production
- обнаружить утечки памяти в Durable Objects
- определить, где код выделяет больше всего памяти
- оптимизировать код на основе реальных данных профилирования
- отследить задержки в развёрнутых Workers
Примеры запросов агенту
- Профилируй CPU для этого Worker, найди горячие точки и предложи оптимизацию
- Захвати heap-профиль Durable Object и покажи, где растёт память
- Анализируй pprof-файл, найди самые дорогие функции и напиши, как их переписать
Как установить workers-profiling
1Через Skills CLI (Vercel)
npx skills add cloudflare/skills --skill workers-profiling -a claude-code2Вручную: положить файлы
~/.claude/skills/workers-profiling/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/workers-profiling/
1Через Skills CLI (Vercel)
npx skills add cloudflare/skills --skill workers-profiling -a codex2Вручную: положить файлы
.agents/skills/workers-profiling/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add cloudflare/skills --skill workers-profiling -a cursor2Вручную: положить файлы
.cursor/skills/workers-profiling/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install cloudflare/skills workers-profiling2Вручную: положить файлы
.github/skills/workers-profiling/SKILL.md1Через Skills CLI (Vercel)
npx skills add cloudflare/skills --skill workers-profiling -a gemini-cli2Командой платформы
gemini skills install https://github.com/cloudflare/skills --path skills/workers-profilingВручную: положить файлы
.devin/skills/workers-profiling/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add cloudflare/skills --skill workers-profiling -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
Из того же набора18
Весь набор →Похожие
Вопросы о workers-profiling
Как установить workers-profiling в Claude Code?
Запусти npx skills add cloudflare/skills --skill workers-profiling -a claude-code, потом профиль скилла появится в ~/.claude/skills/workers-profiling/SKILL.md.
Что делает workers-profiling?
Анализирует CPU и память развёрнутых Workers и Durable Objects: находит дорогие функции, сопоставляет их с исходным кодом и предлагает конкретные оптимизации на основе pprof-данных.
Какие инструменты нужны для профилирования?
Основной способ — CLI cf; если его нет, скилл предложит установить. Результаты профиля — это pprof-файлы, которые можно анализировать напрямую или инструментами вроде Go pprof utility.
Исходный текст
SKILL.md · Apache-2.0
--- name: workers-profiling description: Profile or debug CPU usage and memory allocation in deployed Cloudflare Workers and Durable Objects. Then use this information to optimize your code. --- # Workers profiling Find expensive functions or memory allocations in deployed code and come up with ways to fix them. ## Retrieve the docs Start with the [production profiling guide](https://developers.cloudflare.com/workers/observability/profiling-in-production/index.md) to understand how Workers and Durable Objects profiling works. ## Profiling steps 1. Identify the symptom and affected workload: CPU usage, latency, allocation pressure, or memory growth. 2. Confirm the account, Worker, environment, and deployed version with the user. 3. For a Durable Object, also confirm its owning Worker, namespace, and instance. 4. Choose CPU or heap profiling from the current guide's supported types and meanings. Where possible, use the [`cf` CLI](https://developers.cloudflare.com/cf/index.md) to capture profiles. If the user requests `cf`, inspect the installed version's command help and schema where available. If `cf` isn't available, consider prompting the user whether they would like to install it. The profiling API will return a pprof file which you can analyze directly, or using appropriate tools like Go's `pprof` utility. ## Inspect the evidence - Read the pprof file and analyse it for hotspots - Map hotspots to functions and source locations when evidence supports it; report missing symbols or source mappings. - If filenames and function names are pointing at the generated JavaScript, consider suggesting to the user to enable source maps and re-do the profiling. ## Optimise Propose the smallest code change supported by the capture which resolves the issues identified. ## Report findings Return a concise report with: - Evidence for each finding: file, function, source location, and metric with units, where available. - The smallest actionable change and how to check its effect.
© cloudflare · Apache-2.0 · cloudflare/skills