agent-instructions
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when load testing a system. Covers workload modeling, ramp profiles, what to measure, finding the breaking point, and distinguishing a real bottleneck from a badly configured test.
$ npx -y skills add nimadorostkar/Claude-Skills-collection --skill performance-testing --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/performance-testingContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when load testing a system. Covers workload modeling, ramp profiles, what to measure, finding the breaking point, and distinguishing a real bottleneck from a badly configured test.
name: performance-testing description: Use when load testing a system. Covers workload modeling, ramp profiles, what to measure, finding the breaking point, and distinguishing a real bottleneck from a badly configured test. metadata: category: testing version: 1.0.0 tags: [load-testing, performance, k6, benchmarking, capacity]
Find out where a system breaks, and why, before production finds out for you. A load test that reports "we handled 1,000 requests per second" without stating the latency, the error rate, and where the bottleneck was tells you nothing useful.
1. **Model the workload from reality** — Take the endpoint mix from production access logs. A test that hammers one endpoint measures that endpoint, not your system. 2. **Ramp, do not slam** — Start below expected load and increase gradually. The point at which latency starts climbing is more informative than the point at which it falls over. 3. **Measure percentiles, never averages** — An average latency of 200ms is consistent with half the users waiting 400ms. Report p50, p95, p99, and the maximum. 4. **Watch the system, not just the client** — CPU, memory, connection pools, database locks, queue depth. The load generator tells you what happened; the system tells you why. 5. **Find the first bottleneck, fix it, repeat** — There is always another one behind it. Performance testing is iterative. 6. **Soak test separately** — Run at moderate load for hours. Memory leaks, connection leaks, and disk-filling logs only appear over time.
**A ramp profile that finds the knee, with thresholds that fail the test:**
import http from "k6/http";
import { check, sleep } from "k6";
export const options = {
scenarios: {
ramp: {
executor: "ramping-arrival-rate", // arrival rate: models users, not workers
startRate: 50,
timeUnit: "1s",
preAllocatedVUs: 200,
maxVUs: 2000,
stages: [
{ target: 200, duration: "3m" }, // expected peak
{ target: 500, duration: "3m" }, // 2.5x
{ target: 1000, duration: "3m" }, // find the knee
{ target: 2000, duration: "3m" }, // find the wall
],
},
},
thresholds: {
// The test fails if these are breached. A load test with no thresholds is a demo.
http_req_failed: ["rate<0.01"],
http_req_duration: ["p(95)<500", "p(99)<1500"],
},
};
// The endpoint mix, taken from production access logs — not a single hot path.
export default function () {
const r = Math.random();
if (r < 0.62) http.get(`${__ENV.BASE}/api/products`);
else if (r < 0.85) http.get(`${__ENV.BASE}/api/products/${randomSku()}`);
else if (r < 0.97) http.post(`${__ENV.BASE}/api/cart`, JSON.stringify(cartItem()));
else http.post(`${__ENV.BASE}/api/checkout`, JSON.stringify(order()));
sleep(Math.random() * 3 + 1); // think time: real users pause
}**A result that is actually useful:**
Breaking point: ~840 requests/second. At 800 rps: p50 42ms p95 180ms p99 410ms errors 0.0% At 900 rps: p50 51ms p95 890ms p99 3,200ms errors 0.4% At 1000 rps: p50 2.1s p95 8.4s p99 timeout errors 11% Bottleneck: the Postgres connection pool saturates at 40 connections. Beyond ~840 rps, requests queue for a connection; the queue wait dominates the response time entirely. Database CPU peaked at 34% — the database was never the limit, the pool in front of it was. Fix: raise the pool to 100 and add PgBouncer in transaction mode. Retest: breaking point moves to ~2,900 rps, where the database CPU finally becomes the constraint at 89%. Capacity conclusion: 2,900 rps sustained, against an expected peak of 200. Headroom is adequate for the launch.
A curated library of 137 production-grade skills for Claude and other AI coding agents. Every skill follows one structure, speaks with one voice, and earns its place by changing what the agent does.
Repo: nimadorostkar/Claude-Skills-collection
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when an agent needs state that survives a session or a context compaction. Covers what to persist, file-based memory, structuring notes for retrieval, and…
Use when automating agent behavior with lifecycle hooks. Covers hook events, deterministic enforcement of rules the model should not be trusted to remember,…
Use when packaging skills, commands, hooks, and MCP servers into a distributable plugin. Covers manifest structure, bundling, versioning, testing, and…
Use when writing a new skill for an AI agent. Covers scoping, description writing for reliable triggering, progressive disclosure, and the difference between a…
Use when reviewing or improving an existing agent skill. Covers triggering accuracy, content quality, redundancy with the base model, and measuring whether the…