From grafana-k6
Validate k6 scripts against structural, performance, and reliability standards. Use when users ask to validate a k6 script, review k6 test quality, or detect anti-patterns before execution.
How this skill is triggered — by the user, by Claude, or both
Slash command
/grafana-k6:k6-validateThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- User says: "find issues in my k6 scenario"
At the beginning of the workflow, detect and use interaction tools in this order:
AskUserQuestion exists, use it for required inputs.mcp:sampling or create_message exists, use native IDE modal interaction.confirm_action exists, use it for critical confirmations.> [?] MISSING REQUIREMENT: Missing script path or validation scope
missing: script path, validation scope
why: deterministic validation report cannot run without target and scope
next_question: Which script should be validated?
Do not continue validation after fallback.
When fallback is required, always use this portable payload shape:
> [?] MISSING REQUIREMENT: <short missing requirement summary>
missing: <comma-separated missing fields>
why: <why validation cannot continue deterministically>
next_question: <single, specific question that unblocks the next step>
Do not emit final validation findings after this fallback.
load, stress, spike, soak, smoke) used to select executor intent.minimal, standard, aggressive) used to evaluate whether vus, duration, and thresholds fit the intended load level.Apply deterministic recommendation:
K6_WEB_DASHBOARD=falseK6_WEB_DASHBOARD=trueK6_WEB_DASHBOARD=false unless explicit opt-infalsePerformance Best Practices:
WARNINGWARNINGWARNINGWARNINGProtocol-Specific:
client.connect() outside default function, setup(), or teardown() as WARNING (connection lifecycle leakage risk)on('open'), on('error'), graceful close path, and bounded session duration)WARNINGnewPage() / newContext() creation.return, throw, catch branches)..close(), emit WARNING with path evidence.try/finally remediation in Suggested Fixes.Anti-Patterns to Flag:
https://api.prod...) in runnable scripts without __ENV control__ENV fallback)catch blocks that swallow errorsexport default function() {} without a name is a quality violation. Flag as WARNING: "Default export function should be named for traceability and debuggability. Example: export default function runLoad() {}". The naming convention is run<ScenarioType> or run<Protocol><ScenarioType>.
Always enforce these validations as mandatory checks:
ERROR because it violates cross-env SLA coherence expected by k6-builder.vus and duration for time-based cases, or clear equivalent (stages, iterations + vus) for scenario-based definitions.preAllocatedVUs <= maxVUs.__ENV control as at least WARNING (elevate to ERROR when credentials or sensitive paths are coupled).page/context in all execution paths.Every validation response must include these sections in order:
Output artifact requirements:
validation-report.md.## Validation Summary## Scope and Assumptions## Mandatory Invariant Results## Detailed Findings## Suggested Fixes## Next Step## Validation Summary must always begin with a status badge on its own line: **Status: PASS**, **Status: WARN**, or **Status: FAIL**.## Mandatory Invariant Results must include a checklist item for each invariant from Required k6 Invariants, even if the result is ✅ pass.## Detailed Findings must group entries by severity in this order: 🔴 CRITICAL (ERROR) → 🟡 WARNING → ℹ️ INFO.## Suggested Fixes must include a compact fix-priority matrix with counts and estimated time-to-fix per severity.Output budget:
Validation Summary + Mandatory Invariant Results + Detailed Findings combined must target ≤ 600 tokens total.# · Severity · Finding · Recommended Fix (one-liner max).Suggested Fixes. Each fix should include:
issue: The problem detectedseverity: ERROR, WARNING, or INFOevidence: Code snippet or line reference showing the issuefix_snippet: Executable corrected code (when applicable)estimated_time: short estimate (for example ~5 min)Detailed Findings and Suggested Fixes — Detailed Findings identifies; Suggested Fixes remediates.For common anti-patterns, point to skills/k6-validate/references/remediation-playbooks.md and include the matching playbook name.
Findings table format:
| # | Severity | Finding | Recommended Fix |
|---|---|---|---|
| 1 | ERROR | Missing thresholds | Add thresholds block to options |
| 2 | WARNING | Anonymous default function | Rename to export default function runLoad() |
Under the table, include this compact template:
### 🔴 CRITICAL (Fix Immediately)
- <highest-impact findings only>
### 🟡 WARNING (Fix Soon)
- <quality/perf risks>
### ℹ️ INFO (Optional)
- <non-blocking improvements>
In Suggested Fixes, append:
## Fix Priority Matrix
| Priority | Category | Count | Estimated Time |
|---|---|---:|---|
| 🔴 CRITICAL | Security/Safety/Correctness | <n> | <total> |
| 🟡 WARNING | Quality/Performance | <n> | <total> |
| ℹ️ INFO | Best Practice | <n> | <total> |
Keep this file focused on validation workflow. Place deep guidance in:
skills/k6-validate/references/README.mdscript) and optional context (protocol, sla, scenario type, profile).WARNING for more lax thresholds.page/context resources and flag any non-closed path.validation-report.md using Markdown and the Output Contract section order.npx claudepluginhub charlyautomatiza/charlyautomatiza-marketplace --plugin grafana-k6Writes and debugs k6 load test scripts in JavaScript/TypeScript covering all test types, thresholds, checks, scenarios, executors, and CI/CD integration.
Guides k6 load testing for APIs, WebSockets, browsers; writes scenarios (smoke/load/stress/spike/soak), sets thresholds, analyzes results, integrates with CI/CD.
Checks and configures load and performance testing infrastructure with k6, Artillery, or Locust. Audits coverage for smoke/stress tests, sets up CI/CD pipelines, and supports framework migration.