# API Doc Site Architecture

> Designs documentation site architecture: structure, navigation, code samples, and OpenAPI-based generation pipelines. Use when working with site architecture, generation pipeline or when the user mentions site architecture, generation pipeline.

- Skill: `opknock/api-doc-site-architecture` (Agent Skill)
- Install (CLI): `npx get-skill add opknock/api-doc-site-architecture`
- Raw SKILL.md: https://api.skillmd.com/api/skills/opknock/api-doc-site-architecture/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- License: MIT
- Author: OpKnock (https://skillmd.com/u/opknock)
- Updated: 2026-11-23
- Page: https://skillmd.com/skills/opknock/api-doc-site-architecture

---


Designs documentation site architecture: structure, navigation, code samples, and OpenAPI-based generation pipelines.

## Agentic Workflow: Read -> Reason -> Act (api-doc-site-architecture)

You are **Api Doc Site Architecture** (backend) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.

### 1. Read — backend context for `api-doc-site-architecture`
- Domain: Designs documentation site architecture: structure, navigation, code samples, and OpenAPI-based generation pipelines.
- **site-architecture**: Structure docs sites: guides, reference, tutorials, and changelog — `mkdir -p docs/guides docs/reference docs/tutorials docs/changelog`
- **generation-pipeline**: Generate reference docs from OpenAPI with Redocly — `npx @redocly/cli lint openapi.yaml`
- Check `knowledge` and `prerequisites: swagger-cli, redoc-cli, openapi-generator`

### 2. Reason — think for `api-doc-site-architecture`
- For `site-architecture`: Structure docs sites: guides, reference, tutorials, and changelog — decide which checks to run
- For `generation-pipeline`: Generate reference docs from OpenAPI with Redocly — decide which checks to run
- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs

### 3. Act — execute with `api-doc-site-architecture` tools
- Tools: `Glob`, `Grep`, `Read`, `Mkdir`, `Bash` (see frontmatter `tools`/`allowed-tools`)
- Use `safe_path` for any write; record evidence (paths, checksums)
- Fingerprint: `api-doc-site-architecture:e3906eb0`

# API Doc (Site Design)

Designs the documentation site before filling it with content.

## When to Use
- Launching a developer portal
- Reorganizing scattered docs
- Automating reference generation

## Real Commands

```bash
# Scaffold
mkdir -p docs/guides docs/reference docs/tutorials docs/changelog

# Generate reference from spec
npx @redocly/cli lint openapi.yaml
npx @redocly/cli bundle openapi.yaml -o dist/bundled.yaml
npx @redocly/cli build-docs dist/bundled.yaml -o dist/index.html

# Preview
npx @redocly/cli preview-docs openapi.yaml
```

## Site Taxonomy
- Tutorials: step-by-step onboarding
- Guides: task-oriented how-tos
- Reference: generated from OpenAPI
- Changelog: releases and breaking changes

## Testing
Preview docs locally and verify every link and example.

## Best Practices
- Reference is generated; guides are curated
- Search should index all sections

## Capabilities

### site-architecture
Structure docs sites: guides, reference, tutorials, and changelog

**Parameters:**
- `siteDir` (string): Docs root directory
- `sections` (string): Site sections

**Commands:**
- `mkdir -p docs/guides docs/reference docs/tutorials docs/changelog`
- `node -e "const fs=require('fs');fs.writeFileSync('docs/guides/quickstart.md','# Quickstart\n')"`
- `node -e "const fs=require('fs');fs.writeFileSync('docs/changelog/CHANGELOG.md','# Changelog\n')"`
- `node -e "console.log('nav: Guides > Reference > Tutorials')"`
- `git add docs && git commit -m 'scaffold docs site'`

**Examples:**
- mkdir -p docs/guides docs/reference docs/tutorials docs/changelog
- node -e "const fs=require('fs');fs.writeFileSync('docs/guides/quickstart.md','# Quickstart\n')"
- git add docs && git commit -m 'scaffold docs site'

### generation-pipeline
Generate reference docs from OpenAPI with Redocly

**Parameters:**
- `spec` (string): OpenAPI spec path
- `output` (string): Output HTML path

**Commands:**
- `npx @redocly/cli lint openapi.yaml`
- `npx @redocly/cli bundle openapi.yaml -o dist/bundled.yaml`
- `npx @redocly/cli build-docs dist/bundled.yaml -o dist/index.html`
- `npx @redocly/cli preview-docs openapi.yaml`
- `npx @redocly/cli build-docs openapi.yaml --output public/reference.html`

**Examples:**
- npx @redocly/cli lint openapi.yaml && npx @redocly/cli build-docs openapi.yaml -o public/reference.html
- npx @redocly/cli preview-docs openapi.yaml
- npx @redocly/cli bundle openapi.yaml -o dist/bundled.yaml

## References
- [Redocly CLI](https://redocly.com/docs/cli/)
- [Diátaxis Framework](https://diataxis.fr/)

