skills/setup-artillery-cli-for-load-testing/SKILL.md
Set up Artillery load testing for any project. Detects package manager and project type, creates a TypeScript test script (HTTP or Playwright browser), configures Artillery Cloud, and provides the run command. Use when the user wants to add load testing, performance testing, or browser-based load testing to their project.
npx skillsauth add artilleryio/agent-skills setup-artillery-cli-for-load-testingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are setting up Artillery (https://artillery.io), a load testing tool, for this project. Follow the steps below. Ask the user questions at each decision point marked with DECISION.
Examine the project to determine:
package-lock.json (npm), pnpm-lock.yaml (pnpm), yarn.lock (yarn), bun.lockb (bun). If none exist, this is a non-JS project — you will use npx.turbo.json, pnpm-workspace.yaml, lerna.json, or workspaces in package.json.playwright.config.ts, tests/, e2e/, or existing load test files.dev commands, API routes, or a deployed URL.DECISION — Ask these questions:
What do you want to test?
What is the target URL? (e.g. http://localhost:3000, https://staging.example.com). If you can infer it from the project config, suggest it.
Do you have an Artillery Cloud account? (free at https://app.artillery.io). If yes, ask for their API key (found in Settings > API Keys).
Based on detected package manager:
| Package manager | Command |
|---|---|
| npm | npm install -D artillery |
| pnpm | pnpm add -D artillery |
| yarn | yarn add -D artillery |
| bun | bun add -D artillery |
| non-JS project | No install. Use npx artillery@latest to run. |
If the user chose (B) Playwright, also install Playwright browsers (the Playwright engine is included in Artillery — no separate package needed):
npx playwright install
Create the test as a TypeScript file. Place it at a sensible location (e.g. load-tests/test.ts, tests/load/test.ts, or alongside existing test files). Use .ts extension always.
import type { Config, Scenario } from "artillery";
export const config: Config = {
target: "TARGET_URL",
phases: [
{
duration: 30, // seconds
arrivalRate: 1, // 1 new virtual users per second
name: "warm_up",
},
],
};
export const scenarios: Scenario[] = [
{
name: "SCENARIO_NAME",
engine: "http",
flow: [
{ get: { url: "/ENDPOINT" } },
],
},
];
Adapt this template:
target to the user's URL/ENDPOINT with a real endpoint from the project (prefer GET, read-only)config.http.defaults.headers{ post: { url: "/path", json: { key: "value" } } }import type { Config, Scenario, PlaywrightTestFunction } from "artillery";
export const config: Config = {
target: "TARGET_URL",
phases: [
{
duration: 10,
arrivalCount: 2, // total 2 browser sessions over 10s (safe default)
name: "smoke",
},
],
engines: {
playwright: {},
},
};
export const testFunction: PlaywrightTestFunction = async (page, vuContext, events, test) => {
await test.step("Go to homepage", async () => {
await page.goto("TARGET_URL");
await page.waitForLoadState("networkidle");
});
await test.step("DESCRIBE_ACTION", async () => {
// Add user interaction here:
// await page.click('text=Sign In');
// await page.fill('#email', '[email protected]');
// await page.waitForURL('**/dashboard');
});
};
export const scenarios: Scenario[] = [
{
name: "SCENARIO_NAME",
engine: "playwright",
testFunction: "testFunction",
},
];
Adapt this template:
test.step() to label each logical action — these show up in Artillery CloudIf the user provided an API key, instruct them to set the environment variable:
export ARTILLERY_CLOUD_API_KEY=<their-key>
Or they can pass it inline with the run command using --key.
Do NOT run the test. Output the command for the user to run themselves.
Basic run:
npx artillery run ./path/to/test.ts
With Artillery Cloud recording:
npx artillery run --record ./path/to/test.ts
With inline API key:
npx artillery run --record --key <API_KEY> ./path/to/test.ts
Tell the user:
--record is used, a link to Artillery Cloud dashboard will be printed.phases: [
{ duration: 30, arrivalRate: 5, name: "warm_up" },
{ duration: 60, arrivalRate: 5, rampTo: 50, name: "ramp_up" },
{ duration: 120, arrivalRate: 50, name: "sustained" },
]
export const config: Config — target URL, phases, engine config, pluginsexport const scenarios: Scenario[] — array of test scenariosengine: "http", then flow is auto-typed — { get: { url } }, { post: { url, json } }, { put: ... }, { delete: ... }, { log: ... }, { think: ... }, { loop: [...] }engine: "playwright" and testFunction: "functionName", export the functionexport const fn: PlaywrightTestFunction = async (page, vuContext, events, test) => { ... } — all params auto-typedtest.step(name, fn) — labels steps for reportingimport type { Config, Scenario, PlaywrightTestFunction } from "artillery"development
Set up the Artillery Playwright reporter in an existing Playwright E2E test suite. Installs @artilleryio/playwright-reporter, configures it in playwright.config.ts, sets up Artillery Cloud API key, and runs the suite to verify reporting works. Use when the user wants to add Artillery Cloud reporting to their Playwright tests, monitor E2E test results in a dashboard, or integrate Playwright with Artillery Cloud.
development
Convert existing Artillery YAML scripts to TypeScript or ESM JavaScript, auto-detecting the best output format, resolving YAML anchors by inlining, type-annotating exports, and verifying the output via tsc or node --check. Use when the user wants to migrate, rewrite, or translate Artillery load-test scripts from YAML to TS/JS for better IDE support, type checking, and composability.
tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------