performance-audit — команда для Claude Code: запуск и шаги
Запускает аудит быстродействия кодовой базы: ищет медленные запросы к базе данных, оценивает сложность циклов и проверяет сборку. Помогает составить план оптимизаций.
npx claude-code-templates@latest --command performance/performance-auditЧто делает performance-audit
Команда запускает проверку проекта по одиннадцати направлениям. Сначала агент собирает контекст через терминал: запускает анализ сборки через npm run build -- --analyze, замеряет время выполнения и смотрит список зависимостей. Если в проекте нет npm-скриптов или конфигов вроде vite.config.js или next.config.js, часть первичных замеров завершится заглушками.
Затем модель прочёсывает код. Она ищет алгоритмы сложности O(n²), утечки памяти в UI-компонентах и проблему N+1 в запросах к базе данных. Итоговый отчёт включает точные пути к файлам и номера строк. Вы сразу видите, какие изменения дадут наибольший выигрыш при минимальных усилиях.
Какие задачи решает
- Найти неэффективные алгоритмы с вложенными циклами и операциями O(n²)
- Выявить проблему N+1 и медленные запросы к базам данных
- Замерить длительность сборки и размер бандла приложения
- Найти утечки памяти в коде интерфейса и серверной части
Примеры запросов агенту
- /performance-audit --frontend
- /performance-audit --backend
- /performance-audit src/api --full
Как установить performance-audit
1Через claude-code-templates
npx claude-code-templates@latest --command performance/performance-audit2Вручную: положить файлы
.claude/commands/performance-audit.mdВызов — /performance-audit. Для всех проектов — ~/.claude/commands/
Вручную: положить файлы
~/.codex/prompts/performance-audit.mdВызов — /prompts:performance-audit. В Codex этот формат помечен устаревшим, замена — скиллы
Вручную: положить файлы
.github/prompts/performance-audit.prompt.mdВручную: положить файлы
.gemini/commands/performance-audit.tomlGemini хранит команды в TOML: текст запроса — в поле prompt
Из того же набора205
Весь набор →Похожие
Рядом в теме «Код-ревью и рефакторинг»
Все слэш-команды по теме «Код-ревью и рефакторинг» →Вопросы о performance-audit
Как установить performance-audit в Claude Code?
Запустите npx claude-code-templates@latest --command performance/performance-audit в корне проекта. Либо сохраните шаблон вручную в файл .claude/commands/performance-audit.md.
Что делает команда performance-audit?
Она пошагово анализирует проект на узкие места: проверяет время сборки, алгоритмы, нагрузку на сеть и запросы к базе данных. В конце агент формирует отчёт с указанием файлов и номеров строк.
Какие аргументы поддерживает команда?
Вы можете передать область проверки флагами --frontend, --backend или --full. Также допустимо указать относительный путь к каталогу, чтобы проверить отдельную часть проекта.
Исходный текст
performance-audit.md · MIT
---
allowed-tools: Read, Bash, Grep, Glob
argument-hint: "[target-area] | --frontend | --backend | --full"
description: Comprehensive performance audit with metrics, bottleneck identification, and optimization recommendations
---
# Performance Audit
Conduct comprehensive performance audit: $ARGUMENTS
## Current Performance Context
- Bundle analysis: !`npm run build -- --analyze 2>/dev/null || echo "No build analyzer"`
- Dependencies: !`npm list --depth=0 --prod 2>/dev/null | head -10`
- Build time: !`time npm run build >/dev/null 2>&1 || echo "No build script"`
- Performance config: @webpack.config.js or @vite.config.js or @next.config.js (if exists)
## Task
Conduct comprehensive performance audit following these steps:
1. **Technology Stack Analysis**
- Identify the primary language, framework, and runtime environment
- Review build tools and optimization configurations
- Check for performance monitoring tools already in place
2. **Code Performance Analysis**
- Identify inefficient algorithms and data structures
- Look for nested loops and O(n²) operations
- Check for unnecessary computations and redundant operations
- Review memory allocation patterns and potential leaks
3. **Database Performance**
- Analyze database queries for efficiency
- Check for missing indexes and slow queries
- Review connection pooling and database configuration
- Identify N+1 query problems and excessive database calls
4. **Frontend Performance (if applicable)**
- Analyze bundle size and chunk optimization
- Check for unused code and dependencies
- Review image optimization and lazy loading
- Examine render performance and re-render cycles
- Check for memory leaks in UI components
5. **Network Performance**
- Review API call patterns and caching strategies
- Check for unnecessary network requests
- Analyze payload sizes and compression
- Examine CDN usage and static asset optimization
6. **Asynchronous Operations**
- Review async/await usage and promise handling
- Check for blocking operations and race conditions
- Analyze task queuing and background processing
- Identify opportunities for parallel execution
7. **Memory Usage**
- Check for memory leaks and excessive memory consumption
- Review garbage collection patterns
- Analyze object lifecycle and cleanup
- Identify large objects and unnecessary data retention
8. **Build & Deployment Performance**
- Analyze build times and optimization opportunities
- Review dependency bundling and tree shaking
- Check for development vs production optimizations
- Examine deployment pipeline efficiency
9. **Performance Monitoring**
- Check existing performance metrics and monitoring
- Identify key performance indicators (KPIs) to track
- Review alerting and performance thresholds
- Suggest performance testing strategies
10. **Benchmarking & Profiling**
- Run performance profiling tools appropriate for the stack
- Create benchmarks for critical code paths
- Measure before and after optimization impact
- Document performance baselines
11. **Optimization Recommendations**
- Prioritize optimizations by impact and effort
- Provide specific code examples and alternatives
- Suggest architectural improvements for scalability
- Recommend appropriate performance tools and libraries
Include specific file paths, line numbers, and measurable metrics where possible. Focus on high-impact, low-effort optimizations first.
© davila7 · MIT · davila7/claude-code-templates