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.

1
Comprehend
2
Plan
3
Synthesize

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 NameWhat the product is called
One-linerA single sentence describing what it does
Target AudienceWho uses this product
Audience LevelBeginner, intermediate, or expert
Deployment ModelSaaS, self-hosted, library, CLI, etc.
Primary WorkflowsMain tasks users perform
Key ConceptsCore abstractions users need to understand
ComponentsMajor 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:

TierMeaningExample Sources
HighDirectly from code/ASTFunction signatures, type definitions
MediumInferred from implementationBehavior from code logic
LowContextual reasoningCross-file inferences

Low and medium confidence sections are flagged for human review in the dashboard.