/diagram-skills:diagram-architecturefrom Diagram Skills
Explain 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.
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 this system, and what are its parts?" with C4 views that are true to the repository in front of you. The usual failure is the template: a model draws the architecture it expects (a load balancer, a cache, an auth service) instead of the one that exists. Every box here comes from evidence in the repository, and the checks prove it.
<engine> is ${CLAUDE_SKILL_DIR}/../diagram-review/scripts; shared rules
live in ${CLAUDE_SKILL_DIR}/../diagram-review/references/.
| The reader wants to know | C4 view | Typical size |
|---|---|---|
| What the system is for and who or what it talks to | Context | The system, 2–5 people or external systems |
| What runs, where data lives, how the parts talk | Container | 4–10 apps, services, datastores |
| What is inside one container | Component | 5–12 modules in one container |
Context and container views are enough for most questions (c4model.com). Go
to component level only for one container, on request. Pick the reader's
level as in levels.md; it caps nodes at 7, 12 or 20.
python3 <engine>/repo_inventory.py --root <repo>
lore query "architecture" --limit 5 # if the repo has a lore bundle
The inventory lists deployable units (manifests, Dockerfiles, compose services), datastores and external services, each with the file that proves it. Read the README and any architecture doc, and skim each unit's entry point to learn what it does and how it calls the others: HTTP clients, queue producers, database drivers. Only draw what you found. If the repository says nothing about how two parts talk, leave the edge out and say so, rather than guessing a protocol.
Use flowchart LR with C4 classes, not C4Context, whose parser accepts
malformed input. Name each box the way the reader would, and put the type
and technology in the label:
An illustrative shop (the paths stand in for real ones):
flowchart LR
accTitle: Container view of the shop
accDescr: Customers use the web app, which calls the orders API; the API stores orders in Postgres and charges cards through Stripe.
%% level: intermediate
customer(["Customer"])
subgraph shop["Shop (our system)"]
web["Web app: Next.js"]
api["Orders API: Python, FastAPI"]
db[("Orders database: Postgres")]
end
stripe["Stripe: card payments"]
customer -- "browses, orders" --> web
web -- "calls, JSON over HTTPS" --> api
api -- "reads and writes, SQL" --> db
api -- "charges cards, HTTPS" --> stripe
classDef person fill:#08427b,stroke:#dbe7f3,color:#ffffff
classDef container fill:#2f6fb5,stroke:#dbe7f3,color:#ffffff
classDef datastore fill:#1d5c8f,stroke:#dbe7f3,color:#ffffff
classDef external fill:#686868,stroke:#e0e0e0,color:#ffffff
class customer person
class web,api container
class db datastore
class stripe external
%% ref customer = ext:Shoppers using a browser
%% ref web = path:apps/web
%% ref api = path:services/orders
%% ref db = path:docker-compose.yml#postgres
%% ref stripe = path:services/orders/pyproject.toml#stripe
(["..."]). Datastores: cylinder [("...")].
External systems: class external. The system boundary is a
subgraph. Copy the palette from accessibility.md.path:...#stripe), not to ext:. ext: is for people and for
systems with no footprint in the repository.%% ref: path: for anything in the repository,
lore: for a documented concept, ext: only for people and outside
systems. Group units the reader thinks of as one thing. The ref points
at the directory that holds them.Run the three checks in checks.md on a scratch .md that holds the lead
sentence, the diagram and the explanation. Repair from the error lines until
all three pass.
Lead with one sentence saying what the system is. After the diagram, walk it in the order a request travels, at the reader's level. A beginner gets plain words and no technology names. An advanced reader gets protocols, datastores and where the risk sits. End with a legend sentence for the shapes and colours, for example: "Legend: dark blue boxes are people, mid-blue are parts we run, grey are outside services, cylinders store data."
Put it in the architecture Reference doc (lore query, then edit, or
lore new reference "Architecture overview"), and link the Quest task it
serves (persisting.md). Run lore check.
From ${CLAUDE_SKILL_DIR}/../diagram-review/references/:
levels.md: caps and explanation patterns per reader.mermaid-profile.md: syntax rules and traps.accessibility.md: the C4 palette, legends, accTitle/accDescr.truth.md: %% ref kinds and the prose-agreement checklist.checks.md: the parse, lint and truth loop.persisting.md: where the doc lives and how to link it.In this skill: examples/ holds a worked container view of this repository.
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-dataExplain 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./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.Other plugins' skills for the same job