Skip to content

Guide · Agent skill

How to use the OpenAPI Spec Generation agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The openapi-spec-generation skill is a set of structured instructions that teaches an AI coding agent how to write, generate and check OpenAPI 3.1 specifications, the machine-readable format that describes a REST API's endpoints, data shapes and security. It is aimed at backend developers and teams who need API documentation or an agreed API contract. After this guide you will know how to install the skill, ask for the right kind of spec, and review the output.

OpenAPI Spec Generationwshobson/agents · MIT

Quick start

  1. 1Download the ZIP. Get the openapi-spec-generation skill ZIP from this page.
  2. 2Unzip into a skills folder. Extract it into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder for one project.
  3. 3Or upload in the Claude apps. In the Claude apps, go to Settings → Capabilities → Skills and upload the ZIP.
  4. 4Make a natural request. Ask for an OpenAPI 3.1 spec, naming your framework and the code or endpoints involved.
  5. 5Pick the approach. Say whether you want design-first for a new contract or code-first for an existing API.
  6. 6Review the YAML. Compare paths, schemas, errors and security schemes with the real service before sharing it.

What is an agent skill and what does this one do?

An agent skill is a folder containing a SKILL.md file of instructions that an AI agent loads when a task matches the skill's description. This skill covers three jobs: creating a spec from scratch, generating a spec from existing code, and checking an implementation against a spec.

It also applies best practices from its guidance, such as reusing schemas with $ref, documenting possible error codes, defining every security scheme, and using server variables instead of hardcoded URLs. Detailed templates and worked examples are stored in a separate reference file and loaded only when needed.

  • Design-first: write the spec before the code, to agree on a contract.
  • Code-first: generate a spec from an existing API, with examples for Python/FastAPI and TypeScript/tsoa.
  • Validation: check an implementation against a spec and use linting and SDK generation patterns.

Install the openapi-spec-generation skill

Download the skill ZIP from this page and unzip it. The skill folder contains SKILL.md and a references folder with two files. Put the folder in one of two places depending on how you want to use it.

For all your projects, unzip it into your personal skills folder at ~/.claude/skills/. For a single project, unzip it into that project's .claude/skills/ folder so it applies only there and can be shared with your team through the repository.

In the Claude apps you can instead upload the ZIP under Settings → Capabilities → Skills.

  • Personal: ~/.claude/skills/
  • Single project: .claude/skills/ inside the project folder
  • Claude apps: Settings → Capabilities → Skills, then upload the ZIP

Ask for a spec with a natural request

You do not need a special command. The skill's description tells the agent when to use it, so plain requests about API documentation, contracts or SDKs should be enough. Name your framework or language and point the agent at your code or your intended endpoints.

Be specific about the goal. A request to create a spec for an existing service produces a code-first result, while a request to design an API before building it produces a design-first contract.

  • "Generate an OpenAPI 3.1 spec from my FastAPI routes in app/api."
  • "Design an OpenAPI 3.1 contract for a todo API before we write any code."
  • "Check whether our Express handlers match the openapi.yaml in this repo."
  • "Write the security schemes and error responses for this spec."

Choose between design-first and code-first

The skill describes three approaches. Design-first means writing the spec before code and suits new APIs and contracts. Code-first generates the spec from code and suits existing APIs. Hybrid means annotating code and generating the spec, which suits APIs that are still changing.

If your team needs to agree on endpoints before anyone builds them, ask for design-first. If a REST service already exists and lacks documentation, ask for code-first.

Review and use the output

Read the generated YAML against your real behaviour. Check that servers, paths, schemas and security schemes match what your service actually does, because the agent works from the code or description you give it and cannot confirm runtime behaviour on its own.

Ask the agent to apply the skill's do's and don'ts, such as adding examples, documenting errors and avoiding generic descriptions. For SDK generation or linting, the reference material covers those patterns, but the skill itself does not run any tools.

  • Confirm every path and response code matches the implementation.
  • Confirm each security scheme is defined and referenced.
  • Keep the spec in version control next to the code.

What people use it for

  • Documenting an existing REST service so other developers can read its endpoints and data shapes.
  • Drafting a design-first contract that a frontend and backend team agree on before building.
  • Preparing a spec that will later be used to generate client SDKs.
  • Checking that an implementation still matches its OpenAPI document.

Frequently asked questions

Is the openapi-spec-generation skill free?

The skill is published under the MIT licence, as stated on this page. The MIT licence permits use, modification and redistribution, so check the licence text in the source repository for the full terms.

What do I need to use this skill?

The source lists no specific requirements, and the skill does not run scripts or use the network. You need an agent environment that supports skills and a codebase or description of an API to work from.

Does the skill run code on my machine?

No. The skill runs no scripts and uses no network access, according to its listing. It provides instructions and reference templates that the agent reads.

Can it generate an OpenAPI spec from my existing code?

Yes. The skill includes code-first patterns, including a Python/FastAPI example and TypeScript/tsoa guidance. Output quality depends on how completely your code describes its types and responses.

Does it work for non-REST APIs like GraphQL or gRPC?

No. OpenAPI describes REST-style HTTP interfaces only, so this skill is not suited to projects that do not expose HTTP APIs.

Why won't the skill trigger for my request?

Skills are chosen based on their description. Use clear API-specific wording such as OpenAPI, API documentation, SDK generation or API contract, and confirm the folder is in the correct skills path.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

This skill suits backend developers documenting a REST service, and teams that want to agree on an API contract before coding. It is less useful for non-technical readers who need general documentation, because the output is developer-focused YAML. If your project does not expose HTTP APIs, choose a tool built for that interface instead.

Download the skill