PRD-63: Document Generation Module
Executive Summary
Part 1: Competitive Landscape — Top 10 Document Generation Tools
Comparison Matrix
#
Tool
Stars
Language
License
Output Formats
Template Approach
FastAPI Fit
How the Best Tools Work
Typst (46K stars) — The Modern LaTeX Killer
Gotenberg (11.3K stars) — The Conversion Swiss Army Knife
WeasyPrint (8.5K stars) — HTML/CSS → PDF, Pure Python
python-docx-template (2.3K stars) — Jinja2 in Word Files
pdfme (4K stars) — WYSIWYG PDF Template Designer
Tools We Skip (and Why)
Tool
Reason
2026 Industry Pattern: LLM + Templates
Part 2: Current Automatos State
What Exists Today
Backend
Component
File
Status
Frontend
Component
File
Status
What's Missing
Capability
Gap
Architecture Assessment
Part 3: Recommended Tech Stack
3-Layer Architecture
New Dependencies
Part 4: Implementation Phases
Phase 1: Template Management System (4h)
1.1 Database Schema
1.2 API Endpoints
1.3 Built-in Starter Templates
Template
Format
Category
Variables
Phase 2: PDF Generation Engine (4h)
2.1 Service: DocumentGenerationService
DocumentGenerationService2.2 PDF Template System
2.3 Chart Embedding
Phase 3: DOCX Generation Engine (3h)
3.1 Template Upload Flow
3.2 DOCX Rendering
Phase 4: XLSX Export Engine (2h)
4.1 Two Modes
Phase 5: Agent Tool Integration (3h)
5.1 Agent Tool Schema
5.2 Integration in Agent Factory
5.3 New Artifact Kind
Phase 6: Workflow Document Step (2h)
6.1 New Step Type: generate_document
generate_document6.2 Example Recipe: Weekly Report
Phase 7: Frontend — Template Manager & Document Viewer (5h)
7.1 Template Manager Component
7.2 Document Artifact Renderer
7.3 Integration Points
Phase 8: Gotenberg Sidecar (2h) — Optional
8.1 Docker Compose Addition
8.2 Conversion Service
8.3 Graceful Degradation
File Change Summary
New Files
File
Purpose
File
Purpose
Modified Files
File
Change
Priority Matrix
Phase
What
Effort
Value
Priority
Success Criteria
User Stories
Integration with Existing PRDs
PRD
Integration Point
Out of Scope (Future)
PreviousPRD 62: CodeGraph v2 — Top-10 Competitive UpgradeNextPRD-64: Unified Action Discovery & Platform Self-Awareness
Last updated

