mcpbeat Sign in

Performance Testing Agent Skill

Load testing with k6/Artillery, response time thresholds, memory leak detection, N+1 query detection, and CI integration.

1k tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
521
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/vibeeval/vibecosystem --skill performance-testing

The instruction itself

17 sections, as written by the author

Performance Testing

k6 Script Patterns

Basic scenario with stages

// k6 run load-test.js
import http from 'k6/http'
import { check, sleep } from 'k6'

export const options = {
  stages: [
    { duration: '30s', target: 10 },   // ramp up
    { duration: '1m',  target: 50 },   // hold load
    { duration: '30s', target: 0 },    // ramp down
  ],
  thresholds: {
    http_req_duration: ['p(95)<200', 'p(99)<500'],
    http_req_failed:   ['rate<0.01'],   // < 1% error rate
  },
}

export default function () {
  const res = http.get('https://api.example.com/users')
  check(res, {
    'status is 200':       (r) => r.status === 200,
    'response time < 200ms': (r) => r.timings.duration < 200,
  })
  sleep(1)
}

POST with auth

export default function () {
  const payload = JSON.stringify({ email: '[email protected]', password: 'secret' })
  const headers = { 'Content-Type': 'application/json' }
  const res = http.post(`${BASE_URL}/auth/login`, payload, { headers })
  const token = res.json('token')

  http.get(`${BASE_URL}/profile`, {
    headers: { Authorization: `Bearer ${token}` },
  })
}

Load Test Types

| Type | Duration | Target VU | Purpose |

|------|----------|-----------|---------|

| Smoke | 1 min | 1-5 | Verify script works, no regressions |

| Load | 30 min | expected peak | Normal production conditions |

| Stress | 60 min | 2-3x peak | Find breaking point |

| Spike | 2 min | 10x peak → 0 | Sudden traffic burst behavior |

| Soak | 4-8 hours | 80% peak | Memory leaks, degradation over time |

Threshold Definitions

export const options = {
  thresholds: {
    // Response time
    http_req_duration: ['p(95)<200', 'p(99)<500', 'avg<100'],

    // Error rate
    http_req_failed: ['rate<0.01'],   // < 1%

    // Custom metric for specific endpoint
    'http_req_duration{name:login}': ['p(95)<300'],

    // Checks pass rate
    checks: ['rate>0.99'],
  },
}

CI Integration (GitHub Actions + k6)

# .github/workflows/perf.yml
name: Performance Tests
on:
  pull_request:
    branches: [main]

jobs:
  k6:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Run k6 smoke test
        uses: grafana/[email protected]
        with:
          filename: tests/perf/smoke.js
          flags: --out json=results.json
      - name: Upload results
        uses: actions/upload-artifact@v4
        with:
          name: k6-results
          path: results.json

Memory Leak Detection (Node.js)

Heap snapshot approach

# Start with --inspect
node --inspect --expose-gc server.js

# In Chrome DevTools → Memory → Take heap snapshot
# Run load, take another snapshot
# Compare: growing retained objects = leak

Programmatic detection

import v8 from 'v8'

function checkHeap(label) {
  const stats = v8.getHeapStatistics()
  console.log(`[${label}] Heap used: ${Math.round(stats.used_heap_size / 1024 / 1024)}MB`)
}

setInterval(() => checkHeap('monitor'), 30_000)

Common leak patterns to watch

// BAD: event listener never removed
emitter.on('data', handler)   // grows on every request

// GOOD: cleanup in teardown
emitter.on('data', handler)
return () => emitter.off('data', handler)

// BAD: unbounded cache
const cache = {}
cache[userId] = data   // never evicted

// GOOD: bounded cache
import LRU from 'lru-cache'
const cache = new LRU({ max: 1000, ttl: 1000 * 60 * 5 })

N+1 Query Detection

pg_stat_statements (PostgreSQL)

-- Enable extension
CREATE EXTENSION IF NOT EXISTS pg_stat_statements;

-- Find repetitive queries during a load test window
SELECT
  query,
  calls,
  mean_exec_time,
  total_exec_time
FROM pg_stat_statements
WHERE calls > 100
ORDER BY calls DESC
LIMIT 20;

Query logging (development)

// Prisma: log all queries
const prisma = new PrismaClient({
  log: ['query'],
})

// Detect N+1: same query fired N times in a request
// Fix: use include/select or DataLoader

DataLoader pattern (N+1 fix)

import DataLoader from 'dataloader'

const userLoader = new DataLoader(async (ids) => {
  const users = await db.user.findMany({ where: { id: { in: ids } } })
  return ids.map(id => users.find(u => u.id === id))
})

// In resolver — batches automatically
const user = await userLoader.load(post.authorId)

Web Vitals / Lighthouse CI

# .github/workflows/lhci.yml
- name: Lighthouse CI
  run: |
    npm install -g @lhci/cli
    lhci autorun
  env:
    LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
// lighthouserc.json
{
  "ci": {
    "assert": {
      "assertions": {
        "categories:performance": ["error", { "minScore": 0.8 }],
        "first-contentful-paint": ["error", { "maxNumericValue": 2000 }],
        "largest-contentful-paint": ["error", { "maxNumericValue": 2500 }],
        "cumulative-layout-shift": ["error", { "maxNumericValue": 0.1 }]
      }
    }
  }
}

Trend Tracking

Store k6 results to Grafana/InfluxDB for trend visualization:

k6 run --out influxdb=http://localhost:8086/k6 load-test.js

Or export JSON and compare baselines:

k6 run --out json=results-$(git rev-parse --short HEAD).json load-test.js

Other skills for the same job

different authors, same section of the catalogue
Webapp Testing
by anthropics
vendor ×12

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

6k tokens scripts
Finishing A Development Branch
by ZhanlinCui
×7

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup

1k tokens
Test Driven Development
by w95
×7

Use when implementing any feature or bugfix, before writing implementation code

2k tokens
Systematic Debugging
by ratacat
×7

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes

10k tokens scripts
Verification Before Completion
by ZhanlinCui
×6

Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always

1k tokens
Backtest Expert
by BaggaT236
×3

Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating quantitative trading strategies. Covers "beating ideas to death" methodology, parameter robustness testing, slippage modeling, bias prevention, and interpreting backtest results. Applicable when user asks about backtesting, strategy validation, robustness testing, avoiding overfitting, or systematic trading development.

15k tokens scripts
Adaptyv
by christophacham
×3

Cloud laboratory platform for automated protein testing and validation. Use when designing proteins and needing experimental validation including binding assays, expression testing, thermostability measurements, enzyme activity assays, or protein sequence optimization. Also use for submitting experiments via API, tracking experiment status, downloading results, optimizing protein sequences for better expression using computational tools (NetSolP, SoluProt, SolubleMPNN, ESM), or managing protein design workflows with wet-lab validation.

16k tokens
Aeon
by christophacham
×3

This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.

19k tokens

How to use it

Copy the folder

Take vibeeval/performance-testing from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.

Install what it needs

The instructions reference npm. Without those the skill loads but fails at the first command.