Skip to content
chiltepin

Diagram tool

ER diagrams that match the real schema

Every data model discussion starts with someone sketching the same three tables. An ER diagram as a typed block ends the re-sketching: entities, columns, and crow's-foot relations live as YAML in your Markdown docs, validated by chiltepin check and rendered by the build.

The block and its render

```erd
id: erd-example
entities:
  - name: users
    columns:
      - { name: id, type: uuid, pk: true }
  - name: orders
    columns:
      - { name: id, type: uuid, pk: true }
      - { name: user_id, type: uuid, fk: true }
relations:
  - users ||--o{ orders: places
```
SECTION 01 · Entity model
ER
Entity relationship diagram: 2 entities1NAGGREGATE ROOTusers#iduuidENTITYorders#iduuiduser_iduuidPLACES
Legend#primary keyforeign key1 / Ncardinalityaggregate root
Entities with pk/fk-flagged columns; relations in crow's-foot notation (|| exactly one, o{ zero-or-many). chiltepin check validates every entity a relation references.

From your schema, by your agent

The ERD worth having is the one that matches production. Your AI agent can read the migrations or ORM schema and write the erd block from it — after npx skills add jdiejim/chiltepin -g it knows the grammar, and chiltepin sync sql | dbml | prisma converts a schema file outright. When the schema changes, the diagram changes in the same pull request, as a reviewable three-line diff. No export step, no stale PNG, no separate tool holding the truth.

The data model is part of a document

An ERD usually belongs inside something — a design doc, a data-model or migration-plan template, a service overview — next to the sequence diagrams and architecture views that explain the rest of the system. Chiltepin renders the whole document from one Markdown source: a growing library of typed blocks, exported as a static website, slides, or PDF. It's MIT-licensed, and the playground renders your first ERD in the browser right now.

Frequently asked questions

How does the ER diagram generator work?
An ER diagram in Chiltepin is a typed YAML block: entities with their columns (marking primary and foreign keys), and relations written in crow’s-foot notation like users ||--o{ orders. Write it in Studio or any editor, or have your AI agent generate it — then chiltepin check validates the structure and the build renders it as SVG inside your document.
Can it generate an ER diagram from my actual database schema?
That is the recommended workflow: your AI agent can read your migrations, Prisma or Drizzle schema, or SQL files, and write the erd block to match. Because the block is validated YAML rather than an image, the diagram can be updated in the same pull request that changes the schema — and reviewed as a diff.
Does it support crow’s-foot notation?
Yes. Relations use standard crow’s-foot cardinality symbols — || for exactly one, o{ for zero-or-many, |{ for one-or-many — in the compact form users ||--o{ orders: places, which renders with the conventional fork-and-bar line ends.
Is this a full database design tool?
No — it does not connect to a live database or generate SQL. It is for the ERD that lives in your documentation: the data-model section of a design doc, a service overview, or a migration plan, kept accurate because it is text in the same repository as the schema it describes.