openapi-spec-generator

Automated OpenAPI specification generation from code annotations, comments, and interface definitions

509 stars

Best use case

openapi-spec-generator is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Automated OpenAPI specification generation from code annotations, comments, and interface definitions

Teams using openapi-spec-generator should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/openapi-spec-generator/SKILL.md --create-dirs "https://raw.githubusercontent.com/a5c-ai/babysitter/main/library/specializations/sdk-platform-development/skills/openapi-spec-generator/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/openapi-spec-generator/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How openapi-spec-generator Compares

Feature / Agentopenapi-spec-generatorStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Automated OpenAPI specification generation from code annotations, comments, and interface definitions

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# OpenAPI Spec Generator Skill

## Overview

This skill automates the generation of OpenAPI 3.x specifications from code annotations, comments, and interface definitions. It parses source code to extract API endpoints, schemas, and documentation to produce comprehensive and accurate API specifications.

## Capabilities

- Parse code to extract API endpoints and schemas from annotations
- Generate OpenAPI 3.x specifications in YAML or JSON format
- Validate spec completeness and correctness against OpenAPI standards
- Auto-update specs from code changes with incremental generation
- Support multiple frameworks (Express, FastAPI, Spring, ASP.NET, etc.)
- Extract request/response schemas from TypeScript types, Python type hints, Go structs
- Generate examples from code-level documentation

## Target Processes

- API Design Specification
- API Documentation System
- SDK Code Generation Pipeline

## Integration Points

- Code analysis tools (AST parsers)
- Schema validators (Spectral, openapi-spec-validator)
- Swagger/OpenAPI tooling ecosystem
- IDE extensions for spec preview

## Input Requirements

- Source code with API route definitions
- Annotation/decorator conventions used in the codebase
- Target OpenAPI version (3.0.x or 3.1.x)
- Output format preference (YAML/JSON)

## Output Artifacts

- OpenAPI specification file (openapi.yaml or openapi.json)
- Validation report with any issues found
- Schema extraction summary
- Change diff from previous spec version (if applicable)

## Usage Example

```yaml
skill:
  name: openapi-spec-generator
  context:
    sourceDirectory: ./src/api
    framework: express
    outputFormat: yaml
    openapiVersion: "3.1.0"
    includeExamples: true
```

## Best Practices

1. Use consistent annotation patterns across the codebase
2. Include JSDoc/docstrings for all endpoints
3. Define reusable schema components
4. Validate generated specs before publishing
5. Version control generated specifications

Related Skills

retrospect

509
from a5c-ai/babysitter

Summarize or retrospect on a completed Babysitter run.

openapi

509
from a5c-ai/babysitter

OpenAPI/Swagger specification, code generation, documentation, and validation.

mock-spec-extractor

509
from a5c-ai/babysitter

Extracts design specifications from mock images including colors, typography, spacing, and component details

color-palette-generator

509
from a5c-ai/babysitter

Generate accessible color palettes with WCAG compliance

animation-spec

509
from a5c-ai/babysitter

Generate animation specifications, easing curves, and motion design documentation

openapi-swagger

509
from a5c-ai/babysitter

Expert skill for OpenAPI/Swagger specification analysis, validation, and documentation generation. Parse and validate specs, detect breaking changes, generate code samples, and lint for best practices.

tracing-schema-generator

509
from a5c-ai/babysitter

Generate distributed tracing schemas for OpenTelemetry with Jaeger/Zipkin integration

openapi-validator

509
from a5c-ai/babysitter

Validate OpenAPI specifications for correctness, security, and best practices

metrics-schema-generator

509
from a5c-ai/babysitter

Generate metrics schemas for Prometheus, OpenTelemetry, and Grafana dashboards

log-schema-generator

509
from a5c-ai/babysitter

Generate structured logging schemas with correlation ID patterns and ELK/Splunk integration

load-test-generator

509
from a5c-ai/babysitter

Generate load test scripts for k6, Locust, and Gatling from OpenAPI specs

graphql-schema-generator

509
from a5c-ai/babysitter

Generate GraphQL schemas from data models with resolver stubs and federation support