openapi
БесплатноБез исполняемых скриптовНе проверенOpenAPI/Swagger specification. Covers schema definition, paths, and documentation. Use for API documentation. USE WHEN: user mentions "OpenAPI", "Swagger"…
от claude-dev-suite★ 51 звезда на GitHubОб этом скилле
OpenAPI Core Knowledge
Deep Knowledge: Use
mcp__documentation__fetch_docswith technology:openapifor comprehensive documentation.
Basic Structure
openapi: 3.1.0
info:
title: User API
version: 1.0.0
description: API for managing users
servers:
- url: https://api.example.com/v1
paths:
/users:
get:
summary: List users
operationId: listUsers
parameters:
- name: limit
in: query
schema:
type: integer
default: 20
responses:
'200':
description: List of users
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/User'
post:
summary: Create user
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateUser'
responses:
'201':
description: User created
content:
application/json:
schema:
$ref: '#/components/schemas/User'
/users/{id}:
get:
summary: Get user by ID
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
'200':
description: User found
'404':
description: User not found
components:
schemas:
User:
type: object
properties:
id:
type: string
name:
type: string
email:
type: string
format: email
required: [id, name, email]
CreateUser:
type: object
properties:
name:
type: string
email:
type: string
format: email
required: [name, email]
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
security:
- bearerAuth: []
Schema Types
# String with validation
type: string
minLength: 1
maxLength: 100
pattern: '^[a-zA-Z]+$'
format: email | date | date-time | uri | uuid
# Number
type: integer
minimum: 0
maximum: 100
# Enum
type: string
enum: [active, inactive, pending]
# Array
type: array
items:
type: string
minItems: 1
maxItems: 10
# Object
type: object
additionalProperties: false
When NOT to Use This Skill
- GraphQL API documentation (use
graphqlskill) - tRPC type-safe APIs (use
trpcskill) - Generating API clients (use
openapi-codegenskill) - Spring Boot API documentation (use
springdoc-openapiskill) - Code-first API development (consider using annotations/decorators)
Anti-Patterns
| Anti-Pattern | Why It's Bad | Solution |
|---|---|---|
| Missing response schemas | No type safety, poor docs | Define schemas for all responses |
| No examples in schemas | Hard to understand API | Add example or examples to all schemas |
Using only object without properties |
Loses type information | Define explicit properties with types |
| Not defining error responses | Incomplete API contract | Document 4xx and 5xx responses |
| Hardcoding server URLs | Environment-specific config in spec | Use server variables or multiple servers |
Missing required fields |
Ambiguous API contract | Mark all required fields explicitly |
| Duplicate schema definitions | Maintenance nightmare | Use $ref and components |
| No security schemes defined | Unclear authentication | Define security schemes in components |
Missing operationId |
Poor code generation | Add unique operationId to each endpoint |
Using additionalProperties: true everywhere |
Loses validation benefits | Set to false unless needed |
Quick Troubleshooting
| Issue | Possible Cause | Solution |
|---|---|---|
| Validation errors in spec | Invalid YAML/JSON syntax | Use @redocly/cli lint or Swagger Editor |
| Code generation fails | Missing operationId or invalid refs | Add operationIds, verify all $refs resolve |
| Swagger UI not loading | CORS or invalid spec | Check browser console, validate spec |
| Type errors in generated code | Schema mismatch with implementation | Ensure schemas match actual API responses |
| Missing fields in generated types | Schema not defining all properties | Add all properties to schema definition |
| Circular reference errors | Self-referencing schemas | Use allOf or refactor schema structure |
| Example validation fails | Example doesn't match schema | Ensure examples conform to schema constraints |
| Missing auth in Swagger UI | Security not configured | Add securitySchemes and security requirements |
Production Readiness
Complete Error Responses
components:
schemas:
Error:
type: object
properties:
code:
type: string
example: 'NOT_FOUND'
message:
type: string
example: 'User not
Установить openapi в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGrepGlobWriteEditВложенные файлы
FAQ
Что делает скилл openapi?
OpenAPI/Swagger specification. Covers schema definition, paths, and documentation. Use for API documentation. USE WHEN: user mentions "OpenAPI", "Swagger", "API spec", "API documentation", "schema definition", "OpenAPI 3.0", "Swagger UI", asks about "how to write OpenAPI spec", "document REST API", "API contract", "schema validation" DO NOT USE FOR: GraphQL schemas - use `graphql` instead; tRPC - use `trpc` instead; Generating clients from OpenAPI - use `openapi-codegen` instead; Spring Boot OpenAPI - use `springdoc-openapi` instead
Как установить скилл openapi?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл openapi запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic