Note: doc gen
Context
The doc-gen feature generates documentation from source code, including docstrings, README sections, and API references. It uses a three-stage workflow with specialized subagents for planning, writing, and polishing documentation.
Architecture
The doc-gen package implements a multi-stage workflow through mixins and a central orchestrator:
Core workflow:
DocumentGenerationWorkfloworchestrates three specialized subagents: outline-planner, content-writer, and polish-reviewer- Each subagent focuses on a specific domain and produces structured markdown output
- The workflow synthesizes subagent output into a single document with Summary, Outline, Documentation, and Suggestions sections
Stage mixins:
OutlineStageMixin— handles documentation structure planningWriteStageMixin— generates content with code examples and API referencesPolishStageMixin— performs final review and refinement
Support mixins:
APIReferenceMixin— extracts and formats API documentation from source codeChunkedGenerationMixin— breaks large generation tasks into manageable chunks with progress displayDocGenCostMixin— tracks and manages API costs during generation
Utilities:
format_doc_gen_report()— converts workflow results into human-readable reports
The workflow operates on codebases at specified paths, analyzing source files to produce comprehensive documentation that covers modules, APIs, and usage examples.
Source files
src/attune/workflows/document_gen/**
Tags: docs, documentation, generation