/diagram-skills:diagram-datafrom Diagram Skills
Explain and diagram the shape of an application's data - tables, entities, keys and the relationships between them - as a Mermaid ER or class diagram generated or traced from the real schema (SQL migrations and DDL, Prisma, Django, SQLAlchemy, ActiveRecord or TypeScript models), with cardinality read from the schema rather than guessed, and a plain-English explanation at the reader's level. Use this skill whenever someone asks what the data model or database schema looks like, how tables or entities relate, what an order or user record holds, for an ER diagram, entity-relationship or schema diagram, a class diagram of domain models, or wants to document the data layer for onboarding or a spec - even if they only say "what do we store". For services and infrastructure use diagram-architecture; for how records change state use diagram-process.
Ships in Diagram Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Answers "what is the shape of the data?" Cardinality is where hand-drawn ER diagrams lie: one-to-many drawn as one-to-one, an optional key drawn as required. This skill reads both from the schema. For SQL it generates the diagram; for ORM models it traces each entity to its definition.
<engine> is ${CLAUDE_SKILL_DIR}/../diagram-review/scripts; shared rules
live in ${CLAUDE_SKILL_DIR}/../diagram-review/references/.
In this order: migrations (db/migrations/, migrations/, prisma/migrations/),
then a schema dump (schema.sql, structure.sql), then the ORM models
(models.py, schema.prisma, app/models/, *.entity.ts). Migrations
replay to the current schema; models can drift from it. Say which one you
used.
Pick the tables the question is about. A whole schema is rarely one
diagram. The node cap (7, 12 or 20 by reader level, levels.md) means one
area per diagram: orders, accounts, billing. Beginners get entities and
relationships only, no columns.
SQL DDL or migrations: generate.
python3 <engine>/schema_er.py db/migrations --tables customers,orders,order_items \
--level intermediate --title "Orders data model" --markdown
Add --no-attributes for a beginner view. The output reads cardinality from
the DDL:
}o--||;}o--o|;|o--||.Every table gets a %% ref ... = schema:<file>#<table>, and a key line
explains the notation.
ORM models: write an erDiagram by hand, and trace each entity with
%% ref <Entity> = schema:<models file>#<ClassOrModel>. Read cardinality
from the field definitions (ForeignKey(null=True), @relation, ?
optional markers, unique=True), never from the names. Use classDiagram
only when the models carry behaviour the reader needs to see.
Run the three checks in checks.md. The truth check confirms every entity is
defined in the file its ref names.
Lead with the one-line shape ("A customer has many orders; each order has line items that point at products"). After the diagram, read each relationship in words in both directions, and call out the optional ones, because that is where bugs live. Then the key line for the cardinality marks. A beginner gets nouns and "has many", and no PK or FK. An advanced reader gets keys, nullability and the indexes that matter.
The data model belongs in the Spec or Reference that owns the schema
(persisting.md). Keep the %% generated by line, so readers regenerate
after a migration rather than hand-editing. Run lore check.
user_id with no
foreign key is not a relationship; say it is an unenforced reference).From ${CLAUDE_SKILL_DIR}/../diagram-review/references/:
levels.md: caps and explanation patterns per reader.truth.md: schema: refs and the prose-agreement checklist.mermaid-profile.md: ER syntax traps (quote names with spaces).checks.md: the parse, lint and truth loop.persisting.md: where data models live in lore.In this skill: examples/ holds a generated ER diagram of a sample migrations directory.
What SKILL.md sets; muted values are Claude Code's defaults
diagram-skills@opum is listed by opum-ai/opum-marketplace — review the source before installing
npx claudepluginhub opum-ai/opum-marketplace --plugin diagram-skills6 skills in this plugin
/diagram-architectureExplain and diagram a software system's architecture as C4 views - system context, containers, components - drawn from the actual repository, manifests, compose files and lore docs, never from a generic template. Produces a Mermaid diagram plus a plain-English explanation pitched to the reader (beginner, intermediate or advanced), with every box traced to a real path. Use this skill whenever someone asks how a system or repo is structured, what talks to what, for an architecture overview or C4 diagram, to onboard someone to a codebase, to document services for an arc42 or lore reference doc, or says "draw the architecture", "show me the big picture" or "what are the moving parts" - even if they never say C4 or diagram. For step-by-step flows or lifecycles use diagram-process; for database tables use diagram-data; for task plans use diagram-plan./diagram-decisionExplain and diagram a technical decision - the question, the options considered, the trade-off of each and the path chosen - for an architecture decision record (ADR), a Quest decision (DEC-N) or a design discussion, plus how decisions relate over time (supersedes, requires). Reads the real ADR and Quest decision, so the chosen path in the picture always matches the record, and pairs the diagram with a plain-English explanation at the reader's level. Use this skill whenever someone asks to visualise or explain an ADR or design decision, compare options with a diagram, show why we chose X over Y, write up a decision for stakeholders, show which decisions superseded which, or add a diagram to an ADR - even if they just say "make the trade-off clear". For the system the decision is about use diagram-architecture; for task plans use diagram-plan./diagram-planExplain and diagram where the work stands - which tasks block which, what is ready to start, what each milestone contains, and the critical path - generated directly from the Quest tracker (`quest task list --json`, `quest milestone list --json`) so every task and dependency arrow is real, never remembered. Pairs the diagram with a plain-English status explanation at the reader's level. Use this skill whenever someone asks what's blocking what, what can start next, for a dependency graph, roadmap, milestone or status picture of the backlog, epic or project, "where are we", "what's left", or wants to show a stakeholder the plan - in any repository with a .quest workspace, even if they never mention Quest. Draws a Gantt only when real dates exist. For the decisions behind the plan use diagram-decision; for system structure use diagram-architecture./diagram-processExplain and diagram how something happens - a workflow, request path, pipeline, approval process, incident runbook or object lifecycle - as a Mermaid flowchart (with swimlanes for who does what), sequence diagram (who calls whom, in what order, including the error path) or state diagram (the states something moves through). Every step is traced to the code, runbook or spec that defines it, and the diagram ships with a plain-English walkthrough at the reader's level. Use this skill whenever someone asks how a process, flow, request, job, deploy, checkout, login, retry or approval works, what happens when X, what order things run in, what states an order or ticket goes through, or wants a flowchart, sequence diagram, swimlane or state machine - even if they only say "walk me through it". For the static structure of a system use diagram-architecture; for decisions use diagram-decision; for data models use diagram-data./diagram-reviewValidate and critique Mermaid diagrams in Markdown docs, ADRs, READMEs, PR descriptions or a reply. Checks that each diagram parses under the Mermaid version GitHub renders, follows the accessible profile (accTitle/accDescr, quoted labels, legend, colour never the only signal), stays within the reader's node cap, and is true - every node traced to a real file, Quest record or lore doc, with prose that says what the picture shows. Use this skill whenever someone asks to check, review, lint, validate, fix or audit a diagram, when a Mermaid diagram fails to render on GitHub, when a docs PR adds or changes diagrams, or before publishing any diagram another diagram-* skill drew, even if they only say "does this look right". Also owns the shared engine and references the other diagram skills use. To draw a new diagram, use diagram-architecture, diagram-process, diagram-decision, diagram-plan or diagram-data instead.Other plugins' skills for the same job