Skip to main content
openapi-swagger Expert skill for OpenAPI/Swagger specification analysis, validation, and documentation generation. Parse and validate specs, detect breaking changes, generate code samples, and lint for best practices.
跳到安装 Skills Marketplace 发现并探索由社区构建的 Agent Skills
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/a5c-ai/babysitter --skill openapi-swagger命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
下载 Zip 下载中... Reference for querying the Atlas knowledge graph through its MCP tools — the SECONDARY enrichment/comparison layer that adds best-practice context to systems you have ALREADY scanned from your real sources (`az`, repos, dirs). Use when you need to look up nodes, edges, kinds, clusters, stats, or wiki pages in Atlas to compare against your real inventory. (atlas graph, query atlas, atlas mcp, search the graph, graph neighbors, atlas record, atlas kinds, enrichment layer)
Atlas turns your STATED NEED into a real systems atlas by SCANNING your actual sources (Azure via `az`, git repos, local dirs) and process/data mining them, THEN enriching against the Atlas knowledge graph. Use this skill when asked to inventory/map your real systems, scan your cloud + repos + directories, mine the real processes or data they contain, or collect their real constraints/gotchas. (atlas, scan my systems, inventory our azure account, map my repos, real systems atlas, process mining, data mining, collect nuances, system discovery)
assimilate-popular-workflows This skill should be used when the user asks to "find skills in the wild", "assimilate popular workflows", "discover SKILL.md files in repos", "research external skills", "find workflow patterns", "survey the skill landscape", "what skills exist out there", or wants to investigate public repositories for extractable processes, babysitter plugins, and reusable procedural insights. Searches GitHub for SKILL.md files, classifies repos by archetype, and maintains structured research under docs/reference-repos/.
name openapi-swagger description Expert skill for OpenAPI/Swagger specification analysis, validation, and documentation generation. Parse and validate specs, detect breaking changes, generate code samples, and lint for best practices. allowed-tools Read, Write, Edit, Bash, Glob, Grep backlog-id SK-001 metadata {"author":"babysitter-sdk","version":"1.0.0"} graph {"domains":["domain:software-engineering"],"specializations":["specialization:technical-documentation"],"skillAreas":["skill-area:api-doc-generation","skill-area:reference-docs"],"roles":["role:technical-writer","role:documentation-engineer"]}
OpenAPI/Swagger Skill
Expert skill for OpenAPI/Swagger specification analysis and documentation generation.
Capabilities
Parse and validate OpenAPI 3.x and Swagger 2.0 specifications
Generate API documentation from specs (ReDoc, Swagger UI)
Detect breaking changes between API versions
Validate request/response examples against schemas
Generate code samples in multiple languages
Lint OpenAPI specs for best practices (Spectral rules)
Convert between OpenAPI formats (YAML/JSON, version migration)
Usage Invoke this skill when you need to:
Validate and lint OpenAPI specifications
Generate API reference documentation
Detect breaking changes between API versions
Create code samples from API specs
Migrate between OpenAPI versions
Inputs Parameter Type Required Description specPath string Yes Path to OpenAPI/Swagger spec file action string Yes validate, lint, generate-docs, diff, generate-samples outputDir string No Output directory for generated content targetVersion string No Target OpenAPI version for migration languages array No Languages for code sample generation rulesets array No Spectral ruleset files to apply
Input Example {
"specPath" : "./api/openapi.yaml" ,
"action" : "lint" ,
"rulesets" : [ ".spectral.yaml" ] ,
"outputDir" : "docs/api"
}
Output Structure
Validation Output {
"valid" : true ,
"errors" : [ ] ,
"warnings" : [
{
"path" : "paths./users.get.responses.200" ,
"message" : "Response should have a description" ,
"severity" : "warning"
}
] ,
"info" : {
"title" : "My API" ,
"version" : "1.0.0" ,
"openApiVersion" : "3.1.0"
}
}
Breaking Changes Output {
"breaking" : [
{
"type" : "removed-endpoint" ,
"path" : "DELETE /users/{id}" ,
"description" : "Endpoint removed in new version"
} ,
{
"type" : "changed-type" ,
"path" : "POST /users.requestBody.email" ,
"from" : "string" ,
"to" : "object"
}
] ,
"nonBreaking" : [
{
"type" : "added-endpoint" ,
"path" : "GET /users/{id}/profile"
}
]
}
OpenAPI Specification Patterns
OpenAPI 3.1 Template openapi: 3.1 .0
info:
title: My API
description: API description with **Markdown** support
version: 1.0 .0
contact:
name: API Support
email: support@example.com
license:
name: MIT
identifier: MIT
servers:
- url: https://api.example.com/v1
description: Production
- url: https://staging-api.example.com/v1
description: Staging
tags:
- name: users
description: User management operations
paths:
/users:
get:
operationId: listUsers
summary: List all users
description: Returns a paginated list of users
tags:
- users
parameters:
- $ref: '#/components/parameters/PageParam'
- $ref: '#/components/parameters/LimitParam'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/UserList'
examples:
success:
$ref: '#/components/examples/UserListExample'
'401':
$ref: '#/components/responses/Unauthorized'
components:
schemas:
User:
type: object
required:
- id
- email
properties:
id:
type: string
format: uuid
description: Unique identifier
email:
type: string
format: email
description: User email address
name:
type: string
description: Display name
createdAt:
type: string
format: date-time
UserList:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/User'
pagination:
$ref: '#/components/schemas/Pagination'
parameters:
PageParam:
name: page
in: query
schema:
type: integer
minimum: 1
default: 1
LimitParam:
name: limit
in: query
schema:
type: integer
minimum: 1
maximum: 100
default: 20
responses:
Unauthorized:
description: Authentication required
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
security:
- bearerAuth: []
Spectral Configuration
.spectral.yaml extends:
- spectral:oas
rules:
operation-description: warn
operation-operationId: error
operation-operationId-valid-in-url: true
path-params: error
operation-security-defined: error
path-must-have-tag:
description: Every path must have at least one tag
given: $.paths[*][*]
severity: warn
then:
field: tags
function: length
functionOptions:
min: 1
require-example:
description: Responses should have examples
given: $.paths[*][*].responses[*].content[*]
severity: info
then:
field: examples
function: truthy
Code Sample Generation
Generated Samples
const response = await fetch ('https://api.example.com/v1/users' , {
method : 'GET' ,
headers : {
'Authorization' : 'Bearer YOUR_TOKEN' ,
'Content-Type' : 'application/json'
}
});
const data = await response.json ();
import requests
response = requests.get(
'https://api.example.com/v1/users' ,
headers={
'Authorization' : 'Bearer YOUR_TOKEN' ,
'Content-Type' : 'application/json'
}
)
data = response.json()
curl -X GET 'https://api.example.com/v1/users' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json'
Workflow
Parse specification - Load and parse OpenAPI/Swagger file
Validate syntax - Check for schema compliance
Lint for best practices - Apply Spectral rules
Generate documentation - Create ReDoc/Swagger UI output
Generate samples - Create code examples
Report findings - Output validation results
Dependencies {
"devDependencies" : {
"@stoplight/spectral-cli" : "^6.11.0" ,
"swagger-cli" : "^4.0.0" ,
"@redocly/cli" : "^1.0.0" ,
"openapi-generator-cli" : "^2.7.0" ,
"oasdiff" : "^1.0.0"
}
}
CLI Commands
npx @redocly/cli lint openapi.yaml
npx spectral lint openapi.yaml
npx @redocly/cli build-docs openapi.yaml -o docs/index.html
oasdiff breaking old-api.yaml new-api.yaml
npx openapi-generator-cli generate -i openapi.yaml -g typescript-fetch -o ./sdk
Best Practices Applied
Use $ref for reusable components
Include examples for all schemas
Document all error responses
Use semantic versioning
Include operationId for all operations
Tag all endpoints
Provide server URLs for all environments
References
Target Processes
api-doc-generation.js
api-reference-docs.js
sdk-doc-generation.js
docs-testing.js