From ai
You are an expert TypeScript test-infrastructure engineer. You will generate a production-grade, reusable “Backend Conformance Kit†that validates common enterprise web-application behaviors (insurance-grade) using black-box HTTP tests. This kit must be framework-agnostic and reusable across any backend (Node, Bun, Laravel, Spring Boot, Go, etc.) by configuration only. Do NOT use any framework-native testing utilities. Treat the target system as an external HTTP API.
npx claudepluginhub judigot/aiThis skill uses the workspace's default tool permissions.
You are an expert TypeScript test-infrastructure engineer. You will generate a production-grade, reusable “Backend Conformance Kit†that validates common enterprise web-application behaviors (insurance-grade) using black-box HTTP tests. This kit must be framework-agnostic and reusable across any backend (Node, Bun, Laravel, Spring Boot, Go, etc.) by configuration only. Do NOT use any framew...
Scaffolds or migrates test-suite projects for API, E2E/UI, or shared libraries. Configures archetypes, frameworks like Playwright/Cypress/Jest/Vitest, tags, reporters, CI, and verifies guards.
Build API test suites — endpoint testing, contract testing, load testing for REST/GraphQL/gRPC APIs. Use when asked to "test this API", "API tests", "endpoint testing", "contract tests", or "load test".
Builds API test suites for endpoint integration, contract verification, and load testing on REST/GraphQL/gRPC APIs using tools like Supertest, Pact, k6.
Share bugs, ideas, or general feedback.
You are an expert TypeScript test-infrastructure engineer. You will generate a production-grade, reusable “Backend Conformance Kit†that validates common enterprise web-application behaviors (insurance-grade) using black-box HTTP tests. This kit must be framework-agnostic and reusable across any backend (Node, Bun, Laravel, Spring Boot, Go, etc.) by configuration only. Do NOT use any framework-native testing utilities. Treat the target system as an external HTTP API.
Build a TypeScript monorepo (or single package) that provides:
Primary design principle: One test kit for my whole career. New services should require minimal work: only implement endpoints + fill out a config file + optional seed hooks.
dotenv/config or explicit dotenv.config()), plus process.env accessGenerate a repo with:
Provide a runnable example:
pnpm test:conformance -- --config ./conformance.config.example.ts
or similar.The kit should be used like this:
conformance.config.example.ts to conformance.config.tsbaseUrlpnpm test runs all conformance suitespnpm test:auth runs only auth suiteBASE_URL=http://localhost:3000 pnpm testConfig must be strongly typed and validated at startup. Missing fields should fail fast with human-readable errors.
Each suite:
Allow enabling/disabling suites and individual tests via config flags:
features: { csrf: true, idempotency: true, audit: false, ... }
Allow custom “service adapters†if an org has multiple API styles.Implement these suites in v1:
Config fields:
Notes:
Purpose: enforce consistent API error shape across endpoints. Config fields:
Config fields:
selectItems(json): unknown[]selectNextCursor(json): string | null (cursor mode)selectTotal(json): number | null (optional)
Assertions:Config fields:
Config fields:
Implement a harness that provides:
createClient() returns:
assertStatus(response, allowedStatuses)assertHeader(response, name, predicate)assertSetCookieHasAttributes(setCookieHeaders, cookieName, attributes[])assertCookieCleared(setCookieHeaders, cookieName)assertJsonSchema(data, schema) using AjvparseJson(response) with robust JSON parsing and helpful errorswithFreshClient() utility to test “no cookie†scenariossuite runner that can:
Also include a small retry wrapper:
.env provides ENVIRONMENT-SPECIFIC overrides and sensitive values (base URL, credentials).Do not let .env become “the real config.†If it changes the meaning of the standard, it belongs in TypeScript config.
.env.example (committed): shows required env vars and safe defaults.env (gitignored): developer/CI-specific valuesconformance.config.example.ts (committed): uses env vars but keeps standards in codeSupport these env vars:
BASE_URL (string) - base URL of the target APITEST_EMAIL (string) - seed user emailTEST_PASSWORD (string) - seed user passwordREQUIRE_SECURE_COOKIE ("true" | "false") - whether to enforce Secure on cookiesHTTP_TIMEOUT_MSHTTP_RETRY_COUNT.env values loaded by dotenvimport "dotenv/config" at the entry point OR an explicit dotenv.config() in a dedicated module.env.ts helper:
getEnvString(name, { required, defaultValue })getEnvBoolean(name, { defaultValue })Add scripts:
pnpm test -> vitest runpnpm test:auth -> vitest run (only auth suite)pnpm typecheckpnpm lint (optional; keep minimal if too much)Write a README that explains:
Include:
conformance.config.example.ts.env.exampleany. Use proper types and narrowings.pnpm install then pnpm test (assuming BASE_URL points to a running API).Now generate the repo.