Openapi gen

From berkcangumusisik/claude-code-practices · View interactive version

Openapi gen is an AI agent skill from the GitHub repository berkcangumusisik/claude-code-practices. Generates an OpenAPI 3.0 spec from existing route definitions

How to use this skill

Skill file

Generate OpenAPI Specification

  1. Find all routes:
grep -rn "router\.\|app\." src/ --include="*.ts" | grep -E "\.(get|post|put|patch|delete)\(" | head -40
  1. For each route, extract:
  1. Generate openapi.yaml:
openapi: 3.0.3
info:
  title: API Name
  version: 1.0.0
paths:
  /users:
    get:
      summary: List users
      security:
        - bearerAuth: []
      parameters:
        - name: page
          in: query
          schema: { type: integer, default: 1 }
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserList'
  1. Add components/schemas for all reusable types.
  1. Add security schemes (bearerAuth, apiKey, etc.)
  1. Save to openapi.yaml or docs/openapi.yaml.

Tip: This file can be used with Swagger UI, Postman, or client SDK generators.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.