Best use case
k6 is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
k6 load testing tool. Use for performance testing.
Teams using k6 should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/k6/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How k6 Compares
| Feature / Agent | k6 | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
k6 load testing tool. Use for performance testing.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# k6
k6 is a developer-centric, open-source load testing tool suitable for testing APIs, microservices, and websites. It is written in Go but you script tests in JavaScript.
## When to Use
- **API Load Testing**: The gold standard for modern API performance testing.
- **CI/CD Integration**: Very lightweight binary (or Docker), easy to gate capabilities ("fail if p95 > 500ms").
- **Developer Friendly**: Uses JS (ES6) for scripting, so backend/frontend devs can write tests.
## Quick Start
```javascript
import http from "k6/http";
import { sleep, check } from "k6";
export const options = {
vus: 10,
duration: "30s",
};
export default function () {
const res = http.get("http://test.k6.io");
check(res, {
"status was 200": (r) => r.status == 200,
});
sleep(1);
}
```
Run with `k6 run script.js`.
## Core Concepts
### Virtual Users (VUs)
Simulated users that run your script in a loop. They are concurrent but not browser-based (unless you use xk6-browser), so they are CPU efficient.
### Checks & Thresholds
- **Check**: Boolean assertion (like an assert). Doesn't fail the test, just reports pass/fail % at end.
- **Threshold**: Pass/Fail criteria for the CI pipeline.
```javascript
export const options = {
thresholds: {
http_req_duration: ["p(95)<500"], // 95% of requests must complete below 500ms
},
};
```
## Best Practices (2025)
**Do**:
- **Modularize**: Split logic into folders. k6 supports ES modules (`import { ... } from './utils.js'`).
- **Use Scenarios**: Mix different patterns (ramping up, constant arrival rate) in one test.
- **Correlate specific data**: Ensure you are not just hitting cache. Use dynamic data (random IDs).
**Don't**:
- **Don't treat it like a browser**: Standard k6 `http` does not parse HTML or execute JS on the page. It just hits endpoints. Use `k6-browser` module if you strictly need browser rendering (but it's heavier).
## References
- [k6 Documentation](https://k6.io/docs/)Related Skills
template
Expert [skill-name] assistance covering [feature 1], [feature 2], and [feature 3]. Use when [working with X], [debugging Y], or [implementing Z].
zsh
Zsh shell with oh-my-zsh. Use for terminal shell.
zed
Zed high-performance collaborative editor. Use for fast editing.
xcode
Xcode Apple development IDE with simulators. Use for iOS/macOS development.
webstorm
WebStorm JavaScript IDE with debugging. Use for web development.
webpack
Webpack module bundler with loaders and plugins. Use for bundling.
warp
Warp modern terminal with AI. Use for terminal work.
vscode
Visual Studio Code editor with extensions and debugging. Use for code editing.
vite
Vite fast build tool with HMR. Use for modern frontend builds.
visual-studio
Visual Studio IDE for Windows with debugging and profiling. Use for .NET development.
vim
Vim text editor with motions, macros, and plugins. Use for terminal editing.
turbopack
Turbopack Rust-powered bundler. Use for fast builds.