Generate diagram
generate_diagramCreates architecture, ERD, use-case, sequence, role-access, and dependency diagrams as Mermaid or PlantUML source, with instant preview links and an HTML viewer, to turn a scanned codebase into shareable visual documentation.
Instructions
Generate a diagram as Mermaid or PlantUML source. Types: erd (data model), use_case, architecture (C4 container), role_access (roles → features), overview (actors → features → data), module_dependencies (import graph between features), feature_map (mindmap), sequence (one endpoint's request flow). Writes .mmd/.puml + .html viewer to out_dir and returns instant preview links (mermaid.live, kroki.io, plantuml.com).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| root | Yes | Absolute path of the project to analyse (a mounted path such as /workspace when running in Docker). | |
| type | Yes | ||
| write | No | Write files to out_dir (default true). | |
| format | No | Default mermaid. PlantUML supported for erd, use_case, architecture. | |
| feature | No | Restrict to one feature (erd, use_case, role_access, sequence). | |
| out_dir | No | Where to write files (default <root>/docs/business-overview/diagrams). | |
| refresh | No | Re-scan the project instead of using the cached analysis. | |
| endpoint | No | For sequence: "METHOD /path". | |
| render_svg | No | Also render SVG with mermaid-cli (mmdc) if installed. | |
| max_entities | No | ||
| include_fields | No | ERD: include all fields (default true) or only keys. |