Complete Workflow
This guide covers the full 6-phase workflow for generating professional documentation with AI agents.
Workflow Overview
Phase 1: Source Collection
Objective
Gather all source documents that will inform the generated documentation.
Actions
bash
# Create project from template
cp -r template/ my-project/
cd my-project/
# Add source documents
cp ~/research/*.pdf sources/
cp ~/reports/*.docx sources/
# Verify structure
ls -la sources/Supported Formats
| Format | Extension | Notes |
|---|---|---|
.pdf | Primary format | |
| Word | .docx | Converted internally |
| Text | .txt, .md | Direct reading |
Phase 2: Parallel Source Analysis
Objective
Have multiple agents read and summarize source documents simultaneously.
Process
Claude Code Command
> Analyze all documents in sources/.
For each document, provide:
- Main topics covered
- Key findings
- Relevant data/statistics
- Research gaps
Identify overlaps and unique contributions across sources.Output
The orchestrator produces a merged synthesis:
markdown
# Source Analysis Summary
## Document Overview
| Document | Type | Pages | Main Topic |
|----------|------|-------|------------|
| thesis.pdf | Research | 85 | ML attacks |
| report.pdf | Industry | 45 | Threat landscape |
## Thematic Analysis
1. Attack methodologies (all documents)
2. Defense mechanisms (thesis, survey)
3. Industry impact (report)
## Identified Gaps
- Current 2024 statistics needed
- Academic papers on specific defensePhase 3: External Research
Objective
Fill research gaps using external AI tools.
Tool Selection
| Need | Tool | Output |
|---|---|---|
| Synthesize uploaded PDFs | NotebookLM | Structured summaries |
| Current statistics (2024-2025) | Perplexity | Markdown + URLs |
| Academic papers | Scopus AI | Papers + BibTeX |
Workflow
- Opus generates prompts based on identified gaps
- User runs prompts on external platforms
- Results saved to
research-prompts/results/ - Opus integrates results into context
Phase 4: Document Planning
Objective
Create detailed document structure with chapter assignments.
Claude Code Command
> Create a document plan with:
- Target: [X] pages total
- Chapters with page budgets
- Source-to-chapter mapping
- Style guidelines
Save to plan/DOCUMENT_PLAN.mdOutput Structure
markdown
# Document Plan
## Overview
| Property | Value |
|----------|-------|
| Total Pages | ~100 |
| Chapters | 10 |
| Language | English |
## Chapter Assignments
| Ch | Title | Pages | Sources |
|----|-------|-------|---------|
| 01 | Introduction | 4 | - |
| 02 | Background | 8 | thesis.pdf (10-30) |
| 03 | Attack Vectors | 12 | thesis.pdf, perplexity.md |Phase 5: Parallel Chapter Writing
Objective
Multiple writer agents create chapters simultaneously.
Process
Claude Code Command
> Write chapters 1-5 following plan/CHAPTER_ASSIGNMENTS.md
and agents/AGENT_GUIDELINES.md.
Each chapter should:
- Stay within page budget
- Use flowing prose (not bullet lists)
- Include proper citations
- Use correct language/accentsWhat Each Agent Receives
Chapter Assignment:
├── File: latex/chapters/XX-name.tex
├── Title: Chapter Title
├── Max pages: X
├── Sources: [relevant excerpts only]
├── Research: [relevant research data]
├── Outline: [section structure]
└── Style: [formatting requirements]Phase 6: Review & Build
Objective
Quality assurance and PDF generation.
Review Process
Build Process
bash
# Full compilation
./scripts/compile.sh
# Output
Compiling document...
Running pdflatex (1/3)...
Running biber...
Running pdflatex (2/3)...
Running pdflatex (3/3)...
✅ Compilation successful!
Output: latex/main.pdfError Handling
> Check latex/main.log for errors and fix them.
Common issues:
- Undefined citations: add to bibliography.bib
- Duplicate labels: rename with chapter prefix
- Overfull hbox: adjust figure/table widthComplete Timeline
| Phase | Activities | Parallelism |
|---|---|---|
| 1. Collection | Gather sources | - |
| 2. Analysis | Read sources | 3+ agents |
| 3. Research | External tools | User sequential |
| 4. Planning | Create structure | Orchestrator |
| 5. Writing | Generate chapters | 5+ agents |
| 6. Review | QA and build | 2+ agents |