AgentStack
SKILL verified MIT Self-run

Load Test Generator

skill-girijashankarj-cursor-handbook-load-test-generator · by girijashankarj

Generate load test scripts using k6, Artillery, or Locust from API endpoints or OpenAPI specs. Use when the user asks to create load tests, stress tests, or performance benchmarks.

No reviews yet
0 installs
16 views
0.0% view→install

Install

$ agentstack add skill-girijashankarj-cursor-handbook-load-test-generator

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access Used
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Load Test Generator? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Skill: Load Test Generator

Generate load test scripts for API endpoints with configurable scenarios, thresholds, and reporting.

Trigger

When the user asks to create load tests, stress tests, performance benchmarks, or capacity tests.

Prerequisites

  • [ ] Target API endpoints identified
  • [ ] Expected load profile known (requests/sec, concurrent users)
  • [ ] Performance thresholds defined (latency, error rate)

Steps

Step 1: Choose Tool

| Tool | Language | Best For | |------|----------|----------| | k6 | JavaScript | Developer-friendly, CI integration, cloud scaling | | Artillery | YAML + JS | Quick setup, YAML-based scenarios | | Locust | Python | Python teams, distributed testing |

Default to k6 unless user specifies otherwise.

Step 2: Identify Scenarios

| Scenario Type | Purpose | Pattern | |--------------|---------|---------| | Smoke | Verify works under minimal load | 1–5 VUs, 1 min | | Load | Normal expected traffic | Target RPS, 5–10 min | | Stress | Find breaking point | Ramp to 2–5x normal, 10 min | | Spike | Sudden traffic burst | 0 → max → 0 in seconds | | Soak | Memory leaks, degradation | Normal load, 1–4 hours |

Step 3: Define Test Configuration

// k6 load test
export const options = {
  scenarios: {
    load_test: {
      executor: 'ramping-vus',
      startVUs: 0,
      stages: [
        { duration: '2m', target: 50 },   // Ramp up
        { duration: '5m', target: 50 },   // Steady state
        { duration: '2m', target: 100 },  // Peak
        { duration: '1m', target: 0 },    // Ramp down
      ],
    },
  },
  thresholds: {
    http_req_duration: ['p(95)100'],
  },
};

Step 4: Generate Test Script (k6)

import http from 'k6/http';
import { check, sleep } from 'k6';
import { Rate, Trend } from 'k6/metrics';

const BASE_URL = __ENV.BASE_URL || '[API_BASE_URL]';
const AUTH_TOKEN = __ENV.AUTH_TOKEN || '[TEST_TOKEN]';

const errorRate = new Rate('errors');
const latency = new Trend('request_latency');

const headers = {
  'Content-Type': 'application/json',
  'Authorization': `Bearer ${AUTH_TOKEN}`,
};

export default function () {
  // Scenario: List resources
  const listRes = http.get(`${BASE_URL}/api/v1/resources`, { headers });
  check(listRes, {
    'list returns 200': (r) => r.status === 200,
    'list latency  r.timings.duration  JSON.parse(r.body).data.length >= 0,
  });
  errorRate.add(listRes.status !== 200);
  latency.add(listRes.timings.duration);

  sleep(1);

  // Scenario: Create resource
  const payload = JSON.stringify({
    name: `load-test-${Date.now()}`,
    type: 'test',
  });
  const createRes = http.post(`${BASE_URL}/api/v1/resources`, payload, { headers });
  check(createRes, {
    'create returns 201': (r) => r.status === 201,
    'create latency  r.timings.duration 100 RPS`
- [ ] Document what "pass" and "fail" mean for each threshold

## Rules
- **NEVER** run load tests against production without explicit approval
- **NEVER** hardcode credentials — use environment variables
- **ALWAYS** include think time (`sleep`) between requests to simulate real users
- **ALWAYS** include `check` assertions for response validation
- **ALWAYS** define thresholds (the test should pass/fail based on performance)
- Use test-specific API tokens, not production credentials
- Clean up test data after runs
- Start with smoke tests before running full load tests

## Completion
Load test script with scenarios, thresholds, data-driven testing, and run instructions. Ready to execute locally or in CI.

## If a Step Fails
- **Don't know expected load:** Start with smoke test, baseline current performance
- **Auth complexity:** Create a dedicated load-test user/token
- **Rate limiting blocks tests:** Coordinate with ops to allowlist test IP or increase limits
- **No staging environment:** Use a dedicated load-test environment, never hit production directly

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [girijashankarj](https://github.com/girijashankarj)
- **Source:** [girijashankarj/cursor-handbook](https://github.com/girijashankarj/cursor-handbook)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.