# divizu > A deterministic DSL → SVG compiler for architecture diagrams that coding agents can write. divizu lets an agent express a repository's wiring as a slot or layered drawing. The default slots view plugs each provider directly into its socket. The layers view draws shared providers once with a cable to each consumer. The renderer has zero runtime dependencies, needs no browser, and produces deterministic output for the same DSL. ## Start here - Agent skill: https://jeysef.github.io/divizu/skills/divizu.md - Playground: https://jeysef.github.io/divizu/playground.html - Reference manual: https://jeysef.github.io/divizu/docs.html - Quickstart source: https://jeysef.github.io/divizu/examples/quickstart.di - Shared layers: https://jeysef.github.io/divizu/examples/shared.di - Large system map (28 blocks): https://jeysef.github.io/divizu/examples/large.di ## Use it Ask the agent: > Use divizu to diagram this project's architecture. Read > https://jeysef.github.io/divizu/skills/divizu.md and follow it. Write the > architecture as a `.di` file, validate it, render it to SVG, and show me the > result. Fastest delivery without installing anything: URL-encode the DSL and return a playground link. ```text https://jeysef.github.io/divizu/playground.html#dsl= ``` To render a file: ```bash git clone --depth 1 https://github.com/Jeysef/divizu cd divizu npm install npm run build node dist/cli.js architecture.di --check node dist/cli.js architecture.di -o architecture.svg node dist/cli.js architecture.di --layout layers -o architecture.svg ``` ## Roles Exactly four: - `root` — program/entry point; cannot be used as a provider. - `component` — internal code that gets wired in. - `boundary` — database, network, queue, filesystem or vendor adapter. - `value` — config/injected data with no behaviour. Language details go in `tag:`. `provides:` declares service keys. In `--layout layers` shared providers are drawn once; `<- fresh Provider` opts into a separate instance. The default `--layout slots` duplicates them per consumer. `src: "path:line"` records provenance for `--check --verify-src`. ## DSL ```dsl root CheckoutApp "cmd/api" { src: "cmd/api/main.go:24" needs Orders <- OrdersLive needs Clock } component OrdersLive "order use case" { provides: Orders src: "internal/orders/live.go:18" tag: service needs Db <- DbLive needs Logger <- LoggerLive modules: ValidateCart, PriceOrder } boundary DbLive "postgres" { provides: Db src: "internal/db/pg.go:12" tag: closer } value AppConfig "config" { provides: Config src: "internal/config/config.go:9" } ``` ```dsl file = { block } ; block = role ident [ string ] "{" { NL | directive } "}" ; role = "root" | "component" | "boundary" | "value" ; directive = "provides" ":" list | "needs" key [ "<-" [ "fresh" ] ident ] | "modules" ":" list | "candidates" ":" candidate { "," candidate } | "tag" ":" list | "src" ":" string | "label" ":" name ; list = name { "," [ NL ] name } ; candidate = name [ "(" name ")" ] ; ``` Braces are mandatory. Directives end at a newline or `;`. Comments only start at a token boundary, so `C#Parser` is a name. Quote names with spaces or punctuation. Every non-root block must be referenced; every root must be unreferenced. Cycles are rejected. Use unbound needs for external systems. ## Properties - Input: plain-text `.di` DSL. - Output: deterministic, self-contained SVG. Default slot layout; optional layered DAG with cables for shared providers. - Runtime: zero dependencies, no DOM, no canvas, no headless browser. - Validation: file-relative `line:column`, fix hints, `--check --json`, `--check --verify-src`. - License: MIT.