home / skills / jeremylongshore / claude-code-plugins-plus-skills / k6-script-generator

This skill helps you generate production-ready k6 scripts and configurations for performance testing, following best practices and validating outputs.

npx playbooks add skill jeremylongshore/claude-code-plugins-plus-skills --skill k6-script-generator

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

Files (1)
SKILL.md
2.1 KB
---
name: "k6-script-generator"
description: |
  Generate k6 script generator operations. Auto-activating skill for Performance Testing.
  Triggers on: k6 script generator, k6 script generator
  Part of the Performance Testing skill category. Use when working with k6 script generator functionality. Trigger with phrases like "k6 script generator", "k6 generator", "k6".
allowed-tools: "Read, Write, Edit, Bash(cmd:*)"
version: 1.0.0
license: MIT
author: "Jeremy Longshore <[email protected]>"
---

# K6 Script Generator

## Overview

This skill provides automated assistance for k6 script generator tasks within the Performance Testing domain.

## When to Use

This skill activates automatically when you:
- Mention "k6 script generator" in your request
- Ask about k6 script generator patterns or best practices
- Need help with performance testing skills covering load testing, stress testing, benchmarking, and performance monitoring.

## Instructions

1. Provides step-by-step guidance for k6 script generator
2. Follows industry best practices and patterns
3. Generates production-ready code and configurations
4. Validates outputs against common standards

## Examples

**Example: Basic Usage**
Request: "Help me with k6 script generator"
Result: Provides step-by-step guidance and generates appropriate configurations


## Prerequisites

- Relevant development environment configured
- Access to necessary tools and services
- Basic understanding of performance testing concepts


## Output

- Generated configurations and code
- Best practice recommendations
- Validation results


## Error Handling

| Error | Cause | Solution |
|-------|-------|----------|
| Configuration invalid | Missing required fields | Check documentation for required parameters |
| Tool not found | Dependency not installed | Install required tools per prerequisites |
| Permission denied | Insufficient access | Verify credentials and permissions |


## Resources

- Official documentation for related tools
- Best practices guides
- Community examples and tutorials

## Related Skills

Part of the **Performance Testing** skill category.
Tags: performance, load-testing, k6, jmeter, benchmarking

Overview

This skill automates generation of k6 scripts and related configurations for performance testing. It produces step-by-step guidance, production-ready code snippets, and validation checks to help you implement load, stress, and benchmark tests quickly. Use it as an assistant to accelerate k6 script creation and ensure adherence to common patterns and best practices.

How this skill works

The skill inspects your performance testing intent and required parameters (endpoints, ramp-up, VUs, thresholds, scenarios). It generates k6 JavaScript test scripts, environment configurations, and example execution commands, then runs basic validation against common standards. When asked, it also explains choices, recommends thresholds, and suggests monitoring integrations.

When to use it

  • You need a complete k6 script for an API or web endpoint quickly
  • You want guidance on scenarios, VUs, ramp-up, and thresholds
  • You need best-practice configurations for production-like load tests
  • You want validation of k6 script structure and common issues
  • You are preparing benchmarking, load, or stress test plans

Best practices

  • Define realistic scenarios that mirror production traffic patterns
  • Separate configuration (env vars, thresholds) from script logic
  • Start small and incrementally increase load while observing metrics
  • Set clear thresholds for latency, error rate, and throughput
  • Integrate k6 output with metrics and logging backends for analysis

Example use cases

  • Generate a k6 script to load test a REST API with ramp-up and teardown
  • Create a benchmarking script for an authenticated endpoint with token renewal
  • Produce a scenario-driven script that simulates multiple user journeys
  • Validate an existing k6 script for missing thresholds or bad patterns
  • Provide run commands and environment config for CI/CD integration

FAQ

What input do you need to generate a k6 script?

Provide the target endpoints, auth method, expected user flows, approximate concurrency or VU counts, duration, and any success criteria or thresholds.

Can the skill produce scripts suitable for CI pipelines?

Yes. It can output parameterized scripts, environment variable usage, and example commands to run k6 in CI with artifacts and metrics export.