Write Tests
grafana/synthetic-monitoring-app
Write Jest integration and unit tests for the Grafana Synthetic Monitoring app using React Testing Library, MSW, and src/test helpers.
Generate, validate, and review k6 test scripts — load, stress, spike, soak, smoke, breakpoint, functional, and protocol.
$ npx skills add grafana/skills --skill k6 -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install grafana/skills k6 --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/grafana/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/grafana-k6/k6 .claude/skills/k6 && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "k6" agent skill from https://github.com/grafana/skills/tree/main/skills/grafana-k6/k6 into .claude/skills/k6/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "k6", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/grafana/skills/tree/main/skills/grafana-k6/k6Type this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add grafana/skills --skill k6 -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install grafana/skills k6 --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/grafana/skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/grafana-k6/k6 .agents/skills/k6 && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "k6" agent skill from https://github.com/grafana/skills/tree/main/skills/grafana-k6/k6 into .agents/skills/k6/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "k6", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add grafana/skills --skill k6 -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install grafana/skills k6 --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/grafana/skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/grafana-k6/k6 .cursor/skills/k6 && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "k6" agent skill from https://github.com/grafana/skills/tree/main/skills/grafana-k6/k6 into .cursor/skills/k6/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "k6", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/grafana/skills.git --path skills/grafana-k6/k6--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add grafana/skills --skill k6 -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install grafana/skills k6 --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/grafana/skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/grafana-k6/k6 .gemini/skills/k6 && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "k6" agent skill from https://github.com/grafana/skills/tree/main/skills/grafana-k6/k6 into .gemini/skills/k6/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "k6", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install grafana/skills k6Installs for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add grafana/skills --skill k6 -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/grafana/skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/grafana-k6/k6 .github/skills/k6 && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "k6" agent skill from https://github.com/grafana/skills/tree/main/skills/grafana-k6/k6 into .github/skills/k6/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "k6", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add grafana/skills --skill k6 -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install grafana/skills k6 --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/grafana/skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/grafana-k6/k6 .opencode/skills/k6 && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "k6" agent skill from https://github.com/grafana/skills/tree/main/skills/grafana-k6/k6 into .opencode/skills/k6/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "k6", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
k6Generate, validate, and review k6 test scripts — load, stress, spike, soak, smoke, breakpoint, functional, and protocol.
K6 is an agent skill from grafana/skills, published by the product's own GitHub organization. Generate, validate, and review k6 test scripts — load, stress, spike, soak, smoke, breakpoint, functional, and protocol. Covers HTTP, WebSocket, gRPC, browser, all executors, thresholds, checks, custom metrics, the k6-testing library, k6 Cloud execution, and the xk6 extension ecosystem; uses the xk6-docs CLI (with grafana.com web fallback) for docs lookup and validates every script by running it. Use when writing, generating, validating, or debugging any k6 or load-test script (including plain-language asks like…
Its SKILL.md is about 3.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 22 other files (for example `SETUP.md`, `browser-best-practices.md` and `docs-guidance.md`).
It sits in Testing & QA, covering Load testing. It works with Grafana, gRPC and Testing Library. The licence is Apache-2.0.
8 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 1ccacf2. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships script files (JavaScript, from the files we listed), which the agent can run.
From the folder's file list and the shell code blocks in SKILL.md.
Hosts in commands or code, which the agent is likely to contact:
grafana.comjslib.k6.ioFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
K6 loads about 3.1k tokens when it runs. Until then it costs about 183 tokens; SKILL.md has 1,443 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from grafana/skills at commit 1ccacf2, republished under its Apache-2.0 licence (© grafana). 1,443 words, ~3,106 tokens.
.claude/skills/k6/SKILL.md (or your agent's skills folder). This skill also uses 21 other files; get the full folder from GitHub.Efficiency note: This is a short linear recipe (read example → adapt → save → validate → review). A todo list would just mirror the headings without adding value, so skip the planning overhead and execute the steps directly.
Agent-agnostic: The steps below describe capabilities, not specific tools. Where a step says "fetch a URL" or "write a file", use whatever your agent provides for that capability (e.g. a web-fetch tool, a file-write tool, or shell
curl/tee).
Read only the file that matches the user's request. Examples provide structural scaffolding — the correct scaffold, option shapes, and import patterns.
| User needs | Read this file |
|---|---|
| HTTP REST, auth flow, batch requests | examples/http.js |
| HTML parsing with parseHTML, SharedArray | examples/html.js |
| WebSocket | examples/websocket.js |
| gRPC | examples/grpc.js |
| Browser automation | examples/browser.js |
Browser + functional test / expect() / k6-testing | examples/functional.js (browser scenario) |
Functional/integration tests, expect(), k6-testing | examples/functional.js |
| Custom metrics, execution module, handleSummary, per-vu-iterations | examples/metrics.js |
| Load patterns, all executors (ramping, arrival rate, per-VU, etc.) | examples/executors.js |
Cloud run, --local-execution, cloud options | examples/cloud.js |
| Crypto (HMAC, MD5, SHA256) or encoding (base64) | examples/crypto-encoding.js |
| xk6-faker | examples/ext-faker.js |
| xk6-redis | examples/ext-redis.js |
| xk6-sql / sqlite3 / postgres | examples/ext-sql.js |
| xk6-exec | examples/ext-exec.js |
| xk6-dns | examples/ext-dns.js |
| xk6-tls | examples/ext-tls.js |
| xk6-tcp | examples/ext-tcp.js |
| xk6-crawler | examples/ext-crawler.js |
Example files live in the examples/ directory alongside this SKILL.md.
When the request matches multiple rows (e.g. "browser" + "functional test"), prefer the row whose assertion style fits the intent. If the user says "functional test", "assert", "verify", or "expect", use functional.js even if the test involves a browser — it demonstrates expect() with auto-retrying browser matchers. Use browser.js for browser load/performance tests that don't emphasize correctness assertions.
Use the loaded example as the starting point. Adapt it to the user's exact requirements:
{ ... }, // TODO, or stubssleep() calls, additional endpoints, or options the user didn't request. Unrequested complexity lowers quality and reduces adherence to the spec.For multi-scenario scripts (browser + HTTP, cloud): use named scenarios with exec pointing to separate exported functions.
The example covers common patterns. Adapt from it directly. Skip this step entirely if the example provides everything you need.
Only reach for docs if:
When a gap exists, first establish the docs command (one-time per session).
The k6 x docs CLI renders content only when it detects a TTY. Since agents
run non-interactively, wrap every call with script to allocate a pseudo-TTY
and pipe the ANSI-stripped content to stdout:
# Detect OS once (macOS vs Linux have different `script` flags):
if [[ "$(uname -s)" == "Darwin" ]]; then
DOCS_CMD="script -q /dev/null k6 x docs"
else
DOCS_CMD="script -qc 'k6 x docs' /dev/null"
fi
# Verify it works — should print a topic list, NOT a "browse files" guide:
$DOCS_CMD 2>/dev/null | head -5If the output still shows "k6 documentation is a directory of markdown files",
the TTY wrapper isn't working. Fall back to web docs under
https://grafana.com/docs/k6/latest/ — fetch pages with whatever web-fetch
capability your agent has (a built-in fetch tool, or curl in a shell).
If k6 x docs fails outright (command not found, provisioning or 404 errors),
read SETUP.md — it covers auto-provisioning on k6 v1.7.0+ and the manual
xk6 build for older versions.
Then look up what you need:
$DOCS_CMD <path> # e.g. javascript-api k6-http
$DOCS_CMD <path> --depth 2
$DOCS_CMD search <term>Common CLI paths and the 2-call strategy are in docs-guidance.md.
Do not use unpkg, @types/k6, or any npm type definition URLs.
Line 1 of every script must be a generated-by comment. Get the current UTC timestamp first (the file content depends on it, so this can't be parallelized with the write):
date -u +%Y-%m-%dT%H:%M:%SZThen include it as line 1:
// Generated by grafana-k6 on 2026-03-25T22:02:20.203ZSave to k6/scripts/<descriptive-name>.js. Use lowercase kebab-case filenames. If your file-write capability doesn't create parent directories automatically, mkdir -p k6/scripts first.
The script file on disk is the deliverable — always write it. Never end the task with the script shown only in chat: Steps 5–7 (validate, review, present) all require the file to exist at k6/scripts/<name>.js. If a write fails, retry it before continuing.
Match top-down — the first matching row wins:
| Script type | Command |
|---|---|
Imports k6/browser | k6 run k6/scripts/<name>.js |
Any ramping-vus or *-arrival-rate scenario | k6 inspect k6/scripts/<name>.js — a full run would execute the entire load profile against the target |
Other named executor: blocks (short scenarios) | k6 run k6/scripts/<name>.js |
| Everything else (HTTP, WS, gRPC) | k6 run --vus 1 --iterations 1 k6/scripts/<name>.js |
What counts as passing: for functional and browser scripts, validation passes only when the exit code is 0 and the summary shows no failed checks or expect() errors — a script that completes with failing assertions is not validated. k6's error output names the exact locator or assertion that failed (and what it waited for); use it to fix the selector or logic. For load tests, exit code 0 is a pass, and a pure threshold breach under load (exit code 99) is acceptable.
If validation fails: read stderr, fix the root cause, retry up to 3 attempts. After 3 failures, present the error and ask the user how to proceed (or, when running unattended, deliver the best attempt and clearly report the unresolved error).
Review the script against the rules below. The checklist is authoritative — only look up docs ($DOCS_CMD best-practices or https://grafana.com/docs/k6/latest/using-k6/) if you're uncertain about a specific rule.
export const options with realistic VUs/duration. Default VUs/durations make the test meaningful out of the box.thresholds for every load test. Without thresholds the run can't fail in CI even when performance regresses, which defeats the point of running a load test. At minimum include http_req_duration and http_req_failed (or the protocol equivalent). Pure functional tests — single-iteration expect()-only scripts — can skip this.sleep() in closed-model (VU-based) load tests. sleep() represents user think time; without it, VUs hammer endpoints faster than any real user would, inflating throughput and crowding out the system under test. This applies to VU-based HTTP, WebSocket, gRPC, crypto, and extension scripts. Open-model executors (constant-arrival-rate, ramping-arrival-rate) already pace iterations to a target rate, so sleep() there is usually unnecessary — it only ties up VUs without changing the offered load. Browser scripts use page.waitForTimeout() instead; single-iteration functional tests and one-shot connectivity/demo scripts can skip it. In event-driven WebSocket scripts, put the sleep() inside the close handler (see examples/websocket.js) — sleeping in the main function body blocks the event loop before any messages arrive.expect() from k6-testing — it auto-retries against locators and replaces waitFor() + isVisible() + check() chains. If you need a metric-tracked check() inside an async browser function, the standard check from k6 works fine as long as the predicate is synchronous — await the value first, then check it. Only reach for the k6-utils wrapper (https://jslib.k6.io/k6-utils/1.5.0/index.js) when the predicate itself must await something: a bare async predicate returns a Promise, which is always truthy, so the check silently passes. HTTP/gRPC/WS scripts: use check() for metric-tracked assertions, or expect() for functional tests. Silent failures are worse than loud ones.try/finally with page.close() in finally, so pages clean up even when assertions throw.try/finally and call client.close() in the finally block, so the connection is released even when a check throws mid-iteration.JSON.parse of incoming messages in try/catch — servers can send non-JSON frames, and one bad frame shouldn't kill the VU.let/var at top level — use const, since module-scope state is shared across VUs and mutability there is almost always a bug.k6/websockets for WebSockets; both k6/ws and k6/experimental/websockets are deprecated.ramping-arrival-rate) so the request rate is independent of how slow the system gets; a closed model (ramping-vus) throttles itself as latency rises and masks the breaking point. Pair thresholds with abortOnFail: true and a short delayAbortEval so the run stops (and reports) once an SLO is crossed.Trend), an error Rate, and any domain counters — plus a handleSummary that surfaces p95/p99, throughput (req/s), and error rate. See examples/executors.js and examples/metrics.js.try/catch and record failures to a custom error metric instead of letting an expect() throw — a single flaky browser iteration must not abort a long protocol load run.If the script imports k6/browser, read browser-best-practices.md and apply all checks. Fix issues and re-validate.
k6 run --vus 10 --duration 30s k6/scripts/api-load-test.js
k6 run k6/scripts/browser-test.js
k6 cloud run k6/scripts/cloud-test.js
k6 cloud run --local-execution k6/scripts/hybrid-test.js
./k6-with-faker run k6/scripts/faker-test.js
K6_BROWSER_HEADLESS=true k6 run k6/scripts/browser-test.jsIf the user confirms, run the command.
© grafana, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 21 other files in skills/grafana-k6/k6 of grafana/skills.
Open the folder on GitHubat commit 1ccacf2
K6 next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| K6 this skillgrafana/skills | 281 | — | ~3.1k | Automated safety check: Pass | Apache-2.0 | |
| Write Testsgrafana/synthetic-monitoring-app | 171 | — | ~1.2k | Automated safety check: Pass | AGPL-3.0 | |
| Test CommanderEliasOulkadi/shokunin | 114 | — | ~3k | Automated safety check: Notes | MIT | |
| Nestjs Features Performanceaiskillstore/marketplace | 430 | — | ~3.8k | Automated safety check: Pass | MIT | |
| Renovate Batch Updategrafana/quickpizza | 171 | — | ~3.2k | Automated safety check: Pass | Apache-2.0 | |
| Monitoring ExpertJeffallan/claude-skills | 12k | — | ~1.6k | Automated safety check: Pass | MIT |
grafana/synthetic-monitoring-app
Write Jest integration and unit tests for the Grafana Synthetic Monitoring app using React Testing Library, MSW, and src/test helpers.
EliasOulkadi/shokunin
Generate unit, integration, E2E, and visual regression tests following the Testing Trophy methodology (80% integration).
aiskillstore/marketplace
Selects and implements NestJS runtime features, error and API contracts, security, testing, DevOps, performance, and safe scale.
grafana/quickpizza
Consolidate all open Renovate PRs on quickpizza into tested, reviewable PRs.
Jeffallan/claude-skills
Sets up application monitoring: structured logs, Prometheus metrics, OpenTelemetry tracing, Grafana dashboards, alert rules and load tests with k6 or Artillery.
jeremylongshore/tons-of-skills-marketplace
Load test and scale Vercel deployments with concurrency tuning and capacity planning.
grafana/skills
Write or review k6 documentation across the three k6 repositories - k6-DefinitelyTyped (TypeScript types), k6-docs (user documentation), and k6 (release notes / changelog).
grafana/skills
Configure Grafana Alerting, Incident Response Management (IRM), and SLOs end-to-end — provisions Grafana-managed and data-source-managed alert rules, contact points (Slack/PagerDuty/email/webhook)…
grafana/skills
Build, modify, and ship Grafana dashboards as JSON via the HTTP API — panel types (timeseries / stat / gauge / table / heatmap / logs / traces / node-graph), gridPos 24-column layout, units…
grafana/skills
A skill your agent uses when the user wants to performance-test, load-test, or stress-test a public website end-to-end with k6.
grafana/skills
Write, validate, and optimize PromQL for Prometheus / Grafana Mimir / Grafana Cloud Metrics.
grafana/skills
Cut Grafana Cloud Metrics cost by shrinking active-series count with Adaptive Metrics aggregation rules — auto-recommendations from query history, custom exact/regex rules, label-drop config…
Works with
Categories
Generate, validate, and review k6 test scripts — load, stress, spike, soak, smoke, breakpoint, functional, and protocol. K6 is an agent skill from grafana/skills, published by the product's own GitHub organization. Generate, validate, and review k6 test scripts — load, stress, spike, soak, smoke, breakpoint, functional, and protocol.
K6 fits situations like: debugging any k6; load-test script (including plain-language asks like load test this API; stress test my service); choosing executors/scenarios.
Run `npx skills add grafana/skills --skill k6 -a claude-code`. Or copy the skill folder (skills/grafana-k6/k6 in grafana/skills) into .claude/skills/k6 in your project. Claude Code loads it when a task matches its description.
Run `npx skills add grafana/skills --skill k6 -a codex`. Or copy the skill folder (skills/grafana-k6/k6 in grafana/skills) into .agents/skills/k6 in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add grafana/skills --skill k6 -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/k6, .gemini/skills/k6, .github/skills/k6 and .opencode/skills/k6 in your project.
Going by SKILL.md and its folder, K6 needs JavaScript for the scripts in its folder. Our summary lists: Node.js.
SKILL.md names 2 domains. In commands or code: grafana.com and jslib.k6.io; the agent is likely to contact these when it follows the instructions. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
K6 is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.1k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with K6: Write Tests (grafana/synthetic-monitoring-app, 171 stars), Test Commander (EliasOulkadi/shokunin, 114 stars), Nestjs Features Performance (aiskillstore/marketplace, 430 stars) and Renovate Batch Update (grafana/quickpizza, 171 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
grafana (a GitHub organization, an official publisher) maintains it in grafana/skills, which has 281 GitHub stars. The repository holds 51 skills in this directory. The repository was last updated on October 8, 2026.
Source: grafana/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.