API Documentation
Generate comprehensive, interactive API documentation for multiple API protocols including REST/HTTP, gRPC, GraphQL, and RPC. This skill helps create documentation that is accurate, up-to-date, and useful for both developers and consumers.
When to use me
Use this skill when:
- You need to document APIs for internal or external consumers
- You have multiple API protocols (REST, gRPC, GraphQL, RPC) that need consistent documentation
- You want to generate documentation from code or API definitions automatically
- You need interactive documentation with testing capabilities
- You're preparing API documentation for public release or developer portals
- You need to maintain documentation consistency across multiple API versions
- You want to improve API discoverability and usability
What I do
- Multi-protocol support: Generate documentation for REST/HTTP, gRPC, GraphQL, and RPC APIs
- Code-first documentation: Extract documentation from code annotations, OpenAPI/Swagger, Protobuf, GraphQL schemas
- Interactive examples: Create executable API examples with testing capabilities
- Version management: Handle multiple API versions with migration guides
- Consistency checking: Ensure consistency between API implementation and documentation
- Documentation generation: Generate HTML, Markdown, PDF, and interactive API consoles
- Authentication documentation: Document authentication methods (OAuth, API keys, JWT)
- Error handling documentation: Document error codes, messages, and troubleshooting
- Rate limiting documentation: Document rate limits, quotas, and usage policies
Examples
# Generate OpenAPI documentation from code
./scripts/analyze-api-docs.sh --source src/ --format openapi
# Generate gRPC documentation from Protobuf files
./scripts/analyze-api-docs.sh --source proto/ --format grpc
# Generate GraphQL schema documentation
./scripts/analyze-api-docs.sh --source schema.graphql --format graphql
# Generate comprehensive API portal
./scripts/analyze-api-docs.sh --portal --output docs/api-portal
# Check documentation consistency
./scripts/analyze-api-docs.sh --consistency-check --api implementations/
Output format
API Documentation Analysis
─────────────────────────────────────
API Protocol: REST/HTTP
Source Files: 42
Endpoints Documented: 127/142 (89%)
DOCUMENTATION QUALITY METRICS:
───────────────────────────────
✅ Complete: Authentication documented (OAuth 2.0, API keys)
✅ Complete: Error responses documented (25 error codes)
✅ Complete: Request/response examples provided
⚠️ Needs Improvement: Rate limiting documentation missing
⚠️ Needs Improvement: 15 endpoints missing parameter descriptions
❌ Missing: Version migration guide for v1 → v2
API DISCOVERABILITY:
────────────────────
• Endpoints grouped by resource (Users, Products, Orders)
• Search functionality available
• Interactive testing console enabled
• SDK generation for 5 languages (JavaScript, Python, Go, Java, C#)
MULTI-PROTOCOL ANALYSIS:
────────────────────────
REST/HTTP APIs: 142 endpoints
• OpenAPI specification: Complete
• Interactive docs: Available via Swagger UI
• Testing examples: 85%
gRPC APIs: 28 services
• Protobuf documentation: Complete
• gRPC reflection: Enabled
• Client libraries: Generated for 3 languages
GraphQL APIs: 1 schema
• GraphQL schema: Documented
• GraphiQL interface: Available
• Queries/Mutations: 47 operations documented
RPC APIs: 12 methods
• JSON-RPC documentation: Partial
• WebSocket support: Documented
• Binary protocols: Not documented
CONSISTENCY ISSUES (3):
────────────────────────
1. Endpoint /api/v1/users/{id}/profile missing from OpenAPI spec
2. gRPC service "PaymentService" missing authentication documentation
3. GraphQL field "Product.inventory" description inconsistent with REST API
RECOMMENDATIONS:
────────────────
1. HIGH PRIORITY: Document rate limiting policies for all endpoints
2. HIGH PRIORITY: Add version migration guide for upcoming v2 release
3. MEDIUM PRIORITY: Complete JSON-RPC documentation for remaining 5 methods
4. MEDIUM PRIORITY: Generate SDKs for additional languages (Ruby, PHP, Swift)
5. LOW PRIORITY: Add deprecation notices for endpoints scheduled for removal
GENERATED ARTIFACTS:
────────────────────
• OpenAPI 3.0 specification: openapi.yaml
• Interactive API console: docs/api-console/index.html
• Client SDKs: sdk/javascript/, sdk/python/, sdk/go/
• API reference PDF: docs/api-reference.pdf
• Postman collection: docs/postman-collection.json
• cURL examples: docs/curl-examples.md
Notes
- Documentation should be generated as close to the code as possible
- Interactive documentation increases API adoption and reduces support requests
- Consistency between API implementation and documentation is critical
- Consider documentation as part of the API development lifecycle
- Different API protocols may require different documentation approaches
- Version management helps consumers migrate between API versions
- Authentication and error handling are the most commonly referenced sections
- Regular documentation reviews help maintain accuracy and completeness
1---2name: api-documentation3description: Use when you need to generate comprehensive API documentation for REST/HTTP, gRPC, GraphQL, and RPC APIs4license: MIT5---67# API Documentation89Generate comprehensive, interactive API documentation for multiple API protocols including REST/HTTP, gRPC, GraphQL, and RPC. This skill helps create documentation that is accurate, up-to-date, and useful for both developers and consumers.1011## When to use me1213Use this skill when:14- You need to document APIs for internal or external consumers15- You have multiple API protocols (REST, gRPC, GraphQL, RPC) that need consistent documentation16- You want to generate documentation from code or API definitions automatically17- You need interactive documentation with testing capabilities18- You're preparing API documentation for public release or developer portals19- You need to maintain documentation consistency across multiple API versions20- You want to improve API discoverability and usability2122## What I do2324- **Multi-protocol support**: Generate documentation for REST/HTTP, gRPC, GraphQL, and RPC APIs25- **Code-first documentation**: Extract documentation from code annotations, OpenAPI/Swagger, Protobuf, GraphQL schemas26- **Interactive examples**: Create executable API examples with testing capabilities27- **Version management**: Handle multiple API versions with migration guides28- **Consistency checking**: Ensure consistency between API implementation and documentation29- **Documentation generation**: Generate HTML, Markdown, PDF, and interactive API consoles30- **Authentication documentation**: Document authentication methods (OAuth, API keys, JWT)31- **Error handling documentation**: Document error codes, messages, and troubleshooting32- **Rate limiting documentation**: Document rate limits, quotas, and usage policies3334## Examples3536```bash37# Generate OpenAPI documentation from code38./scripts/analyze-api-docs.sh --source src/ --format openapi3940# Generate gRPC documentation from Protobuf files41./scripts/analyze-api-docs.sh --source proto/ --format grpc4243# Generate GraphQL schema documentation44./scripts/analyze-api-docs.sh --source schema.graphql --format graphql4546# Generate comprehensive API portal47./scripts/analyze-api-docs.sh --portal --output docs/api-portal4849# Check documentation consistency50./scripts/analyze-api-docs.sh --consistency-check --api implementations/51```5253## Output format5455```56API Documentation Analysis57─────────────────────────────────────58API Protocol: REST/HTTP59Source Files: 4260Endpoints Documented: 127/142 (89%)6162DOCUMENTATION QUALITY METRICS:63───────────────────────────────64✅ Complete: Authentication documented (OAuth 2.0, API keys)65✅ Complete: Error responses documented (25 error codes)66✅ Complete: Request/response examples provided67⚠️ Needs Improvement: Rate limiting documentation missing68⚠️ Needs Improvement: 15 endpoints missing parameter descriptions69❌ Missing: Version migration guide for v1 → v27071API DISCOVERABILITY:72────────────────────73• Endpoints grouped by resource (Users, Products, Orders)74• Search functionality available75• Interactive testing console enabled76• SDK generation for 5 languages (JavaScript, Python, Go, Java, C#)7778MULTI-PROTOCOL ANALYSIS:79────────────────────────80REST/HTTP APIs: 142 endpoints81 • OpenAPI specification: Complete82 • Interactive docs: Available via Swagger UI83 • Testing examples: 85%8485gRPC APIs: 28 services86 • Protobuf documentation: Complete87 • gRPC reflection: Enabled88 • Client libraries: Generated for 3 languages8990GraphQL APIs: 1 schema91 • GraphQL schema: Documented92 • GraphiQL interface: Available93 • Queries/Mutations: 47 operations documented9495RPC APIs: 12 methods96 • JSON-RPC documentation: Partial97 • WebSocket support: Documented98 • Binary protocols: Not documented99100CONSISTENCY ISSUES (3):101────────────────────────1021. Endpoint /api/v1/users/{id}/profile missing from OpenAPI spec1032. gRPC service "PaymentService" missing authentication documentation1043. GraphQL field "Product.inventory" description inconsistent with REST API105106RECOMMENDATIONS:107────────────────1081. HIGH PRIORITY: Document rate limiting policies for all endpoints1092. HIGH PRIORITY: Add version migration guide for upcoming v2 release1103. MEDIUM PRIORITY: Complete JSON-RPC documentation for remaining 5 methods1114. MEDIUM PRIORITY: Generate SDKs for additional languages (Ruby, PHP, Swift)1125. LOW PRIORITY: Add deprecation notices for endpoints scheduled for removal113114GENERATED ARTIFACTS:115────────────────────116• OpenAPI 3.0 specification: openapi.yaml117• Interactive API console: docs/api-console/index.html118• Client SDKs: sdk/javascript/, sdk/python/, sdk/go/119• API reference PDF: docs/api-reference.pdf120• Postman collection: docs/postman-collection.json121• cURL examples: docs/curl-examples.md122```123124## Notes125126- Documentation should be generated as close to the code as possible127- Interactive documentation increases API adoption and reduces support requests128- Consistency between API implementation and documentation is critical129- Consider documentation as part of the API development lifecycle130- Different API protocols may require different documentation approaches131- Version management helps consumers migrate between API versions132- Authentication and error handling are the most commonly referenced sections133- Regular documentation reviews help maintain accuracy and completeness