๐ก 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
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.