From nickcrew-claude-ctx-plugin
Designs, validates, and maintains OpenAPI 3.x specifications for REST API contracts including schema patterns, security schemes, and versioning. Use for creating specs, reviewing contracts, generating docs/SDKs.
npx claudepluginhub nickcrew/claude-cortexThis skill uses the workspace's default tool permissions.
Design, validate, and maintain OpenAPI 3.x specifications for REST API contracts.
Authors and validates OpenAPI 3.1 specifications for REST API design following API-first and contract-first practices. Provides templates for paths, components, servers, and responses.
Generates and maintains OpenAPI 3.1 specs from code, design-first approaches, or validation patterns for RESTful APIs, docs, SDKs, and contract compliance.
Designs contract-first REST APIs using OpenAPI 3.1 specifications, covering schemas, paths, parameters, responses, security, and best practices.
Share bugs, ideas, or general feedback.
Design, validate, and maintain OpenAPI 3.x specifications for REST API contracts. Covers schema patterns, security schemes, versioning, and code generation integration.
| Resource | Purpose | Load when |
|---|---|---|
references/spec-patterns.md | Schema patterns, security schemes, validation, versioning, reusable components | Designing or reviewing specs |
Phase 1: Design → Define API overview, resources, and operations
Phase 2: Schema → Build data models with reusable components
Phase 3: Validate → Lint and verify the spec for correctness
Phase 4: Integrate → Generate docs, SDKs, and contract tests
Start with a high-level design before writing the spec:
openapi: 3.1.0
info:
title: [API Name]
version: 1.0.0
description: [What this API does]
paths:
/resources:
get:
summary: List resources
operationId: listResources
post:
summary: Create a resource
operationId: createResource
/resources/{id}:
get:
summary: Get a resource
operationId: getResource
components:
schemas: {}
securitySchemes: {}
Build data models using components/schemas for reuse:
$ref to reference shared schemas -- never duplicate definitionsallOf for composition, oneOf / anyOf for polymorphismexample values to every schema and propertyrequired arrays explicitly -- don't rely on implicit behaviortype: [string, "null"] (3.1) or nullable: true (3.0)Run validation before committing any spec changes:
# Spectral (recommended)
spectral lint openapi.yaml
# Redocly
redocly lint openapi.yaml
# swagger-cli
swagger-cli validate openapi.yaml
| Issue | Fix |
|---|---|
Missing operationId | Add unique operationId to every operation |
| Unused schema | Remove from components or add a $ref |
Missing response description | Add description to every response code |
| Path parameter not in path | Match {param} in path with parameter definition |
No 2xx response defined | Add at least one success response per operation |
Use the validated spec to generate downstream artifacts:
$ref to components/schemas for anything reused200 OK for create operations -- use 201 Created4xx and 5xx consistentlyadditionalProperties: true without clear justification