home / skills / laurigates / claude-plugins / configure-load-tests

This skill helps you set up and audit load testing with k6, Artillery, or Locust, enabling CI, thresholds, and reporting.

npx playbooks add skill laurigates/claude-plugins --skill configure-load-tests

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
6.9 KB
---
model: haiku
created: 2025-12-16
modified: 2026-02-10
reviewed: 2025-12-16
description: Check and configure load and performance testing with k6, Artillery, or Locust
allowed-tools: Glob, Grep, Read, Write, Edit, Bash, AskUserQuestion, TodoWrite
argument-hint: "[--check-only] [--fix] [--framework <k6|artillery|locust>]"
name: configure-load-tests
---

# /configure:load-tests

Check and configure load and performance testing infrastructure for stress testing, benchmarking, and capacity planning.

## When to Use This Skill

| Use this skill when... | Use another approach when... |
|------------------------|------------------------------|
| Setting up load testing infrastructure from scratch (k6, Artillery, Locust) | Running existing load tests — use `k6 run` or `artillery run` directly |
| Auditing current load testing coverage (smoke, stress, spike, soak) | Writing unit or integration tests — use `/configure:tests` |
| Adding CI/CD pipelines for performance regression detection | Profiling application memory usage — use `/configure:memory-profiling` |
| Migrating between load testing frameworks | Benchmarking individual functions — use language-specific benchmark tools |
| Ensuring load test thresholds and reporting are properly configured | Testing API contracts — use `/configure:api-tests` |

## Context

- Project root: !`pwd`
- k6 tests: !`find . -maxdepth 3 \( -name '*.k6.js' -o -name '*.k6.ts' \) 2>/dev/null`
- Load test directory: !`find . -maxdepth 2 -type d -name 'load' 2>/dev/null`
- Artillery config: !`find . -maxdepth 2 -name 'artillery.yml' -o -name 'artillery.yaml' 2>/dev/null`
- Locust files: !`find . -maxdepth 2 -name 'locustfile.py' 2>/dev/null`
- Package files: !`find . -maxdepth 1 \( -name 'package.json' -o -name 'pyproject.toml' \) 2>/dev/null`
- CI workflows: !`find .github/workflows -maxdepth 1 -name '*load*' -o -name '*perf*' 2>/dev/null`
- k6 binary: !`command -v k6 2>/dev/null`

## Parameters

Parse from `$ARGUMENTS`:

- `--check-only`: Report load testing compliance status without modifications
- `--fix`: Apply all fixes automatically without prompting
- `--framework <k6|artillery|locust>`: Override framework detection

**Framework preferences:**

| Framework | Best For |
|-----------|----------|
| k6 (recommended) | Complex scenarios, CI/CD integration, TypeScript support |
| Artillery | Quick YAML configs, simple API testing |
| Locust | Python teams, distributed testing, custom behavior |

## Execution

Execute this load testing configuration check:

### Step 1: Detect existing load testing infrastructure

Read the context values above and identify:

| Indicator | Component | Status |
|-----------|-----------|--------|
| `k6` binary or `@grafana/k6` | k6 | Installed |
| `*.k6.js` or `load-tests/` | k6 tests | Present |
| `artillery.yml` | Artillery config | Present |
| `locustfile.py` | Locust tests | Present |
| `.github/workflows/*load*` | CI integration | Configured |

If `--framework` flag is set, use that framework regardless of detection.

### Step 2: Analyze current load testing setup

Check for complete setup coverage:

**Installation:** k6 installed (binary or npm), TypeScript support if applicable.

**Test Scenarios:** Check which test types exist:
- Smoke tests (minimal load validation)
- Load tests (normal load)
- Stress tests (peak load)
- Spike tests (burst traffic)
- Soak tests (endurance)

**Configuration:** Thresholds, environment-specific configs, data files.

**Reporting:** Console output, JSON/HTML reports, trend tracking.

**CI/CD:** GitHub Actions workflow, scheduled runs, PR gate.

### Step 3: Generate compliance report

Print a compliance report covering:
- Framework installation status and version
- Test scenario coverage (smoke, load, stress, spike, soak)
- Threshold configuration (response time, error rate)
- Environment configuration (staging, production)
- CI/CD integration (workflow, schedule, PR gate)
- Reporting setup (console, JSON, HTML, Grafana Cloud)

End with overall issue count and recommendations.

If `--check-only` is set, stop here.

### Step 4: Configure load testing framework (if --fix or user confirms)

Apply configuration using templates from [REFERENCE.md](REFERENCE.md):

1. Install k6 (or chosen framework)
2. Create directory structure: `tests/load/{config,scenarios,helpers,data}`
3. Create base configuration with shared thresholds and headers
4. Create test scenarios (smoke, load, stress, spike)
5. Add npm/package scripts for running tests

### Step 5: Configure CI/CD integration

1. Create `.github/workflows/load-tests.yml` with:
   - Smoke tests on PRs
   - Full load tests via workflow_dispatch
   - Scheduled weekly runs
   - Results artifact upload
2. Add HTML reporting via k6-reporter
3. Use templates from [REFERENCE.md](REFERENCE.md)

### Step 6: Update standards tracking

Update `.project-standards.yaml`:

```yaml
components:
  load_tests: "2025.1"
  load_tests_framework: "k6"
  load_tests_scenarios: ["smoke", "load", "stress"]
  load_tests_ci: true
  load_tests_thresholds: true
```

### Step 7: Print final compliance report

Print a summary of framework installed, scenarios created, scripts added, CI/CD configured, thresholds set, and next steps for the user.

For detailed k6 test scripts, CI workflow templates, and reporting configuration, see [REFERENCE.md](REFERENCE.md).

## Agentic Optimizations

| Context | Command |
|---------|---------|
| Quick compliance check | `/configure:load-tests --check-only` |
| Auto-fix all issues | `/configure:load-tests --fix` |
| Run smoke test quickly | `k6 run --vus 1 --duration 10s tests/load/scenarios/smoke.k6.js` |
| Run with JSON output | `k6 run --out json=results.json tests/load/scenarios/load.k6.js` |
| Check k6 version | `k6 version` |
| List test scenarios | `find tests/load -name '*.k6.js' -type f` |

## Flags

| Flag | Description |
|------|-------------|
| `--check-only` | Report status without offering fixes |
| `--fix` | Apply all fixes automatically without prompting |
| `--framework <framework>` | Override framework (k6, artillery, locust) |

## Examples

```bash
# Check compliance and offer fixes
/configure:load-tests

# Check only, no modifications
/configure:load-tests --check-only

# Auto-fix all issues
/configure:load-tests --fix

# Force specific framework
/configure:load-tests --fix --framework artillery
```

## Error Handling

- **k6 not installed**: Provide installation instructions for platform
- **No target URL**: Prompt for BASE_URL configuration
- **Docker not available**: Suggest local app startup
- **CI secrets missing**: Provide setup instructions for k6 Cloud

## See Also

- `/configure:tests` - Unit testing configuration
- `/configure:integration-tests` - Integration testing
- `/configure:api-tests` - API contract testing
- `/configure:all` - Run all compliance checks
- **k6 documentation**: https://k6.io/docs
- **k6 examples**: https://github.com/grafana/k6/tree/master/examples
- **Grafana k6 Cloud**: https://grafana.com/products/cloud/k6

Overview

This skill checks and configures load and performance testing infrastructure using k6, Artillery, or Locust. It audits existing tests, verifies CI/CD integration and reporting, and can scaffold missing components and workflows to meet baseline standards. Use it to ensure repeatable load testing for benchmarking, capacity planning, and performance regression detection.

How this skill works

The skill scans the repository for k6, Artillery, or Locust indicators, inspects test scenario coverage (smoke, load, stress, spike, soak), and validates installation, thresholds, environment configs, and reporting. It generates a compliance report listing missing items and recommendations. If instructed with --fix, it scaffolds directories, baseline scenarios, package scripts, and a GitHub Actions workflow for scheduled and PR-based runs.

When to use it

  • Setting up load testing from scratch or migrating frameworks
  • Auditing load test coverage and threshold configuration
  • Adding CI/CD gates and scheduled performance runs
  • Creating standard reporting and trend tracking for performance
  • Enabling a repeatable baseline for capacity planning

Best practices

  • Prefer k6 for CI integration and TypeScript support; choose Artillery or Locust based on team language and needs
  • Include smoke, load, stress, spike, and soak scenarios to cover basic failure modes
  • Define clear thresholds (response time, error rate) and enforce them in CI PR gates
  • Store environment-specific configs and secrets outside test code; use CI secrets for credentials
  • Produce machine-readable reports (JSON/HTML) and export to a dashboard for trend analysis

Example use cases

  • Run a repository audit to see which load scenarios exist and where gaps are
  • Auto-generate tests/load structure and base k6 scenarios with --fix
  • Add a GitHub Actions load-tests.yml that runs smoke checks on PRs and full tests on schedule
  • Switch a team from Artillery to k6 and migrate key test scenarios and CI steps
  • Create consistent reporting artifacts for upload to build artifacts or Grafana Cloud

FAQ

What does --check-only do?

It runs the full analysis and prints a compliance report without making any changes.

Can I force a specific framework?

Yes. Use --framework k6|artillery|locust to override automatic detection and scaffold for that framework.

Will --fix overwrite existing tests?

The --fix flow creates missing directories and baseline files. It avoids overwriting existing tests but may update CI and package scripts; review changes in a commit.