ADR-002 — Robust AI Documentation Review Pipeline
Status: Proposed
Date: 2026-06-01
Context: The current review-docs bash-based skill relies on fixed-height chromium screenshots and Gemini LLM calls to handle both deterministic checks (broken links, missing acronyms) and semantic reasoning. This causes truncation of long pages, misses lazy-loaded elements, and burns context tokens on tasks better suited for static analysis.
Decision: Transition the documentation review pipeline to a hybrid architecture: offload deterministic checks to purpose-built static analysis tools (Lychee, Vale, AST parsing) and reserve Gemini strictly for holistic semantic review and targeted Playwright element screenshots.
Consequences:
- ✓ What this enables: Perfect link checking, zero-hallucination acronym linting, and high-fidelity, untruncated diagram reviews via bounded screenshots.
- ✗ What this rules out or costs: Increases tooling complexity by requiring a Node.js/Python orchestrator, Playwright binaries, and Vale dictionaries instead of a single standalone bash script.
Pipeline Architecture
Stop using the LLM for things a linter can do. An LLM cannot reliably click a broken link or count acronyms. It can tell you if a diagram is confusing.
Category Breakdown & Recommendations
chromium --headless?
A raw Chromium capture won't click through interactive tabs, won't trigger lazy-loading below the fold, and its --window-size argument blindly crops content. Playwright allows the script to scroll, expand accordions, and isolate specific diagrams (await page.$('.mermaid').screenshot()).
Scripting Recommendations
The current SKILL.md is a monolithic bash script stringing together grep and cat. This needs to be rewritten as a structured orchestrator (Node.js/TypeScript or Python).
- Initialization: Start the local
mkdocs serveprocess in the background. - Lychee Sweep: Execute
lychee http://localhost:<port>to identify routing and missing image issues globally. - Vale Sweep: Execute
vale docs/to collect all style, acronym, and clarity flags. - Playwright Execution:
- Iterate over the site map.
- Screenshot the top 1000px "Hero" section of each page.
- Locate all
img,svg, and.mermaidelements, taking precise bounding-box screenshots of each.
- Synthesis: Batch the findings. Send the text, static tool reports, and specific image elements to Gemini for the final "Junior Researcher" summary.

