/api-testing:api-buggerfrom api-testing
Acts as a senior SQA analyst when an API script fails in the automation project: triages the failure and drafts a house-style Azure DevOps Bug to review now and push later. Use whenever a Playwright API spec (contract / endpoint / workflow) fails and the user wants a bug drafted, when the user pastes a failed API test's output, assertion error, zod safeParse issues or 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". Drafts live in the automation project's find-bugs module; the skill drafts and reviews only and never auto-files. Failure-side sibling of api-tester, which authors the API cases and scripts.
Ships in api-testing. 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 script goes red, a senior SQA analyst does not paste the stack trace into ADO. They decide whether it is a real product bug, and if so write a bug a developer can reproduce and a reviewer can approve. This skill does exactly that for the automation/ project: take a failed Playwright API spec (contract / endpoint / workflow) plus its failure output, triage it, and draft a bug in the exact house format — saved to the find-bugs module to view and push to ADO later. It is the failure-side sibling of api-tester (which authors the cases/scripts).
Scope: this skill runs against the automation/ project and drafts into automation/find-bugs/.
Draft-and-review only. The lifecycle is Draft → Approved/Rejected → Pushed; this skill produces the Draft and stops. Pushing to ADO is a separate, deliberate step (hand the drafted fields to the user's tracker-filing tool, or file via ADO tooling using the field map below). Never auto-file.
Read references/workspace-profile.md, then load .claude/workspace-profile.json from the user's project. This skill needs:
tracker.*, boards.delivery, boards.support, workItemTypes.bug, fields.bug, identity, environments, variants, variantIdParam, and clientIdFormat.
If any are missing, run discovery for those keys only, confirm with the user, save, then continue. Every org fact below comes from the profile; nothing is assumed. Routes, partner names, ids and field values in the examples below are illustrative placeholders.
traces-case: header (from api-tester) — the case title and, if present, the adoTestCaseId and level (@contract|@endpoint|@workflow).expect(res.status()).toBe(201) → received 500), the response status/body, and for contract failures the zod safeParse error.issues.routes.<unit>.ts), the schema, the variant profile (a variants.values item) + environment + client id the run used, and (optional) the relevant code snippet for a suggested fix.Not every red test is a product bug. Classify first:
api-tester), 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 (this is the frozen shape — camelCase): 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/module, and END with the environment. ALL-CAPS the domain keywords (states/entities like OPEN, CLOSED, EMAIL, PDF, CSV; integration-partner names from variants.values, e.g. PARTNER-A, PARTNER-B; environments QA, STAGING, PRODUCTION), matching the house title habits recorded during discovery. Bracket a client id when client-specific (clientIdFormat, e.g. Contoso Outdoor [10001]). 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 aren't)API-molded examples (match this style):
POST orders returns 500 on QA environmentUnable to CREATE order via POST orders on PARTNER-B QA environmentorders response is missing the required id field on QA environmentAble to CREATE an order without a required contact via POST orders on QA environmentGET orders returns 401 for a valid bearer token on QA environmentCLOSED invoices are syncing as OPEN from PARTNER-B on STAGING environmentpreconditions is ALWAYS ""; all setup goes into reproSteps as the first steps. Rules:
POST /api/orders/.../orders, Authorization header, tenantId, status). Leave the broken result out of the steps — it belongs in 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 safeParse issue ("items[0].id is missing (zod: Required)"). This renders under a bold OBSERVATION: header.Concrete and code-aware if a code snippet was provided ("Return id from the create handler before serializing OrderResponse."). 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.
Save drafts under a find-bugs/ module in the automation/ repo (create it if absent; everything stays under automation/ — the isolation boundary). Confirm the path with the user before writing.
find-bugs/
README.md # the flow: red run → triage → draft → review → push
drafts/<slug>.json # the machine record (BugDraft shape + triage + source)
drafts/<slug>.md # a rendered preview of exactly what ADO will show (for review)
Draft JSON (mirrors the framework's BugDraft; status starts Draft, adoBugId null):
{
"title": "POST orders returns 500 on QA environment",
"severity": "High",
"preconditions": "",
"reproSteps": ["Authenticate to the API as an ADMIN on Client 10001 on the QA environment.", "Send a POST request to /api/orders/tenants/10001/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",
"adoBugId": null,
"source": { "spec": "modules/orders/api/tests/endpoints/orders-create.spec.ts", "tracesCase": "Sales - Orders - Verify that POST orders creates an order successfully.", "adoTestCaseId": null, "level": "endpoint" },
"triage": { "classification": "real_bug", "confidence": "high", "reason": "A valid create payload returns 500 and persists nothing; the endpoint is at fault." }
}
When pushed, the draft maps to an ADO Bug ($Bug) with this frozen field order — render the .md preview to match so review == the real thing:
System.Title = titleMicrosoft.VSTS.TCM.ReproSteps = repro HTML — env-first steps as <ul><li>…</li></ul>, then <div><b>OBSERVATION:</b></div><ul><li>…</li></ul> (one <li> per observation), then <div><i>[Attach screenshot/GIF here]</i></div>. (preconditions is empty, so no preconditions line.)Microsoft.VSTS.Common.Severity = 1 - Critical | 2 - High | 3 - Medium | 4 - LowSystem.AreaPath = the delivery board (boards.delivery.areaPath) for QA/Staging failures, or the support board (boards.support.areaPath) when the failure is on PRODUCTION / live clientsMicrosoft.VSTS.Common.Priority = 2Microsoft.VSTS.Common.ValueArea = Businessfields.bug), each set to its typical value from the profile; an owner/QA field takes identityfields.bug has one), use its typical manual value from the observed values (picklists reject arbitrary values like "Automated Test"; the automation provenance goes in System Info)Microsoft.VSTS.Common.AcceptanceCriteria = I know this bug is resolved when: + <ul><li>expected</li></ul>Microsoft.VSTS.TCM.SystemInfo = Suggested fix: (if any) + a "How this bug was found" block: filed from a failed Playwright API test, the spec/test name, the traces-case/ADO Test Case #, the triage verdict + confidence + reason, and the exact failing assertion message.Severity string mapping is exact: Critical→"1 - Critical", High→"2 - High", Medium→"3 - Medium", Low→"4 - Low".
Present the draft(s) for review; let the user edit and Approve/Reject. When they choose to file, hand off:
$Bug in tracker.project, then link Related to the source adoTestCaseId if known). With the official Azure DevOps MCP server that is wit_work_item_write (action create, the fields as { name, value, format }, format: "Html" on the HTML fields), then wit_work_item_link_write (action link, type: "related"); the tools appear as mcp__ado__<tool> or under a plugin's bundled ado server prefix. Show the draft and get approval first. On success, set the draft status to Pushed and record adoBugId.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: "Push any of these to ADO?" Only write the find-bugs/ files (and only under automation/) after confirming the path. For authoring or fixing the API cases/scripts themselves, use the api-tester sibling.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub shironigun/marketplace --plugin api-testing2 skills in this plugin