Skip to main content
skill Claude Code CX Codex Cursor

openapi-spec-generation — Claude Code skill

Creates and maintains OpenAPI 3.1 specs from code or design-first contracts. Use it for API docs, SDK generation, and contract checks.

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add wshobson/agents
/plugin install documentation-generation@claude-code-workflows
Open on GitHub

What openapi-spec-generation does

This skill covers OpenAPI 3.1 work from the first draft through ongoing maintenance. It can help create API documentation, derive a specification from existing code, design contracts before implementation, validate an API against its spec, and prepare specs for client SDK generation.

The material describes design-first, code-first, and hybrid workflows. Templates and worked examples are stored in references/details.md. It also covers reusable schemas with $ref, error responses, security schemes, API versioning, nullable values, naming consistency, and server variables.

Install it when your project needs the API code and contract to stay aligned. Skip it for work that has no OpenAPI or API-contract concerns.

What it helps with

  • draft an OpenAPI 3.1 specification
  • derive an API spec from existing code
  • design a contract before implementation
  • check an API implementation against its spec
  • prepare a specification for client SDK generation

Example prompts for the agent

  • Create an OpenAPI 3.1 spec for this REST API and reuse shared schemas with `$ref`.
  • Compare the API implementation with its specification and list missing error responses.
  • Build a design-first contract for these endpoints using the templates in `references/details.md`.

How to install openapi-spec-generation

1Plugin marketplace

/plugin marketplace add wshobson/agents
/plugin install documentation-generation@claude-code-workflows

This installs the whole documentation-generation plugin with all its skills

2Skills CLI (Vercel)

npx skills add wshobson/agents --skill openapi-spec-generation -a claude-code

3Manually: put the files in place

~/.claude/skills/openapi-spec-generation/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/openapi-spec-generation/

From the same set213

The whole set →
typescript-advanced-types Seth Hobson Guides an agent through advanced TypeScript types, from generics to conditional and mapped types. Use it for typed libraries, API clients, or strict configuration objects. Claude Code CX Codex Cursor 92,169installs tailwind-design-system Seth Hobson Helps build design systems with Tailwind CSS v4, from theme tokens to component variants. Use it when a project needs shared UI patterns. Claude Code CX Codex Cursor 70,180installs brand-landingpage Travis D. Elliott This skill interviews you about the product and its visual direction, then builds a landing page through Stitch. Use it when there’s no established design yet. Claude Code CX Codex Cursor 39,476installs python-testing-patterns Seth Hobson This skill guides Python testing with pytest, fixtures and mocks. Use it when building a test suite or tracking down failing checks. Claude Code CX Codex Cursor 36,943installs python-performance-optimization Seth Hobson This skill profiles Python code to locate CPU and memory bottlenecks. Use it when an application responds slowly or consumes too many resources. Claude Code CX Codex Cursor 35,675installs nextjs-app-router-patterns Seth Hobson This skill covers Next.js App Router patterns for rendering, routing, and data fetching. Use it when starting an App Router project or moving from Pages Router. Claude Code CX Codex Cursor 32,529installs api-design-principles Seth Hobson Use this skill to plan or review REST and GraphQL APIs. It helps when writing a specification or setting API conventions for a team. Claude Code CX Codex Cursor 30,348installs code-review-excellence Seth Hobson This skill guides pull request reviews, catches logic and security issues, and helps teams give specific feedback. Use it for review standards or developer mentoring. Claude Code CX Codex Cursor 30,193installs

Similar

google-ads-api-account-diagnostics official google-ads-api-team This skill helps investigate falling conversions, low lead volume, and lost Google Ads impressions caused by budget, bids, or ad rank. Claude Code Gemini CLI CX Codex 5,508installs google-cloud-global-frontend-configuration official google This skill guides design and deployment of a Google Cloud global external Application Load Balancer. Use it for CDN, WAF, and Service Extensions setup. Claude Code Gemini CLI CX Codex 5,300installs gemini-live-api official google This skill generates a Gemini LiveAPI client for bidirectional WebSocket exchange. Use it when a project needs session handling, authentication, and streaming input or output. Claude Code Gemini CLI CX Codex 5,200installs ccxt-python ccxt Helps Python developers integrate cryptocurrency exchanges using CCXT. Covers REST and WebSocket endpoints in both synchronous and asyncio modes. Claude Code CX Codex Cursor +1 2,000installs google-cloud-solution-n-tier-serverless-web-app official google Design secure n-tier serverless apps and microservices on Google Cloud with architecture guidance, Terraform, security checks, and deployment help. Claude Code Gemini CLI CX Codex 5,000installs golang-pro https://github.com/Jeffallan A Go skill for concurrent code, microservices, performance profiling, and idiomatic interfaces. Use it for goroutines, gRPC, benchmarks, and table-driven tests. Claude Code CX Codex Cursor +1 18,900installs mcp-builder official anthropics This skill walks through building an MCP server in TypeScript or Python, from reading the protocol spec to writing tests and evaluation questions. Claude Code Claude.ai 130,949installs google-agents-cli-adk-code official Google A reference skill for building ADK agents with tools, callbacks, state, and workflows. Use it when an agent project needs concrete API patterns or code examples. Claude Code CX Codex Cursor +1 511,400installs

Questions about openapi-spec-generation

How do I install openapi-spec-generation in Claude Code?

Run npx skills add wshobson/agents --skill openapi-spec-generation -a claude-code. The skill file is placed at ~/.claude/skills/openapi-spec-generation/SKILL.md.

What does openapi-spec-generation do?

It helps create and maintain OpenAPI 3.1 specifications from code or a contract designed before implementation. It also covers API validation, documentation, and SDK-generation workflows.

Which OpenAPI design approaches does it support?

It supports design-first, code-first, and hybrid approaches. Concrete templates and worked examples are available in references/details.md.

Source text

SKILL.md · MIT
---
name: openapi-spec-generation
description: Generate and maintain OpenAPI 3.1 specifications from code, design-first specs, and validation patterns. Use when creating API documentation, generating SDKs, or ensuring API contract compliance.
---

# OpenAPI Spec Generation

Comprehensive patterns for creating, maintaining, and validating OpenAPI 3.1 specifications for RESTful APIs.

## When to Use This Skill

- Creating API documentation from scratch
- Generating OpenAPI specs from existing code
- Designing API contracts (design-first approach)
- Validating API implementations against specs
- Generating client SDKs from specs
- Setting up API documentation portals

## Core Concepts

### 1. OpenAPI 3.1 Structure

```yaml
openapi: 3.1.0
info:
  title: API Title
  version: 1.0.0
servers:
  - url: https://api.example.com/v1
paths:
  /resources:
    get: ...
components:
  schemas: ...
  securitySchemes: ...
```

### 2. Design Approaches

| Approach         | Description                  | Best For            |
| ---------------- | ---------------------------- | ------------------- |
| **Design-First** | Write spec before code       | New APIs, contracts |
| **Code-First**   | Generate spec from code      | Existing APIs       |
| **Hybrid**       | Annotate code, generate spec | Evolving APIs       |

## Templates and detailed worked examples

Full template library and detailed worked examples live in `references/details.md`. Read that file when you need the concrete templates.

## Best Practices

### Do's

- **Use $ref** - Reuse schemas, parameters, responses
- **Add examples** - Real-world values help consumers
- **Document errors** - All possible error codes
- **Version your API** - In URL or header
- **Use semantic versioning** - For spec changes

### Don'ts

- **Don't use generic descriptions** - Be specific
- **Don't skip security** - Define all schemes
- **Don't forget nullable** - Be explicit about null
- **Don't mix styles** - Consistent naming throughout
- **Don't hardcode URLs** - Use server variables

© Seth Hobson · MIT · wshobson/agents

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor