Write and run Artillery load tests with YAML phases and scenarios, CSV data payloads, the expect plugin for functional checks, and ensure thresholds that fail CI when latency or error budgets are breached.
npx skills add https://github.com/PramodDutta/qaskills --skill Artillery Load Testing
This skill makes an AI agent author Artillery 2.x load tests as declarative YAML: realistic traffic phases, multi-step scenarios with captured variables, CSV-driven virtual user data, functional expect checks inside load flows, and ensure thresholds that turn latency regressions into red CI builds. Trigger it when a project contains artillery.yml, artillery in package.json, or when the user asks for load, stress, soak, or spike testing of an HTTP API or website in a Node.js stack.
arrivalRate hides cold-start effects and autoscaling lag. Always define at least warm-up, ramp, and sustain phases.arrivalRate is new virtual users per second, not concurrency. Each arriving VU runs the whole scenario. If your scenario takes 10 seconds and you arrive 50/sec, you have roughly 500 concurrent users. Calculate this before picking numbers.ensure plugin so artillery run exits non-zero when p95/p99 or error rate budgets are blown. A load test that cannot fail is a demo, not a test.expect. A server returning 200 with an empty body at p99 latency is still broken. Check statusCode, contentType, and hasProperty inside the flow.payload with hundreds of distinct credentials and SKUs to defeat caches realistically.npm install --save-dev artillery@latest
npx artillery version
# Run a test locally
npx artillery run load/checkout.yml
# Save raw metrics for trend analysis
npx artillery run load/checkout.yml --output artillery-report.json
# load/checkout.yml
config:
target: https://staging-api.example.com
http:
timeout: 10
phases:
- duration: 60
arrivalRate: 2
name: warm-up
- duration: 120
arrivalRate: 5
rampTo: 40
name: ramp-to-peak
- duration: 300
arrivalRate: 40
name: sustained-peak
payload:
path: users.csv
fields:
- email
- password
order: random
skipHeader: true
plugins:
expect: {}
ensure: {}
ensure:
thresholds:
- http.response_time.p95: 250
- http.response_time.p99: 500
conditions:
- expression: http.codes.200 > 0
strict: true
maxErrorRate: 1
scenarios:
- name: login-browse-order
flow:
- post:
url: /auth/login
json:
email: '{{ email }}'
password: '{{ password }}'
capture:
- json: $.token
as: authToken
expect:
- statusCode: 200
- contentType: json
- hasProperty: token
- get:
url: /products?category=audio
headers:
Authorization: 'Bearer {{ authToken }}'
capture:
- json: $[0].id
as: productId
expect:
- statusCode: 200
- post:
url: /orders
headers:
Authorization: 'Bearer {{ authToken }}'
json:
productId: '{{ productId }}'
quantity: 1
expect:
- statusCode: 201
- hasProperty: orderId
- think: 2
email,password
[email protected],Str0ngPass!001
[email protected],Str0ngPass!002
[email protected],Str0ngPass!003
[email protected],Str0ngPass!004
Generate hundreds of rows with a one-liner instead of writing them by hand:
seq -w 1 500 | awk -F, 'BEGIN{print "email,password"} {printf "loadtest-%[email protected],Str0ngPass!%s\n", $1, $1}' > users.csv
# In config:
config:
target: https://staging-api.example.com
processor: ./processor.js
scenarios:
- name: create-order-with-dynamic-payload
flow:
- function: generateOrderPayload
- post:
url: /orders
json:
sku: '{{ sku }}'
quantity: '{{ quantity }}'
afterResponse: logSlowResponse
// processor.js
module.exports = { generateOrderPayload, logSlowResponse };
function generateOrderPayload(context, events, done) {
// Runs before the request; sets template variables on the VU context
context.vars.sku = `SKU-${1000 + Math.floor(Math.random() * 9000)}`;
context.vars.quantity = 1 + Math.floor(Math.random() * 4);
return done();
}
function logSlowResponse(requestParams, response, context, events, done) {
const tookMs = response.timings ? response.timings.phases.total : 0;
if (tookMs > 1000) {
console.warn(`SLOW ${requestParams.url} -> ${response.statusCode} in ${tookMs}ms`);
events.emit('counter', 'custom.slow_responses', 1);
}
return done();
}
The ensure plugin makes Artillery exit with code 1 on any threshold breach, so the job fails without extra scripting.
# .github/workflows/load-test.yml
name: load-test
on:
workflow_dispatch:
schedule:
- cron: '0 2 * * 1'
jobs:
artillery:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- name: Run load test against staging
run: npx artillery run load/checkout.yml --output artillery-report.json
env:
ARTILLERY_DISABLE_TELEMETRY: 'true'
- name: Upload raw metrics
if: always()
uses: actions/upload-artifact@v4
with:
name: artillery-report
path: artillery-report.json
think steps (1-3 seconds) between requests so VUs pace like humans instead of a retry storm.weight: to mirror real traffic mix (for example 70 percent browse, 25 percent search, 5 percent checkout).--overrides '{"config":{"phases":[{"duration":10,"arrivalRate":1}]}}') before any big run to catch broken auth and 4xx noise cheaply.--output JSON artifacts from every CI run so you can diff p95 across releases.http.timeout explicitly; the 120-second default hides hangs as slow successes.arrivalRate and no ramp: you are testing the load balancer's SYN queue, not your application.expect or ensure block exists.arrivalRate past what one generator machine can produce: watch for Artillery's own CPU warnings, and split load across workers (or Fargate via artillery run-fargate) instead.artillery.yml, files under load/ or perf/ with Artillery config, or artillery in package.json devDependencies.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.
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
Use when implementing any feature or bugfix, before writing implementation code
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
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
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.
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.
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.
Take pramoddutta/qaskills-artillery load testing from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
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.
The instructions reference npm, npx.
Without those the skill loads but fails at the first command.