一键导入
qa-k6-writer
Generate k6 performance tests in JavaScript for load, stress, soak, and spike testing with thresholds, scenarios, checks, and CI-friendly output.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate k6 performance tests in JavaScript for load, stress, soak, and spike testing with thresholds, scenarios, checks, and CI-friendly output.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Master skill coordinating all QA skills through pipeline modes (full-cycle, docs-only, testcases-only, write-tests, report), formalized handoff chains, scheduler rules, and framework/language selection based on project context.
QA project memory with auto-update. Structured log of bugs, decisions, tests, regressions, environments. Automatically updated after every QA task. Archive system with searchable index for large projects. Trigger phrases (EN): "initialize memory", "init qa memory", "find known bug", "search memory", "show what was done", "check regressions", "memory status", "archive memory", "log a bug", "add decision", "memory summary", "what bugs do we know", "update memory", "show test log". Trigger phrases (UA): "ініціалізувати пам'ять", "знайти відомий баг", "пошук у пам'яті", "показати що було зроблено", "перевірити регресії", "статус пам'яті", "архівувати пам'ять", "залогувати баг", "додати рішення", "зведення пам'яті", "які баги відомі", "оновити пам'ять", "показати лог тестів", "що ми вирішили про", "які тестові середовища є".
Analyze OpenAPI/Swagger spec (JSON or YAML) against existing test files and generate an HTML coverage report with QA automation tasks. Use when user provides an OpenAPI spec file and wants to know test coverage status.
Generate accessibility tests for WCAG 2.2 compliance using axe-core, Pa11y, and Lighthouse with automated checks for ARIA patterns, keyboard navigation, color contrast, and screen reader support.
Manage and formalize API contracts from existing endpoints, swagger/JSON, network traffic, or developer interviews into OpenAPI specifications.
Autonomously explore live web applications using Playwright MCP to collect page structure, form fields, validation rules, API endpoints, and user flows for test case generation.
| name | qa-k6-writer |
| description | Generate k6 performance tests in JavaScript for load, stress, soak, and spike testing with thresholds, scenarios, checks, and CI-friendly output. |
| output_dir | tests/performance |
Write k6 performance tests from test case specifications and performance plans. Transform structured performance requirements (from qa-nfr-analyst, qa-plan-creator performance plans) into executable k6 scripts with scenarios, thresholds, checks, and CI-friendly output.
| Type | Purpose | Key Characteristics |
|---|---|---|
| Load testing | Validate behavior under expected load | Steady VUs, target throughput |
| Stress testing | Find breaking point | Ramp up until failure |
| Soak testing | Detect memory leaks, degradation | Sustained load over hours |
| Spike testing | Sudden traffic surge | Sharp ramp up/down |
| Smoke testing | Quick sanity check | 1–5 VUs, minimal duration |
| Breakpoint testing | Find capacity limit | Incremental load until threshold fails |
| Feature | Description |
|---|---|
| JavaScript ES6 | Standard JS syntax; no transpilation required |
| Scenarios | Multiple executors: shared-iterations, per-vu-iterations, constant-arrival-rate, ramping-arrival-rate, externally-controlled |
| Thresholds | Pass/fail criteria: http_req_duration, http_req_failed, custom metrics |
| Checks | Assertions: check(res, { 'status is 200': (r) => r.status === 200 }) |
| Stages | Ramp-up, steady, ramp-down for realistic load profiles |
| Custom metrics | Trend, Rate, Counter, Gauge for business metrics |
| Protocols | HTTP, WebSocket, gRPC |
.js file with export default function, HTTP calls, checks, groupsUse Context7 MCP for k6 documentation when:
| Pattern | Usage |
|---|---|
export default function(options) | Main entry; receives options (env, etc.) |
http.get(url) / http.post(url, body) | HTTP requests; returns response |
check(res, assertions) | Assertions; returns boolean; does not fail test |
sleep(duration) | Think time between actions |
group(name, fn) | Logical grouping; metrics tagged by group |
Trend, Rate, Counter, Gauge | Custom metrics |
scenarios in options | Define executor-based scenarios |
thresholds: {
'http_req_duration': ['p(95)<200', 'p(99)<500'],
'http_req_failed': ['rate<0.01'],
'http_reqs': ['count>1000'],
}
| Executor | Use Case |
|---|---|
shared-iterations | Fixed total iterations across all VUs |
per-vu-iterations | Each VU runs N iterations |
constant-arrival-rate | Fixed request rate (RPS) |
ramping-arrival-rate | Ramping RPS (stress/spike) |
externally-controlled | Control VUs from external source |
See references/patterns.md for load profiles, scenario executors, thresholds, custom metrics, groups.
.js files in tests/ or performance/ per project conventionk6 run, threshold pass/failCan do (autonomous):
Cannot do (requires confirmation):
Will not do (out of scope):
k6 run script.js)references/patterns.md — Load profiles, scenario executors, thresholds, custom metrics, groupsreferences/config.md — options, scenarios, stages, thresholds, output formatsreferences/best-practices.md — Realistic load, correlation, parameterization, CI integrationthreshold for pass/fail__ENV or options| Symptom | Likely Cause | Fix |
|---|---|---|
| Thresholds fail in CI | Different baseline or env | Align thresholds with target env; use env-specific config |
High http_req_failed | Timeouts, 5xx, or wrong assertions | Increase timeout; fix check logic; verify endpoint |
| VUs not ramping as expected | Wrong executor or stage config | Use ramping-vus or ramping-arrival-rate for stress |
| Metrics not tagged | Missing groups | Wrap logic in group('name', () => { ... }) |
| Script fails to run | ES module or import error | Use export default; ensure k6-compatible imports |
| WebSocket/gRPC errors | Protocol-specific setup | Use k6/experimental/grpc or k6/ws; check Context7 docs |
| CI exit code 0 despite failures | Thresholds not enforced | Ensure --threshold or options.thresholds set; k6 exits non-zero on threshold fail |