Skip to content
Back to skills

Openapi Gen

ASecurity

Generates an OpenAPI 3.0 spec from existing route definitions

  • 10 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added June 1, 2026
ai-agentstypescriptbashapisecurity

Works with

  • cli
  • api

Security analysis

A100/100

Scanned June 1, 2026

npx -y skills add berkcangumusisik/claude-code-practices --skill openapi-gen --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Openapi Gen?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Openapi Gen
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/berkcangumusisik-openapi-gen/badge)](https://www.skillsdirectory.com/skills/berkcangumusisik-openapi-gen)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: openapi-gen
description: Generates an OpenAPI 3.0 spec from existing route definitions
user-invocable: true
allowed-tools: Read Grep Glob Edit
effort: medium
---

## Generate OpenAPI Specification

1. Find all routes:
```bash
grep -rn "router\.\|app\." src/ --include="*.ts" | grep -E "\.(get|post|put|patch|delete)\(" | head -40
```

2. For each route, extract:
   - HTTP method and path
   - Path parameters (`:id`, `:slug`)
   - Query parameters (from validation schema)
   - Request body schema (from Zod/TypeScript types)
   - Response schema
   - Auth requirement

3. Generate `openapi.yaml`:
```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'
```

4. Add `components/schemas` for all reusable types.

5. Add security schemes (bearerAuth, apiKey, etc.)

6. Save to `openapi.yaml` or `docs/openapi.yaml`.

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

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…