Skip to content

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 ​

FormatExtensionNotes
PDF.pdfPrimary format
Word.docxConverted internally
Text.txt, .mdDirect 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 defense

Phase 3: External Research ​

Objective ​

Fill research gaps using external AI tools.

Tool Selection ​

NeedToolOutput
Synthesize uploaded PDFsNotebookLMStructured summaries
Current statistics (2024-2025)PerplexityMarkdown + URLs
Academic papersScopus AIPapers + BibTeX

Workflow ​

  1. Opus generates prompts based on identified gaps
  2. User runs prompts on external platforms
  3. Results saved to research-prompts/results/
  4. 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.md

Output 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/accents

What 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.pdf

Error 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 width

Complete Timeline ​

PhaseActivitiesParallelism
1. CollectionGather sources-
2. AnalysisRead sources3+ agents
3. ResearchExternal toolsUser sequential
4. PlanningCreate structureOrchestrator
5. WritingGenerate chapters5+ agents
6. ReviewQA and build2+ agents

Multi-Agent Documentation Generation System