Official agent skill

K6 Test Maintenance

by grafana in grafana/skills

Maintain and improve existing k6 test scripts. An agent skill from grafana/skills.

OfficialApache-2.0Auto-check passedTesting & QA

Install K6 Test Maintenance

skills CLI
$ npx skills add grafana/skills --skill k6-test-maintenance -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install grafana/skills k6-test-maintenance --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/grafana/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/grafana-k6/k6-test-maintenance .claude/skills/k6-test-maintenance && rm -rf skills-src

Use ~/.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/

Facts

Skill name
k6-test-maintenance
GitHub stars
282
Token cost
~2.4k tokens
SKILL.md length
1,049 words
Files
3 (incl. references)
Skills in repo
51
Repo updated
First seen
Licence
Apache-2.0

At a glance

Maintain and improve existing k6 test scripts. An agent skill from grafana/skills.

  • Works in 5 steps: Threshold tightening -- adjust threshold… → Version migration -- update scripts for… → Service change adaptation -- fix tests… → …
  • The user asks to fix a failing k6 test
  • SKILL.md covers Core principle: behavior-aware…, Dependencies, Validation loop (every edit) and Documentation lookup, plus 5 more sections
  • Reaches grafana.com and jslib.k6.io

What it does

K6 Test Maintenance is an agent skill from grafana/skills, published by the product's own GitHub organization. Maintain and improve existing k6 test scripts. Covers threshold tightening based on trend data, version migration between k6 releases, auto-fixing tests when the underlying service changes, refactoring for cleanliness, and auditing scripts against current best practices from docs. Use when the user asks to fix a failing k6 test, tighten thresholds, migrate a script to a new k6 version, refactor a test, update a script after a service change, or improve a script with best practices. Trigger on phrases like "fix my…

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/verification.md` and `references/workflows.md`).

It sits in Testing & QA, covering Load testing and Refactoring. It works with Grafana. The licence is Apache-2.0.

When your agent uses it

  • The user asks to fix a failing k6 test
  • Tighten thresholds
  • Migrate a script to a new k6 version
  • Refactor a test

Example prompts

  • “fix my k6 test”
  • “tighten my thresholds”
  • “migrate to k6 v2”
  • “/k6-test-maintenance”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Threshold tightening -- adjust threshold values based on observed metrics
  2. Version migration -- update scripts for new k6 releases
  3. Service change adaptation -- fix tests when the underlying service changes
  4. Refactoring -- clean up and modernize test code
  5. Best practices audit -- check scripts against current k6 best practices

What it can do on your machine

Read from SKILL.md and the folder at commit 1ccacf2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are bash).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • grafana.com
    • jslib.k6.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

K6 Test Maintenance loads about 2.4k tokens when it runs, and up to ~6.7k if it reads all its reference files. Until then it costs about 229 tokens; SKILL.md has 1,049 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~229
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~6.7k

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.

Safety

Auto-check passed

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.

SKILL.md

The full file from grafana/skills at commit 1ccacf2, republished under its Apache-2.0 licence (© grafana). 1,049 words, ~2,424 tokens.

Download SKILL.mdSave it as .claude/skills/k6-test-maintenance/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
k6-test-maintenance
description
Maintain and improve existing k6 test scripts. Covers threshold tightening based on trend data, version migration between k6 releases, auto-fixing tests when the underlying service changes, refactoring for cleanliness, and auditing scripts against current best practices from docs. Use when the user asks to fix a failing k6 test, tighten thresholds, migrate a script to a new k6 version, refactor a test, update a script after a service change, or improve a script with best practices. Trigger on phrases like "fix my k6 test", "tighten my thresholds", "migrate to k6 v2", "update my test script", "refactor this k6 test", "my test is failing after a deploy", "apply best practices to my script", "modernize my k6 test", or "the service changed and my test broke". Also trigger when another skill (k6-trend-analysis or k6-cloud-investigate-test) hands off with a recommendation to edit a script.

k6 Test Maintenance

Maintain, fix, and improve existing k6 test scripts. Five maintenance tasks, each with a step-by-step procedure in references/workflows.md:

  1. Threshold tightening -- adjust threshold values based on observed metrics
  2. Version migration -- update scripts for new k6 releases
  3. Service change adaptation -- fix tests when the underlying service changes
  4. Refactoring -- clean up and modernize test code
  5. Best practices audit -- check scripts against current k6 best practices

Core principle: behavior-aware change control

Classify every proposed change by whether it alters the test's runtime behavior:

  • Syntactic (behavior unchanged): the k6 runtime produces identical metrics, pass/fail results, and endpoints. Examples: rename a variable, let → const, remove unused imports, update comments, reformat. Apply directly.
  • Behavioral (behavior differs): anything affecting metrics, pass/fail, timing, request targets, or load shape. Examples: threshold value changes, adding sleep(), endpoint URL updates, check rewrites, scenario changes, new thresholds. Always present as a diff with rationale and require confirmation.

The threshold for "behavioral" is deliberately low. If in doubt, treat it as behavioral and ask -- a trivial-looking threshold change can cascade to CI gates, SLO calculations, and alerting.

Dependencies

  • k6-manage -- fetch and edit GCk6-hosted scripts safely (§5: GET, backup, edit, validate, PUT, verify by sha256). Read it before touching any cloud-hosted script.
  • gcx -- sole tool for Grafana Cloud API access.
  • mcp-k6 tools -- validate_script and get_documentation. Check availability first; fall back to k6 x docs if absent.
  • k6 x docs CLI -- documentation lookup when mcp-k6 isn't configured.
  • k6 CLI -- local validation (k6 inspect, k6 run).

Validation loop (every edit)

Every workflow produces a modified script. Never present or PUT an unvalidated script -- run this loop, fixing and re-running until it passes:

  1. Parse-check: k6 inspect <script> -- catches syntax errors, invalid options, broken imports. Works on all types including browser tests (no browser needed). If mcp-k6 is available, also run validate_script.
  2. Local smoke (non-browser, service reachable): k6 run --vus 1 --iterations 1 <script>.
  3. Classify the change (below) and verify per the matrix -- recipes in references/verification.md.
  4. Cloud-hosted scripts: apply via the k6-manage §5 safe-edit recipe (GET → backup → edit → validate → PUT as application/octet-stream → sha256-verify).
Change classification
  • Class A -- declarative-config only. The diff is confined to options.thresholds or similar declarative fields that don't alter what the k6 runtime executes; the bytes inside default function, imported modules, and check predicates are byte-identical. Example: p(95)<500 → p(95)<420.
  • Class B -- runtime logic changes. Any change to default function, imports, helper modules, request URLs, check predicates, or to scenarios.*.vus/iterations/duration/executor (which alter load shape and metric distributions). Example: changing a URL, adding a check, rewriting auth, switching executors.

When in doubt, treat as Class B.

Verification matrix
ClassTest durationVerification
Aanysha256 + k6 inspect + historical pass/fail prediction. No cloud run needed.
Bshort (< 5 min)sha256 + k6 inspect + full cloud run (k6-manage §11).
Blong (≥ 5 min)sha256 + k6 inspect + local 1-iteration smoke + k6 cloud run of a local copy with --vus 1 --iterations 1. PUT to the saved test only after the cloud smoke passes.

Verification depth depends on the change class, not the test's duration -- most edits don't need a full run, and production tests may run for hours. Per-class recipes (Class A prediction table, Class B short/long, edge cases like scenario changes and loosening) are in references/verification.md.

Documentation lookup

Before proposing any change that touches k6 APIs, imports, or patterns, confirm it against current docs and cite the source in your report -- this grounds recommendations in the real API, not stale model knowledge. Look up in order:

  1. mcp-k6 (preferred): get_documentation("best_practices"), get_documentation("javascript-api/k6-browser"), validate_script(...).
  2. k6 x docs CLI (always available):
    bash
    k6 x docs using-k6 thresholds
    k6 x docs javascript-api k6-http
    k6 x docs search "websocket migration"
    2-call strategy: try the direct path first; if it returns a topic list, pick the subtopic and call again. Full parent paths required (using-k6 thresholds, not thresholds). k6 x docs serves docs for the installed k6 version -- it may lag the target version when migrating.
  3. Web fetch (last resort): https://grafana.com/docs/k6/latest/.
Show full SKILL.md (408 more words)Show less

Async check pattern

A common browser-test bug: using check() from k6 with async predicates. The built-in check() does not await Promises, so check(page, { 'title': p => p.locator('h1').textContent() === 'Foo' }) silently passes because the Promise object is truthy. Two valid fixes:

  • Async-aware check from jslib: import { check } from 'https://jslib.k6.io/k6-utils/1.5.0/index.js' -- then predicates can be async and await inside them works.
  • Resolve the value before the check: const text = await page.locator('h1').textContent(); check(text, { ... }) -- keeps the standard sync check from k6.

When you hit this during any workflow (migration, refactor, audit), flag it as a behavioral bug and propose one of these fixes.

Script sources

  • GCk6-hosted -- fetched and pushed via k6-manage §5 (GET → backup → edit → validate → PUT → verify sha256).
  • Local on disk -- read and edit directly. Validate before presenting.

Determine the source before starting: a GCk6 test URL or ID is cloud-hosted; a file path is local.

Workflows

Full procedures are in references/workflows.md:

  • Threshold tightening -- propose values with observed-metric justification, diff, apply, Class A verify.
  • Version migration -- find deprecated/renamed APIs, classify syntactic vs behavioral, apply, Class B verify.
  • Service change adaptation -- map each service change to a script change, propose fixes, Class B verify.
  • Refactoring -- find issues, auto-apply syntactic, propose behavioral, Class B verify after confirmation.
  • Best practices audit -- doc-driven audit across thresholds, load design, resource management, code quality, and browser specifics.

All five follow behavior-aware change control: auto-apply syntactic changes, present behavioral ones as diffs for confirmation.

Gotchas

IssueDetail
Cloud script formatGCk6 scripts can be single files or tar archives. Detect with file(1) before editing (see k6-manage §5).
Zero-observation thresholdsA threshold on a metric with no observations passes by default. When adding new thresholds, ensure the metric is actually emitted by the test.
abortOnFail cascadesIf a threshold has abortOnFail: true, tightening it means runs abort earlier. Warn the user.
Browser script validationBrowser scripts can't be validated with k6 run --iterations 1 without a browser. Use k6 inspect for parse-only validation, or validate_script via mcp-k6.
k6 x docs version alignmentk6 x docs serves docs for the installed k6 version; when migrating to a newer version, local docs may not reflect the target API. Note this in migration lookups.
Script drift after editAfter pushing a cloud-hosted script, the next run uses the new version, but historical runs keep their bundled snapshot. To investigate a past failure, compare the run-bundled script (read-only), not the current one.

References

© 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

Files

SKILL.md and 2 other files (references) in skills/grafana-k6/k6-test-maintenance of grafana/skills.

  • SKILL.md
  • references/verification.md
  • references/workflows.md

Open the folder on GitHubat commit 1ccacf2

Compare with similar skills

K6 Test Maintenance 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.

K6 Test Maintenance compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
K6 Test Maintenance this skillgrafana/skills282—~2.4kAutomated safety check: PassApache-2.0
Interviewgenkovich/sdd171—~3.8kAutomated safety check: PassMIT
Triage Sonarqubenetdata/netdata81k—~2.8kAutomated safety check: NotesGPL-3.0
Renovate Batch Updategrafana/quickpizza171—~3.2kAutomated safety check: PassApache-2.0
Rust Skillsnoh-rs/nohrs156—~5.3kAutomated safety check: PassMIT
Monitoring ExpertJeffallan/claude-skills12k—~1.6kAutomated safety check: PassMIT

Similar skills

  • Interview

    genkovich/sdd

    Use BEFORE roadmap or specify to get the idea OUT OF YOUR HEAD and onto disk — a Socratic interview that surfaces hidden assumptions, names tradeoffs, exposes imprecisions and proposes fresh angles…

    171 GitHub stars~3.8k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Triage Sonarqube

    netdata/netdata

    Inspect, review, or apply authorized triage decisions to SonarCloud issues and security hotspots; also review the Sonar helpers.

    81k GitHub stars~2.8k tokensUpdated today
    Testing & QAAuto-check: notes
  • Renovate Batch Update

    grafana/quickpizza

    Official

    Consolidate all open Renovate PRs on quickpizza into tested, reviewable PRs.

    171 GitHub stars~3.2k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Rust Skills

    noh-rs/nohrs

    Comprehensive Rust coding guidelines with 179 rules across 14 categories.

    156 GitHub stars~5.3k tokensUpdated 8 days ago
    DevelopmentAuto-check passed
  • Monitoring Expert

    Jeffallan/claude-skills

    Sets up application monitoring: structured logs, Prometheus metrics, OpenTelemetry tracing, Grafana dashboards, alert rules and load tests with k6 or Artillery.

    12k GitHub stars~1.6k tokensUpdated 7 days ago
    DevOps & CloudAuto-check passed
  • Verification loop for Quarkus projects: build, static analysis (Checkstyle, PMD, SpotBugs), tests with JaCoCo coverage, OWASP dependency and container security scans, GraalVM native compilation…

    276k GitHub starsUsed in 1 repo~2.7k tokens
    SecurityAuto-check passed

More from grafana/skills

All 51 skills in this repo
  • K6 Docs

    grafana/skills

    Official

    Write or review k6 documentation across the three k6 repositories - k6-DefinitelyTyped (TypeScript types), k6-docs (user documentation), and k6 (release notes / changelog).

    282 GitHub stars~678 tokensUpdated yesterday
    Auto-check passed
  • Alerting Irm

    grafana/skills

    Official

    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)…

    282 GitHub starsUsed in 1 repo~1.9k tokens
    Auto-check passed
  • Dashboarding

    grafana/skills

    Official

    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…

    282 GitHub starsUsed in 1 repo~1.4k tokens
    Auto-check passed
  • K6 Perf Test Website

    grafana/skills

    Official

    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.

    282 GitHub stars~3.3k tokensUpdated yesterday
    Auto-check passed
  • Promql

    grafana/skills

    Official

    Write, validate, and optimize PromQL for Prometheus / Grafana Mimir / Grafana Cloud Metrics.

    282 GitHub starsUsed in 1 repo~1.1k tokens
    Auto-check passed
  • Adaptive Metrics

    grafana/skills

    Official

    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…

    282 GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about K6 Test Maintenance

What does K6 Test Maintenance do?

Maintain and improve existing k6 test scripts. An agent skill from grafana/skills. K6 Test Maintenance is an agent skill from grafana/skills, published by the product's own GitHub organization. Maintain and improve existing k6 test scripts.

When should I use K6 Test Maintenance?

K6 Test Maintenance fits situations like: the user asks to fix a failing k6 test; tighten thresholds; migrate a script to a new k6 version; refactor a test.

How do I install K6 Test Maintenance in Claude Code?

Run `npx skills add grafana/skills --skill k6-test-maintenance -a claude-code`. Or copy the skill folder (skills/grafana-k6/k6-test-maintenance in grafana/skills) into .claude/skills/k6-test-maintenance in your project. Claude Code loads it when a task matches its description.

How do I install K6 Test Maintenance in Codex?

Run `npx skills add grafana/skills --skill k6-test-maintenance -a codex`. Or copy the skill folder (skills/grafana-k6/k6-test-maintenance in grafana/skills) into .agents/skills/k6-test-maintenance in your project. Codex loads it when a task matches its description.

Can I use K6 Test Maintenance in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add grafana/skills --skill k6-test-maintenance -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-test-maintenance, .gemini/skills/k6-test-maintenance, .github/skills/k6-test-maintenance and .opencode/skills/k6-test-maintenance in your project.

What does K6 Test Maintenance need to run?

SKILL.md names no scripts, command-line tools or credentials: K6 Test Maintenance is instructions for the agent only.

Does K6 Test Maintenance access the network?

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.

Is K6 Test Maintenance safe to install?

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.

What licence does K6 Test Maintenance use?

K6 Test Maintenance is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does K6 Test Maintenance use?

About 2.4k tokens (SKILL.md is roughly 9.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4.3k tokens, read only when the agent opens those files.

What are the alternatives to K6 Test Maintenance?

Skills that share tags, products or a category with K6 Test Maintenance: Interview (genkovich/sdd, 171 stars), Triage Sonarqube (netdata/netdata, 81k stars), Renovate Batch Update (grafana/quickpizza, 171 stars) and Rust Skills (noh-rs/nohrs, 156 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains K6 Test Maintenance?

grafana (a GitHub organization, an official publisher) maintains it in grafana/skills, which has 282 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.