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.
Best use case
doc-generator is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
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.
Teams using doc-generator should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/doc-generator/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How doc-generator Compares
| Feature / Agent | doc-generator | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
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.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# 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: ```markdown # 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 ```python # Extract from docstring examples or generate basic usage ``` ``` ## Analysis Approach 1. **Parse Python files** using AST or inspection 2. **Extract key elements:** - Module-level docstrings - Class definitions and docstrings - Function/method signatures with type hints - Docstring content (support Google, NumPy, Sphinx formats) 3. **Organize hierarchically** (modules -> classes -> methods -> functions) 4. **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
Related Skills
prometheus-config-generator
Prometheus Config Generator - Auto-activating skill for DevOps Advanced. Triggers on: prometheus config generator, prometheus config generator Part of the DevOps Advanced skill category.
process-flow-generator
Process Flow Generator - Auto-activating skill for Visual Content. Triggers on: process flow generator, process flow generator Part of the Visual Content skill category.
plotly-chart-generator
Plotly Chart Generator - Auto-activating skill for Visual Content. Triggers on: plotly chart generator, plotly chart generator Part of the Visual Content skill category.
plantuml-diagram-generator
Plantuml Diagram Generator - Auto-activating skill for Visual Content. Triggers on: plantuml diagram generator, plantuml diagram generator Part of the Visual Content skill category.
pdf-generator
Pdf Generator - Auto-activating skill for Business Automation. Triggers on: pdf generator, pdf generator Part of the Business Automation skill category.
password-hash-generator
Password Hash Generator - Auto-activating skill for Security Fundamentals. Triggers on: password hash generator, password hash generator Part of the Security Fundamentals skill category.
openapi-spec-generator
Openapi Spec Generator - Auto-activating skill for API Development. Triggers on: openapi spec generator, openapi spec generator Part of the API Development skill category.
network-diagram-generator
Network Diagram Generator - Auto-activating skill for Visual Content. Triggers on: network diagram generator, network diagram generator Part of the Visual Content skill category.
nestjs-module-generator
Nestjs Module Generator - Auto-activating skill for Backend Development. Triggers on: nestjs module generator, nestjs module generator Part of the Backend Development skill category.
n8n-workflow-generator
N8N Workflow Generator - Auto-activating skill for Business Automation. Triggers on: n8n workflow generator, n8n workflow generator Part of the Business Automation skill category.
mock-generator
Mock Generator - Auto-activating skill for Test Automation. Triggers on: mock generator, mock generator Part of the Test Automation skill category.
mkdocs-config-generator
Mkdocs Config Generator - Auto-activating skill for Technical Documentation. Triggers on: mkdocs config generator, mkdocs config generator Part of the Technical Documentation skill category.