/qa-toolkit:api-failure-to-bugfrom qa-toolkit
When 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).
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.
When an API test goes red, a senior SQA analyst does not paste the stack trace into the tracker. They decide whether it is a real product bug, and if so write a bug a developer can reproduce and a reviewer can approve. Take a failed API test (contract / endpoint / workflow) plus its failure output, triage it, and draft a bug in the exact house format below.
Draft-and-review only. The lifecycle is Draft -> Approved/Rejected -> Filed; this skill produces the Draft and stops. Filing to a tracker is a separate, deliberate step — hand the fields to testcase-to-tracker, or file directly. Never auto-file.
~~tracker below means whatever issue system the user files bugs in. references/bug-format.md maps the draft fields to common trackers.
Verify that ... case title if available) and level (contract / endpoint / workflow).Not every red test is a product bug. Classify first:
api-test-cases), no bug.State classification, confidence (high/medium/low), and a one-or-two-sentence reason. Only real_bug produces a drafted bug; still record the verdict for the others.
Draft fields (the frozen shape): title, severity, preconditions (ALWAYS ""), reproSteps (array of plain strings), expected, observations (array — the actual, one fact per bullet), suggestedFix (optional).
[Module] - [Feature])State plainly what is broken, name the endpoint, and END with the environment. ALL-CAPS the domain keywords (states/entities like OPEN, CLOSED, EMPTY; environment names QA, STAGING, PRODUCTION). No "should", no question phrasing, no speculation, no [Module] - [Feature] prefix. Pick the frame that fits:
<thing> not working / <thing> is/are not <verb>ingUnable to <verb> - <thing> is not <correct>Error <doing X> - Able to <do invalid thing> (for things that should be blocked but are not)Examples (match this style):
POST orders returns 500 on QA environmentUnable to CREATE order via POST orders on QA environmentorders response is missing the required id field on QA environmentAble to CREATE an order without a required customer via POST orders on QA environmentGET orders returns 401 for a valid bearer token on QA environmentpreconditions is ALWAYS ""; all setup goes into reproSteps as the first steps. Rules:
observations.["Response status is 500 Internal Server Error", "Response body is empty", "A subsequent GET orders does not include the new record"]. For a contract failure, one bullet per validation error ("items[0].id is missing (required)").Concrete and code-aware if a snippet was provided ("Return id from the create handler before serializing the response."). Leave "" if no high-confidence suggestion.
Definitive, neutral. No emoji, no greetings, no "Note:", no hedging, no em/en dashes. Exact identifiers verbatim. One bug = one issue — if the failure surfaces multiple distinct deviations, output multiple bugs.
Present the draft as readable text AND, when the user wants to save/queue it, as this JSON shape (status starts Draft):
{
"title": "POST orders returns 500 on QA environment",
"severity": "High",
"preconditions": "",
"reproSteps": ["Authenticate to the API as an ADMIN on the QA environment.", "Send a POST request to /orders with a valid payload.", "Read the response status."],
"expected": "POST orders returns 201 with the created order.",
"observations": ["Response status is 500 Internal Server Error", "Response body is empty", "No order is created"],
"suggestedFix": "",
"status": "Draft",
"source": { "test": "Orders - Orders - Verify that POST orders creates an order successfully.", "level": "endpoint", "failingAssertion": "expect(res.status()).toBe(201) // received 500" },
"triage": { "classification": "real_bug", "confidence": "high", "reason": "A valid create payload returns 500 and persists nothing; the endpoint is at fault." }
}
Present the draft(s) for review; let the user edit and Approve/Reject. When they choose to file, hand off to testcase-to-tracker (or file directly) using the field map in references/bug-format.md, which maps title/severity/repro/expected/observations to Azure DevOps ($Bug fields), Jira, and a generic tracker. Link the new bug to the source test case if one exists.
Show each drafted bug (title, severity, repro, expected, observations) grouped by triage verdict, with the non-real_bug failures listed as classified-but-not-filed. Ask: "File any of these?" For authoring or fixing the API cases themselves, use api-test-cases.
references/bug-format.md — the rendered bug anatomy and field mapping per tracker (Azure DevOps, Jira, generic)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub shironigun/marketplace --plugin qa-toolkit4 skills in this plugin
/api-test-casesAct 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./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.