Extract Openapi From Code

🌐Community
by speakeasy-api · vlatest · Repository

Automatically generates OpenAPI specifications from existing codebase, streamlining API documentation and development workflows.

Install on your platform

We auto-selected Claude Code based on this skill’s supported platforms.

1

Run in terminal (recommended)

terminal
claude mcp add extract-openapi-from-code npx -- -y @trustedskills/extract-openapi-from-code
2

Or manually add to ~/.claude/settings.json

~/.claude/settings.json
{
  "mcpServers": {
    "extract-openapi-from-code": {
      "command": "npx",
      "args": [
        "-y",
        "@trustedskills/extract-openapi-from-code"
      ]
    }
  }
}

Requires Claude Code (claude CLI). Run claude --version to verify your install.

About This Skill

What it does

This skill automatically generates OpenAPI specifications directly from existing codebases. It analyzes your implementation to map out endpoints, request/response schemas, and authentication flows without manual documentation.

When to use it

  • You need to document a legacy API where original specs are missing or outdated.
  • You want to ensure your AI agents understand the exact structure of your backend services.
  • You are refactoring code and need to verify that new implementations match expected API contracts.
  • You require machine-readable documentation for rapid client SDK generation.

Key capabilities

  • Parses source code to identify HTTP methods, paths, and parameters.
  • Infers data models and validation rules from typed variables and function signatures.
  • Outputs standard OpenAPI 3.x format compatible with major tools like Swagger UI.
  • Handles complex scenarios including authentication headers and file uploads.

Example prompts

"Extract an OpenAPI spec from my Python FastAPI application located in the src directory." "Generate an OpenAPI document from this Node.js Express server code to help my AI agent interact with it." "Analyze my Go HTTP handlers and create a corresponding OpenAPI specification file."

Tips & gotchas

Ensure your codebase includes type hints or explicit struct definitions, as the extraction relies on these for accurate schema generation. Review the output carefully, as inferred logic may occasionally miss edge cases present only in runtime behavior.

Tags

🛡️

TrustedSkills Verification

Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.

Security Audits

Gen Agent Trust HubPass
SocketPass
SnykPass

Details

Version
vlatest
License
Author
speakeasy-api
Installs
28

🌐 Community

Passed automated security scans.