Docsprompt onlyIntermediate

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.

← all loops
architecturedocumentationsystem designmermaidtechnical writingcode analysis

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.

  1. 01

    1. Prepare Context

    Ensure your codebase is accessible and provide existing documentation if available

  2. 02

    2. Execute Kickoff Prompt

    Launch with the provided kickoff prompt in your chosen AI coding environment

  3. 03

    3. Monitor Iterations

    Agent will self-pace through workflow steps, running validation checks between iterations

  4. 04

    4. Approve Final Output

    Review and approve generated documentation to trigger exit condition

Workflow Steps

  1. 01

    Analyze codebase structure and identify core components/services

    Verify component inventory against known architectural layers

  2. 02

    Create architecture template with section headers

    Confirm template includes all required documentation sections

  3. 03

    Generate component interaction diagrams using Mermaid

    Validate Mermaid diagram syntax and logical consistency

  4. 04

    Write architectural explanations and design decisions

    Review clarity and completeness of explanatory text

  5. 05

    Incorporate data flow and dependency relationships

    Verify data flow accuracy against codebase analysis

  6. 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

rendering…

Related loops — Docs