@getmikk/diagram-generator
v1.9.0
Published
> 7 Mermaid architecture diagrams generated from your lock file.
Readme
@getmikk/diagram-generator
7 Mermaid architecture diagrams generated from your lock file.
Generates Mermaid .mmd files from mikk.lock.json and mikk.json. All metrics are derived from the actual call graph — no manual input.
Part of Mikk — live architectural context for your AI agent.
Usage
Generated automatically by mikk init and mikk analyze. Or regenerate manually:
mikk visualize all # all 7 diagrams
mikk visualize module <id> # one module diagramProgrammatically:
import { DiagramOrchestrator } from '@getmikk/diagram-generator'
const orchestrator = new DiagramOrchestrator(contract, lock, projectRoot)
const { generated } = await orchestrator.generateAll()
// generated: string[] — paths of written .mmd filesDiagrams
All files are written to .mikk/diagrams/.
main.mmd
Full architecture overview. All modules as nodes, inter-module dependencies as directed edges. Entry points marked distinctly.
health.mmd
Module health dashboard. For each module, shows:
- Cohesion — ratio of internal calls to total calls (higher = more self-contained)
- Coupling — count of external function calls + cross-module file imports (lower = more independent)
- Function count
- Health indicator — 🟢 healthy (> 70%), 🟡 warning (40–70%), 🔴 critical (< 40%)
Metrics are computed directly from the call graph in the lock file — not estimated.
matrix.mmd
Dependency matrix. Grid of which modules depend on which. Identifies tight coupling and potential circular dependencies at a glance.
flow-entrypoints.mmd
Entry point call flow. Traces how calls propagate from declared entry functions into the rest of the codebase.
impact-<file>.mmd
Blast radius visualization for a specific file change. Generated by mikk context impact <file>. Shows the change origin and all impacted nodes.
modules/<id>.mmd
Per-module internal call graph. All functions in the module as nodes, internal function calls as edges. Exported functions marked distinctly.
capsules/<id>.mmd
Per-module public API capsule. Shows only the exported surface — function names, params, return types — without internal implementation detail.
Viewing Diagrams
Any Mermaid-compatible renderer works. Recommended:
- VS Code: install the "Mermaid Preview" extension, then open any
.mmdfile - GitHub: Mermaid renders natively in
.mdfiles — embed with```mermaidfences - Mermaid Live: paste at https://mermaid.live
