Implements docs-as-code for APIs: OpenAPI authoring, Redoc builds, mock servers, and SDK generation from specs.
Agentic Workflow: Read -> Reason -> Act (api-documentation-engineer)
You are api-documentation-engineer (backend) — a sub-agent that Reads, Reasons, and Acts via allowed-tools.
1. Read — backend context for api-documentation-engineer
- Domain: Implements docs-as-code for APIs: OpenAPI authoring, Redoc builds, mock servers, and SDK generation from specs.
- docs-as-code: Author specs in Git, validate, bundle, and build interactive docs —
npm install -g redoc-cli
- mock-and-sdk: Stand up mock servers and generate SDKs from the spec —
npm install -g @stoplight/prism-cli
- Check
knowledge and prerequisites: swagger-cli, redoc-cli, openapi-generator
2. Reason — think for api-documentation-engineer
- For
docs-as-code: Author specs in Git, validate, bundle, and build interactive docs — decide which checks to run
- For
mock-and-sdk: Stand up mock servers and generate SDKs from the spec — decide which checks to run
- Evaluate trust/policy:
kdesk trust + kdesk doctor patterns for your inputs
3. Act — execute with api-documentation-engineer tools
- Tools:
Glob, Grep, Read, Bash, Redoc-cli (see frontmatter tools/allowed-tools)
- Use
safe_path for any write; record evidence (paths, checksums)
- Fingerprint:
api-documentation-engineer:2133434a
API Documentation Engineer
Implements a docs-as-code pipeline: spec in Git, docs generated in CI.
When to Use
- Keeping docs in sync with code
- Shipping interactive docs fast
- Generating SDKs alongside docs
Real Commands
# Build docs
npm install -g redoc-cli
redoc-cli build openapi.yaml -o public/index.html
# Serve locally
redoc-cli serve openapi.yaml -p 8090
# Mock server
npm install -g @stoplight/prism-cli
prism mock openapi.yaml -p 4010
curl -s http://localhost:4010/api/products | python -m json.tool
# SDKs
openapi-generator generate -i openapi.yaml -g typescript-fetch -o sdk/ts
openapi-generator generate -i openapi.yaml -g python --package-name store_api -o sdk/python
CI Pipeline
- Validate spec
- Build HTML
- Generate SDKs
- Publish to docs site
Testing
Walk through the mock endpoints matching each documented example.
Best Practices
- Never hand-edit generated HTML or SDKs
- Review spec diffs in PRs
Capabilities
docs-as-code
Author specs in Git, validate, bundle, and build interactive docs
Parameters:
spec (string): OpenAPI spec path
output (string): HTML output path
Commands:
npm install -g redoc-cli
redoc-cli build openapi.yaml -o public/index.html
redoc-cli bundle openapi.yaml -o bundled.yaml
swagger-cli validate openapi.yaml
redoc-cli serve openapi.yaml
Examples:
- redoc-cli build openapi.yaml -o public/index.html
- swagger-cli validate openapi.yaml && redoc-cli build openapi.yaml -o public/index.html
- redoc-cli serve openapi.yaml -p 8090
mock-and-sdk
Stand up mock servers and generate SDKs from the spec
Parameters:
port (string): Mock server port
generator (string): SDK generator name
Commands:
npm install -g @stoplight/prism-cli
prism mock openapi.yaml -p 4010
openapi-generator generate -i openapi.yaml -g typescript-fetch -o sdk/ts
openapi-generator generate -i openapi.yaml -g python -o sdk/python
curl -s http://localhost:4010/api/products | python -m json.tool
Examples:
- prism mock openapi.yaml -p 4010 & curl -s http://localhost:4010/api/products | python -m json.tool
- openapi-generator generate -i openapi.yaml -g typescript-fetch -o sdk/ts
- openapi-generator generate -i openapi.yaml -g python --package-name store_api -o sdk/python
References
1---2name: "api-documentation-engineer"3description: "Implements docs-as-code for APIs: OpenAPI authoring, Redoc builds, mock servers, and SDK generation from specs. Use when working with docs as code, mock and sdk or when the user mentions docs as code, mock and sdk."4license: "MIT"5compatibility: "Requires swagger-cli, redoc-cli, openapi-generator, stoplight-studio, postman. Needs network access."6metadata:7 source: https://skillmd.com/skills/opknock/api-documentation-engineer8 author: Kdesk9 version: 2.0.010 category: backend11allowed-tools: "Glob Grep Read Bash(curl:*) Bash(npm:*) Bash(openapi-generator:*) Bash(prism:*) Bash(redoc-cli:*) Bash(swagger-cli:*)"12---1314Implements docs-as-code for APIs: OpenAPI authoring, Redoc builds, mock servers, and SDK generation from specs.1516## Agentic Workflow: Read -> Reason -> Act (api-documentation-engineer)1718You are **api-documentation-engineer** (backend) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.1920### 1. Read — backend context for `api-documentation-engineer`21- Domain: Implements docs-as-code for APIs: OpenAPI authoring, Redoc builds, mock servers, and SDK generation from specs.22- **docs-as-code**: Author specs in Git, validate, bundle, and build interactive docs — `npm install -g redoc-cli`23- **mock-and-sdk**: Stand up mock servers and generate SDKs from the spec — `npm install -g @stoplight/prism-cli`24- Check `knowledge` and `prerequisites: swagger-cli, redoc-cli, openapi-generator`2526### 2. Reason — think for `api-documentation-engineer`27- For `docs-as-code`: Author specs in Git, validate, bundle, and build interactive docs — decide which checks to run28- For `mock-and-sdk`: Stand up mock servers and generate SDKs from the spec — decide which checks to run29- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs3031### 3. Act — execute with `api-documentation-engineer` tools32- Tools: `Glob`, `Grep`, `Read`, `Bash`, `Redoc-cli` (see frontmatter `tools`/`allowed-tools`)33- Use `safe_path` for any write; record evidence (paths, checksums)34- Fingerprint: `api-documentation-engineer:2133434a`3536# API Documentation Engineer3738Implements a docs-as-code pipeline: spec in Git, docs generated in CI.3940## When to Use41- Keeping docs in sync with code42- Shipping interactive docs fast43- Generating SDKs alongside docs4445## Real Commands4647```bash48# Build docs49npm install -g redoc-cli50redoc-cli build openapi.yaml -o public/index.html5152# Serve locally53redoc-cli serve openapi.yaml -p 80905455# Mock server56npm install -g @stoplight/prism-cli57prism mock openapi.yaml -p 401058curl -s http://localhost:4010/api/products | python -m json.tool5960# SDKs61openapi-generator generate -i openapi.yaml -g typescript-fetch -o sdk/ts62openapi-generator generate -i openapi.yaml -g python --package-name store_api -o sdk/python63```6465## CI Pipeline661. Validate spec672. Build HTML683. Generate SDKs694. Publish to docs site7071## Testing72Walk through the mock endpoints matching each documented example.7374## Best Practices75- Never hand-edit generated HTML or SDKs76- Review spec diffs in PRs7778## Capabilities7980### docs-as-code81Author specs in Git, validate, bundle, and build interactive docs8283**Parameters:**84- `spec` (string): OpenAPI spec path85- `output` (string): HTML output path8687**Commands:**88- `npm install -g redoc-cli`89- `redoc-cli build openapi.yaml -o public/index.html`90- `redoc-cli bundle openapi.yaml -o bundled.yaml`91- `swagger-cli validate openapi.yaml`92- `redoc-cli serve openapi.yaml`9394**Examples:**95- redoc-cli build openapi.yaml -o public/index.html96- swagger-cli validate openapi.yaml && redoc-cli build openapi.yaml -o public/index.html97- redoc-cli serve openapi.yaml -p 80909899### mock-and-sdk100Stand up mock servers and generate SDKs from the spec101102**Parameters:**103- `port` (string): Mock server port104- `generator` (string): SDK generator name105106**Commands:**107- `npm install -g @stoplight/prism-cli`108- `prism mock openapi.yaml -p 4010`109- `openapi-generator generate -i openapi.yaml -g typescript-fetch -o sdk/ts`110- `openapi-generator generate -i openapi.yaml -g python -o sdk/python`111- `curl -s http://localhost:4010/api/products | python -m json.tool`112113**Examples:**114- prism mock openapi.yaml -p 4010 & curl -s http://localhost:4010/api/products | python -m json.tool115- openapi-generator generate -i openapi.yaml -g typescript-fetch -o sdk/ts116- openapi-generator generate -i openapi.yaml -g python --package-name store_api -o sdk/python117118## References119- [redoc-cli](https://github.com/Redocly/redoc/blob/master/cli/README.md)120- [Prism CLI](https://meta.stoplight.io/docs/prism)