k6 Performance Testing (workflow)
Operating mode (token-efficient)
- •Treat this skill as a router + governor.
- •Do not load multiple procedures. Select exactly one procedure below and follow it end-to-end.
- •Optimize for reproducible performance signals (thresholds + stable environments).
Routing (pick one procedure)
| Task | Open this procedure | Optional examples |
|---|---|---|
| Bootstrap k6 perf testing in a repo | reference/procedures/bootstrap.md | reference/examples/thresholds.js |
| Add a new scenario (smoke/load/stress/soak) | reference/procedures/add-scenario.md | reference/examples/smoke.js, reference/examples/load.js |
| Run locally | reference/procedures/run-local.md | — |
| Add CI gating (threshold-based) | reference/procedures/ci-gate.md | reference/examples/thresholds.js |
| Interpret regressions | reference/procedures/interpret-regressions.md | — |
Shared non-negotiables (apply to all procedures)
- •
Versioned scenarios
- •Store k6 scripts in-repo and review like code.
- •Keep scenarios small and composable.
- •
Explicit thresholds
- •Every CI-gated scenario must have thresholds (p95/p99 latency, error rate).
- •Thresholds must be justified and documented.
- •
Environment control
- •Prefer stable staging environments for consistent results.
- •Do not run load/stress tests against production unless explicitly approved.
- •
Artifact contract (for CI + trend analysis)
- •Standardize under:
artifacts/k6/ - •Export at least a JSON summary (and optionally JUnit-like output if you convert).
- •Standardize under:
- •
No secrets in repo
- •Inject tokens via CI secrets / env vars.
- •Never commit API tokens in scripts.
Minimal inputs you should capture before changing code
- •Target endpoint(s) and base URL(s)
- •Auth strategy for load tests (token acquisition and rotation strategy)
- •Target SLOs / acceptable latency and error rates
- •Load model (users, arrival rate, duration)
- •Whether tests are PR-gating vs scheduled (nightly)
Verification
- •
If you changed skills:
- •Prefer host-repo tooling if present:
- •
node .ai/scripts/lint-skills.cjs --strict
- •
- •Always run the local validator:
- •
node .ai/skills/testing/test-perf-k6/scripts/validate-skill.cjs
- •
- •Prefer host-repo tooling if present:
- •
If you changed perf scripts:
- •
k6 version(ordocker run --rm grafana/k6 version) - •
k6 run <script.js>
- •
Boundaries
- •Do not edit
.codex/skills/or.claude/skills/directly (generated). - •Do not set thresholds so loose that regressions pass unnoticed.
- •Do not run high-load tests without coordinating capacity and rate limits.