agentleFS
tuannv14tuannv14/claude-team-toolkit/skills/k6/SKILL.md

k6

Skill1 starsChanged 7 months agoMITView on GitHub

Use when running load, stress, soak, or spike tests, or analyzing p50/p95/p99 latency against dev/staging/prod targets. Multi-environment via K6_PROFILE; prod requires typed RUN confirmation.

  • Installs packages

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    Verify: k6 version. If missing, stop.

    line 47
  2. Very specific:

    Rate limit awareness: if testing a 3rd-party API, add --rps cap.

    line 103

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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

/k6 — load testing with environment profiles

Wrapper around k6 for load/stress/soak tests. Profiles select target environment (dev/staging/prod) so the same script runs against different hosts with different auth. Profile resolution: --profile <name> → K6_PROFILE → ~/.k6/active_profile → [default].

Overview

Profiles select the target environment so the same script runs against different hosts with different auth. Prod profiles require typed RUN confirmation to prevent accidental DDoS of own infrastructure.

When to Use

  • Pre-release load testing (smoke/load before deploy)
  • Capacity planning (find breakpoint with stress test)
  • Soak tests (memory leaks, connection pool issues over time)
  • Latency regression tracking (p50/p95/p99 vs baseline)
  • Spike tests (cold cache, autoscaling validation)

When NOT to Use

  • Hitting third-party APIs without their consent → DDoS / TOS violation
  • Functional testing → k6 is for load, not assertion-heavy logic
  • Browser-based UI testing → use Maestro/Detox, not k6
  • VUs > 1000 without --force → almost always a typo

Dependencies

choco install k6        # Windows (or scoop install k6)
brew install k6         # macOS
# Linux: see https://k6.io/docs/get-started/installation/

Verify: k6 version. If missing, stop.

Profile config

~/.k6/credentials (mode 600 — may contain auth tokens):

[default]
base_url = http://localhost:3000
auth_header =
vus = 10
duration = 30s

[staging]
base_url = https://staging.example.com
auth_header = Bearer eyJxxxxxxxx...
vus = 50
duration = 2m

[prod]
base_url = https://api.example.com
auth_header = Bearer eyJxxxxxxxx...
vus = 100
duration = 5m
require_confirm = true                   # prod special: require typed RUN

Shared profile/INI/ctt_* pattern reference: profiles-and-credentials.

Dispatch verbs

VerbPurpose
gen <type> <endpoint>Generate tests/k6/<endpoint>-<type>.js from template
run <script>Execute against profile target; prod requires typed RUN
analyze <summary.json>Print p50/p95/p99/RPS summary
profile add|list|use|removeManage targets (shared CTT pattern)

Reference files (load on demand)

  • recipes.md — full templates per type (smoke/load/stress/soak/spike), run flow with confirmation gate, analyze jq query. Load when user invokes gen, run, or analyze.

Common Mistakes

  • Hard-coding auth in JS script → leaks on commit. Use env vars (__ENV.X).
  • No --rps cap when testing 3rd-party APIs → IP gets banned
  • Wrong test type for the question: stress to find breakpoint, soak for leaks, load for SLO
  • Comparing runs across environments → pointless. Compare same env over time.
  • Running prod profile without require_confirm=true set
  • VUs > 1000 without --force flag → almost always a typo

Safety

  • Never run prod profile without explicit user confirmation. The require_confirm = true field forces the typed RUN confirmation.
  • VU caps: the skill should refuse --vus > 1000 without an extra --force flag — typo-protection against accidentally DDoSing your own service.
  • No credential interpolation into the JS script. Pass auth via env var only. Scripts may be committed to git — credentials must not be.
  • Rate limit awareness: if testing a 3rd-party API, add --rps cap. Default --rps 0 = unlimited = will get IP banned from real APIs.
  • Output summary-export JSON may contain URLs and response samples — treat as potentially sensitive; don't paste publicly.

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.