# Generate OpenAPI 3.0 Documentation from Your Source Code

Writing API documentation by hand is slow and often incomplete. This skill automatically generates OpenAPI 3.0 specifications, request examples, and Postman collections directly from your code so your team always has accurate API docs.

## Install

```bash
npx skillstore add hermes-sedimentary/zhangchenlai-dev-api-doc-generator
```

## Metadata

- - Slug: zhangchenlai-dev-api-doc-generator
- - Version: 1.0.0
- - Author: Hermes-Sedimentary
- - GitHub username: zhangchenlai-dev
- - License: MIT
- - Repository: https://github.com/zhangchenlai-dev/hermes-skill-store/tree/master/api-doc-generator
- - Ref: master
- - Supported tools: Claude, Codex, Claude Code
- - Risk level: safe
- - Quality score: 80
- - Quality tier: silver
- - Public page: https://skillstore.pages.dev/skills/zhangchenlai-dev-api-doc-generator
- - Manifest: https://skillstore.pages.dev/api/skills/zhangchenlai-dev-api-doc-generator/manifest

## Capabilities

- Generate OpenAPI 3.0 compliant specification documents from source code
- Create request and response examples for each API endpoint
- Produce ready-to-import Postman collections for API testing
- Document REST endpoints including path parameters, query strings, and headers
- Output API documentation in Markdown format for team sharing
- Extract API definitions from code written in multiple programming languages

## Use Cases

- Auto-Generate API Docs from Backend Code: Backend developers paste their route handlers or controller files and receive complete OpenAPI 3.0 specification documents ready for team use.
- Create Postman Collections for Onboarding: Frontend developers and new team members get ready-to-import Postman collections with example requests so they can explore and test APIs immediately.
- Standardize API Documentation Across Teams: Engineering leads use this skill to enforce consistent OpenAPI documentation across microservices, ensuring every API follows the same specification format.

## Prompt Templates

### Basic Endpoint Documentation

```
Generate API documentation for this Express route handler. Include the HTTP method, path, request parameters, and response format.
```

### OpenAPI 3.0 Full Specification

```
Create a complete OpenAPI 3.0 YAML specification for this REST API controller. Include all endpoints, request schemas, response schemas, and error codes.
```

### Postman Collection with Auth Headers

```
Generate a Postman collection JSON from this API definition. Include authorization headers, example request bodies, and test scripts for each endpoint.
```

### Multi-Language API Documentation

```
Extract API definitions from these source files written in Python, Java, and TypeScript. Generate a unified OpenAPI 3.0 specification with consistent naming and examples.
```

## Limitations

- Cannot execute or test actual API endpoints at runtime
- Documentation quality depends on the clarity and completeness of the source code provided
- Designed for REST API patterns and does not support GraphQL or gRPC documentation
- Generated output requires human review to verify accuracy before publication

## Best Practices

- Provide complete source code files with all routes and handlers for the most comprehensive documentation output
- Always review generated OpenAPI specs for correctness and add any business logic details the code alone cannot express
- Include sample request payloads and expected response data in your prompt to produce richer API documentation

## Anti Patterns

- Do not paste source code containing API keys, tokens, or secrets when requesting documentation generation
- Do not publish generated API documentation without first reviewing and correcting endpoint descriptions and schemas
- Avoid documenting internal-only or deprecated endpoints that should not be exposed to external API consumers

## Security Audit

- - Safe to publish: true
- - Audited at: 2026-05-21T17:33:23.395\+00:00
- - Summary: Two static analysis findings evaluated and dismissed as false positives. The 'weak cryptographic algorithm' alert on SKILL.md:4 is a YAML description field with no cryptography. The 'high file entropy' alert is caused by CJK/Chinese UTF-8 characters, which naturally have higher entropy than ASCII text. No actual security threats found: no network access, no filesystem operations, no external commands, no scripts, no environment variable access, and no prompt injection attempts detected.

## Stats

- - Views: 0
- - Downloads: 1
- - Favorites: 0
- - Popularity score: 0
