Skip to main content

Pipeline

The Doc Generator operates as a four-stage pipeline with iterative refinement.

Architecture Overview

┌─────────────────┐
│ Webhook Trigger │
│  Minimal Input  │
└────────┬────────┘


┌─────────────────┐
│ Input Validation│
│Complexity Check │
└────────┬────────┘


┌─────────────────┐
│ Stage 1:        │
│ Conceptual      │
│ Design          │
└────────┬────────┘


┌─────────────────────────────┐
│ Stage 2-3: Iterative Loop   │
│ ┌─────────┐   ┌───────────┐ │
│ │ Draft   │──▶│ Quality   │ │
│ │Generator│   │ Review    │ │
│ └─────────┘   └─────┬─────┘ │
│       ▲             │       │
│       └─────────────┘       │
│      (if score < 85%)       │
└─────────────┬───────────────┘


┌─────────────────┐
│ Stage 4:        │
│ Finalization    │
└────────┬────────┘


┌─────────────────┐
│ Output Layer    │
│ GitHub + Slack  │
└─────────────────┘

Stage 1: Conceptual Design

LLM Role: Senior Technical Architect Temperature: 0.3 (consistent, structured output)

Output

JSON document blueprint including:
  • Document architecture with section purposes
  • Section depths and word count estimates
  • Key concepts and explanation approaches
  • Comparison frameworks with evaluation criteria
  • Audience profile and learning objectives
  • Success criteria for quality assessment
  • Research requirements

Stage 2: Draft Generator

LLM Role: Senior Technical Writer Temperature: 0.5 (balanced creativity and consistency)

Output

Full Markdown document with:
  • Clear hierarchical structure (H1, H2, H3)
  • Technical depth appropriate to audience
  • Code examples where applicable
  • Diagrams described in Mermaid syntax
  • Cross-references and links

Stage 3: Quality Review

LLM Role: Senior Editor / Tech Lead Temperature: 0.2 (precise evaluation)

Scoring Dimensions

DimensionDescription
Technical AccuracyFacts, code, and concepts correct
Clarity & StructureLogical flow, readable prose
CompletenessAll required topics covered
Audience FitAppropriate depth and tone
ActionabilityReader can take action

Decision Logic

if (overallScore >= 0.85 || iteration >= maxIterations) {
  proceedToFinalization();
} else {
  prepareRevisionContext(feedback);
  returnToDraftGenerator();
}

Stage 4: Finalization

LLM Role: Document Publisher Temperature: 0.1 (deterministic formatting)

Tasks

  1. Generate YAML frontmatter
  2. Apply consistent formatting
  3. Add metadata (timestamps, version)
  4. Prepare for GitHub commit

API Throttling

Built-in delays prevent rate limiting:
BetweenDelay
Conceptual → Draft3 seconds
Draft → Review3 seconds
Review → Revision5 seconds