/team-skills:openapifrom Team Skills
Produce a clean, standards-compliant OpenAPI 3.0.3 JSON spec from a deployed REST API by capturing live responses (real IDs, real error messages) and assembling them into a vendor-neutral document that imports cleanly into EchoAPI, Postman, Swagger UI, codegen tools, and AI agents. Use when the user asks to write an openapi.json, document a deployed API, regenerate the spec from a stack, or refresh examples after a backend change. Triggered with /openapi.
Ships in Team 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.
None: SKILL.md is the whole skill.
Produce a clean, vendor-neutral OpenAPI 3.0.3 document from a deployed REST API. Examples and error bodies in the output are captured live against the target environment — no synthetic placeholders, no pat_abc123.
openapi.json for a deployed stack.{ "data": {}, "error": { "type": "", "details": "" } } schema stubs — i.e. it lacks real examples.Before writing the spec, always do these three steps in order:
Ask for (or read from session context):
https://typnqht56e.execute-api.us-east-1.amazonaws.com/dev).template.yaml, FastAPI app, or an existing draft openapi.yaml. Read it to enumerate routes, methods, request schemas, path params, and query params.testing_data.txt from the user or derive them by calling a list endpoint first.Goal: capture one real response body per endpoint per documented status code.
-w "\n---HTTP:%{http_code}---\n" on every curl so the status code is visible alongside the body.Rules are non-negotiable. Each one fixed a real EchoAPI / agent-renderer bug during the original session.
{
"openapi": "3.0.3",
"info": { "title": "...", "version": "1.0.0", "description": "...", "contact": {...} },
"servers": [ { "url": "<BASE_URL>", "description": "<env> (<region>)" } ],
"security": [ { "ApiKeyAuth": [] } ],
"tags": [ ... ],
"paths": { ... },
"components": { "securitySchemes": {...}, "parameters": {...}, "schemas": {...}, "responses": {...} }
}
/. Never use full URLs as path keys. The base URL belongs in servers. EchoAPI's importer rejects full-URL keys (Property "https://..." is not expected to be here).allOf, oneOf, anyOf, not, discriminator. EchoAPI's schema-stub generator doesn't merge them and falls back to the parent schema, producing empty {} and "" stubs.XxxEnvelope schema explicitly lists status, message, data (with the concrete typed $ref or inline object), meta, error. Don't compose via allOf: [Envelope, {data: Xxx}].{"type": "object", "nullable": true, "properties": {...}} instead of {"allOf": [{"$ref": "..."}], "nullable": true}.Every response under paths.*.*.responses.<code>.content."application/json" MUST carry:
schema ($ref or inline) — for codegen.examples block with named camelCase keys, each containing summary, optionally description, and value = the real captured payload.Standard example key names — use exactly these so AI agents pattern-match them:
| Key | When |
|---|---|
successWithData | 200 with a populated response body |
successEmpty | 200 with an empty list / no matching rows |
created | 201 |
validationError | 400 generic |
invalidPhoneFormat / invalidDateRange / ... | 400 specific |
missingRequiredField | 400 specific |
unauthorized | 401 (envelope from the handler) |
forbidden | 403 (envelope from the handler) |
apiGatewayMissingKey | 403 RAW (AWS API Gateway response when header missing — bypasses the envelope) |
notFound, patientNotFound, hospitalNotFound, appointmentNotFound | 404 |
conflict, slotAlreadyTaken | 409 |
gone | 410 |
unprocessable, slotNotAvailable | 422 |
serverError | 500 |
Pattern (real captured data — never pat_abc123 placeholders):
"200": {
"description": "Reach runtime blob — agent metadata, hospital profile, details, and instructions.",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/ReachRuntimeConfigEnvelope" },
"examples": {
"successWithData": {
"summary": "200 OK — populated payload",
"value": { "status": 200, "message": "OK", "data": {...real captured...}, "meta": null, "error": null }
}
}
}
}
}
example on every envelopeIn addition to the response-level examples, every envelope schema in components/schemas MUST carry a top-level example field with a realistic captured payload. This is what schema-stub generators (EchoAPI, codegen tools, Swagger UI) use when rendering from the schema rather than the labeled examples:
"ReachRuntimeConfigEnvelope": {
"type": "object",
"properties": { "status": {...}, "message": {...}, "data": { "$ref": "..." }, "meta": {...}, "error": {...} },
"example": { "status": 200, "message": "OK", "data": {...real...}, "meta": null, "error": null }
}
To clear lint rule "A schema property should have a $ref property referencing a reusable schema" — define these in components/schemas and reference from every parameter:
"StringParam": { "type": "string" },
"DateParam": { "type": "string", "format": "date" },
"LimitParam": { "type": "integer", "minimum": 1, "maximum": 200, "default": 50 },
"AppointmentStatus": { "type": "string", "enum": [...] }
Then every parameters[].schema becomes { "$ref": "#/components/schemas/StringParam" } etc.
Put every error response in components/responses with a description AND an examples block:
"NotFound": {
"description": "404 Not Found — the addressed resource does not exist in the caller's tenant.",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/Envelope" },
"examples": {
"patientNotFound": { "summary": "...", "value": {...real...} },
"hospitalNotFound": { "summary": "...", "value": {...real...} },
"appointmentNotFound": { "summary": "...", "value": {...real...} }
}
}
}
}
Per-endpoint responses then reference them: "404": { "$ref": "#/components/responses/NotFound" }.
"securitySchemes": {
"ApiKeyAuth": {
"type": "apiKey",
"in": "header",
"name": "x-api-key",
"description": "<one-line of how the key is provisioned + which env table holds the sha256 hash>"
}
}
Never embed the raw key value. Document the header name + where keys are seeded, nothing more.
If the stack is behind AWS API Gateway with ApiKeyRequired: true, a missing x-api-key header returns the raw API-Gateway body — NOT the handler envelope:
{ "message": "Forbidden" }
Status code is 403, not 401. Document this explicitly as a separate example under the Unauthorized response (key apiGatewayMissingKey) with a description noting the bypass — otherwise consumers will reasonably expect the envelope shape.
Before declaring the spec done, run:
python -c "import json, re; t = open('openapi.json').read(); s = json.loads(t); \
print('openapi :', s['openapi']); \
print('servers :', 'servers' in s and s['servers'][0]['url']); \
print('paths :', len(s['paths'])); \
print('schemas :', len(s['components']['schemas'])); \
print('allOf :', t.count('\"allOf\"')); \
print('oneOf :', t.count('\"oneOf\"')); \
print('anyOf :', t.count('\"anyOf\"')); \
print('empty \"\" :', len(re.findall(r'\"[a-zA-Z_]+\"\\s*:\\s*\"\"', t))); \
print('full-URL keys:', sum(1 for k in s['paths'] if k.startswith('http')))"
All of: openapi=3.0.3, servers set, paths > 0, allOf=0, oneOf=0, anyOf=0, empty-strings=0, full-URL-keys=0.
Also confirm:
examples block.example field.message and error.details string from the live API — not generic text like "item not found".Write the spec to <repo-or-stack>/api/openapi.json. If the user asked for it in a specific path, honor that. Always finish with:
"data": "", "description": "", "example": "". Empty strings come from un-typed schemas; type them properly instead."200 (success with data)") — EchoAPI auto-appends (200), producing "200 (success with data) (200)". Use camelCase keys without status codes.pat_abc123, Apollo Hospitals Hyderabad, Cardiology, Arjun Reddy, +91 98765 43210) after capturing real data. Replace every one.x-api-key value, JWTs, basic-auth credentials — all stay out.X-Apidog-Api-Version, X-Echoapi-Api-Version, or other vendor headers to documented requests unless the deployed API actually requires them.x-internal: { "captured": false, "reason": "..." } and tell the user.What SKILL.md sets; muted values are Claude Code's defaults
12 skills in this plugin
/backend-pythonSenior-level standard for building and extending Python backends. Enforces uv-only workflow, the latest stable Python installed on the machine, Pydantic v2 schemas + pydantic-settings config, a clean layered src/ layout, robust & optimized typed code, pytest testing, Ruff lint+format, and proper documentation. Use whenever creating a new Python project/service or adding backend code (APIs, services, data models, CLIs, workers)./context7-mcpThis skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code generation involving libraries, or mentions of specific frameworks like React, Vue, Next.js, Prisma, Supabase, etc./Other plugins' skills for the same job
npx claudepluginhub karthikrommula/team-toolkit --plugin team-skills