Pipeline
Git2Docs uses a three-stage AI pipeline to generate high-quality documentation that understands your product holistically.
Overview
Unlike simple code-to-docs tools that process files in isolation, Git2Docs first understands your entire product before generating any documentation. This results in documentation that is coherent, well-organized, and truly helpful to users.
Stage 1: Comprehend
The comprehend stage reads your codebase and extracts a structured understanding of your product. It analyzes:
- README - Primary source of product intent and description
- Package files - package.json, setup.py, go.mod for dependencies and metadata
- Core source files - Main entry points and business logic
- Configuration - Environment variables, config files
Output: Product Brief
The comprehend stage produces a product brief containing:
| Product Name | What the product is called |
| One-liner | A single sentence describing what it does |
| Target Audience | Who uses this product |
| Audience Level | Beginner, intermediate, or expert |
| Deployment Model | SaaS, self-hosted, library, CLI, etc. |
| Primary Workflows | Main tasks users perform |
| Key Concepts | Core abstractions users need to understand |
| Components | Major parts of the system |
Stage 2: Plan
Using the product brief, the planner designs a complete documentation structure. It considers:
- What documentation types are needed (guides, tutorials, API reference, etc.)
- How to organize content into logical spaces and hierarchies
- Which source files are relevant for each planned page
Output: Documentation Plan
The plan includes:
- Spaces - Top-level groupings (e.g., "Getting Started", "API Reference")
- Pages - Individual documentation pages with titles and descriptions
- Hierarchy - Parent-child relationships between pages
- Doc Types - Page types (guide, tutorial, concept, reference, etc.)
- Source Hints - Which files/functions to reference for each page
Stage 3: Synthesize
For each planned page, the synthesizer generates the actual documentation content. It receives:
- The product brief (for context)
- The page plan (title, description, doc type)
- Relevant source code (based on source hints)
Output: Documentation Sections
Each page is broken into sections based on its doc type. For example, a Guide might have:
- Overview
- Prerequisites
- Steps
- Examples
- Troubleshooting
While an API Reference page might have:
- Description
- Parameters
- Returns
- Errors
- Examples
Confidence Tiers
Each generated section includes a confidence tier indicating how certain the AI is about the content:
| Tier | Meaning | Example Sources |
|---|---|---|
| High | Directly from code/AST | Function signatures, type definitions |
| Medium | Inferred from implementation | Behavior from code logic |
| Low | Contextual reasoning | Cross-file inferences |
Low and medium confidence sections are flagged for human review in the dashboard.