Skip to content
Development
Command

/load-test

Comprehensive load testing orchestrator with intelligent scenario generation, performance baselines, and automated analysis

From plugin
claude-cmd
313180 skills180 commands

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/load-test

Context preview

What this command does when you run it.

Comprehensive load testing orchestrator with intelligent scenario generation, performance baselines, and automated analysis

Command definition

load-test.md
allowed-tools: Task, Read, Write, Edit, MultiEdit, Bash(fd:*), Bash(rg:*), Bash(jq:*), Bash(gdate:*), Bash(k6:*), Bash(artillery:*), Bash(docker:*), Bash(curl:*), Bash(eza:*), Bash(bat:*)
name: "Load Test"
description: "Comprehensive load testing orchestrator with intelligent scenario generation, performance baselines, and automated analysis"
author: "wcygan"
tags: ["test","run"]
version: "1.0.0"
created_at: "2025-07-14T00:00:00Z"
updated_at: "2025-07-14T00:00:00Z"

Context

  • Session ID: !`gdate +%s%N 2>/dev/null || date +%s%N 2>/dev/null || echo "$(date +%s)$(jot -r 1 100000 999999 2>/dev/null || shuf -i 100000-999999 -n 1 2>/dev/null || echo $RANDOM$RANDOM)"`
  • Load test target: $ARGUMENTS
  • Current directory: !`pwd`
  • Project structure: !`eza -la --tree --level=2 2>/dev/null | head -15 || fd . -t d -d 2 | head -10`
  • Technology stack: !`fd "(package\.json|Cargo\.toml|go\.mod|deno\.json|pom\.xml|build\.gradle)" . -d 3 | head -10 || echo "No build files detected"`
  • Load testing tools: !`echo "k6: $(which k6 >/dev/null && echo ✓ || echo ✗) | artillery: $(which artillery >/dev/null && echo ✓ || echo ✗) | docker: $(which docker >/dev/null && echo ✓ || echo ✗)"`
  • Existing endpoints: !`rg "(app|router|handler)\.(get|post|put|delete|patch)" --type js --type ts -m 5 2>/dev/null | head -5 || echo "No API routes detected"`
  • Running services: !`docker ps --format "table {{.Names}}\t{{.Ports}}" 2>/dev/null | head -5 || echo "No Docker services detected"`
  • Available ports: !`netstat -an 2>/dev/null | rg ":3000|:8000|:8080" | head -3 || echo "No common dev ports in use"`

Your Task

STEP 1: Initialize load testing session with intelligent context analysis

  • CREATE session state file: `/tmp/load-test-session-$SESSION_ID.json`
  • ANALYZE project structure from Context section
  • DETECT primary technology stack and frameworks
  • IDENTIFY existing load testing configurations
  • VALIDATE load testing tools availability (k6, artillery, docker are REQUIRED)
# Initialize load testing session state
echo '{
  "sessionId": "'$SESSION_ID'",
  "target": "'$ARGUMENTS'",
  "detectedFramework": "auto-detect",
  "loadTestingTool": "k6",
  "scenarioStrategy": "intelligent",
  "baselineRequired": true,
  "ciIntegration": true
}' > /tmp/load-test-session-$SESSION_ID.json

STEP 2: Intelligent target detection and analysis strategy

CASE target_type: WHEN "no_arguments":

  • EXECUTE comprehensive project analysis for API discovery
  • DETECT OpenAPI/Swagger specifications in project
  • IDENTIFY docker-compose services with exposed ports
  • PROVIDE interactive endpoint selection interface

WHEN "endpoint_url":

  • CREATE targeted load tests for specific URL endpoint
  • AUTO-DETECT authentication requirements via endpoint analysis
  • ANALYZE response patterns for realistic test scenarios
  • GENERATE endpoint-specific performance thresholds

WHEN "api_spec_file":

  • PARSE comprehensive test suite from OpenAPI/Swagger specification
  • CREATE weighted scenario distributions based on endpoint criticality
  • INCLUDE all endpoint combinations with realistic data flows
  • GENERATE full API coverage testing matrix

STEP 3: Advanced framework detection with parallel sub-agent analysis

TRY:

IF project_complexity == "enterprise" OR codebase_size > 100_files:

LAUNCH parallel sub-agents for comprehensive load testing strategy:

  • **Agent 1: Technology Stack Analysis**: Analyze project dependencies and frameworks
  • Focus: Package managers, runtime dependencies, existing test tools
  • Tools: fd for file discovery, jq for JSON parsing, rg for pattern matching
  • Output: Technology manifest with recommended load testing tools
  • **Agent 2: API Surface Discovery**: Map all available API endpoints and services
  • Focus: REST endpoints, GraphQL schemas, gRPC services, WebSocket connections
  • Tools: rg for route patterns, framework-specific endpoint detection
  • Output: Comprehensive API inventory with criticality scoring
  • **Agent 3: Performance Requirements Analysis**: Determine performance criteria and SLAs
  • Focus: Existing monitoring, performance budgets, business requirements
  • Tools: Analysis of monitoring configs, SLA documents, performance metrics
  • Output: Performance baseline requirements and threshold definitions
  • **Agent 4: Infrastructure Assessment**: Evaluate deployment and scaling characteristics
  • Focus: Container orchestration, database connections, external dependencies
  • Tools: docker-compose analysis, kubernetes manifest detection
  • Output: Infrastructure constraints and scaling considerations

ELSE:

EXECUTE streamlined framework detection:

# Detect existing load testing tools
echo "🔍 Analyzing project for load testing tools..."
fd "package.json" . | xargs jq -r '.devDependencies | keys[]?' 2>/dev/null | rg "(k6|artillery|wrk|autocannon)" || echo "No existing tools found"

# Check for load testing configurations
echo "📁 Searching for existing load test configs..."
fd "(k6|artillery|wrk)\.(js|yml|yaml|json)$" . --max-depth 3 || echo "No load test configs found"

# Analyze project language preferences for tool recommendation
project_tech=$(fd "(package\.json|Cargo\.toml|go\.mod|deno\.json)" . | head -1)
case $project_tech in
  *package.json*|*deno.json*) echo "🎯 JavaScript/TypeScript project - k6 or Artillery recommended" ;;
  *go.mod*) echo "🐹 Go project - wrk or hey recommended" ;;
  *Cargo.toml*) echo "🦀 Rust project - drill or wrk recommended" ;;
  *) echo "📊 Multi-language project - k6 recommended for versatility" ;;
esac

STEP 4: Intelligent load test generation with framework-specific optimizations

**Comprehensive API Endpoint Discovery:**

# Advanced framework-specific endpoint extraction
echo "🔍 Discovering API endpoints for load testing..."

# JavaScript/TypeScript frameworks
if fd "package\.json" . | head -1 >/dev/null; then
  echo "📡 Analyzing JavaScript/TypeScript API routes..."
  rg "(app|router|handler)\.(get|post|put|delete|patch)" --ty
Read more
Ships withclaude-cmd

A lightweight (~46kB) and comprehensive CLI tool for managing Claude commands, configurations, and workflows.

Get the whole plugin