Langsung ke konten
Skillpedia
API & server (backend)48k Β· #5377

openapi-spec-generator

Fungsinya

Alat ini membuat dokumen teknis (disebut spesifikasi OpenAPI atau Swagger) yang menjelaskan cara kerja sebuah API (layanan yang digunakan perangkat lunak untuk saling berkomunikasi). Alat ini dapat membuat dokumen tersebut dari deskripsi dalam bahasa alami, kode, atau dokumen yang belum lengkap.

Kapan dipakai

  • βœ“Saat Anda perlu menjelaskan API untuk developer lain.
  • βœ“Saat membuat dokumentasi teknis untuk layanan web.
  • βœ“Jika Anda sudah memiliki draf API dan ingin mengubahnya menjadi standar.

Link skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/openapi-spec-generator/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/openapi-spec-generator/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBuatkan spesifikasi OpenAPI untuk API yang mengelola tugas, dengan endpoint untuk menampilkan daftar, membuat, dan memperbarui tugas. Gunakan format YAML.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

AI menganalisis deskripsi atau kode Anda untuk memahami detail API, seperti data yang digunakannya dan tindakan yang dapat dilakukannya. Setelah itu, AI menyusun dokumen teknis lengkap yang mengikuti standar OpenAPI atau Swagger.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

OpenAPI / Swagger Specification Generator

When to Use

Use this skill when you need generate complete, production-ready OpenAPI 3.x and Swagger 2.0 specifications from natural language descriptions, code, or partial specs. Use this skill whenever the user mentions OpenAPI, Swagger, API spec, REST API documentation, YAML/JSON API schema, endpoint documentation, API...

Generate complete, valid OpenAPI 3.x or Swagger 2.0 specifications from descriptions, code, or partial specs.

Workflow

Step 1 β€” Gather Context

Before writing any YAML/JSON, ask (or infer from context) the following:

Question Why it matters
OpenAPI 3.x or Swagger 2.0? Different info, servers/host, components/definitions structure
Output format: YAML or JSON? YAML default unless user specifies JSON
What does this API do? Sets info.title, info.description, tags
List of endpoints (or code to extract from)? Core paths object
Authentication type(s)? securitySchemes β€” see reference
Common data models or entities? components/schemas / definitions
Any existing partial spec to extend? Merge rather than overwrite

If the user provides code (Express routes, FastAPI, Django URLs, Spring controllers, etc.), extract endpoints automatically β€” do not ask what the user already told you.

Step 2 β€” Build the Spec

Follow the structure guide for the chosen version. Always produce a complete, valid spec β€” never leave placeholder comments like # TODO: add schema.

OpenAPI 3.x Skeleton

openapi: "3.1.0"
info:
  title: <API Title>
  version: "1.0.0"
  description: <Short description>
  contact:
    name: <Team or Author>
    email: <contact@example.com>
servers:
  - url: https://api.example.com/v1
    description: Production
  - url: https://staging-api.example.com/v1
    description: Staging
tags:
  - name: <Tag>
    description: <Tag description>
paths:
  /resource:
    get:
      summary: List resources
      operationId: listResources
      tags: [<Tag>]
      parameters: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResourceList"
              example:
                items: []
                total: 0
        "401":
          $ref: "#/components/responses/Unauthorized"
        "500":
          $ref: "#/components/responses/InternalError"
      security:
        - BearerAuth: []
components:
  schemas: {}
  responses:
    Unauthorized:
      description: Authentication required
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
  securitySchemes: {}

Swagger 2.0 Skeleton

swagger: "2.0"
info:
  title: <API Title>
  version: "1.0.0"
  description: <Short description>
host: api.example.com
basePath: /v1
schemes: [https]
consumes: [application/json]
produces: [application/json]
tags: []
paths: {}
definitions: {}
securityDefinitions: {}

Step 3 β€” Schemas and Models

  • Always use $ref for any schema used in more than one place.
  • Include example or examples on every schema and response body.
  • Mark required fields with the required array.
  • Use nullable: true (OAS 3.0) or x-nullable: true (Swagger 2.0) for optional nullable fields.
  • Prefer format keywords: int32, int64, float, date, date-time, uuid, email, uri, byte, binary.

Common schema patterns:

# Pagination wrapper
PagedResult:
  type: object
  required: [items, total, page, pageSize]
  properties:
    items:
      type: array
      items:
        $ref: "#/components/schemas/Resource"
    total:
      type: integer
      format: int64
      example: 100
    page:
      type: integer
      format: int32
      example: 1
    pageSize:
      type: integer
      format: int32
      example: 20

# Standard error
Error:
  type: object
  required: [code, message]
  properties:
    code:
      type: string
      example: RESOURCE_NOT_FOUND
    message:
      type: string
      example: The requested resource was not found.
    details:
      type: object
      additionalProperties: true

# Timestamps mixin (use allOf)
Timestamps:
  type: object
  properties:
    createdAt:

…
Pertanyaan umum

Apa itu OpenAPI/Swagger?

Keduanya adalah standar untuk mendeskripsikan API. Standar ini membantu mendokumentasikan cara kerja layanan web sehingga berbagai perangkat lunak lebih mudah terhubung satu sama lain.

Apa perbedaan antara OpenAPI dan Swagger?

OpenAPI adalah nama standar yang berlaku saat ini. Swagger adalah alat populer yang menerapkan standar ini dan juga merujuk pada versi standar yang lebih lama.

Apakah saya perlu bisa coding untuk menggunakan ini?

Belum tentu. Anda dapat mendeskripsikan API dalam bahasa alami, dan alat ini akan mengubahnya menjadi dokumen teknis.

Detail

Deskripsi asli dari pembuat

Generate complete, production-ready OpenAPI 3.x and Swagger 2.0 specifications from natural language descriptions, code, or partial specs.

repo: sickn33/agentic-awesome-skills

Popularitas

Bintang GitHub
48k
Peringkat
#5377
Lisensi
MIT
Diperbarui
15/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa