Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Load Testing Patterns

ASecurity

k6 script templates, load profiles, response time thresholds, SLO validation, and performance testing strategies.

530 stars
0 votes
0 copies
1 views
Added 5/29/2026
ai-agentsjavascriptjavatestinggitapiperformance

Works with

api

Security Analysis

A100/100

Scanned 5/29/2026

$npx -y skills add vibeeval/vibecosystem --skill load-testing-patterns --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Load Testing Patterns?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Load Testing Patterns
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vibeeval-load-testing-patterns/badge)](https://www.skillsdirectory.com/skills/vibeeval-load-testing-patterns)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
skill.md
---
name: load-testing-patterns
description: k6 script templates, load profiles, response time thresholds, SLO validation, and performance testing strategies.
---

# Load Testing Patterns

Performance validation with k6 for SLO-driven load testing.

## Basic k6 Script Template

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

// Custom metrics
const errorRate = new Rate('errors')
const loginDuration = new Trend('login_duration')

// Thresholds define pass/fail criteria
export const options = {
  thresholds: {
    http_req_duration: ['p(95)<500', 'p(99)<1000'],  // 95th < 500ms, 99th < 1s
    http_req_failed: ['rate<0.01'],                    // Error rate < 1%
    errors: ['rate<0.05'],                             // Custom error rate < 5%
  },
  scenarios: {
    smoke: {
      executor: 'constant-vus',
      vus: 5,
      duration: '1m',
    }
  }
}

export default function () {
  const res = http.get('https://api.example.com/health')

  check(res, {
    'status is 200': (r) => r.status === 200,
    'response time < 500ms': (r) => r.timings.duration < 500,
    'body has status': (r) => JSON.parse(r.body).status === 'ok',
  }) || errorRate.add(1)

  sleep(1)
}
```

## Load Profiles

```javascript
export const options = {
  scenarios: {
    // 1. Smoke Test: verify system works under minimal load
    smoke: {
      executor: 'constant-vus',
      vus: 3,
      duration: '1m',
    },

    // 2. Load Test: normal expected traffic
    load: {
      executor: 'ramping-vus',
      startVUs: 0,
      stages: [
        { duration: '2m', target: 50 },   // Ramp up
        { duration: '5m', target: 50 },   // Steady state
        { duration: '2m', target: 0 },    // Ramp down
      ],
    },

    // 3. Stress Test: find breaking point
    stress: {
      executor: 'ramping-vus',
      startVUs: 0,
      stages: [
        { duration: '2m', target: 100 },
        { duration: '5m', target: 100 },
        { duration: '2m', target: 200 },  // Beyond normal
        { duration: '5m', target: 200 },
        { duration: '2m', target: 300 },  // Breaking point?
        { duration: '5m', target: 300 },
        { duration: '5m', target: 0 },
      ],
    },

    // 4. Spike Test: sudden traffic surge
    spike: {
      executor: 'ramping-vus',
      startVUs: 0,
      stages: [
        { duration: '30s', target: 10 },
        { duration: '10s', target: 500 },  // Instant spike
        { duration: '1m', target: 500 },
        { duration: '10s', target: 10 },   // Instant drop
        { duration: '1m', target: 10 },
      ],
    },

    // 5. Soak Test: sustained load over time (memory leaks, connection exhaustion)
    soak: {
      executor: 'constant-vus',
      vus: 50,
      duration: '2h',
    },
  }
}
```

## Realistic User Scenarios

```javascript
import http from 'k6/http'
import { check, group, sleep } from 'k6'

const BASE_URL = __ENV.BASE_URL || 'https://api.example.com'

export default function () {
  // Simulate real user journey, not isolated endpoints
  let token

  group('01_login', () => {
    const res = http.post(`${BASE_URL}/auth/login`, JSON.stringify({
      email: `user${__VU}@test.com`,
      password: 'testpass123'
    }), { headers: { 'Content-Type': 'application/json' } })

    check(res, { 'login successful': (r) => r.status === 200 })
    token = JSON.parse(res.body).token
  })

  sleep(Math.random() * 3 + 1)  // Think time: 1-4 seconds

  group('02_browse_products', () => {
    const headers = { Authorization: `Bearer ${token}` }

    const listRes = http.get(`${BASE_URL}/products?page=1&limit=20`, { headers })
    check(listRes, { 'products loaded': (r) => r.status === 200 })

    const products = JSON.parse(listRes.body).data
    if (products.length > 0) {
      const product = products[Math.floor(Math.random() * products.length)]
      const detailRes = http.get(`${BASE_URL}/products/${product.id}`, { headers })
      check(detailRes, { 'product detail loaded': (r) => r.status === 200 })
    }
  })

  sleep(Math.random() * 2 + 1)

  group('03_add_to_cart', () => {
    const res = http.post(`${BASE_URL}/cart/items`, JSON.stringify({
      productId: 'prod_001',
      quantity: 1
    }), {
      headers: {
        'Content-Type': 'application/json',
        Authorization: `Bearer ${token}`
      }
    })
    check(res, { 'item added to cart': (r) => r.status === 201 })
  })
}
```

## SLO Validation

```javascript
export const options = {
  thresholds: {
    // SLO: Availability > 99.9%
    http_req_failed: ['rate<0.001'],

    // SLO: p50 < 100ms, p95 < 500ms, p99 < 1000ms
    http_req_duration: [
      'p(50)<100',
      'p(95)<500',
      'p(99)<1000',
    ],

    // SLO per endpoint using tags
    'http_req_duration{name:login}': ['p(95)<800'],
    'http_req_duration{name:get_products}': ['p(95)<200'],
    'http_req_duration{name:checkout}': ['p(95)<2000'],

    // SLO: Throughput > 1000 RPS
    http_reqs: ['rate>1000'],
  }
}

// Tag requests for per-endpoint SLOs
export default function () {
  http.get(`${BASE_URL}/products`, { tags: { name: 'get_products' } })
  http.post(`${BASE_URL}/auth/login`, payload, { tags: { name: 'login' } })
}
```

## CI Integration

```yaml
# .github/workflows/load-test.yml
name: Load Test
on:
  pull_request:
    branches: [main]

jobs:
  load-test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: grafana/k6-action@v0.3.1
        with:
          filename: tests/load/smoke.js
        env:
          BASE_URL: ${{ secrets.STAGING_URL }}

      # k6 exits non-zero if thresholds fail → PR check fails
```

## Checklist

- [ ] Run smoke test on every PR (fast, catches regressions)
- [ ] Load test weekly against staging with production-like data
- [ ] Stress test quarterly to find breaking points
- [ ] Soak test before major releases (2+ hours, detect memory leaks)
- [ ] Thresholds set per endpoint, not just global p95
- [ ] Realistic think times between requests (sleep 1-5s)
- [ ] Use multiple VU scenarios (not everyone does the same thing)
- [ ] Store results in Grafana/InfluxDB for trend analysis

## Anti-Patterns

- Testing only happy paths: include error scenarios (404, 429, 500)
- No think time: unrealistic request rate, not how users behave
- Testing against production without traffic control (use staging)
- Single endpoint tests: real users hit multiple endpoints per session
- Ignoring connection time: p95 duration hides DNS/TLS overhead
- Hardcoded test data: VUs sharing same user account causes contention

Attribution

vibeevalvibeeval
View sourceSee grades on GitHubMore from vibeeval →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698461 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →