Api documentation generator

From XSpoonAi/spoon-awesome-skill · View interactive version

Api documentation generator is an AI agent skill from the GitHub repository XSpoonAi/spoon-awesome-skill. AI-powered API documentation generation tool that auto-generates comprehensive API docs from source code, including OpenAPI/Swagger specs, Postman collections, and markdown documentation with examples and authentication details.

How to use this skill

Skill file

Usage Examples

Generate OpenAPI Specification

from scripts.openapi_generator import OpenAPIGenerator

generator = OpenAPIGenerator()
spec = generator.generate_spec(
    source_code=api_code,
    framework="fastapi",
    include_examples=True
)
print(f"OpenAPI version: {spec['openapi']}")
print(f"Endpoints: {len(spec['paths'])}")

Create Postman Collection

from scripts.postman_generator import PostmanGenerator

generator = PostmanGenerator()
collection = generator.create_collection(
    endpoints=endpoints,
    auth_schemes=["bearer", "api_key"]
)
print(f"Collection: {collection['info']['name']}")
print(f"Requests: {len(collection['item'])}")

Generate Markdown Documentation

from scripts.markdown_generator import MarkdownGenerator

generator = MarkdownGenerator()
markdown = generator.generate_docs(
    endpoints=endpoints,
    include_examples=True
)
print(f"Documentation generated: {len(markdown)} characters")

Analyze API Code

from scripts.code_analyzer import CodeAnalyzer

analyzer = CodeAnalyzer()
analysis = analyzer.analyze_code(
    source_code=api_code,
    framework="fastapi"
)
print(f"Endpoints found: {analysis['endpoint_count']}")
print(f"Schemas detected: {analysis['schema_count']}")

Output Format

All modules return structured JSON:

{
  "documentation_type": "string",
  "format": "openapi|markdown|postman|html",
  "endpoints_documented": number,
  "schemas_generated": number,
  "examples_included": boolean,
  "authentication": ["array"],
  "openapi_spec": "object",
  "postman_collection": "object",
  "markdown_content": "string",
  "validation_status": "valid|warning|error",
  "recommendations": ["array of actionable items"]
}

Severity Levels

| Level | Meaning | Impact | Action |

|-------|---------|--------|--------|

| CRITICAL | Missing authentication documentation | High risk | Document immediately |

| HIGH | Incomplete endpoint documentation | Moderate risk | Complete within sprint |

| MEDIUM | Missing request/response examples | Low-moderate risk | Add examples |

| LOW | Minor formatting inconsistency | Low risk | Consider for future |

Version & Support

Future Enhancements (v1.1.0)


Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.