Generated banner for K6 Docs
Generated logo for K6 Docs

K6 Docs

Grafana LabsOfficialPublished by Grafana Labs

  • Skill
  • Content generator
  • Cloud and DevOps
  • Apache-2.0
  • Low risk
  • Has scripts

From the author

Write or review k6 documentation across the three k6 repositories - k6-DefinitelyTyped (TypeScript types), k6-docs (user documentation), and k6 (release notes / changelog). Applies k6 doc style conventions, generates TypeScript type definitions, drafts release notes, and validates examples by running them against k6@master. Use when working on k6 documentation, the k6 changelog, the k6 release notes, k6 API reference, k6 TypeScript types, load testing docs, or when the user asks to write, edit, or review anything in the k6, k6-docs, or k6-DefinitelyTyped repos - even if they don't explicitly say "documentation".
— the description by Grafana Labs

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

The k6-docs skill provides a structured approach to managing documentation across the k6 ecosystem. It ensures that user-facing documentation, TypeScript type definitions, and release notes remain accurate and synchronized with the k6 codebase. The skill enforces strict quality standards, including mandatory validation of all code examples against the current k6 master branch and visual verification of rendered documentation using browser-based tools.

What it does

  • Drafts and reviews user documentation for k6 features
  • Generates and maintains TypeScript type definitions
  • Drafts release notes and changelogs for new versions
  • Validates code examples by executing them against k6@master
  • Verifies documentation rendering and link integrity
  • Applies consistent style conventions across all documentation

When to use it

  • When updating or creating k6 API reference documentation
  • When drafting release notes for a new k6 version
  • When modifying TypeScript type definitions for k6
  • When reviewing documentation changes for accuracy and style
  • When verifying that code examples in documentation are functional

Advantages

  • Ensures all documentation code examples are tested and functional
  • Maintains consistency across multiple repositories
  • Prevents broken links and rendering issues through automated checks
  • Automates the validation of TypeScript types
  • Provides a clear, repeatable workflow for documentation maintenance

Usage examples

“Review the new documentation for the k6 browser module.”
The agent will check the documentation against the style guide, verify all links, and run the included code examples against k6@master.
“Generate the release notes for the latest k6 update.”
The agent will draft the release notes, ensuring all mentioned features are documented and examples are validated.
“Update the TypeScript types for the k6 HTTP module.”
The agent will update the type definitions and run tests to ensure they are compatible with the current k6 implementation.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/grafana/k6-docs/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip k6-docs.zip -d .agents/skills

Documentation by Grafana Labs

k6 Documentation

Document or review k6 features across three repositories: k6-DefinitelyTyped (TypeScript types), k6-docs (user documentation), and k6 (release notes).

Workflow

Pick the workflow that matches the user's intent:

Quick References

Critical Rules

  • Never push automatically - always ask first

  • Never chain commands with && or ; - run each command separately (prevents failures)

  • Only document user-facing features - not internal implementation

  • Use 1. for every numbered list item (not 1., 2., 3.)

  • Test every code example against k6@master before committing

  • No Co-Authored-By: Claude or AI attribution in commits

Validating examples (always run before committing)

Every code example in k6 documentation and release notes must execute cleanly against k6@master. The minimum loop:

# 1. cd into the k6 repo (not k6-docs or k6-DefinitelyTyped)
cd ~/path/to/k6

# 2. Make sure you're on master at the latest commit (the contract is k6@master)
#    First check for local work: if this prints anything, stop and ask the user before switching branches
git status --porcelain
git checkout master
git pull

# 3. Run each example as a separate command (no &&)
go run . run /path/to/script.js

If the run fails: read the error, fix the example in the source (doc or release note), re-run. Do not commit a change whose example doesn't run clean against current master. For the full multi-example workflow with parallel subagents, see references/testing-workflow.md.

Files

references/workflows/write.md

Write Documentation Workflow

Document k6 features across three repositories: k6-DefinitelyTyped (TypeScript types), k6-docs (user documentation), and k6 (release notes).

Before Starting

Ask the user for clarification if not already specified:

  1. PR or branch? - Is there a PR number to fetch with gh pr checkout <PR>, or should you check out a branch directly?

  2. Which release? - What milestone/version is this for? (e.g., v1.5.0)

    • Release branches are named release-X.X.0 or release-vX.X.0

    • This format is used in both k6 and k6-DefinitelyTyped repositories

    • If documenting from a PR, use the PR's milestone when it exists to decide which doc version(s) get the change.

  3. Repository paths? - Where are the repositories located? Auto-detect from pwd or ask user.

Setup

  • Determine absolute paths to repos before running commands

  • For PR number: First cd /absolute/path/to/repo, then gh pr checkout <PR> (separate commands)

  • For branch name: Use ${CLAUDE_PLUGIN_ROOT}/skills/k6-docs/scripts/find_branch.sh

  • k6 must be on master branch for testing examples

  • Never chain commands with && or ; - run separately

Workflow

Create tasks for each documentation type requested, and handle them using parallel subagents.

1. User Documentation (k6-docs)

Base branch: main (k6-docs always branches from main, targeting docs/sources/k6/next/ for upcoming releases)

Branch name: add/<feature-name> (e.g., add/page-waitForEvent)

Steps:

  1. Create docs/sources/k6/next/javascript-api/<module>/<feature>.md

  2. Use User documentation template

  3. Update docs/sources/k6/next/javascript-api/<module>/_index.md table

  4. Add bidirectional cross-links to related methods (alphabetically sorted)

Test (REQUIRED):

# Start local server
cd k6-docs
npm install
npm start  # Runs at http://localhost:3002

Then follow Documentation checklist:

  • Validate ALL links (git diff + grep + curl pipeline)

  • Visual verification with agent-browser

  • Test ALL examples with k6@master (see Testing workflow)

Commit format:

docs: add <module>.<feature> documentation

Adds documentation for <brief description>.

Related: grafana/k6#<PR_NUMBER>

Example: docs: add browser.page.waitForEvent documentation

Note: Related: grafana/k6#1234 format creates bidirectional GitHub links between repositories.

2. TypeScript Definitions (k6-DefinitelyTyped)

Base branch: release-X.X.0 (TypeScript branches from release branch because types are published per k6 version)

Branch name: add/<feature-name> (e.g., add/page-waitForEvent)

Steps:

  1. Identify the interface (Page, HTTP, etc.) - see Repository structure guide

  2. Add method signature to types/k6/<module>/index.d.ts - see TypeScript patterns

  3. Add type tests to types/k6/test/<module>.ts

  4. Format: ${CLAUDE_PLUGIN_ROOT}/skills/k6-docs/scripts/format_typescript.sh

Test (REQUIRED):

cd k6-DefinitelyTyped
pnpm install -w --filter "{./types/k6}..."
pnpm test k6

See TypeScript checklist for full validation.

Commit format:

<module>: add TypeScript definitions for <feature>

<Brief description of what was added>

Related: grafana/k6#<PR_NUMBER>

Example: browser: add TypeScript definitions for page.waitForEvent

Using Playwright Documentation as Reference

For browser module only: k6-browser's API is based on Playwright. Always reference official Playwright documentation to ensure API signatures, parameters, and patterns match established conventions.

# Search for Playwright documentation
WebSearch: "playwright page.waitForEvent documentation"

# Fetch specific Playwright docs page
WebFetch: url="https://playwright.dev/docs/api/class-page#page-wait-for-event"
         prompt="Explain the page.waitForEvent method parameters and usage"

Note: k6-browser may have slight differences from Playwright (e.g., different default timeouts, missing features). Always verify the actual k6 implementation, but use Playwright docs as your baseline reference.

3. Release Notes (k6)

Branch: release-X.X.0 or release-vX.X.0 (same repository, use existing release branch)

Steps:

  1. Edit release notes/v{VERSION}.md

  2. Use Release notes template

  3. Check PR commits for external contributors - see k6 team members list

    • Follow the 3-step identification process

    • Remember: Git shows real names, not GitHub handles

    • If team list is outdated, run ${CLAUDE_PLUGIN_ROOT}/skills/k6-docs/scripts/update_team_members.sh to refresh

  4. Thank external contributors: Thanks, @username for your contribution! 🎉

Test examples (REQUIRED):

Release note examples do NOT need <!-- md-k6:skip --> markers (they demonstrate features, not runnable tests). However, you should still verify they're syntactically correct and follow k6 patterns.

Commit format:

release notes: add <feature> to vX.X.0

Documents the new <feature> that allows <brief description>.

Related: #<PR_NUMBER>

Example: release notes: add page.waitForEvent to v1.5.0

Note: Related: #1234 format (without repo prefix) because this is in the same repository as the PR.

Verification

After completing all three, use Review workflow to validate the work.

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs a command-line tool

Security

What our scanner noticed· Low risk

  • Instructions that use the network
  • Scripts that your agent may run

This skill includes scripts that your agent may run. Read them before you use it.

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Grafana Labs
Publisher
Grafana Labs (Official)
Source
grafana/skills · skills/grafana-k6/k6-docs · commit 8fb72a5
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Grafana Labs.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download k6-docs.zip