AgentSkillsCN

api-documentation-generator

从代码中自动生成全面且开发者友好的 API 文档,涵盖端点、参数、示例与最佳实践。

SKILL.md
--- frontmatter
version: 4.1.0-fractal
name: api-documentation-generator
description: "Generate comprehensive, developer-friendly API documentation from code, including endpoints, parameters, examples, and best practices"

API Documentation Generator

Overview

Automatically generate clear, comprehensive API documentation from your codebase. This skill helps you create professional documentation that includes endpoint descriptions, request/response examples, authentication details, error handling, and usage guidelines.

Perfect for REST APIs, GraphQL APIs, and WebSocket APIs.

When to Use This Skill

  • Use when you need to document a new API
  • Use when updating existing API documentation
  • Use when your API lacks clear documentation
  • Use when onboarding new developers to your API
  • Use when preparing API documentation for external users
  • Use when creating OpenAPI/Swagger specifications

How It Works

🧠 Knowledge Modules (Fractal Skills)

1. Step 1: Analyze the API Structure

2. Step 2: Generate Endpoint Documentation

3. Step 3: Add Usage Guidelines

4. Step 4: Document Error Handling

5. Step 5: Create Interactive Examples

6. Example 1: REST API Endpoint Documentation

7. Example 2: GraphQL API Documentation

8. Example 3: Authentication Documentation

9. Getting a Token

10. Using the Token

11. Token Expiration

12. ✅ Do This

13. ❌ Don't Do This

14. Recommended Sections

15. Problem: Documentation Gets Out of Sync

16. Problem: Missing Error Documentation

17. Problem: Examples Don't Work

18. Problem: Unclear Parameter Requirements

19. OpenAPI/Swagger

20. Postman Collection