/engineering-advanced-skills:api-test-suite-builderfrom engineering-advanced-skills
Generates API test skeletons from OpenAPI specs, scans route definitions across frameworks, and produces ready-to-run test suites for Vitest+Supertest, Pytest+httpx, or k6. Use when adding API tests, auditing coverage, or catching contract drift.
Ships in engineering-advanced-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Scan API route definitions across frameworks (Next.js App Router, Express, FastAPI, Django REST, Go net/http), analyze request/response schemas, and generate comprehensive test suites covering authentication, authorization, input validation, error handling, pagination, file uploads, rate limiting, contract testing, and load testing. Outputs ready-to-run test files for Vitest+Supertest (Node), Pytest+httpx (Python), or k6 (load testing).
Before generating the suite, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.
--framework).Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.
The scripts read OpenAPI 3.x / Swagger 2.0 JSON specs. Auth, validation, Pact and k6 patterns for the parts the scripts do not generate are in the references.
# 1. Generate skeletons (pytest+httpx or vitest+supertest) into a scratch dir, then move what you keep
python scripts/test_generator.py assets/sample_openapi.json --framework vitest --output /tmp/api-tests
# 2. Measure coverage: endpoints called by a test, and endpoints whose tests assert on the body
python scripts/coverage_analyzer.py assets/sample_openapi.json assets/sample_tests --threshold 50 --show-covered
python scripts/coverage_analyzer.py assets/sample_openapi.json /tmp/api-tests --threshold 95 # exit 1: skeletons only
# 3. Validate recorded responses against the spec's response schemas
python scripts/contract_validator.py assets/sample_openapi.json assets/sample_responses # exit 0
python scripts/contract_validator.py assets/sample_openapi.json assets/sample_responses_flawed # exit 1, 3 violations
Tools overview.
test_generator.py writes one file per tag: 401 tests for secured operations, 422 tests per required field and wrong type, a success test that expects the spec's own 2xx code (201 for create, 204 for delete) on a URL with path parameters filled in, and a skipped placeholder for each declared error code. Every success test carries a TODO to assert on the body; a skeleton proves the route answers, not that it is right.coverage_analyzer.py pairs each HTTP call with its own method and path, matches {param} segments, and ignores skipped tests. It reports two numbers: endpoints called, and endpoints with a body or header assertion. --threshold gates on the second, so a suite of status-only skeletons cannot pass a 95% gate.contract_validator.py matches each sample by filename (GET_users_200.json) or a _meta block ({"method", "path", "status"}) and reports missing required fields, wrong types and disallowed properties; --strict also rejects extra properties where the schema does not forbid them.All three accept --json.
Exit codes. 0 sound (or files generated); 1 coverage below --threshold or a sample violates its contract; 2 missing or unreadable spec, directory or sample set, invalid JSON, or a file that is not an OpenAPI spec.
Done when:
coverage_analyzer.py --threshold passes at the bar your team agreed (asserted coverage, not call coverage).contract_validator.py passes on fresh recorded responses.Mistake: Every test asserts status == 200 and nothing about the body.
Why it happens: Generated skeletons look finished, and status checks are easy to write.
Instead: Assert the fields the spec promises (ids, types, error messages). coverage_analyzer.py counts only these tests toward the gate.
Mistake: No test sends a missing field, a wrong type or an expired token. Why it happens: Negative cases need fixtures and feel like extra work. Instead: Start from the generated 401 and 422 cases and add one negative test per validation rule and per role boundary.
Mistake: Validating response samples someone typed, which match the spec by construction. Why it happens: Recording real traffic takes setup. Instead: Record responses from a running build (staging or a local server) and validate those. Drift only shows up in real output.
scripts/test_generator.py, scripts/coverage_analyzer.py, scripts/contract_validator.py — the three CLIs above.assets/sample_openapi.json — four-operation Users API; assets/sample_tests/ — a small hand-written suite (75% called, 50% asserted).assets/sample_responses/ (valid) and assets/sample_responses_flawed/ (three contract violations).references/ — route detection per framework, test matrices, Pact and k6 scripts, workflow and quality bar.Load the reference that matches the task — keep this file lean and pull detail on demand:
This skill covers:
This skill does NOT cover:
engineering/api-design-reviewer for schema review patterns)engineering/playwright-pro)engineering/database-schema-designer)engineering/skill-security-auditor)engineering/api-design-reviewer — review the spec before generating tests from it.engineering/ci-cd-pipeline-builder — run the suite and the coverage gate where your team gates merges.engineering/playwright-pro — browser-level tests for the frontend that calls these APIs.engineering/performance-profiler — follow up on endpoints that miss k6 thresholds.assets/sample_openapi.json (opens in a new tab)assets/sample_responses/GET_users_200.json (opens in a new tab)assets/sample_responses/get_user.json (opens in a new tab)assets/sample_responses_flawed/create_user.json (opens in a new tab)assets/sample_tests/test_users.py (opens in a new tab)references/contract-and-load-testing.md (opens in a new tab)references/route-detection-and-matrices.md (opens in a new tab)references/workflow-and-quality.md (opens in a new tab)scripts/contract_validator.py (opens in a new tab)scripts/coverage_analyzer.py (opens in a new tab)scripts/test_generator.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
api-testing, contract-testing, load-testing, openapi, test-generation
npx claudepluginhub borghei/claude-skills --plugin engineering-advanced-skills100 skills in this plugin
/a11y-auditStatic WCAG scan of HTML files (alt text, headings, labels, ARIA, lang, landmarks) and colour contrast checks for colour pairs or CSS. Use when auditing templates for accessibility, checking contrast, or adding an a11y gate to CI.
/agent-designerDesigns multi-agent system architectures with orchestration patterns, tool schemas, and performance evaluation. Use when building AI agent systems, designing agent workflows, creating tool schemas, or evaluating agent performance.
/agent-harnessTest and evaluation harness for AI agents — scenario suites, deterministic replay, regression diffing, cost and latency budgets. Use when agent quality is vibe-checked, before shipping a prompt or model change, or when evals drift.
Other plugins' skills for the same job