Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Generate OpenAPI specifications from code or legacy APIs with schema inference and documentation
.claude/skills/a5c-ai-openapi-generator/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 23% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 5% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 122% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 142% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 246% | 0% |
You are openapi-generator - a specialized skill for generating and validating OpenAPI specifications. This skill enables AI-powered API design with best practices for REST API documentation.
This skill enables comprehensive OpenAPI specification management including:
Generate complete OpenAPI specifications:
yamlopenapi: 3.1.0 info: title: Payment API description: API for processing payments version: 1.0.0 contact: name: API Support email: api@example.com license: name: MIT url: https://opensource.org/licenses/MIT servers: - url: https://api.example.com/v1 description: Production server - url: https://staging-api.example.com/v1 description: Staging server tags: - name: payments description: Payment operations - name: refunds description: Refund operations paths: /payments: post: operationId: createPayment summary: Create a new payment tags: [payments] security: - bearerAuth: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/PaymentRequest' examples: creditCard: summary: Credit card payment value: amount: 9999 currency: USD paymentMethod: type: card cardNumber: "4111111111111111" responses: '201': description: Payment created successfully content: application/json: schema: $ref: '#/components/schemas/Payment' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' components: securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT schemas: PaymentRequest: type: object required: - amount - currency - paymentMethod properties: amount: type: integer minimum: 1 description: Amount in smallest currency unit (cents) currency: type: string enum: [USD, EUR, GBP] description: ISO 4217 currency code paymentMethod: $ref: '#/components/schemas/PaymentMethod' metadata: type: object additionalProperties: type: string Payment: type: object properties: id: type: string format: uuid status: type: string enum: [pending, processing, completed, failed] amount: type: integer currency: type: string createdAt: type: string format: date-time responses: BadRequest: description: Invalid request content: application/json: schema: $ref: '#/components/schemas/Error' Unauthorized: description: Authentication required content: application/json: schema: $ref: '#/components/schemas/Error' Error: type: object properties: code: type: string message: type: string details: type: array items: type: object
Validate OpenAPI specifications using multiple tools:
bash# Using Spectral (Stoplight) spectral lint openapi.yaml --ruleset .spectral.yaml # Using Redocly CLI redocly lint openapi.yaml # Using swagger-cli swagger-cli validate openapi.yaml # Using openapi-generator-cli openapi-generator-cli validate -i openapi.yaml
Infer OpenAPI schemas from examples:
javascript// Input: JSON examples const examples = [ { id: 1, name: "Product A", price: 29.99, inStock: true }, { id: 2, name: "Product B", price: 49.99, inStock: false } ]; // Generated schema const schema = { type: 'object', required: ['id', 'name', 'price', 'inStock'], properties: { id: { type: 'integer' }, name: { type: 'string' }, price: { type: 'number', format: 'double' }, inStock: { type: 'boolean' } } };
Detect breaking changes between API versions:
bash# Using openapi-diff openapi-diff v1/openapi.yaml v2/openapi.yaml --format json # Breaking changes include: # - Removed endpoints # - Required parameter added # - Response schema changes # - Security requirement changes
Generate mock servers from specifications:
bash# Using Prism prism mock openapi.yaml # Using Mockoon mockoon-cli start --data openapi.yaml # Using openapi-mock-generator openapi-mock-generator -i openapi.yaml -o ./mocks
Generate client and server code:
bash# Generate TypeScript client openapi-generator-cli generate \ -i openapi.yaml \ -g typescript-axios \ -o ./generated/client # Generate Node.js server stubs openapi-generator-cli generate \ -i openapi.yaml \ -g nodejs-express-server \ -o ./generated/server # Generate Python client openapi-generator-cli generate \ -i openapi.yaml \ -g python \ -o ./generated/python-client
This skill can leverage the following MCP servers:
| Server | Description | Installation | |--------|-------------|--------------| | mcp-openapi-schema | OpenAPI schema exploration for LLMs | GitHub | | Apidog MCP Server | API documentation and code generation | apidog.com |
yaml# Good: Reusable components components: schemas: PaginatedResponse: type: object properties: data: type: array pagination: $ref: '#/components/schemas/Pagination' Pagination: type: object properties: total: { type: integer } limit: { type: integer } offset: { type: integer } hasMore: { type: boolean }
yaml# Multiple security options components: securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT apiKeyAuth: type: apiKey in: header name: X-API-Key oauth2: type: oauth2 flows: authorizationCode: authorizationUrl: https://auth.example.com/authorize tokenUrl: https://auth.example.com/token scopes: read: Read access write: Write access
This skill integrates with the following processes:
api-design-specification.js - Primary API design workflowmicroservices-decomposition.js - Service interface definitionsystem-design-review.js - API review and validationWhen generating specifications, provide structured output:
json{ "operation": "generate", "version": "3.1.0", "status": "success", "specification": { "path": "./api/openapi.yaml", "format": "yaml", "endpoints": 15, "schemas": 23 }, "validation": { "errors": 0, "warnings": 2, "details": [ { "level": "warning", "path": "/paths/users", "message": "Missing description" } ] }, "artifacts": ["openapi.yaml", "openapi.json"], "mockServer": { "url": "http://localhost:4010", "tool": "prism" } }
| Error | Cause | Resolution | |-------|-------|------------| | Invalid schema reference | $ref points to undefined | Define all referenced schemas | | Duplicate operationId | Non-unique operation IDs | Ensure unique operationIds | | Invalid response code | Invalid HTTP status code | Use standard status codes | | Missing required field | Schema validation failure | Add all required fields |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 25,240 | 19,986 | -21% | 1 | 1 | 0% | 6,221 | 7,634 | +23% | 0 | 0 | — |
case-02 | fail→pass | 23,658 | 16,912 | -29% | 1 | 1 | 0% | 6,215 | 6,530 | +5% | 0 | 0 | — |
case-03 | fail→pass | 7,227 | 4,576 | -37% | 1 | 1 | 0% | 1,483 | 3,297 | +122% | 0 | 0 | — |
case-04 | pass→pass | 3,097 | 3,561 | +15% | 1 | 1 | 0% | 660 | 3,063 | +364% | 0 | 0 | — |
case-05 | pass→pass | 1,866 | 2,002 | +7% | 1 | 1 | 0% | 345 | 2,688 | +679% | 0 | 0 | — |
case-06 | pass→pass | 2,202 | 1,685 | -23% | 1 | 1 | 0% | 365 | 2,672 | +632% | 0 | 0 | — |
case-07 | pass→pass | 3,062 | 1,782 | -42% | 1 | 1 | 0% | 607 | 2,674 | +341% | 0 | 0 | — |
case-08 | pass→pass | 4,859 | 3,823 | -21% | 1 | 1 | 0% | 870 | 3,011 | +246% | 0 | 0 | — |
case-09 | pass→pass | 4,300 | 3,344 | -22% | 1 | 1 | 0% | 648 | 2,962 | +357% | 0 | 0 | — |
case-10 | fail→pass | 7,027 | 6,901 | -2% | 1 | 1 | 0% | 1,605 | 3,878 | +142% | 0 | 0 | — |
case-11 | fail→pass | 4,495 | 4,047 | -10% | 1 | 1 | 0% | 922 | 3,187 | +246% | 0 | 0 | — |
case-12 | pass→pass | 4,908 | 1,822 | -63% | 1 | 1 | 0% | 915 | 2,680 | +193% | 0 | 0 | — |
case-13 | pass→pass | 2,437 | 1,833 | -25% | 1 | 1 | 0% | 399 | 2,646 | +563% | 0 | 0 | — |
case-14 | pass→pass | 2,084 | 1,348 | -35% | 1 | 1 | 0% | 351 | 2,541 | +624% | 0 | 0 | — |
case-15 | pass→pass | 10,862 | 7,323 | -33% | 1 | 1 | 0% | 2,055 | 3,912 | +90% | 0 | 0 | — |
case-16 | pass→pass | 4,540 | 4,209 | -7% | 1 | 1 | 0% | 893 | 3,276 | +267% | 0 | 0 | — |
case-17 | pass→pass | 4,463 | 2,475 | -45% | 1 | 1 | 0% | 770 | 2,807 | +265% | 0 | 0 | — |
case-18 | pass→pass | 3,491 | 3,447 | -1% | 1 | 1 | 0% | 798 | 3,102 | +289% | 0 | 0 | — |
case-19 | pass→pass | 10,474 | 9,560 | -9% | 1 | 1 | 0% | 1,819 | 4,223 | +132% | 0 | 0 | — |
case-20 | pass→fail | 7,159 | 7,091 | -1% | 1 | 1 | 0% | 1,513 | 3,896 | +158% | 0 | 0 | — |
case-21 | pass→pass | 1,887 | 6,222 | +230% | 1 | 1 | 0% | 345 | 3,493 | +912% | 0 | 0 | — |
case-22 | pass→pass | 5,129 | 4,250 | -17% | 1 | 1 | 0% | 1,114 | 3,363 | +202% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +18 percentage points is the difference between those two pass rates over the 22 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
| Model | Method | Date | Lift |
|---|---|---|---|
| gemini-3.6-flash | verified | 8/1/2026 | +68% |
Other measured skills in the registry, with their headline benchmark lift.