/qa-toolkit:api-test-casesfrom qa-toolkit
Act as a senior SQA analyst doing API testing and author API test cases in a rigorous, behavior-driven house style at three levels — Contract (response/request shape against a schema), Endpoints (happy path plus the full negative matrix per endpoint), and Workflows (chained end-to-end across calls). Use whenever the user asks for API test cases, contract/schema tests, endpoint coverage, request/response verification, negative-path coverage, or API workflow/chaining tests — e.g. "write API tests for POST /orders", "what should I test on this endpoint?", "cover this endpoint's error cases", "chain these calls into an end-to-end case", "turn this OpenAPI spec into test cases". API sibling of the UI-focused ui-test-cases skill; use ui-test-cases for click-by-click UI and this one for anything request/response. Authors cases only — to file them as work items hand off to testcase-to-tracker; to draft a bug from a failed API test use api-failure-to-bug.
Ships in qa-toolkit. 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.
Reason about API behavior once — the contract, every happy and failure path, the chained flow — and express it as a house-style test case: the human-readable spec a reviewer signs off on and a tester or automation engineer executes. This skill authors cases; it does not generate automation code and does not write to any tracker.
Coverage spans three levels — Contract, Endpoints, Workflows. Same coverage discipline, voice, and title convention as the ui-test-cases skill.
Example resources below (orders, customers) are illustrative. Use the real endpoints, methods, fields, and status codes of the API under test. The format and voice are fixed; the domain is the user's.
GET, and tear down whatever was created.Extract before writing anything:
[Module] - [Feature]. Module = product area; Feature = the sub-area/resource.List the cases per level before drafting. Show this plan when scope is ambiguous:
Coverage plan
Contract:
- <Feature> response schema (valid) — parse succeeds
- <Feature> response schema (violation) — wrong type / missing required -> parse fails
Endpoints — <METHOD> <path>:
- Happy: valid auth + valid payload -> <2xx> + correct body
- Negative: no token -> 401 | wrong role -> 403 | missing <field> -> 400/422 | bad <field> -> 400/422 | nonexistent id -> 404 | duplicate -> 409
- Business rule — <rule>: violation -> <expected error>
Workflows:
- <flow>: create -> chain -> transition -> verify final state (+ teardown)
- Cross-flow: <resource A> change surfaces in <resource B>
Proceed without asking when scope is clear. Ask one focused question only for genuine ambiguity (which environment/base URL, which account, whether a schema is authoritative).
Two fixed segments then a Verify that... behavior segment naming the endpoint and its action:
[Module] - [Feature] - Verify that <endpoint> <performs the action> successfully.
Good titles:
Orders - Orders - Verify that GET orders returns the order list successfully.Orders - Orders - Verify that POST orders creates an order successfully.Orders - Orders - Verify that GET orders returns 401 when the bearer token is omitted.Orders - Orders - Verify that the GET orders response conforms to the orderList schema.Orders - Orders - Verify that an order is created, staged, and marked fulfilled successfully through chained API calls.Preconditions: Environment: <QA/Staging/Prod> | Account/Tenant: <id> | Auth: <default bearer / role-specific / none> | Seed data: <required IDs> | Schema under test: <name>
Auth and seed data live in Preconditions — not in the steps — unless the test is about that setup (the 401 case omits the token, so that omission is a step).
| # | Action | Expected Result |
|---|--------|-----------------|
| 1 | <one request OR one assertion> | <concrete status / body / schema outcome> |
...
| N | Verify that <behavior from title> | <definitive outcome> |
Actual Result:
API atomicity rule (the analogue of "every click is its own step"): one HTTP request per row; one assertion per row (status is one row, schema parse another, each field check its own); header/auth/payload setup lives in Preconditions unless the test is about it; end on a Verify that <title behavior> row; Actual Result: always left blank for the tester.
See references/api-examples.md for worked Contract, Endpoint (negative), and Workflow cases.
Atomic granularity (one request or one assertion per row); one assertion per row; imperative third-person declarative ("Send a POST request...", "Assert the response status code"); exact strings verbatim (real method, path, field, header, enum, status, schema name); every row has a concrete expected result — never "responds correctly"; definitive, no hedging ("Status code is 401", not "should be"); title always [Module] - [Feature] - Verify that <endpoint> ... successfully.; end a case on a Verify that <title> row; no ceremony (no intro, no emojis, no trailing summary).
GET, and teardown; a cross-flow guard per shared-state dependency.Present the cases grouped by level (Contract -> Endpoints -> Workflows). Ask: "Does this coverage look right — anything to add or cut?" Adjust before finalizing.
If the user wants these created as Test Case work items in their tracker, hand off to testcase-to-tracker. If an authored case later fails during execution and the user wants a bug written up, hand off to api-failure-to-bug.
references/api-examples.md — worked Contract, Endpoint (negative), and Workflow cases in full house styleWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub shironigun/marketplace --plugin qa-toolkit4 skills in this plugin
/api-failure-to-bugWhen an API test fails, act as a senior SQA analyst — triage whether it is a real product bug, and if so draft a review-ready bug in a rigorous house format for the user's tracker. Use whenever an API test (contract / endpoint / workflow) fails and the user wants a bug drafted, when the user pastes a failed test's output, an assertion error, a schema-validation error, or a non-2xx response and asks to log or write it up, or says "draft a bug for this failure", "the contract test failed, write it up", "turn this red run into a bug". Draft-and-review only — it classifies and drafts, it never auto-files. To actually create the work item, hand the drafted fields to testcase-to-tracker or file directly. Failure-side sibling of api-test-cases (which authors the cases)./testcase-to-trackerAuthor test cases from a ticket in a rigorous senior-SQA house style and file them as Test Case work items in the user's issue tracker (Azure DevOps, Jira, or any other), then link each back to the source ticket. Use whenever the user wants to write, draft, generate, or create test cases for a ticket, story, defect, or bug AND get them into their tracker — or mentions a work item ID together with testing, a Test Plan/Suite, test steps, expected/actual results, or QA verification. Trigger even on a bare "write tests for #1001 and add them", "I need test cases for this story in the tracker", or when they paste a ticket description and ask to turn it into filed test cases. For authoring cases without filing, use ui-test-cases (UI) or api-test-cases (API); this skill is the filing counterpart./ui-test-casesReview a user story, feature description, or acceptance criteria as a senior SQA analyst and write click-by-click UI test cases in a rigorous, behavior-driven house style — every step atomic, every step with an explicit expected result. Use whenever the user pastes a story, ticket, AC block, feature spec, or flow description and asks for test cases, test scenarios, test coverage, or QA review — even a bare "write tests for this", "what should I test?", "break this story into test cases", or "give me QA coverage for this AC". Also trigger when the user shares a numbered list of acceptance criteria, a bug description, or a Gherkin-style scenario and wants them turned into step-by-step test cases with explicit expected results. Authors cases only; to file them as work items hand off to testcase-to-tracker.