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://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/checklists/documentation.md

User Documentation Checklist

Front Matter

  • [ ] title matches method signature format

  • [ ] description is accurate

Parameters Table

  • [ ] All parameters documented with Type, Default, Description

  • [ ] Required params marked as "Required."

Returns Section

  • [ ] Return type is accurate

  • [ ] Description is clear

Examples

REQUIRED: Test ALL examples with k6@master. See Testing workflow for complete procedure.

# Extract example from docs
# Write to /tmp/test-example.js
# Then run:
cd /path/to/k6
go run . run /tmp/test-example.js

Checklist:

  • [ ] Code is complete and runnable

  • [ ] Includes proper imports

  • [ ] Non-runnable code has <!-- md-k6:skip --> comment

  • [ ] All runnable examples tested with k6@master

  • [ ] All examples pass without errors

  • [ ] Examples use generic URLs (not localhost or hardcoded paths)

Best Practices

  • [ ] Uses 1. for ALL numbered list items (not 1., 2., 3.)

  • [ ] Helpful and actionable

  • [ ] Links sorted ALPHABETICALLY

  • [ ] Bidirectional links exist (if A links to B, B links to A)

REQUIRED: Validate ALL added links using this procedure:

cd k6-docs
git diff main -- docs/sources/k6/next/ | grep '^\+' | grep -oE 'https://grafana\.com/docs/k6/<K6_VERSION>/[^)\"]+' | sed 's/<K6_VERSION>/next/g' | sort -u

This extracts only YOUR added links, not pre-existing ones.

For each URL from step 1, replace https://grafana.com with http://localhost:3002 and verify:

# Check multiple links at once
for url in \
  "/docs/k6/next/javascript-api/k6-browser/page/waitforevent/" \
  "/docs/k6/next/javascript-api/k6-browser/request/"
do
  echo "$(curl -s -o /dev/null -w '%{http_code}' http://localhost:3002$url) $url"
done

All links must return 200. Any 404 is a broken link that must be fixed.

Common link issues:

  • Wrong casing: consolemessage vs console-message

  • Missing hyphens: browsercontext vs browser-context

  • Wrong path: Check actual file/folder names in docs directory

Step 4: Re-validate After Fixes

Run validation again to ensure all links return 200.

Checklist:

  • [ ] All links extracted with git diff pipeline

  • [ ] Each link checked with curl against localhost:3002

  • [ ] All links return 200 (no 404s)

  • [ ] Broken links fixed and re-validated

Visual Verification

REQUIRED: Use agent-browser to verify rendering. Screenshots catch issues HTTP 200 status cannot detect.

When reviewing screenshots, verify ALL seven criteria:

  1. No 404 errors - Page content renders, not an error page

  2. Parameters table - All columns visible (Parameter, Type, Default, Description)

  3. Code blocks - Syntax highlighting applied (colored keywords)

  4. Navigation - Breadcrumbs show correct path (e.g., "k6 > JavaScript API > k6-browser > Page > waitForEvent")

  5. Related links section - Links are styled and clickable

  6. No broken images - All images load properly

  7. Proper formatting - Headers, lists, and tables render correctly

Commands:

# Take full-page screenshot (ALWAYS use --full flag for docs)
agent-browser screenshot --full page.png

# Check page title (should not be "404")
agent-browser get title

# Verify related links work
agent-browser snapshot  # Get @refs
agent-browser click "@e42"  # Click link by @ref

See agent-browser reference for complete command list.

Checklist:

  • [ ] Method appears in module's API index table (screenshot verified)

  • [ ] Method documentation page loads without 404 (screenshot verified)

  • [ ] Parameters table renders with all columns (screenshot verified)

  • [ ] Code examples render with syntax highlighting (screenshot verified)

  • [ ] Related links are clickable and load correct pages (click and screenshot each)

  • [ ] Navigation breadcrumbs are correct (screenshot verified)

  • [ ] No broken images or formatting issues (screenshot verified)

Index

  • [ ] _index.md updated with new method entry

  • [ ] New method row is in alphabetical order in the method table

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 or Grafana Labs.

Download ZIP

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