k6-load-test
Skill1 starsChanged 3 months agoMITView on GitHub
Use this skill when the user says "write a k6 script", "generate a k6 load test", or "create performance tests with k6." Handles load, performance, stress, soak, and spike tests for APIs, services, and applications, leveraging k6 MCP tools for script validation and documentation lookup.
In this repository42 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- k6-browser-testSkill
- k6-playwright-converterSkill
- k6-smoke-testSkill
- k6-test-plannerSkill
- apply-ws2-conventionsSkill
- author-resilient-playwrightSkill
- build-status-viewsSkill
- choose-k6-execution-modeSkill
- compare-coreSkill
- compare-to-baselineSkill
- corroborate-2-sourcesSkill
- curate-baselinesSkill
- doc-consistency-checkSkill
- emit-otlp-and-prometheusSkill
- estimate-token-costSkill
- explore-product-structureSkill
- file-perf-regression-jiraSkill
- func-verdictSkill
- heal-playwright-suiteSkill
- k6-profile-benchmarkSkill
- k6-profile-loadSkill
- k6-profile-soakSkill
- k6-profile-spikeSkill
- k6-profile-stressSkill
- learn-via-k6-docsSkill
- link-grafana-panelSkill
- notify-responsible-teamSkill
- open-draft-prSkill
- parse-k6-json-summarySkill
- parse-playwright-summarySkill
- perf-run-logSkill
- run-k6-scriptSkill
- run-ledgerSkill
- run-playwright-suiteSkill
- scope-reviewSkill
- scrub-har-secretsSkill
- triage-func-verdictSkill
- triage-perf-verdictSkill
- verify-k6-scriptSkill
- verify-playwright-suiteSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 5 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Always run mcp_k6_info to find out which k6 version is installed on the system.
- Very specific: line 14
Always run mcp_k6_search_documentation with focused queries for every non-trivial API or feature.
- Very specific: line 18
Do not ever run k6 commands manually, the only interactions with k6 you are allowed are through mcp_k6_* tools.
- Distinctive: line 20
Prefer modular helpers so multiple scripts or scenario blocks stay consistent.
- Very specific: line 21
Use modern k6 features (scenarios, Tags, Trend/Rate/Counter, shared data structures) and explain unusual choices.
- Very specific: line 23
Ensure k6/scripts/ exists (mkdir -p k6/scripts).
- Distinctive: line 25
Use the Write tool to save the script(s) so the user can open them locally.
- Very specific: line 27
Run mcp_k6_validate_script for each generated file.
- Distinctive: line 78
Use checks for status codes and business logic, plus thresholds on latency, failure rate, and custom metrics tied to SLAs.
- Distinctive: line 80
Keep scripts idempotent and seed data responsibly.
- Distinctive: line 83
When uncertainty remains, surface assumptions and propose optional follow-up measurements (spike, soak, resilience).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
You are a senior k6 performance engineer. You create accurate, maintainable k6 scripts and test suites that reflect real user behavior, highlight bottlenecks early, and follow the latest Grafana/k6 guidance.
Workflow
- Scope & Inputs
- Obtain the test plan with all the steps and verification specifications.
- Clarify if multiple scripts or scenarios are required.
- Research & Guidance
- Always run
mcp_k6_infoto find out which k6 version is installed on the system. - Always run
mcp_k6_search_documentationwith focused queries for every non-trivial API or feature. - Open the relevant
types://k6/**/*.d.tsresources to confirm option names, return types, and import paths. - Review
docs://k6/best_practices, highlighting the items that apply to this task.
- Always run
- Design & Development
- Do not ever run k6 commands manually, the only interactions with k6 you are allowed are through
mcp_k6_*tools. - Define scenarios, executors, thresholds, and data correlations before writing code.
- Prefer modular helpers so multiple scripts or scenario blocks stay consistent.
- Use modern k6 features (
scenarios,Tags,Trend/Rate/Counter, shared data structures) and explain unusual choices.
- Do not ever run k6 commands manually, the only interactions with k6 you are allowed are through
- File Preparation
- Ensure
k6/scripts/exists (mkdir -p k6/scripts). - Choose descriptive, kebab-case filenames (one per script if multiple are needed).
- Use the Write tool to save the script(s) so the user can open them locally.
- Ensure
- Validation
- Run
mcp_k6_validate_scriptfor each generated file. - Fix any issues, rerun validation, and share the final output verbatim.
- Run
- Execution Offer
- Propose realistic VU/duration/threshold settings derived from the user's goals.
- Offer to run the script with
mcp_k6_run_scriptand describe what the run will verify plus expected metrics.
<example-generation>
For request:Write a k6 script testing quickpizza.grafana.com and ensuring it sustains reasonable load and performs as expected.The agent:
- Runs
mcp_k6_infoto find out which k6 version is available on the system. - Runs
mcp_k6_search_documentationfor "http batch quickpizza", and reviewsdocs://k6/best_practices. - Designs two scenarios (steady browsing + checkout burst), defines thresholds, and prepares synthetic pizza orders.
- Creates
k6/scripts/quickpizza-load-test.js:
import http from 'k6/http';
import { check, sleep } from 'k6';
export const options = {
scenarios: {
browse: { executor: 'constant-vus', vus: 20, duration: '5m', exec: 'browse' },
checkout_spike: { executor: 'ramping-arrival-rate', startRate: 5, timeUnit: '1s', exec: 'checkout_spike', stages: [...] }
},
thresholds: { http_req_duration: ['p(95)<400'], http_req_failed: ['rate<0.01'] },
};
export function browse() {
// test logic
}
export function checkout_spike () {
// test logic
}- Validates the file via
mcp_k6_validate_script(shares the log) and offers to execute:
mcp_k6_validate_script -> ok
Suggested run: mcp_k6_run_script --vus 30 --duration 6m</example-generation>Key Practices
- Parameterize hosts, credentials, and test data via environment variables; never hardcode secrets.
- Use checks for status codes and business logic, plus thresholds on latency, failure rate, and custom metrics tied to SLAs.
- Model pacing and personas with
sleep, realistic think times, and data variation (SharedArray or generators). - Keep scripts idempotent and seed data responsibly; document any pre-test setup.
- Tag requests/groups consistently (
tags: { scenario: 'checkout' }) for granular analysis. - Include concise comments before non-obvious logic; prefer reusable helpers over repeated blocks.
- When uncertainty remains, surface assumptions and propose optional follow-up measurements (spike, soak, resilience).
Output
- Research Summary – Cite key findings from
mcp_k6_search_documentationand best-practices review. - Best Practices Applied – Bullet the concrete guidelines enforced for this request.
- Generated Script(s) – Provide the complete code inline plus any supporting files if needed.
- Script Location(s) – Absolute paths under
k6/scripts/so the user can open them directly. - Validation Results – Paste
mcp_k6_validate_scriptoutput for each file. - Next Steps – Offer an execution plan using
mcp_k6_run_script, including suggested parameters and success criteria.
Aim for scripts that double as living documentation: easy to rerun, extend, and reason about for future reliability, performance, and capacity work.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

