From agentforge
Maintains Toxiproxy chaos tests under src/tests/chaos/. Use when adding fault-injection scenarios or changing chaos CI/provision scripts.
How this skill is triggered — by the user, by Claude, or both
Slash command
/agentforge:chaos-test-maintainerThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Keeps **Toxiproxy** fault-injection tests and provision scripts aligned. See `docs/reference/reliability/chaos-testing.md`.
Keeps Toxiproxy fault-injection tests and provision scripts aligned. See docs/reference/reliability/chaos-testing.md.
src/tests/chaos/**/*.chaos.test.tstooling/vitest/chaos.config.ts, pnpm chaos:provision, or docker-compose.yml chaos profiledocker compose up -d postgres redis # Docker daemon must be running (docker info)
pnpm chaos:up # builds tooling/chaos/toxiproxy.Dockerfile on first run
pnpm chaos:provision # default upstreams postgres:5432 / redis:6379 (compose net)
pnpm db:migrate
pnpm test:chaos # self-contained: forces NODE_ENV=test, sets proxied URLs itself
Proxied defaults: Postgres 25432, Redis 26379, Toxiproxy admin 8474.
Most chaos "failures" on a fresh machine are environment, not code. Check these first:
docker-compose.yml builds
tooling/chaos/toxiproxy.Dockerfile from the official
GitHub release binary because ghcr.io/shopify/toxiproxy's blob CDN (pkg-containers.githubusercontent.com)
is 403-blocked on some networks. Don't "fix" chaos:up by switching to image: ghcr.io/... or Docker Hub
shopify/toxiproxy (Docker Hub only has ≤2.1.4, whose /version is a bare string and breaks the health
check). Keep the pinned version matching the CI service container in reusable-chaos-toxiproxy.yml.NODE_ENV=test. src/tests/chaos/bootstrap-env.ts hard-forces it (= 'test',
not ||=) so a developer's .env.local (which load-env-files layers as an override, often NODE_ENV=local)
cannot leak through. If it runs as local: public auth forms 401 (captcha is only bypassed for
test/development/staging) and cleanupDatabase/cleanupTestRedis throw. Never downgrade that to ||=.chaos:provision
uses postgres:5432 / redis:6379. Only set CHAOS_TOXIPROXY_POSTGRES_UPSTREAM / ..._REDIS_UPSTREAM
(e.g. 127.0.0.1:5432) if you run Toxiproxy outside the compose network.X-Idempotency-Key is a correct 422 (idempotency_key_reuse), not a replay.app.close(). Administratively disabling the Postgres proxy can
leave a severed postgres.js connection that sql.end() cannot drain, hanging afterAll to its timeout.
Re-enable the proxy, probe once, then Promise.race the close against a short cap (see postgres-health.chaos.test.ts).src/tests/chaos/<name>.chaos.test.ts (picked up only by tooling/vitest/chaos.config.ts).docs/reference/reliability/chaos-testing.md if needed.reusable-chaos-toxiproxy.yml: provision → migrate (proxied DATABASE_URL) → pnpm test:chaos.
app.close() if it disables a proxy)pnpm test:chaos passes locally with chaos profile uppnpm test unless intentionalbootstrap-env.ts still hard-forces NODE_ENV = 'test' (never ||=)tooling/chaos/toxiproxy.Dockerfile, version matching the CI service containerGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub nikunjmavani/core-be