# Multi-agent legacy documentation

- Period: Aug 2026 – Oct 2026
- Domain: Client demo, embedded systems
- Role: Architect and builder
- Key result: 16 sections, every claim verified against cited lines
- Stack: Claude Agent SDK, TypeScript, Next.js, Mermaid, Static analysis
- URL: https://farhanbaluch.com/work/legacy-docs-agents

An orchestrator, a deterministic analyzer, parallel explorer agents and an independent reviewer turn an undocumented codebase into a verified, 16-section technical report.

### Problem

Legacy firmware and enterprise code often has no living documentation, and LLM summaries hallucinate. Modernization starts with understanding, and understanding needs to be trustworthy.

### Approach

Split the job between deterministic tools and agents, and never let an agent's claim through unchecked.

### What I built

- A master orchestrator plus a static analyzer for call graphs, interrupt handlers and registers.
- A doc lead that plans workstreams, and parallel explorer sub-agents with read-only tools.
- An independent reviewer that checks every claim against cited source lines (verified, corrected, or flagged for an expert).
- A visualizer that generates Mermaid diagrams and repairs syntax errors automatically, plus an assembler that produces a 16-section report with a traceability matrix.
- Replay of recorded runs for reliable demos, ingestion by zip, folder or repo, and switchable model providers.

### Outcome

- Documented a 32-file, 3,000-line firmware sample (200+ magic numbers, cyclomatic complexity up to 51) in a 15-minute live demo.
- The reviewer stage turned a plausible draft into one an engineer can trust.