performance-analysis · autohandai — скилл для Claude Code: как установить
Инструктирует агента измерять задержки и потребление памяти до правок кода. Помогает найти узкое место с цифрами и проверить результат повторным тестом.
npx skills add autohandai/code-cli --skill performance-analysis -a claude-codeЧто делает performance-analysis
Скилл запрещает агенту оптимизировать код вслепую. Сначала ассистент фиксирует сценарий и базовую метрику: запускает замеры трижды через hyperfine или встроенные профайлеры, записывая медиану и разброс. Заодно проверяется загрузка системы: если процессор занят фоновыми задачами, сравнивать цифры бессмысленно.
Далее агент делит общее время на этапы и отделяет блокирующие ожидания сети или диска от работы CPU. Скилл заставляет искать типичные проблемы: последовательные вызовы await, повторные вычисления без кэша или запросы N+1. Набор доступных инструментов включает run_command, git_diff и поиск по коду.
Правка вносится точечно — только одно изменение с наилучшим соотношением выигрыша к риску. После этого агент снова снимает метрику, оформляет отчёт со ссылками на файл:строка и предлагает тайминг-тест или константу бюджета, чтобы регресс не повторился.
Какие задачи решает
- найти причину замедления запуска сервиса или команды
- сравнить задержки и потребление памяти до и после рефакторинга
- обнаружить скрытые запросы N+1 и лишний синхронный ввод-вывод
- зафиксировать бюджет производительности в тестах
Примеры запросов агенту
- Проанализируй, почему команда сборки стала выполняться дольше десяти секунд.
- Найди узкое место в обработке входящих вебхуков и замерь базовую задержку через hyperfine.
- Проверь потребление памяти при разборе большого файла и предложи минимальную правку.
Как установить performance-analysis
1Через Skills CLI (Vercel)
npx skills add autohandai/code-cli --skill performance-analysis -a claude-code2Вручную: положить файлы
~/.claude/skills/performance-analysis/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/performance-analysis/
1Через Skills CLI (Vercel)
npx skills add autohandai/code-cli --skill performance-analysis -a codex2Вручную: положить файлы
.agents/skills/performance-analysis/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add autohandai/code-cli --skill performance-analysis -a cursor2Вручную: положить файлы
.cursor/skills/performance-analysis/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install autohandai/code-cli performance-analysis2Вручную: положить файлы
.github/skills/performance-analysis/SKILL.md1Через Skills CLI (Vercel)
npx skills add autohandai/code-cli --skill performance-analysis -a gemini-cli2Командой платформы
gemini skills install https://github.com/autohandai/code-cli --path src/skills/builtin/performance-analysisВручную: положить файлы
.devin/skills/performance-analysis/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add autohandai/code-cli --skill performance-analysis -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о performance-analysis
Как установить performance-analysis в Claude Code?
Выполните команду npx skills add autohandai/code-cli --skill performance-analysis -a claude-code. Файл инструкции сохранится по пути ~/.claude/skills/performance-analysis/SKILL.md.
Что делает этот скилл?
Он задаёт пошаговый процесс анализа производительности с обязательными замерами до и после правок. Ассистент ищет доминирующие затраты ресурсов, меняет только одну деталь за раз и готовит отчёт с точными строками кода.
Какие утилиты нужны проекту для замеров?
Скилл опирается на инструменты, которые уже есть в репозитории или операционной системе. Это могут быть флаги --cpu-prof, замеры через hyperfine и time, снимки кучи или профилировщики бандла.
Исходный текст
SKILL.md · Apache-2.0
--- name: performance-analysis description: Measure before optimizing. Profile startup time, latency, throughput, memory, or bundle size, find the dominant cost with evidence, and propose the smallest change that moves the number. Use for "slow", "takes N seconds", "high CPU or memory", and performance regressions. allowed-tools: read_file find_grep fff_find list_tree run_command git_log git_diff file_stats --- # Analyze performance with numbers Optimizing without a measurement changes the code without changing the outcome. Every step below produces a number you can show. ## Establish the baseline 1. Define the metric and the scenario exactly: what is slow, from which event to which, on what input size, on what machine. Ask if unclear. 2. Measure it three times with the tools the project already has (timers, `--profile` flags, `time`, `hyperfine`, language profilers, `--cpu-prof`, heap snapshots, bundle analyzers). Record median and spread. 3. Record the environment: load average, CPU count, disk free, network, concurrent processes. A loaded machine invalidates comparisons. ## Find the dominant cost - Break the total into phases with timestamps or a profiler; sort by time. - Distinguish blocking waits (network, disk, subprocess, locks, timeouts) from CPU work; the fix differs. - Look for the usual shapes: sequential awaits that could be parallel, work repeated per item that could be cached, unbounded scans that need a budget, startup work that could be lazy or deferred, N+1 calls, large payloads, synchronous I/O on the main thread, retries with long timeouts. - Check what scales with input size using two sizes and compare. ## Change one thing, then measure again - Pick the change with the best ratio of expected gain to risk. State the expected gain before making it. - Re-measure the same way. Report before and after with the spread. - Add a guard so it stays fixed: a timing assertion with a generous bound, a budget constant, or a test that the work is deferred or cached. ## Report Metric, scenario, baseline, cause with file:line, change, result, and what was not addressed. If the measurement showed the suspected cause was wrong, say so.
© autohandai · Apache-2.0 · autohandai/code-cli
Похожие скиллы
Все скиллы по теме «Код-ревью и рефакторинг» →Сначала — performance-analysis от других авторов.