Skip to content

๐Ÿ“ก API Documentation Agent Specification

๐Ÿ“Œ Purpose

The API Documentation Agent is responsible for generating and maintaining developer-facing API documentation across the ConnectSoft platform โ€” including developer portal content, interactive API explorers, SDK guides, integration tutorials, versioned changelogs, and code samples.

It transforms raw API contracts (OpenAPI, AsyncAPI, gRPC proto), SDK metadata, and integration patterns into polished, navigable, and version-aware documentation that accelerates third-party and internal developer adoption.

๐Ÿงพ Every published API in ConnectSoft must be documented, explorable, and sample-enriched โ€” this agent ensures that happens autonomously.


๐ŸŽฏ Primary Goals

Goal Description
๐Ÿ“„ Generate API reference docs Transforms OpenAPI/AsyncAPI specs into structured Markdown or HTML reference pages
๐Ÿงช Produce interactive explorers Creates try-it-out panels and request/response examples for every endpoint
๐Ÿ“ฆ Build SDK guides Generates getting-started guides, authentication walkthroughs, and SDK quickstarts
๐Ÿ”„ Maintain versioned changelogs Detects breaking changes and produces migration guides between API versions
๐Ÿงฉ Create integration tutorials Writes step-by-step integration tutorials with code samples in multiple languages
๐Ÿง  Enrich from memory Cross-links related APIs, modules, and architectural decisions from Knowledge Management

๐Ÿง  Core Role in the Factory

The API Documentation Agent sits within the Documentation and Knowledge Management cluster, acting as the bridge between backend API design and developer experience (DX).

It consumes structured API contracts from the API Designer and Backend Developer agents and produces documentation artifacts that feed into the Documentation Site Generator, Developer Portal, and Knowledge Management systems.


๐Ÿงฉ Position in the Documentation and Knowledge Management Cluster

Layer Cluster Description
๐Ÿ“ก API DX Layer Documentation & Knowledge Management Converts API contracts into developer-consumable documentation
๐Ÿ”— Cross-Reference Layer Connects APIs to architecture decisions, SDK releases, and changelogs
๐Ÿ“š Knowledge Contributor Feeds structured API knowledge into the Knowledge Management Agent
flowchart TD
    API_DESIGNER[๐ŸŽจ API Designer Agent] -->|api_contract_published| API_DOC[๐Ÿ“ก API Documentation Agent]
    BACKEND[๐Ÿ’ป Backend Developer Agent] -->|sdk_version_released| API_DOC
    API_DOC --> DOC_WRITER[๐Ÿ“ Documentation Writer Agent]
    API_DOC --> KM[๐Ÿง  Knowledge Management Agent]
    API_DOC --> DOC_SITE[๐Ÿ“ฆ Documentation Site Generator Agent]
    API_DOC --> STUDIO[๐Ÿ“Š Studio Agent]
Hold "Alt" / "Option" to enable pan & zoom

โšก Triggering Events

Event Description
api_contract_published New or updated OpenAPI/AsyncAPI/gRPC spec is published by the API Designer Agent
sdk_version_released A new SDK package version is released, requiring updated guides and samples
api_breaking_change_detected A breaking change is detected between API versions, triggering migration guide generation
integration_pattern_added A new integration pattern or webhook contract is registered
developer_portal_refresh_requested Manual or scheduled refresh of the developer portal documentation

๐Ÿ“‹ Responsibilities and Deliverables

๐Ÿงฐ Key Responsibilities

Responsibility Description
๐Ÿ“„ API Reference Generation Parse OpenAPI/AsyncAPI specs and produce per-endpoint reference pages with parameters, schemas, and examples
๐Ÿงช Interactive Explorer Creation Generate try-it-out panels with pre-filled request bodies, authentication headers, and response previews
๐Ÿ“ฆ SDK Guide Authoring Write getting-started guides, authentication setup, error handling patterns, and pagination tutorials per SDK language
๐Ÿ”„ Changelog and Migration Guide Diff API versions and produce structured changelogs with migration steps for breaking changes
๐Ÿงฉ Code Sample Generation Produce code samples in C#, TypeScript, Python, and cURL for every documented endpoint
๐Ÿ“Ž Cross-Linking Link API docs to related ADRs, architecture diagrams, and domain model documentation
๐Ÿง  Memory Enrichment Store API documentation metadata in Knowledge Management for cross-agent retrieval

๐Ÿ“ค Deliverables

Deliverable Type Description
๐Ÿ“„ api-docs Per-endpoint Markdown reference pages with schemas, examples, and authentication requirements
๐Ÿ“ฆ developer-portal-content Structured content for the developer portal: guides, tutorials, and conceptual overviews
๐Ÿ“š sdk-guide Language-specific SDK quickstarts and integration walkthroughs
๐Ÿ”„ api-changelog.md Versioned changelog with breaking change annotations and migration instructions
๐Ÿงฉ code-samples/ Multi-language code samples organized by API domain and use case

๐Ÿ“˜ Example Output: API Endpoint Reference

# POST /api/v2/appointments

> **Edition**: vetclinic-premium | **Module**: AppointmentService

## Description
Creates a new appointment for a client and their pet.

## Authentication
Bearer token required. Scope: `appointments:write`

## Request Body
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `clientId` | string | โœ… | The client's unique identifier |
| `petId` | string | โœ… | The pet's unique identifier |
| `scheduledAt` | datetime | โœ… | Appointment date and time (UTC) |
| `notes` | string | โŒ | Optional notes for the veterinarian |

## Response (201 Created)
```json
{
  "appointmentId": "apt-8f3b72ac",
  "status": "confirmed",
  "scheduledAt": "2026-04-15T10:00:00Z"
}

Code Samples

cURL

curl -X POST https://api.connectsoft.ai/v2/appointments \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"clientId": "c-123", "petId": "p-456", "scheduledAt": "2026-04-15T10:00:00Z"}'
---

## ๐Ÿค Collaboration Interfaces

### ๐Ÿ”— Upstream Agents (Inputs)

| Agent | Input Provided |
| ----- | -------------- |
| **API Designer Agent** | OpenAPI/AsyncAPI specs, API versioning metadata, endpoint contracts |
| **Backend Developer Agent** | SDK package metadata, authentication flows, error code catalogs |
| **Enterprise Architect Agent** | API governance policies, naming conventions, versioning strategy |
| **Knowledge Management Agent** | Prior API docs, related architecture decisions, module-to-API mappings |

### ๐Ÿ“ค Downstream Agents (Outputs Consumed By)

| Agent | Output Consumed |
| ----- | --------------- |
| **Documentation Writer Agent** | Uses API reference as source for higher-level integration guides |
| **Documentation Site Generator Agent** | Integrates API docs into MkDocs site navigation and search index |
| **Knowledge Management Agent** | Indexes API docs as memory entries for cross-agent retrieval |
| **Studio Agent** | Displays API coverage metrics and documentation freshness dashboards |

### ๐Ÿ“Š Collaboration Flow

```mermaid
flowchart TD
    API_DESIGNER[๐ŸŽจ API Designer Agent] --> API_DOC[๐Ÿ“ก API Documentation Agent]
    BACKEND[๐Ÿ’ป Backend Developer Agent] --> API_DOC
    ARCH[๐Ÿ›๏ธ Enterprise Architect Agent] --> API_DOC
    KM_IN[๐Ÿง  Knowledge Management Agent] --> API_DOC

    API_DOC --> DOC_WRITER[๐Ÿ“ Documentation Writer Agent]
    API_DOC --> DOC_SITE[๐Ÿ“ฆ Doc Site Generator Agent]
    API_DOC --> KM_OUT[๐Ÿง  Knowledge Management Agent]
    API_DOC --> STUDIO[๐Ÿ“Š Studio Agent]


๐Ÿง  Memory and Knowledge

๐Ÿ“š Pre-Embedded Knowledge

Domain Description
๐Ÿงพ OpenAPI/AsyncAPI grammar Full understanding of OpenAPI 3.x and AsyncAPI 2.x specification formats
๐Ÿ“ฆ SDK documentation patterns Best practices for SDK quickstarts, authentication guides, and error handling docs
๐Ÿ”„ API versioning strategies Semantic versioning, URL-based versioning, header-based versioning conventions
๐Ÿ“˜ ConnectSoft API style guide Naming conventions, pagination patterns, error response schemas, HATEOAS links
๐Ÿงฉ Code sample templates Pre-built templates for cURL, C#, TypeScript, and Python request examples

๐Ÿง  Short-Term Memory

Capability Description
๐Ÿ“ Active spec context Holds the current API spec being processed with all endpoints and schemas
๐Ÿ”„ Version diff state Tracks changes between previous and current API version during changelog generation
๐Ÿ“Ž Cross-reference cache Temporarily stores related ADRs, modules, and architecture docs for linking

๐Ÿง  Long-Term Memory

Memory Type Storage Purpose
๐Ÿ“„ Published API docs Blob Storage + Vector DB Enables version comparison and historical reference
๐Ÿ”„ Changelog history api-changelog-index.yaml Tracks all API changes across versions and editions
๐Ÿงฉ Code sample library code-samples-index.yaml Reusable code samples indexed by endpoint and language
๐Ÿ“Š Coverage metrics api-doc-coverage.metrics.json Tracks documentation coverage per API domain and edition

โœ… Validation

๐Ÿงช Validation Checks

Check Description
๐Ÿ“„ Schema completeness Every endpoint in the spec must have a corresponding documentation page
๐Ÿงฉ Sample correctness Code samples must match the current API contract (parameters, types, auth)
๐Ÿ”— Link integrity All cross-references to ADRs, modules, and architecture docs must resolve
๐Ÿ”„ Version consistency Changelog entries must align with actual spec diffs between versions
๐Ÿ“˜ Style compliance Documentation must follow ConnectSoft API documentation style guide
๐Ÿง  Trace metadata Every doc must include traceId, agentId, editionId, and apiVersion

๐Ÿ” Retry and Correction

Scenario Correction
Missing endpoint documentation Re-parse spec and generate missing pages
Stale code samples after SDK update Regenerate samples using latest SDK metadata
Broken cross-references Re-resolve links from Knowledge Management index
Changelog mismatch Re-run version diff with stricter comparison

๐Ÿ“Š Observability Hooks

Event Trigger Payload
ApiDocGenerated Documentation page created or updated traceId, apiVersion, endpointCount, editionId
ApiChangelogPublished Changelog emitted for new API version fromVersion, toVersion, breakingChanges, traceId
ApiDocValidationFailed Validation error detected reason, endpoint, traceId
ApiCoverageUpdated Coverage metrics recalculated totalEndpoints, documentedEndpoints, coveragePercent

๐Ÿงพ Summary and Positioning

The API Documentation Agent is the developer experience engine of the ConnectSoft platform, ensuring every API is:

  • ๐Ÿ“„ Documented with comprehensive reference pages and schemas
  • ๐Ÿงช Explorable through interactive try-it-out panels and examples
  • ๐Ÿ“ฆ Accessible via SDK guides and integration tutorials in multiple languages
  • ๐Ÿ”„ Version-tracked with automated changelogs and migration guides
  • ๐Ÿง  Knowledge-linked to architecture decisions, modules, and trace context

๐Ÿงฉ Position in the ConnectSoft Platform

flowchart TD
    API_CONTRACTS[๐Ÿ“‹ API Contracts] --> API_DOC[๐Ÿ“ก API Documentation Agent]
    SDK_RELEASES[๐Ÿ“ฆ SDK Releases] --> API_DOC
    API_DOC --> PORTAL[๐ŸŒ Developer Portal]
    API_DOC --> DOC_SITE[๐Ÿ“ฆ Documentation Site]
    API_DOC --> KM[๐Ÿง  Knowledge Management]
    API_DOC --> STUDIO[๐Ÿ“Š Studio Dashboard]
Hold "Alt" / "Option" to enable pan & zoom

Without this agent, APIs are black boxes. With it, every API becomes a self-documenting, developer-friendly interface that accelerates integration and adoption across the ConnectSoft ecosystem.