perf-test

A command that creates and runs performance tests for web APIs, which are program interfaces that applications use to exchange data. It supports k6 and Locust, two tools for simulating many users.

In plain words
What is it for?
Finding API endpoints, running smoke, load, stress, spike, or soak tests, and generating performance reports.
Why use it?
It helps reveal slow endpoints, capacity limits, and bottlenecks before they affect real users.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/alphaaiservice/cortex/perf-test
Clone the repo
git clone --depth 1 https://github.com/alphaaiservice/cortex
Per session 48 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 13,237 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00048 $0.13237
Opus 5 $0.00024 $0.06619
Sonnet 5 $0.00010 $0.02647
Haiku 4.5 $0.00005 $0.01324

Measured yesterday against content hash c87d0ec8cb79, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

perf-test scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

curl -s http://localhost:8000/openapi.json 2>/dev/null | python3 -m json.tool 2>/dev/null | head -100 || echo "Server not running or no OpenAPI schema available"

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s http://localhost:8000/openapi.json 2>/dev/null | python3 -m json.tool 2>/dev/null | head -100 || echo "Server not running or no OpenAPI schema available"
commands/perf-test.md · 1,558 lines

How it starts

The opening of the file, as written. The whole thing — 1,558 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Performance & Load Testing Suite

Target: $ARGUMENTS (default: all endpoints, default users: 100, default duration: 60s)

Parse $ARGUMENTS for:

  • target: specific endpoint path (e.g., /api/v1/users) or all
  • --users=N: number of virtual users (default: 100)
  • --duration=Ns: test duration in seconds (default: 60s)
  • --type=TYPE: test type — smoke, load, stress, spike, soak (default: load)
  • --tool=TOOL: testing tool — k6 or locust (default: k6)
  • --base-url=URL: API base URL (default: auto-detect from project config)

Step 1: Discover API Endpoints

Scan the project for all API endpoints, categorize them, and build an endpoint inventory.

1a: Find FastAPI Routers and Endpoints

echo "=== Scanning for FastAPI router files ==="
find . -name "*.py" -path "*/api/*" -o -name "*.py" -path "*/routes/*" -o -name "*.py" -path "*/routers/*" | head -50

echo ""
echo "=== Scanning for endpoint decorators ==="
grep -rn "@router\.\(get\|post\|put\|delete\|patch\|options\|head\)\|@app\.\(get\|post\|put\|delete\|patch\|options\|head\)" --include="*.py" . | head -100

echo ""
echo "=== Checking for OpenAPI schema ==="
grep -rn "openapi\|swagger\|/docs\|/redoc" --include="*.py" . | head -20

echo ""
echo "=== Checking for API prefix configuration ==="
grep -rn "prefix\s*=\s*['\"]" --include="*.py" . | grep -i "router\|api" | head -20

echo ""
echo "=== Checking for auth dependencies ==="
grep -rn "Depends.*auth\|Depends.*get_current_user\|Depends.*verify_token\|Depends.*require_role" --include="*.py" . | head -30

1b: Parse and Categorize Endpoints

For each discovered endpoint, extract:

  • HTTP method (GET, POST, PUT, DELETE, PATCH)
  • Full path (including router prefix)
  • Auth requirement (public vs authenticated vs admin-only)
  • Request body schema (if POST/PUT/PATCH — find Pydantic models)
  • Path parameters and query parameters
  • Response model

Categorize each endpoint:

  • Public vs Authenticated: Does it have auth dependency injection?
  • Read vs Write: GET/HEAD = read, POST/PUT/DELETE/PATCH = write
  • Critical vs Non-Critical: Auth endpoints, payment endpoints, health checks = critical

Read the full file on GitHub · 1,558 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 1,558 lines · 48 tokens per session scan C c87d0ec8cb79

Subscribe to this mod's changes

perf-test is a command published in the GitHub repository alphaaiservice/cortex (1 stars, last pushed 26d ago), licensed MIT. It adds 48 tokens to every session and 13,237 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.