Architecture Documentation Builder
An automated loop for generating comprehensive, up-to-date system architecture documentation. This agent analyzes your codebase, identifies key architectural components, creates visual diagrams, and produces explanatory text suitable for technical stakeholders.
Goal
Generate validated system architecture documentation including component diagrams, data flow, and design rationale
How to Run
Iterative documentation generation with automated review checks. Run in any supported AI coding environment.
- 01
1. Prepare Context
Ensure your codebase is accessible and provide existing documentation if available
- 02
2. Execute Kickoff Prompt
Launch with the provided kickoff prompt in your chosen AI coding environment
- 03
3. Monitor Iterations
Agent will self-pace through workflow steps, running validation checks between iterations
- 04
4. Approve Final Output
Review and approve generated documentation to trigger exit condition
Workflow Steps
- 01
Analyze codebase structure and identify core components/services
Verify component inventory against known architectural layers
- 02
Create architecture template with section headers
Confirm template includes all required documentation sections
- 03
Generate component interaction diagrams using Mermaid
Validate Mermaid diagram syntax and logical consistency
- 04
Write architectural explanations and design decisions
Review clarity and completeness of explanatory text
- 05
Incorporate data flow and dependency relationships
Verify data flow accuracy against codebase analysis
- 06
Run check_command for validation
Assess readiness for review approval
Kickoff Prompt
Start the "Architecture Documentation Builder" loop. Goal: Generate validated system architecture documentation including component diagrams, data flow, and design rationale Max iterations: 10 Between iterations run: review validation Exit when: Review approved Please analyze the provided codebase to generate comprehensive system architecture documentation. Create visual diagrams (Mermaid format) showing component interactions, data flows, and architectural patterns. For each major component, include a brief description of its purpose, responsibilities, and key interfaces. Organize the output into clear sections: Overview, Components, Interactions, Data Flow, Design Decisions, and Dependencies. Prioritize accuracy based on actual code structure rather than assumptions. Self-pace this loop. After each iteration, run `review validation` and evaluate the output, and only continue if the exit condition is not met (Review approved). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.
Guardrails
hardcoded- ·Validate against existing documentation to avoid redundant output
- ·Use standard architectural diagram formats (Mermaid, PlantUML)
- ·Maintain consistent terminology throughout documents
- ·Avoid generating code snippets unrelated to architecture
- ·Focus on high-level design patterns over implementation details
- ·Ensure all generated diagrams are valid Mermaid syntax
Flow Diagram
Related loops — Docs
Docs
Changelog Generator
Automatically generates and maintains a project's CHANGELOG.md file by analyzing code changes, commits, or version control history to produce structured release notes.
Docs
Example Coverage Builder
Automatically identifies areas in your codebase lacking usage examples and iteratively adds them to improve documentation coverage. The agent focuses on generating practical, copy-paste-friendly examples for functions, methods, and components that currently lack adequate documentation.
Docs
API Docs Sync
Automatically synchronizes API documentation with the codebase to ensure no drift occurs between implementation and documented interfaces. This loop detects discrepancies, generates necessary updates, and applies them while respecting guardrails to maintain consistency and quality.