Receber por email
← Voltar para o catálogo

doc-generator

Generate markdown documentation from Python codebases by analyzing source files, extracting docstrings, type hints, and code structure. Use when the user asks to document Python code, create API docs, or generate README files from source code.

367estrelas
Atualizado há 4 meses

Ver no GitHub ↗

Como adicionar

/plugin marketplace add aiskillstore/marketplace

O comando exato pode variar conforme o repositório. Confira o README no GitHub.

Para o autor da skill

Cole no README do seu repo

Mostra que sua skill está catalogada na Skillteca, gera backlink e tráfego rastreável.

[![Skillteca](https://www.skillteca.com.br/api/badge/doc-generator-aiskillstore/svg)](https://www.skillteca.com.br/skills/doc-generator-aiskillstore)

Alerta por categoria

Receba novas skills de Escrita e Conteúdo toda segunda

1 email curto, só com as skills novas de Escrita e Conteúdo. 4 minutos de leitura, sem spam, cancela com 1 clique.

Você confirma o email no primeiro envio. Sem spam. Cancela com 1 clique.

Ler descrição completa

Python Documentation Generator

Generate comprehensive markdown documentation from Python source code.

When to Use This Skill

  • User asks to "document this code" or "generate docs"
  • Creating API documentation from Python modules
  • Generating README files with usage examples
  • Extracting docstrings and type signatures into readable format
  • User mentions "documentation", "docstrings", or "API reference"

Input

Accept either:

  • Single Python file path
  • Directory path (recursively process .py files)
  • List of specific files

Output Format

Generate standard markdown with:

# Module Name

Brief description from module docstring.

## Classes

### ClassName

Description from class docstring.

**Methods:**
- `method_name(param: type) -> return_type`: Brief description

## Functions

### function_name(param: type) -> return_type

Description from docstring.

**Parameters:**
- `param` (type): Description

**Returns:**
- type: Description

## Usage Examples

Extract from docstring examples or generate basic usage

Analysis Approach

  1. Parse Python files using AST or inspection
  2. Extract key elements:
  3. Module-level docstrings
  4. Class definitions and docstrings
  5. Function/method signatures with type hints
  6. Docstring content (support Google, NumPy, Sphinx formats)
  7. Organize hierarchically (modules -> classes -> methods -> functions)
  8. Generate clean markdown with consistent formatting

Quality Guidelines

  • Preserve original docstring formatting when meaningful
  • Include type hints prominently in signatures
  • Group related items (all classes together, all functions together)
  • Add table of contents for large modules
  • Skip private members (leading underscore) unless explicitly requested
  • Handle missing docstrings gracefully (note "No description provided")

Python Tools

Prefer standard library:

  • ast module for parsing
  • inspect module for runtime introspection
  • pathlib for file handling

No external dependencies required for basic documentation generation.

Error Handling

  • Skip files with syntax errors (log warning)
  • Handle missing type hints gracefully
  • Warn if no docstrings found but continue processing
  • Validate file paths exist before processing
Compartilhar X LinkedIn