mcpField
A
api-docs

api-docs

github.com/htlin222Development7838 installsUpdated 3w ago
Repository

About api-docs

api-docs is a skill for creating API documentation and OpenAPI specifications. It is intended for API authors who need references, guides, schemas, or Postman collections.

Key features

  1. 01Create OpenAPI specifications
  2. 02Structure API reference documentation
  3. 03Document authentication and errors
  4. 04Generate SDK documentation
  5. 05Create Postman collections

Use cases

  1. 01Documenting a new API
  2. 02Generating API docs from code
  3. 03Creating an OpenAPI or Swagger spec

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/htlin222/dotfiles --skill api-docs

After installing, type/api-docsin Claude Code to confirm it loaded.

Details

From the project README

API Documentation

Create comprehensive API documentation and OpenAPI specs.

When to Use

  • Documenting new APIs
  • Creating OpenAPI/Swagger specs
  • Generating SDK documentation
  • Writing API guides
  • Creating Postman collections

OpenAPI Template

openapi: 3.0.3
info:
  title: API Name
  version: 1.0.0
  description: API description

servers:
  - url: https://api.example.com/v1
    description: Production

paths:
  /users:
    get:
      summary: List users
      operationId: listUsers
      parameters:
        - name: limit
          in: query
          schema:
            type: integer
            default: 20
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/User"

    post:
      summary: Create user
      operationId: createUser
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateUser"
      responses:
        "201":
          description: Created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/User"

components:
  schemas:
    User:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        email:
          type: string
          format: email
      required:
        - id
        - name
        - email

    CreateUser:
      type: object
      properties:
        name:
          type: string
        email:
          type: string
          format: email
      required:
        - name
        - email

  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

security:
  - bearerAuth: []

Documentation Structure

# API Reference

## Authentication

All requests require a Bearer token in the Authorization header.

## Endpoints

### Users

#### List Users

`GET /users`

**Parameters:**

| Name  | Type    | Required | Description      |
| ----- | ------- | -------- | ---------------- |
| limit | integer | No       | Results per page |

**Response:**

    ```json
    [{ "id": "...", "name": "...", "email": "..." }]
    ```

#### Create User

`POST /users`

**Request Body:**

    ```json
    { "name": "John", "email": "[email protected]" }
    ```

## Error Codes

| Code | Description           |
| ---- | --------------------- |
| 400  | Bad Request           |
| 401  | Unauthorized          |
| 404  | Not Found             |
| 500  | Internal Server Error |

Examples

Input: "Document the user API" Action: Create OpenAPI spec with all endpoints, schemas, examples, error codes

Input: "Generate API docs from code" Action: Extract endpoints, infer types, create structured documentation

Comments

Markdown supported