Runs load tests, profiles application bottlenecks, analyzes response time metrics, and generates performance optimization recommendations. Use when you need to benchmark a system, run load or stress tests, measure latency or throughput, identify performance bottlenecks, optimize Core Web Vitals (LCP, FID, CLS), plan capacity, enforce performance budgets in CI/CD pipelines, or investigate slow API response times, database query performance, or frontend rendering delays.
93
92%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Risky
Do not use without reviewing
Measures, analyzes, and optimizes system performance through concrete testing, profiling, and data-driven recommendations. Covers load testing, web performance, database tuning, infrastructure scaling, and CI/CD quality gates.
Choose the appropriate test type and run it:
| Test Type | Purpose | Key Signal |
|---|---|---|
| Load | Validate normal + peak traffic | p95 response time, error rate |
| Stress | Find breaking point | Error spike, latency cliff |
| Spike | Sudden traffic surge recovery | Recovery time after spike |
| Endurance | Memory leaks, long-run drift | Resource growth over time |
| Scalability | Horizontal/vertical scaling limits | Perf degradation per added node |
Run with k6:
k6 run --out json=results.json script.jsValidation checkpoint: If error rate exceeds 1% during ramp-up, reduce VU count by 50% and re-run to isolate the failing endpoint before proceeding.
After each run:
p(95) < 500, http_req_failed rate < 0.01.EXPLAIN ANALYZE on top offenders.py-spy, async-profiler, Chrome DevTools).For each optimization:
import http from 'k6/http';
import { check, sleep } from 'k6';
export const options = {
stages: [
{ duration: '2m', target: 10 }, // Warm-up
{ duration: '5m', target: 50 }, // Normal load
{ duration: '2m', target: 100 }, // Peak load
{ duration: '5m', target: 100 }, // Sustained peak
{ duration: '2m', target: 200 }, // Stress
{ duration: '3m', target: 0 }, // Cool-down
],
thresholds: {
http_req_duration: ['p(95)<500'], // 95% of requests under 500ms
http_req_failed: ['rate<0.01'], // Error rate under 1%
},
};
export default function () {
const baseUrl = __ENV.BASE_URL || 'http://localhost:3000';
// Authenticate and test a critical user journey
const loginRes = http.post(`${baseUrl}/api/auth/login`, {
email: 'test@example.com',
password: 'password123',
});
check(loginRes, { 'login 200': (r) => r.status === 200 });
if (loginRes.status === 200) {
const token = loginRes.json('token');
const apiRes = http.get(`${baseUrl}/api/dashboard`, {
headers: { Authorization: `Bearer ${token}` },
});
check(apiRes, {
'dashboard 200': (r) => r.status === 200,
'dashboard < 300ms': (r) => r.timings.duration < 300,
});
}
sleep(1); // Realistic think time
}
export function handleSummary(data) {
return { 'performance-report.json': JSON.stringify(data) };
}If error rate > 1% at any stage: stop the test, check application logs for the failing endpoint, fix the issue, and restart from Step 2.
Common fixes by metric:
<link rel="preload">), serve via CDN, compress with WebP/AVIF.setTimeout chunking), defer non-critical JS, reduce main-thread blocking.width/height attributes or aspect-ratio), avoid injecting content above fold.Measure with: Lighthouse, WebPageTest, or field data via web-vitals JS library + RUM pipeline.
See REPORT_TEMPLATE.md for the full structured report template covering test configuration, results summary (p50/p95/p99, error rate, throughput), bottleneck findings, optimizations applied, SLA pass/fail status, and next steps.
See CAPACITY_PLANNING.md for horizontal/vertical scaling tests, auto-scaling validation steps, and growth forecasting guidance.
010799b
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.