repo-cartographer
v1.0.1Maps any repo into an architecture diagram (Mermaid/Graphviz) and enforces architecture rules in CI
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
map_repo Map repository (one-shot)
Point at a folder and get a downloadable architecture diagram in one call: runs scan + import-graph + render internally and returns the HTML path, a facts summary, and the draft diagram source inline. By default writes architecture.html plus the raw source (.mermaid or .dot) into the repo; pass outPath to write elsewhere. Use the granular tools (scan_repo, build_import_graph, generate_diagram, render_diagram) only when you need to compose the steps yourself.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute or relative path to the repository root |
format | string | Diagram notation: 'mermaid' (default; renders on GitHub) or 'dot' (Graphviz interop) |
level | string | Diagram granularity (default 'high') |
outPath | string | Output base path (default: <repo>/architecture); .html and the raw source are written |
scan_repo Scan repository
Deterministically extract facts from a local repo: programming languages, frameworks/libraries, entry points, top-level modules (with role guesses), and a manifest summary. Returns JSON facts only — no interpretation. Use this when you need repo facts WITHOUT a diagram (e.g. to answer questions about the stack). Prefer map_repo for the one-shot diagram flow; use build_import_graph when you need dependency edges rather than an inventory.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute or relative path to the repository root |
build_import_graph Build import graph
Extract intra-repo import/require relationships for JavaScript/TypeScript and Python. Nodes are files (auto-collapsed to module/directory level for large repos); edges are directed import relationships. Returns JSON. Use this when you need the raw dependency edges — who imports whom — e.g. to reason about coupling, cycles, layering, or the blast radius of a change. Do NOT use it just to draw a picture: generate_diagram returns a ready-to-render draft, and map_repo does the whole flow in one call.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute or relative path to the repository root |
generate_diagram Generate diagram
Combine scan + import facts into a DRAFT diagram string — Mermaid flowchart (default) or Graphviz DOT. level 'high' (default) shows modules/directories; 'detail' shows files grouped by module. This is a draft the calling model is expected to refine. Use this when you want to edit or refine the diagram source before rendering (pair with render_diagram to write the HTML afterwards). If no in-between editing is needed, prefer map_repo — it generates AND renders in one call.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute or relative path to the repository root |
format | string | Diagram notation: 'mermaid' (default; renders on GitHub) or 'dot' (Graphviz interop) |
level | string | Diagram granularity (default 'high') |
render_diagram Render diagram
Write a self-contained, shareable HTML page (renders via CDN: Mermaid, or Viz for Graphviz DOT) plus the raw source file (.mermaid or .dot). Returns the absolute paths written. Use this as the final step after refining a draft from generate_diagram — or to render ANY Mermaid/DOT source, hand-written included. If you have not edited the draft, prefer map_repo, which renders it for you.
| Parameter | Type | Description |
|---|---|---|
outPath * | string | Output path (with or without extension); .html and the raw source siblings are written |
source * | string | Diagram source to render (Mermaid, or DOT when format is 'dot') |
format | string | Notation of `source` (default 'mermaid') |