generating-documentation
Generate comprehensive technical documentation including API docs (OpenAPI/Swagger), code documentation (TypeDoc/Sphinx), documentation sites (Docusaurus/MkDocs), Architecture Decision Records (ADRs), and diagrams (Mermaid/PlantUML). Use when documenting APIs, libraries, systems architecture, or building developer-facing documentation sites.
What this skill does
# Documentation Generation
Generate comprehensive technical documentation across multiple layers: API documentation, code documentation, documentation sites, architecture decisions, and system diagrams.
## When to Use This Skill
Use this skill when:
- Documenting REST or GraphQL APIs with OpenAPI specifications
- Creating code documentation for libraries (TypeScript, Python, Go, Rust)
- Building documentation sites for projects or products
- Recording architectural decisions (ADRs) for system design choices
- Generating diagrams to visualize system architecture or data flows
- Setting up automated documentation pipelines in CI/CD
## Documentation Layers Overview
Technical documentation operates at five distinct layers:
**Layer 1: API Documentation** - OpenAPI specs for REST/GraphQL APIs (Swagger UI, Redoc, Scalar)
**Layer 2: Code Documentation** - Generated from code comments (TypeDoc, Sphinx, godoc, rustdoc)
**Layer 3: Documentation Sites** - Comprehensive guides and tutorials (Docusaurus, MkDocs)
**Layer 4: Architecture Decisions** - ADRs using MADR template format
**Layer 5: Diagrams** - Visual architecture (Mermaid, PlantUML, D2)
See `references/api-documentation.md`, `references/code-documentation.md`, and `references/documentation-sites.md` for detailed guides.
## Quick Decision Framework
### Which Documentation Layer?
```
API for external consumers?
→ Layer 1: API Documentation (OpenAPI + Swagger UI/Redoc)
Code for maintainers?
→ Layer 2: Code Documentation (TypeDoc/Sphinx/godoc/rustdoc)
Comprehensive guides?
→ Layer 3: Documentation Site (Docusaurus/MkDocs)
Architectural decision?
→ Layer 4: ADR (MADR template)
Visual system design?
→ Layer 5: Diagrams (Mermaid/PlantUML/D2)
```
### Tool Selection Matrix
| Need | Primary Tool | Best For |
|------|-------------|----------|
| **Doc Site** | Docusaurus | Feature-rich React sites |
| **Doc Site** | MkDocs Material | Simple Python docs |
| **API Docs (Interactive)** | Swagger UI | Testing |
| **API Docs (Read-Only)** | Redoc | Professional design |
| **TypeScript** | TypeDoc | All TS projects |
| **Python** | Sphinx | All Python projects |
| **Go** | godoc | Built-in |
| **Rust** | rustdoc | Built-in |
| **Diagrams** | Mermaid | All-purpose |
## API Documentation Quick Start
Create OpenAPI specification:
```yaml
openapi: 3.1.0
info:
title: User API
version: 1.0.0
servers:
- url: https://api.example.com/v1
paths:
/users/{userId}:
get:
summary: Get a user
parameters:
- name: userId
in: path
required: true
schema:
type: string
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/User'
components:
schemas:
User:
type: object
required: [id, email, name]
properties:
id:
type: string
email:
type: string
format: email
name:
type: string
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
security:
- bearerAuth: []
```
Render with Swagger UI, Redoc, or Scalar. See `references/api-documentation.md` for complete examples and `templates/openapi-template.yaml` for starter template.
## Code Documentation Quick Start
### TypeScript
```typescript
/**
* Calculate the sum of two numbers.
*
* @param a - The first number
* @param b - The second number
* @returns The sum of a and b
*
* @example
* ```typescript
* const result = add(2, 3);
* console.log(result); // 5
* ```
*/
export function add(a: number, b: number): number {
return a + b;
}
```
Generate docs:
```bash
npm install -D typedoc
npx typedoc --entryPoints src/index.ts --out docs
```
### Python
```python
def calculate_total(items: list[dict], tax_rate: float = 0.0) -> float:
"""Calculate the total price including tax.
Args:
items: List of items with 'price' and 'quantity' keys.
tax_rate: Tax rate as decimal (e.g., 0.1 for 10%).
Returns:
Total price including tax.
Example:
>>> items = [{'price': 10, 'quantity': 2}]
>>> calculate_total(items, tax_rate=0.1)
22.0
"""
subtotal = sum(item['price'] * item['quantity'] for item in items)
return subtotal * (1 + tax_rate)
```
Generate docs:
```bash
pip install sphinx sphinx-rtd-theme
sphinx-quickstart docs
cd docs && make html
```
See `references/code-documentation.md` for Go and Rust examples.
## Documentation Site Quick Start
### Docusaurus
```bash
npx create-docusaurus@latest my-website classic
cd my-website
npm start
```
Basic config:
```javascript
// docusaurus.config.js
module.exports = {
title: 'My Project',
url: 'https://docs.example.com',
themeConfig: {
navbar: {
items: [
{type: 'doc', docId: 'intro', label: 'Docs'},
],
},
},
presets: [
['@docusaurus/preset-classic', {
docs: {
sidebarPath: require.resolve('./sidebars.js'),
},
}],
],
};
```
### MkDocs
```bash
pip install mkdocs mkdocs-material
mkdocs new my-project
mkdocs serve
```
Basic config:
```yaml
# mkdocs.yml
site_name: My Project
theme:
name: material
features:
- navigation.tabs
- search.suggest
plugins:
- search
nav:
- Home: index.md
- Getting Started: getting-started.md
```
See `references/documentation-sites.md` for versioning and deployment.
## Architecture Decision Records
Use MADR template for recording decisions:
```markdown
# Use PostgreSQL for Primary Database
* Status: accepted
* Deciders: Engineering Team, CTO
* Date: 2025-01-15
## Context and Problem Statement
Application requires relational database with complex queries,
ACID transactions, JSON support, and full-text search.
## Decision Drivers
* Data integrity (ACID compliance)
* Performance (10K+ queries/second)
* Cost (open-source preferred)
* Features (JSONB, full-text search)
## Considered Options
* PostgreSQL
* MySQL
* Amazon Aurora
## Decision Outcome
Chosen "PostgreSQL" for best balance of features and cost.
### Positive Consequences
* Open-source with no licensing costs
* Advanced features (JSONB, full-text search)
* Strong ACID compliance
### Negative Consequences
* Self-hosting requires DevOps investment
* Horizontal scaling requires changes
```
Copy full template from `templates/adr-template.md`. See `references/adr-guide.md` for workflow and `examples/adr/0001-database-selection.md` for complete example.
## Diagrams Quick Start
Create diagrams with Mermaid:
````markdown
```mermaid
sequenceDiagram
User->>Frontend: Click "Login"
Frontend->>API: POST /auth/login
API->>Database: Verify credentials
Database-->>API: User found
API-->>Frontend: JWT token
Frontend->>User: Redirect to dashboard
```
````
Mermaid renders in GitHub, Docusaurus, and MkDocs. See `references/diagram-generation.md` for PlantUML and D2 examples.
## Common Patterns
### Design-First vs Code-First APIs
**Design-First:**
1. Write OpenAPI spec
2. Review with stakeholders
3. Generate server stubs
4. Implement handlers
**Pros:** Contract before implementation, parallel development
**Cons:** Spec authoring can be verbose
**Code-First:**
1. Implement API with decorators
2. Generate OpenAPI from code
3. Publish documentation
**Pros:** Faster development, spec matches code
**Cons:** Documentation lags behind
**Recommendation:** Design-first for new APIs, code-first for existing.
### Embedding API Docs in Sites
Docusaurus integration:
```javascript
// docusaurus.config.js
plugins: [
['docusaurus-plugin-openapi-docs', {
config: {
api: {
specPath: 'openapi/api.yaml',
outputDir: 'docs/api',
},
},
}],
],
themes: ['docusaurus-theme-openapi-docs'],
```
See `references/api-documentation.md` for MkDocs integration.
### CI/CD Automation
```yaml
# .github/workflows/docs.yml
nRelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.