From nickcrew-claude-ctx-plugin
Designs, validates, and maintains OpenAPI 3.x specifications for REST API contracts. Covers schema patterns, security schemes, versioning, and code generation integration.
How this skill is triggered — by the user, by Claude, or both
Slash command
/nickcrew-claude-ctx-plugin:openapi-specificationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Design, validate, and maintain OpenAPI 3.x specifications for REST API contracts.
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 justificationnpx claudepluginhub nickcrew/claude-cortexStructures OpenAPI 3.x specs with consistent naming, reusable schemas, error modeling, pagination, security schemes, and examples to produce a spec that works as a contract for code generation.
Generates and maintains OpenAPI 3.1 specs from code, design-first specs, and validation patterns. Use for API docs, SDK generation, or contract compliance.
Generates and validates OpenAPI 3.1 specs from code or design-first contracts. Use when creating API docs, generating SDKs, or ensuring contract compliance.