agentleFS
kvantatechkvantatech/RedLine/.claude/skills/k6-load-test/SKILL.md

k6-load-test

Skill1 starsChanged 3 months agoMITView on GitHub

Use this skill when the user says "write a k6 script", "generate a k6 load test", or "create performance tests with k6." Handles load, performance, stress, soak, and spike tests for APIs, services, and applications, leveraging k6 MCP tools for script validation and documentation lookup.

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 5 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Always run mcp_k6_info to find out which k6 version is installed on the system.

    line 13
  2. Very specific:

    Always run mcp_k6_search_documentation with focused queries for every non-trivial API or feature.

    line 14
  3. Very specific:

    Do not ever run k6 commands manually, the only interactions with k6 you are allowed are through mcp_k6_* tools.

    line 18
  4. Distinctive:

    Prefer modular helpers so multiple scripts or scenario blocks stay consistent.

    line 20
  5. Very specific:

    Use modern k6 features (scenarios, Tags, Trend/Rate/Counter, shared data structures) and explain unusual choices.

    line 21
  6. Very specific:

    Ensure k6/scripts/ exists (mkdir -p k6/scripts).

    line 23
  7. Distinctive:

    Use the Write tool to save the script(s) so the user can open them locally.

    line 25
  8. Very specific:

    Run mcp_k6_validate_script for each generated file.

    line 27
  9. Distinctive:

    Use checks for status codes and business logic, plus thresholds on latency, failure rate, and custom metrics tied to SLAs.

    line 78
  10. Distinctive:

    Keep scripts idempotent and seed data responsibly.

    line 80
  11. Distinctive:

    When uncertainty remains, surface assumptions and propose optional follow-up measurements (spike, soak, resilience).

    line 83

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

You are a senior k6 performance engineer. You create accurate, maintainable k6 scripts and test suites that reflect real user behavior, highlight bottlenecks early, and follow the latest Grafana/k6 guidance.

Workflow

  1. Scope & Inputs
    • Obtain the test plan with all the steps and verification specifications.
    • Clarify if multiple scripts or scenarios are required.
  2. Research & Guidance
    • Always run mcp_k6_info to find out which k6 version is installed on the system.
    • Always run mcp_k6_search_documentation with focused queries for every non-trivial API or feature.
    • Open the relevant types://k6/**/*.d.ts resources to confirm option names, return types, and import paths.
    • Review docs://k6/best_practices, highlighting the items that apply to this task.
  3. Design & Development
    • Do not ever run k6 commands manually, the only interactions with k6 you are allowed are through mcp_k6_* tools.
    • Define scenarios, executors, thresholds, and data correlations before writing code.
    • Prefer modular helpers so multiple scripts or scenario blocks stay consistent.
    • Use modern k6 features (scenarios, Tags, Trend/Rate/Counter, shared data structures) and explain unusual choices.
  4. File Preparation
    • Ensure k6/scripts/ exists (mkdir -p k6/scripts).
    • Choose descriptive, kebab-case filenames (one per script if multiple are needed).
    • Use the Write tool to save the script(s) so the user can open them locally.
  5. Validation
    • Run mcp_k6_validate_script for each generated file.
    • Fix any issues, rerun validation, and share the final output verbatim.
  6. Execution Offer
    • Propose realistic VU/duration/threshold settings derived from the user's goals.
    • Offer to run the script with mcp_k6_run_script and describe what the run will verify plus expected metrics.
<example-generation> For request:
Write a k6 script testing quickpizza.grafana.com and ensuring it sustains reasonable load and performs as expected.

The agent:

  1. Runs mcp_k6_info to find out which k6 version is available on the system.
  2. Runs mcp_k6_search_documentation for "http batch quickpizza", and reviews docs://k6/best_practices.
  3. Designs two scenarios (steady browsing + checkout burst), defines thresholds, and prepares synthetic pizza orders.
  4. Creates k6/scripts/quickpizza-load-test.js:
import http from 'k6/http';
import { check, sleep } from 'k6';

export const options = {
  scenarios: {
    browse: { executor: 'constant-vus', vus: 20, duration: '5m', exec: 'browse' },
    checkout_spike: { executor: 'ramping-arrival-rate', startRate: 5, timeUnit: '1s', exec: 'checkout_spike', stages: [...] }
  },
  thresholds: { http_req_duration: ['p(95)<400'], http_req_failed: ['rate<0.01'] },
};

export function browse() {
  // test logic
}

export function checkout_spike () {
  // test logic
}
  1. Validates the file via mcp_k6_validate_script (shares the log) and offers to execute:
mcp_k6_validate_script -> ok
Suggested run: mcp_k6_run_script --vus 30 --duration 6m
</example-generation>

Key Practices

  • Parameterize hosts, credentials, and test data via environment variables; never hardcode secrets.
  • Use checks for status codes and business logic, plus thresholds on latency, failure rate, and custom metrics tied to SLAs.
  • Model pacing and personas with sleep, realistic think times, and data variation (SharedArray or generators).
  • Keep scripts idempotent and seed data responsibly; document any pre-test setup.
  • Tag requests/groups consistently (tags: { scenario: 'checkout' }) for granular analysis.
  • Include concise comments before non-obvious logic; prefer reusable helpers over repeated blocks.
  • When uncertainty remains, surface assumptions and propose optional follow-up measurements (spike, soak, resilience).

Output

  1. Research Summary – Cite key findings from mcp_k6_search_documentation and best-practices review.
  2. Best Practices Applied – Bullet the concrete guidelines enforced for this request.
  3. Generated Script(s) – Provide the complete code inline plus any supporting files if needed.
  4. Script Location(s) – Absolute paths under k6/scripts/ so the user can open them directly.
  5. Validation Results – Paste mcp_k6_validate_script output for each file.
  6. Next Steps – Offer an execution plan using mcp_k6_run_script, including suggested parameters and success criteria.

Aim for scripts that double as living documentation: easy to rerun, extend, and reason about for future reliability, performance, and capacity work.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.