К основному содержанию
команда

system-behavior-simulator — команда для Claude Code

Команда помогает смоделировать поведение системы под нагрузкой, оценить узкие места и спланировать ёмкость. Пригодится для разбора целевых метрик и сценариев трафика.

Установить в Claude Code · Через claude-code-templates Все способы и платформы ↓
npx claude-code-templates@latest --command performance/system-behavior-simulator
Открыть на GitHub

Что делает system-behavior-simulator

Команда собирает модель системы: её компонентов, связей между ними, профилей нагрузки и метрик производительности. Она рассматривает задержки, пропускную способность, использование ресурсов и ошибки, а также сценарии стрессовой и отказоустойчивой проверки.

Чтобы начать, нужно описать архитектуру, цели по производительности, ожидаемый трафик и ограничения ресурсов. Если контекста не хватает, команда задаёт вопросы о типе системы и целевых показателях. Без этих вводных оценка будет опираться на неполную картину.

Запрос задаётся через $ARGUMENTS. Модель может охватывать веб-приложения, API, базы данных и микросервисы; среди сценариев есть постепенный рост трафика, резкие пики и сбои компонентов.

Какие задачи решает

  • смоделировать рост нагрузки на API
  • найти узкое место в архитектуре системы
  • оценить пропускную способность и задержки
  • подготовить сценарий проверки отказа компонента

Примеры запросов агенту

  • Смоделируй нагрузку на наш API и покажи возможные узкие места.
  • Оцени, как система поведёт себя при резком росте трафика.
  • Составь сценарий проверки восстановления после сбоя базы данных.

Как установить system-behavior-simulator

1Через claude-code-templates

npx claude-code-templates@latest --command performance/system-behavior-simulator

2Вручную: положить файлы

.claude/commands/system-behavior-simulator.md

Вызов — /system-behavior-simulator. Для всех проектов — ~/.claude/commands/

Вопросы о system-behavior-simulator

Как установить system-behavior-simulator в Claude Code?

Выполните npx claude-code-templates@latest --command performance/system-behavior-simulator. Файл команды находится по пути .claude/commands/system-behavior-simulator.md.

Что делает system-behavior-simulator?

Команда моделирует компоненты системы и нагрузку, затем помогает оценить производительность, узкие места и потребность в ресурсах.

Что нужно сообщить команде для симуляции?

Опишите архитектуру, целевые показатели, ожидаемый профиль нагрузки и ограничения инфраструктуры. Если этих сведений не хватает, команда запросит уточнения.

Исходный текст

system-behavior-simulator.md · MIT
---
description: "Simulate system performance under various loads with capacity planning, bottleneck identification, and optimization strategies."
---

# System Behavior Simulator

Simulate system performance under various loads with capacity planning, bottleneck identification, and optimization strategies.

## Instructions

You are tasked with creating comprehensive system behavior simulations to predict performance, identify bottlenecks, and optimize capacity planning. Follow this approach: **$ARGUMENTS**

### 1. Prerequisites Assessment

**Critical System Context Validation:**

- **System Architecture**: What type of system are you simulating behavior for?
- **Performance Goals**: What are the target performance metrics and SLAs?
- **Load Characteristics**: What are the expected usage patterns and traffic profiles?
- **Resource Constraints**: What infrastructure and budget limitations apply?
- **Optimization Objectives**: What aspects of performance are most critical to optimize?

**If context is unclear, guide systematically:**

```
Missing System Architecture:
"What type of system needs behavior simulation?
- Web Application: User-facing application with HTTP traffic patterns
- API Service: Backend service with programmatic access patterns
- Data Processing: Batch or stream processing with throughput requirements
- Database System: Data storage and query processing optimization
- Microservices: Distributed system with inter-service communication

Please specify system components, technology stack, and deployment architecture."

Missing Performance Goals:
"What performance objectives need to be met?
- Response Time: Target latency for user requests (p50, p95, p99)
- Throughput: Requests per second or transactions per minute
- Availability: Uptime targets and fault tolerance requirements
- Scalability: User growth and load handling capabilities
- Resource Efficiency: CPU, memory, storage, and network optimization"
```

### 2. System Architecture Modeling

**Systematically map system components and interactions:**

#### Component Architecture Framework
```
System Component Mapping:

Application Layer:
- Frontend Components: User interfaces, single-page applications, mobile apps
- Application Services: Business logic, workflow processing, API endpoints
- Background Services: Scheduled jobs, message processing, batch operations
- Integration Services: External API calls, webhook handling, data synchronization

Data Layer:
- Primary Databases: Transactional data storage and query processing
- Cache Systems: Redis, Memcached, CDN, and application-level caching
- Message Queues: Asynchronous communication and event processing
- Search Systems: Elasticsearch, Solr, or database search capabilities

Infrastructure Layer:
- Load Balancers: Traffic distribution and health checking
- Web Servers: HTTP request handling and static content serving
- Application Servers: Dynamic content generation and business logic
- Network Components: Firewalls, VPNs, and traffic routing
```

#### Interaction Pattern Modeling
```
System Interaction Analysis:

Synchronous Interactions:
- Request-Response: Direct API calls and database queries
- Service Mesh: Inter-service communication with service discovery
- Database Transactions: ACID compliance and locking mechanisms
- External API Calls: Third-party service dependencies and timeouts

Asynchronous Interactions:
- Message Queues: Pub/sub patterns and event-driven processing
- Event Streams: Real-time data processing and analytics
- Background Jobs: Scheduled tasks and delayed processing
- Webhooks: External system notifications and callbacks

Data Flow Patterns:
- Read Patterns: Query optimization and caching strategies
- Write Patterns: Data ingestion and consistency management
- Batch Processing: ETL operations and data pipeline processing
- Real-time Processing: Stream processing and live analytics
```

### 3. Load Modeling Framework

**Create realistic traffic and usage pattern simulations:**

#### Traffic Pattern Analysis
```
Load Characteristics Modeling:

User Behavior Patterns:
- Daily Patterns: Peak hours, lunch dips, overnight minimums
- Weekly Patterns: Weekday vs weekend usage variations
- Seasonal Patterns: Holiday traffic, business cycle fluctuations
- Event-Driven Spikes: Marketing campaigns, viral content, news events

Request Distribution:
- Geographic Distribution: Multi-region traffic and latency patterns
- Device Distribution: Mobile vs desktop vs API usage patterns
- Feature Distribution: Popular vs niche feature usage ratios
- User Type Distribution: New vs returning vs power user behaviors

Load Volume Scaling:
- Concurrent Users: Simultaneous active sessions and request patterns
- Request Rate: Transactions per second with burst capabilities
- Data Volume: Payload sizes and data transfer requirements
- Connection Patterns: Session duration and connection pooling
```

#### Synthetic Load Generation
```
Load Testing Scenario Framework:

Baseline Load Testing:
- Normal Traffic: Typical daily usage patterns and request volumes
- Sustained Load: Constant traffic over extended periods
- Gradual Ramp: Slow traffic increase to identify scaling points
- Steady State: Stable load for performance baseline establishment

Stress Testing:
- Peak Load: Maximum expected traffic during busy periods
- Capacity Testing: System limits and breaking point identification
- Spike Testing: Sudden traffic increases and recovery behavior
- Volume Testing: Large data sets and high-throughput scenarios

Resilience Testing:
- Failure Scenarios: Component outages and degraded service behavior
- Recovery Testing: System restoration and performance recovery
- Chaos Engineering: Random failure injection and system adaptation
- Disaster Simulation: Major outage scenarios and business continuity
```

### 4. Performance Modeling Engine

**Create comprehensive system performance predictions:**

#### Performance Metric Framework
```
Multi-Dimensional Performance Analysis:

Response Time Metrics:
- Request Latency: End-to-end response time measurement
- Processing Time: Application logic execution duration
- Database Query Time: Data access and retrieval performance
- Network Latency: Communication overhead and bandwidth utilization

Throughput Metrics:
- Requests per Second: HTTP request handling capacity
- Transactions per Minute: Business operation completion rate
- Data Processing Rate: Batch job and stream processing throughput
- Concurrent User Capacity: Simultaneous session handling capability

Resource Utilization Metrics:
- CPU Usage: Processing power consumption and efficiency
- Memory Usage: RAM allocation and garbage collection impact
- Storage I/O: Disk read/write performance and capacity
- Network Bandwidth: Data transfer rates and congestion management

Quality Metrics:
- Error Rates: Failed requests and transaction failures
- Availability: System uptime and service reliability
- Consistency: Data integrity and transaction isolation
- Security: Authentication, authorization, and data protection overhead
```

#### Performance Prediction Modeling
```
Predictive Performance Framework:

Analytical Models:
- Queueing Theory: Wait time and service rate mathematical modeling
- Little's Law: Relationship between concurrency, throughput, and latency
- Capacity Planning: Resource requirement forecasting and optimization
- Bottleneck Analysis: System constraint identification and resolution

Simulation Models:
- Discrete Event Simulation: System behavior modeling with event queues
- Monte Carlo Simulation: Probabilistic performance outcome analysis
- Load Testing Data: Historical performance pattern extrapolation
- Machine Learning: Pattern recognition and predictive analytics

Hybrid Models:
- Analytical + Empirical: Mathematical models calibrated with real data
- Multi-Layer Modeling: Component-level models aggregated to system level
- Dynamic Adaptation: Models that adjust based on real-time performance
- Scenario-Based: Different models for different load and usage patterns
```

### 5. Bottleneck Identification System

**Systematically identify and analyze performance constraints:**

#### Bottleneck Detection Framework
```
Performance Constraint Analysis:

CPU Bottlenecks:
- High CPU Utilization: Processing-intensive operations and algorithms
- Thread Contention: Locking and synchronization overhead
- Context Switching: Excessive thread creation and management
- Inefficient Algorithms: Poor time complexity and optimization opportunities

Memory Bottlenecks:
- Memory Leaks: Gradual memory consumption and garbage collection pressure
- Large Object Allocation: Memory-intensive operations and caching strategies
- Memory Fragmentation: Allocation patterns and memory pool management
- Cache Misses: Application and database cache effectiveness

I/O Bottlenecks:
- Database Performance: Query optimization and index effectiveness
- Disk I/O: Storage access patterns and disk performance limits
- Network I/O: Bandwidth limitations and latency optimization
- External Dependencies: Third-party service response times and reliability

Application Bottlenecks:
- Blocking Operations: Synchronous calls and thread pool exhaustion
- Inefficient Code: Poor algorithms and unnecessary processing
- Resource Contention: Shared resource access and locking mechanisms
- Configuration Issues: Suboptimal settings and parameter tuning
```

#### Root Cause Analysis
- Performance profiling and trace analysis
- Correlation analysis between metrics and bottlenecks
- Historical pattern recognition and trend analysis
- Comparative analysis across different system configurations

### 6. Optimization Strategy Generation

**Create systematic performance improvement approaches:**

#### Performance Optimization Framework
```
Multi-Level Optimization Strategies:

Code-Level Optimizations:
- Algorithm Optimization: Improved time and space complexity
- Database Query Optimization: Index usage and query plan improvement
- Caching Strategies: Application, database, and CDN caching
- Asynchronous Processing: Non-blocking operations and parallelization

Architecture-Level Optimizations:
- Horizontal Scaling: Load distribution across multiple instances
- Vertical Scaling: Resource allocation and capacity increases
- Caching Layers: Multi-tier caching and cache invalidation strategies
- Database Sharding: Data partitioning and distributed storage

Infrastructure-Level Optimizations:
- Auto-Scaling: Dynamic resource allocation based on demand
- Load Balancing: Traffic distribution and health checking optimization
- CDN Implementation: Geographic content distribution and edge caching
- Network Optimization: Bandwidth allocation and latency reduction

System-Level Optimizations:
- Monitoring and Alerting: Performance visibility and proactive issue detection
- Capacity Planning: Resource forecasting and growth accommodation
- Disaster Recovery: Backup strategies and failover mechanisms
- Security Optimization: Performance-aware security implementation
```

#### Cost-Benefit Analysis
- Performance improvement quantification and measurement
- Infrastructure cost implications and budget optimization
- Development effort estimation and resource allocation
- ROI calculation for different optimization strategies

### 7. Capacity Planning Integration

**Connect performance insights to infrastructure and resource planning:**

#### Capacity Planning Framework
```
Systematic Capacity Management:

Growth Projection:
- User Growth: Customer acquisition and usage pattern evolution
- Data Growth: Storage requirements and processing volume increases
- Feature Growth: New capabilities and functionality impacts
- Geographic Growth: Multi-region expansion and latency requirements

Resource Forecasting:
- Compute Resources: CPU, memory, and processing power requirements
- Storage Resources: Database, file system, and backup capacity needs
- Network Resources: Bandwidth, connectivity, and latency optimization
- Human Resources: Team scaling and expertise development needs

Scaling Strategy:
- Horizontal Scaling: Instance multiplication and load distribution
- Vertical Scaling: Resource enhancement and capacity increases
- Auto-Scaling: Dynamic adjustment based on real-time demand
- Manual Scaling: Planned capacity increases and maintenance windows

Cost Optimization:
- Reserved Capacity: Long-term resource commitment and cost savings
- Spot Instances: Variable pricing and cost-effective temporary capacity
- Right-Sizing: Optimal resource allocation and waste elimination
- Multi-Cloud: Provider comparison and cost arbitrage opportunities
```

### 8. Output Generation and Recommendations

**Present simulation insights in actionable performance optimization format:**

```
## System Behavior Simulation: [System Name]

### Performance Summary
- Current Capacity: [baseline performance metrics]
- Bottleneck Analysis: [primary performance constraints identified]
- Optimization Potential: [improvement opportunities and expected gains]
- Scaling Requirements: [resource needs for growth accommodation]

### Load Testing Results

| Scenario | Throughput | Latency (p95) | Error Rate | Resource Usage |
|----------|------------|---------------|------------|----------------|
| Normal Load | 500 RPS | 200ms | 0.1% | 60% CPU |
| Peak Load | 1000 RPS | 800ms | 2.5% | 85% CPU |
| Stress Test | 1500 RPS | 2000ms | 15% | 95% CPU |

### Bottleneck Analysis
- Primary Bottleneck: [most limiting performance factor]
- Secondary Bottlenecks: [additional constraints affecting performance]
- Cascade Effects: [how bottlenecks impact other system components]
- Resolution Priority: [recommended order of bottleneck addressing]

### Optimization Recommendations

#### Immediate Optimizations (0-30 days):
- Quick Wins: [low-effort, high-impact improvements]
- Configuration Tuning: [parameter adjustments and settings optimization]
- Query Optimization: [database and application query improvements]
- Caching Implementation: [strategic caching layer additions]

#### Medium-term Optimizations (1-6 months):
- Architecture Changes: [structural improvements and scaling strategies]
- Infrastructure Upgrades: [hardware and platform enhancements]
- Code Refactoring: [application optimization and efficiency improvements]
- Monitoring Enhancement: [observability and alerting system improvements]

#### Long-term Optimizations (6+ months):
- Technology Migration: [platform or framework modernization]
- System Redesign: [fundamental architecture improvements]
- Capacity Expansion: [infrastructure scaling and geographic distribution]
- Innovation Integration: [new technology adoption and competitive advantage]

### Capacity Planning
- Current Capacity: [existing system limits and headroom]
- Growth Accommodation: [resource scaling for projected demand]
- Cost Implications: [budget requirements for capacity increases]
- Timeline Requirements: [implementation schedule for capacity improvements]

### Monitoring and Alerting Strategy
- Key Performance Indicators: [critical metrics for ongoing monitoring]
- Alert Thresholds: [performance degradation warning levels]
- Escalation Procedures: [response protocols for performance issues]
- Regular Review Schedule: [ongoing optimization and capacity assessment]
```

### 9. Continuous Performance Learning

**Establish ongoing simulation refinement and system optimization:**

#### Performance Validation
- Real-world performance comparison to simulation predictions
- Optimization effectiveness measurement and validation
- User experience correlation with system performance metrics
- Business impact assessment of performance improvements

#### Model Enhancement
- Simulation accuracy improvement based on actual system behavior
- Load pattern refinement and user behavior modeling
- Bottleneck prediction enhancement and early warning systems
- Optimization strategy effectiveness tracking and improvement

## Usage Examples

```bash
# Web application performance simulation
/performance:system-behavior-simulator Simulate e-commerce platform performance under Black Friday traffic with 10x normal load

# API service scaling analysis
/performance:system-behavior-simulator Model REST API performance for mobile app with 1M+ daily active users and geographic distribution

# Database performance optimization
/performance:system-behavior-simulator Simulate database performance for analytics workload with real-time reporting requirements

# Microservices capacity planning
/performance:system-behavior-simulator Model microservices mesh performance under various failure scenarios and auto-scaling conditions
```

## Quality Indicators

- **Green**: Comprehensive load modeling, validated bottleneck analysis, quantified optimization strategies
- **Yellow**: Good load coverage, basic bottleneck identification, estimated optimization benefits
- **Red**: Limited load scenarios, unvalidated bottlenecks, qualitative-only optimization suggestions

## Common Pitfalls to Avoid

- Load unrealism: Testing with artificial patterns that don't match real usage
- Bottleneck tunnel vision: Focusing on single constraints while ignoring others
- Optimization premature: Optimizing for problems that don't exist yet
- Capacity under-planning: Not accounting for growth and traffic spikes
- Monitoring blindness: Not establishing ongoing performance visibility
- Cost ignorance: Optimizing performance without considering budget constraints

Transform system performance from reactive firefighting into proactive, data-driven optimization through comprehensive behavior simulation and capacity planning.

© davila7 · MIT · davila7/claude-code-templates

Похожие слэш-команды

Каталог слэш-команд →
code-review официальный Anthropic Команда проводит многоэтапное ревью pull request через утилиту gh. Она фильтрует ложные срабатывания и сверяет правки с правилами CLAUDE.md. 5 537установок commit официальный Anthropic Создаёт коммит в git на основе текущих изменений в ветке. Помогает зафиксировать правки без ручного набора сообщений коммита. 4 121установок feature-dev официальный Anthropic Сопровождает разработку новой функции: изучает кодовую базу, задаёт вопросы, предлагает архитектуру и ждёт подтверждения перед реализацией. 179установок security-hardening Seth Hobson Команда проводит аудит безопасности по этапам: сканирует уязвимости, строит threat model и проверяет архитектуру. Подходит для поэтапного hardening проекта. CX Codex 437установок status Seth Hobson Показывает состояние проекта Conductor, активные треки и следующие действия. Нужна, когда важно увидеть прогресс по задачам и блокеры. CX Codex 348установок status официальный Vercel Labs Проверяет состояние проекта Vercel, последние деплои, домены и настройки наблюдаемости прямо через диалог с моделью. CX Codex GP ChatGPT 348установок

Из того же набора651

Весь набор →
game-testing-framework Команда помогает спроектировать и внедрить тестирование игрового проекта: от проверок логики и загрузки сцен до бенчмарков и CI. Пригодится, когда нужно собрать тесты в единую систему. 219установок setup-cdn-optimization Слэш-команда разбирает трафик и типы контента, затем настраивает CDN: кэш, сжатие, картинки, инвалидацию. 218установок marp-slide Собирает слайды Marp из вашего текста и сразу выбирает оформление под тему: техно, бизнес, минимализм или тёмный фон. Полезно, когда нужна презентация, а не разметка. 217установок discord-notifications Отправляет сообщение в Discord, когда Claude закончил работу или завершил субагента. Пригодится, если вы уходите от терминала и хотите знать, что задача готова. 217установок gemini-review Команда выгружает комментарии Gemini Code Assist из пулреквеста на GitHub, расставляет приоритеты и формирует список задач для Claude Code. 217установок angular Скилл помогает разрабатывать Angular v20+ через Signals, standalone-компоненты и современные реактивные паттерны. Пригодится для новых приложений и постепенной миграции. 216установок bash-linux Справочник по Bash для macOS и Linux: связки команд, работа с файлами и процессами, обработка ошибок. Нужен, когда агент правит скрипты или разбирается с логами. 215установок spreadsheet Скилл для работы с таблицами: собирает книги с формулами, правит готовые файлы, считает метрики и строит графики. Пригодится, когда формулы и оформление надо сохранить. 214установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой