Skip to main content

API Documenter

API documentation specialist generating OpenAPI specifications and developer-friendly API references.

Quick Reference

PropertyValue
DomainDocumentation
FORGE Stage5 (VERIFY)
Version1.0.0
Output TypesOpenAPI JSON/YAML

Overview

Use this agent when you need to:
  • Generate OpenAPI 3.1 specifications from code
  • Convert Zod schemas to JSON Schema
  • Document REST API endpoints
  • Create realistic request/response examples
  • Keep API docs synchronized with implementation
  • Validate OpenAPI specs for correctness
The API Documenter extracts API structure from Hono route handlers and Zod schemas, producing comprehensive OpenAPI specifications.

Core Capabilities

OpenAPI Generation

Create OpenAPI 3.1 specifications from Hono APIs

Schema Conversion

Convert Zod schemas to JSON Schema for OpenAPI

Example Generation

Create realistic request/response examples

Documentation Sync

Keep specs in sync with code implementation

When to Use

API endpoints implemented in Hono backend
Zod schemas defined in so1-shared
Need OpenAPI spec for API reference docs
Integrating with API tools (Postman, Insomnia)
Validating API design and consistency
Generating client SDKs from OpenAPI

Usage Examples

Generate a full OpenAPI 3.1 specification:
openapi: 3.1.0
info:
  title: SO1 Control Plane API
  version: 1.0.0
  description: |
    The SO1 API provides programmatic access to manage workflows,
    executions, and integrations.
    
    ## Authentication
    All requests require API key in Authorization header:
Authorization: Bearer sk_live_xxxxxxxxxxxx

## Rate Limiting
100 requests per minute per API key
contact:
email: support@so1.io

servers:
- url: https://api.so1.io
description: Production
- url: https://api-staging.so1.io
description: Staging

security:
- bearerAuth: []

tags:
- name: Workflows
description: Manage automation workflows
- name: Executions
description: View workflow executions

paths:
/api/v1/workflows:
get:
  operationId: listWorkflows
  summary: List workflows
  tags: [Workflows]
  parameters:
    - name: page
      in: query
      schema:
        type: integer
        minimum: 1
        default: 1
    - name: status
      in: query
      schema:
        type: string
        enum: [draft, active, inactive]
  responses:
    '200':
      description: Success
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/WorkflowList'
          example:
            success: true
            data:
              items:
                - id: wf_abc123
                  name: Daily Report
                  status: active
              pagination:
                page: 1
                total: 1

post:
  operationId: createWorkflow
  summary: Create workflow
  tags: [Workflows]
  requestBody:
    required: true
    content:
      application/json:
        schema:
          $ref: '#/components/schemas/CreateWorkflowInput'
        example:
          name: Daily Report
          triggerType: schedule
  responses:
    '201':
      description: Created
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Workflow'

components:
securitySchemes:
bearerAuth:
  type: http
  scheme: bearer
  bearerFormat: API Key

schemas:
Workflow:
  type: object
  required: [id, name, status]
  properties:
    id:
      type: string
      pattern: ^wf_[a-zA-Z0-9]+$
    name:
      type: string
      minLength: 1
      maxLength: 100
    status:
      type: string
      enum: [draft, active, inactive]
Result: Complete OpenAPI spec ready for Mintlify, Swagger UI, or SDK generation.

Outputs

Zod Type Mappings

Zod TypeOpenAPI TypeNotes
z.string(){ type: "string" }
z.number(){ type: "number" }
z.boolean(){ type: "boolean" }
z.array(T){ type: "array", items: T }
z.object({...}){ type: "object", properties: {...} }
z.enum([...]){ type: "string", enum: [...] }
z.optional()Remove from required array
z.nullable()Add null to type union
z.coerce.date(){ type: "string", format: "date-time" }
z.min(n) / z.max(n)minLength / maxLengthFor strings
z.regex(pattern){ pattern: "..." }

OpenAPI Structure

openapi: 3.1.0
info:                    # API metadata
  title: ...
  version: ...
  description: ...
servers:                 # API base URLs
  - url: ...
security:                # Global auth requirements
  - bearerAuth: []
tags:                    # Endpoint groupings
  - name: ...
paths:                   # API endpoints
  /api/v1/resource:
    get: ...
    post: ...
components:              # Reusable components
  securitySchemes: ...
  schemas: ...
  responses: ...
  parameters: ...

FORGE Gate Compliance

Entry Gates

All Hono route handlers must be implemented and working.
Request/response schemas must be defined in so1-shared package.
Auth middleware and patterns must be documented.

Exit Gates

Complete openapi.json or openapi.yaml file created.
Every route has summary, description, parameters, and responses.
Request and response examples for success and error cases.
Spec validates against OpenAPI 3.1 schema (use spectral or openapi-lint).

Integration Points

Veritas Prompts

Prompt IDPurpose
vrt-k1l2m3n4API documentation standards (RESTful conventions, naming)
vrt-o5p6q7r8OpenAPI best practices (schema design, examples)
AgentRelationship
Hono BackendSource of API implementations
TypeScript SharedSource of Zod schemas
Mintlify AuthorConsumes OpenAPI for docs site

Source Files

View Agent Source

Repository: so1-io/so1-agents
Path: agents/documentation/api-documenter.md
Version: 1.0.0

Validation and Tools

Validate OpenAPI Spec

# Using Spectral (recommended)
npm install -g @stoplight/spectral-cli
spectral lint openapi.yaml

# Using openapi-lint
npm install -g @redocly/cli
redocly lint openapi.yaml

Generate from Spec

# Generate TypeScript client
npx openapi-typescript openapi.yaml -o api-types.ts

# Generate Postman collection
npx openapi-to-postmanv2 -s openapi.yaml -o postman-collection.json

# Preview in Swagger UI
npx swagger-ui-watcher openapi.yaml

Next Steps: