k6-best-practices
Installation
SKILL.md
k6 Scenario Builder
Enforces a consistent, production-ready pattern for k6 load test scripts using JavaScript or TypeScript, covering HTTP/REST, WebSocket, and gRPC protocols.
Output Format
When producing or fixing a script, always deliver three things:
- A complete, runnable script file — never a partial snippet.
- The exact run command with the environment variables needed.
- A one-line explanation of the executor chosen and why it fits the load goal.
When fixing any OOM error or open() misuse, cover both failure modes — even if the user only mentioned one:
- Plain variable at init context → OOM (data copied per VU). Fix:
SharedArray. open()insidedefault()→ immediate runtime error (can't call open() in the VU context). Fix: move to init context.