AugmentClaude

OpenAPI Spec Generation

Writes and validates OpenAPI 3.1 specs from code or design-first contracts.

Installation

  1. Make sure Claude is on your device and in your terminal.

    Skills load from ~/.claude/skills/ when Claude Code starts up — so you need it on your machine first. If you don't have it yet, install it once with the command below, then run claude in any terminal to verify.

    One-time setup
    npm i -g @anthropic-ai/claude-code

    Already have it? Skip ahead.

  2. Paste into Claude Code or into your terminal.

    This copies the whole skill folder into ~/.claude/skills/openapi-spec-generation-wshobson/ — the SKILL.md plus any scripts, reference docs, or templates the skill ships with. Safe default: works for every skill.

    Faster alternative (instruction-only skills)

    Skips the clone and grabs only the SKILL.md file. Don't use this if the skill ships Python scripts, reference markdowns, or asset templates — they won't be downloaded and the skill will fail when it tries to load them.

    Quick install (SKILL.md only)
    Sign up to copy
  3. Restart Claude Code.

    Quit and reopen Claude Code (or any other agent that loads from ~/.claude/skills/). New skills are picked up on startup.

  4. Just ask Claude.

    Skills auto-activate when your request matches the skill's description — no slash command needed. Trigger phrases live in the skill's own frontmatter; you can read them in the “What this skill does” section above.

Prefer to read the source first? Open on GitHub.

When Claude uses it

Teaches Claude to author and maintain OpenAPI 3.1 specifications for REST APIs, covering the spec structure (info, servers, paths, components) and the three workflows for getting there: design-first, code-first, and hybrid annotation. Includes a reusable-schema and validation playbook with concrete do's and don'ts ($ref reuse, explicit nullable, documented error codes, defined security schemes). Reach for it when documenting an API from scratch, generating a spec from existing code, enforcing contract compliance, or producing client SDKs from a spec.

What this skill does

What it does: Gives Claude reference patterns for producing valid, maintainable OpenAPI 3.1 specifications and choosing the right authoring workflow for the situation.

  • Lays out the OpenAPI 3.1 document skeleton (openapi, info, servers, paths, components for schemas and securitySchemes) as a starting template.
  • Compares three design approaches with guidance on when each fits: design-first for new contracts, code-first for existing APIs, and hybrid annotation for evolving ones.
  • Covers the full lifecycle: documenting from scratch, generating specs from code, validating implementations against the contract, and generating client SDKs.
  • Encodes best practices as do's and don'ts, $ref schema reuse, real-world examples, exhaustive error-code documentation, explicit nullable fields, API versioning, and defined security schemes.
  • Points to a bundled references/details.md template library and worked examples to load when concrete spec snippets are needed.

Related skills