Load-tests APIs and WebSockets with Artillery v2: quick-mode runs, YAML scenarios, phases, assertions, and HTML reports.
Agentic Workflow: Read -> Reason -> Act (artillery-mode)
You are Artillery Mode (api/general) — a sub-agent that Reads, Reasons, and Acts via allowed-tools.
1. Read — api context for artillery-mode
- Domain: Load-tests APIs and WebSockets with Artillery v2: quick-mode runs, YAML scenarios, phases, assertions, and HTML reports.
- quick-mode: Run instant load tests without config files. —
npx artillery quick -d 60 -r 20 http://localhost:3000/api/users
- scenario-tests: Write multi-step YAML scenarios with phases, hooks, and assertions. —
npx artillery run load-test.yml
- Check
knowledge and prerequisites: npx
2. Reason — think for artillery-mode
- For
quick-mode: Run instant load tests without config files. — decide which checks to run
- For
scenario-tests: Write multi-step YAML scenarios with phases, hooks, and assertions. — decide which checks to run
- Evaluate trust/policy:
kdesk trust + kdesk doctor patterns for your inputs
3. Act — execute with artillery-mode tools
- Tools:
Glob, Grep, Read, Npx (see frontmatter tools/allowed-tools)
- Use
safe_path for any write; record evidence (paths, checksums)
- Fingerprint:
artillery-mode:27a05c32
Artillery v2
What this skill does
Load-tests APIs with Artillery: instant quick runs for smoke tests, YAML scenarios for realistic flows, phased load ramping, response assertions, and HTML report generation.
When to use
- Verifying an endpoint's capacity before launch
- Catching latency regressions under load
- Reproducing a production spike pattern locally
Real commands
# Quick smoke test: 60s at 20 RPS
npx artillery quick -d 60 -r 20 http://localhost:3000/api/users
# POST with body
npx artillery quick -d 30 -r 10 -m POST -b '{"name":"test"}' -H "Content-Type: application/json" http://localhost:3000/api/users
# Scenario test
npx artillery run load-test.yml
# Save + render report
npx artillery run --output report.json load-test.yml
npx artillery report report.json
Scenario config
config:
target: http://localhost:3000
phases:
- duration: 60
arrivalRate: 10
rampTo: 50
- duration: 120
arrivalRate: 50
scenarios:
- name: fetch users
flow:
- get:
url: /api/users
expect:
statusCode: 200
Testing
- Compare p99 latency against an SLO, not just the average
- Run 2-3 minutes of steady load before judging capacity
Best practices
- Start with quick smoke tests, then formalize scenarios
- Assert statusCode and JSON bodies to fail on wrong responses
- Save raw JSON results as CI artifacts
Capabilities
quick-mode
Run instant load tests without config files.
Parameters:
duration (number): Test duration in seconds (-d)
rate (number): Requests per second (-r)
method (string): HTTP method, e.g. GET/POST
Commands:
npx artillery quick -d 60 -r 20 http://localhost:3000/api/users
npx artillery quick -d 30 -r 10 -m POST -b '{"name":"test"}' http://localhost:3000/api/users
npx artillery quick --insecure https://staging.your-app.test/api
npx artillery quick -d 60 -r 50 http://localhost:3000 -H "Authorization: Bearer $TOKEN"
Examples:
scenario-tests
Write multi-step YAML scenarios with phases, hooks, and assertions.
Parameters:
environment (string): Environment name from config (-e)
output (string): JSON results output path
report (string): Input JSON to render an HTML report
Commands:
npx artillery run load-test.yml
npx artillery run --output report.json load-test.yml
npx artillery report report.json
npx artillery run -e staging load-test.yml
npx artillery run --config base.yml --test-scenarios load-test.yml
Examples:
- npx artillery run --output results.json load.yml && npx artillery report results.json
- npx artillery run -e production --quiet load.yml
- npx artillery run --snippet-mode load.yml
References
1---2name: "artillery-mode"3description: "Load-tests APIs and WebSockets with Artillery v2: quick-mode runs, YAML scenarios, phases, assertions, and HTML reports. Use when working with quick mode, scenario tests, api or when the user mentions quick mode, scenario tests, api."4license: "MIT"5compatibility: "Requires npx."6metadata:7 source: https://skillmd.com/skills/opknock/artillery-mode8 author: Kdesk9 version: 2.0.010 category: api11allowed-tools: "Glob Grep Read Bash(npx:*)"12---1314Load-tests APIs and WebSockets with Artillery v2: quick-mode runs, YAML scenarios, phases, assertions, and HTML reports.1516## Agentic Workflow: Read -> Reason -> Act (artillery-mode)1718You are **Artillery Mode** (api/general) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.1920### 1. Read — api context for `artillery-mode`21- Domain: Load-tests APIs and WebSockets with Artillery v2: quick-mode runs, YAML scenarios, phases, assertions, and HTML reports.22- **quick-mode**: Run instant load tests without config files. — `npx artillery quick -d 60 -r 20 http://localhost:3000/api/users`23- **scenario-tests**: Write multi-step YAML scenarios with phases, hooks, and assertions. — `npx artillery run load-test.yml`24- Check `knowledge` and `prerequisites: npx`2526### 2. Reason — think for `artillery-mode`27- For `quick-mode`: Run instant load tests without config files. — decide which checks to run28- For `scenario-tests`: Write multi-step YAML scenarios with phases, hooks, and assertions. — decide which checks to run29- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs3031### 3. Act — execute with `artillery-mode` tools32- Tools: `Glob`, `Grep`, `Read`, `Npx` (see frontmatter `tools`/`allowed-tools`)33- Use `safe_path` for any write; record evidence (paths, checksums)34- Fingerprint: `artillery-mode:27a05c32`3536# Artillery v23738## What this skill does3940Load-tests APIs with Artillery: instant quick runs for smoke tests, YAML scenarios for realistic flows, phased load ramping, response assertions, and HTML report generation.4142## When to use4344- Verifying an endpoint's capacity before launch45- Catching latency regressions under load46- Reproducing a production spike pattern locally4748## Real commands4950```bash51# Quick smoke test: 60s at 20 RPS52npx artillery quick -d 60 -r 20 http://localhost:3000/api/users5354# POST with body55npx artillery quick -d 30 -r 10 -m POST -b '{"name":"test"}' -H "Content-Type: application/json" http://localhost:3000/api/users5657# Scenario test58npx artillery run load-test.yml5960# Save + render report61npx artillery run --output report.json load-test.yml62npx artillery report report.json63```6465## Scenario config6667```yaml68config:69 target: http://localhost:300070 phases:71 - duration: 6072 arrivalRate: 1073 rampTo: 5074 - duration: 12075 arrivalRate: 5076scenarios:77 - name: fetch users78 flow:79 - get:80 url: /api/users81 expect:82 statusCode: 20083```8485## Testing8687- Compare p99 latency against an SLO, not just the average88- Run 2-3 minutes of steady load before judging capacity8990## Best practices9192- Start with quick smoke tests, then formalize scenarios93- Assert statusCode and JSON bodies to fail on wrong responses94- Save raw JSON results as CI artifacts9596## Capabilities9798### quick-mode99Run instant load tests without config files.100101**Parameters:**102- `duration` (number): Test duration in seconds (-d)103- `rate` (number): Requests per second (-r)104- `method` (string): HTTP method, e.g. GET/POST105106**Commands:**107- `npx artillery quick -d 60 -r 20 http://localhost:3000/api/users`108- `npx artillery quick -d 30 -r 10 -m POST -b '{"name":"test"}' http://localhost:3000/api/users`109- `npx artillery quick --insecure https://staging.your-app.test/api`110- `npx artillery quick -d 60 -r 50 http://localhost:3000 -H "Authorization: Bearer $TOKEN"`111112**Examples:**113- npx artillery quick -d 60 -r 20 http://localhost:3000/api/users114- npx artillery quick -d 30 -r 10 -m POST -b '{"name":"test"}' -H "Content-Type: application/json" http://localhost:3000/api/users115- npx artillery quick -d 120 -r 100 --output report.json http://localhost:3000116117### scenario-tests118Write multi-step YAML scenarios with phases, hooks, and assertions.119120**Parameters:**121- `environment` (string): Environment name from config (-e)122- `output` (string): JSON results output path123- `report` (string): Input JSON to render an HTML report124125**Commands:**126- `npx artillery run load-test.yml`127- `npx artillery run --output report.json load-test.yml`128- `npx artillery report report.json`129- `npx artillery run -e staging load-test.yml`130- `npx artillery run --config base.yml --test-scenarios load-test.yml`131132**Examples:**133- npx artillery run --output results.json load.yml && npx artillery report results.json134- npx artillery run -e production --quiet load.yml135- npx artillery run --snippet-mode load.yml136137## References138- [Artillery Docs](https://www.artillery.io/docs)139- [Artillery Reference](https://www.artillery.io/docs/reference)140- [Getting Started](https://www.artillery.io/docs/guides/getting-started/installing-artillery)