一键导入
load-test-runner
Generate and run load test scripts for APIs and pages. Use when the user asks for load tests, stress tests, or traffic simulation scripts.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate and run load test scripts for APIs and pages. Use when the user asks for load tests, stress tests, or traffic simulation scripts.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Full QA audit orchestrator. Use when the user asks to "test my app", "run a full QA audit", "test everything", or invokes /qa-audit. Discovers what kind of application this is, selects the relevant QA agents (ui-inspector, api-sentinel, security-scout, perf-guardian, data-validator, regression-watcher), runs them, and merges their reports into one master QA report.
Onboard the QA toolkit onto any project. Use on first contact with a new codebase, when the user says "set up QA", "qa init", "/qa-init", or when any QA agent finds no qa-profile.md. Studies the project deeply and writes the persistent QA profile that every other agent reads first — the toolkit's long-term memory for this project.
Wire the QA suite into CI. Use when the user wants tests running automatically on every PR or on a schedule: "add this to CI", "run tests on every push", "/qa-ci". Generates GitHub Actions workflows for the generated Playwright suite and (optionally) scheduled full audits.
Self-healing for the generated test suite. Use when previously-green Playwright tests are failing, the user says "my tests broke", "fix the tests", "/qa-heal", or after a UI refactor breaks selectors. Classifies each failure (real bug vs test drift) and repairs the drift — never papers over real bugs.
Compare two QA audit runs and report what improved, what regressed, and what persists. Use when the user asks "did it improve since last time?", "compare audits", "QA trend", or invokes /qa-trend. Requires at least two timestamped runs under qa-reports/runs/.
Audit web pages for WCAG 2.1 compliance. Use when the user asks about accessibility, a11y, WCAG, screen readers, or contrast issues.
| name | load-test-runner |
| description | Generate and run load test scripts for APIs and pages. Use when the user asks for load tests, stress tests, or traffic simulation scripts. |
Generate and execute load test scripts for APIs and web applications.
This skill creates ready-to-run load test scripts that simulate concurrent users hitting your endpoints. It generates scripts using lightweight, zero-dependency tools (shell + curl) as well as Python scripts for more complex scenarios.
When the user provides endpoints and performance requirements:
#!/bin/bash
# Load Test: [Endpoint Name]
# Usage: ./load_test.sh [concurrent_users] [total_requests]
URL="${1:-https://api.example.com/endpoint}"
CONCURRENT="${2:-10}"
TOTAL="${3:-100}"
RESULTS_FILE="results_$(date +%Y%m%d_%H%M%S).csv"
echo "timestamp,status_code,time_total,time_connect,time_starttransfer" > "$RESULTS_FILE"
run_request() {
curl -s -o /dev/null -w "%{time_total},%{time_connect},%{time_starttransfer},%{http_code}\n" "$URL"
}
echo "Starting load test: $CONCURRENT concurrent, $TOTAL total requests"
echo "Target: $URL"
seq 1 "$TOTAL" | xargs -P "$CONCURRENT" -I {} bash -c '
result=$(curl -s -o /dev/null -w "%{time_total},%{time_connect},%{time_starttransfer},%{http_code}" "'"$URL"'")
echo "$(date +%s),$result"
' >> "$RESULTS_FILE"
echo "Test complete. Results in $RESULTS_FILE"
#!/usr/bin/env python3
"""Load Test Script - Generated by Claude QA Toolkit"""
import concurrent.futures
import requests
import time
import statistics
import json
from datetime import datetime
class LoadTestRunner:
def __init__(self, url, method="GET", headers=None, body=None):
self.url = url
self.method = method
self.headers = headers or {}
self.body = body
self.results = []
def run_request(self, request_id):
start = time.time()
try:
resp = requests.request(
self.method, self.url,
headers=self.headers,
json=self.body,
timeout=30
)
elapsed = time.time() - start
return {
"id": request_id,
"status": resp.status_code,
"time": round(elapsed * 1000, 2),
"size": len(resp.content),
"error": None
}
except Exception as e:
elapsed = time.time() - start
return {
"id": request_id,
"status": 0,
"time": round(elapsed * 1000, 2),
"size": 0,
"error": str(e)
}
def run(self, concurrent_users, total_requests, ramp_up_seconds=0):
print(f"Load Test: {concurrent_users} users, {total_requests} requests")
with concurrent.futures.ThreadPoolExecutor(max_workers=concurrent_users) as executor:
futures = [executor.submit(self.run_request, i) for i in range(total_requests)]
self.results = [f.result() for f in concurrent.futures.as_completed(futures)]
return self.analyze()
def analyze(self):
times = [r["time"] for r in self.results if r["error"] is None]
errors = [r for r in self.results if r["error"] is not None]
if not times:
return {"error": "All requests failed"}
return {
"total_requests": len(self.results),
"successful": len(times),
"failed": len(errors),
"p50_ms": round(statistics.median(times), 2),
"p90_ms": round(sorted(times)[int(len(times)*0.9)], 2),
"p95_ms": round(sorted(times)[int(len(times)*0.95)], 2),
"p99_ms": round(sorted(times)[int(len(times)*0.99)], 2),
"avg_ms": round(statistics.mean(times), 2),
"min_ms": round(min(times), 2),
"max_ms": round(max(times), 2),
"error_rate": f"{round(100*len(errors)/len(self.results),2)}%",
"throughput_rps": round(len(times) / (max(times)/1000), 2)
}
Create a load test for POST /api/orders that handles 100 concurrent users.
Include authentication headers and a sample JSON body.
Generate a stress test that ramps from 10 to 500 users over 5 minutes
for these 3 endpoints: [list endpoints]