Write C4 architecture diagrams
Produces C4 context, container and optionally component diagrams as Mermaid, PlantUML or Structurizr DSL from a codebase or description, with a legend and stated assumptions.
The C4 model describes software at four zoom levels: system context (the system, its users and the external systems it talks to), containers (separately deployable or runnable things such as web apps, APIs, workers, databases and queues), components (the major building blocks inside one container) and code. Most teams need only the first two. Diagrams go wrong in predictable ways: boxes with no technology or responsibility, unlabelled arrows, a library drawn as a container, a database shared by everything with no owner shown, and elements that exist only in someone's memory, not in the code. A useful C4 diagram is accurate, readable in a minute and states what it does not know.
Produce C4 diagrams down to the "" level, written in , for:
- Gather the facts. If you were pointed at a repo, read what reveals the architecture: build manifests, Dockerfiles and compose files, deployment and infrastructure config, service entry points, environment variable names, HTTP and queue clients, and database migrations. Cite the file each element comes from. If you have only a description, use it and mark anything you inferred.
- Identify the elements:
- People: user roles and operators, by role not by name.
- Software systems: the system in scope and every external system it calls or is called by, with direction.
- Containers (for the container level and below): each runnable or deployable unit and each data store, with its technology and one-line responsibility. Libraries and modules are not containers.
- Components (for the component level): the main building blocks of the single most important container, which you name and justify, or the one the user indicated.
- Label every relationship with what flows and how, for example "Places orders [JSON over HTTPS]" or "Publishes OrderPlaced [Kafka]". Every arrow has a direction, a verb phrase and, at container level and below, a protocol.
- Write the diagrams in :
- mermaid: Mermaid C4 syntax (
C4Context,C4Container,C4Component) withPerson,System,System_Ext,Container,ContainerDb,ComponentandRel. Mention that Mermaid's C4 support is still experimental in some renderers. - plantuml: the C4-PlantUML standard library (
!include <C4/C4_Context>,<C4/C4_Container>,<C4/C4_Component>) withSHOW_LEGEND(). - structurizr: one Structurizr DSL
workspacecontaining the model once and a view per level (systemContext,container,component) withautoLayout. One fenced block per diagram (one block in total for Structurizr), each with a title.
- Keep each diagram readable: at most about 15 elements. If the system is bigger, group or split and say how.
- Add a legend explaining shapes, colours, line styles and the meaning of external elements, unless the notation renders one (then say so).
- Do not invent services, data stores, external systems or protocols. Anything not found in the code or description is either left out or marked as assumed in the element catalogue.
- Use the C4 vocabulary correctly: a container is something that runs or stores data, not a Docker container by definition and not a code module.
- The output must render as written: check identifiers are unique, quotes are balanced and every relationship refers to a defined element.
- Read the relevant code before making a claim about it. Do not guess what a file, function or config contains.
- If the information you need is not available, say what is missing and how to get it instead of inventing it.
Scope
The system in scope, the levels drawn, and for a component diagram which container and why. At most 4 lines.
Diagrams
One fenced code block per diagram (or one Structurizr workspace), each preceded by its title.
Legend
Bullets, or "Rendered by the notation".
Element catalogue
Table: element, C4 type, technology, responsibility, source (file path or "description" or "assumed").
Assumptions and gaps
Numbered. What you inferred or could not find, and what to check to confirm it.
1 required value still a placeholder; the assistant will ask for it.
details
- kind
- Prompt: a task you run by name to get one finished thing back
- domain
- Software engineering
- category
- Architecture
- level
- Intermediate
- made for
- Software architect, Software engineer, Tech lead / staff engineer, Technical writer
- needs
- repo-read
- risk
- read-only
- version
- v1.0.0 · incubating
- reviewed
- 2026-10-02
- works in
- Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Antigravity, OpenCode, Windsurf, Zed, Continue, AGENTS.md
use in
npx @hermes-hq/hodios install write-c4-diagram --target claude-codenpx skills add hermes-hq/hodios-dist --skill write-c4-diagram -a claude-codeclaude plugin marketplace add hermes-hq/hodios-distclaude plugin install hodios-software-engineering@hodiosThe plugin brings every entry in this domain at once.
pairs well with
All of ArchitectureSoftware architect
Acts as a pragmatic software architect who designs from requirements and constraints, names trade-offs and failure modes, and keeps designs as simple as the problem allows.
software-architectTechnical writer
Writes and edits developer documentation that is accurate to the code, task-oriented and easy to scan. Use as the voice for READMEs, API references, guides and changelogs.
technical-writerExplain a codebase
Explains an unfamiliar codebase. Maps its structure, traces one real request end to end and names the concepts and gotchas a newcomer needs. Use when joining a project or reading an unknown repo.
explain-codebaseWrite a developer onboarding guide
Writes an onboarding guide for a repository covering setup, an architecture map, first tasks and known gotchas, with every command checked against the repo. Use for new hires or contributors.
write-onboarding-guideWrite an engineering design doc
Writes an engineering design doc or RFC with context, goals and non-goals, options and trade-offs, the decision, risks and a rollout plan. Use before building a change that needs review or buy-in.
write-design-docCompare design options
Compares two to four technical options against the criteria that matter, weighs reversibility and risk, and recommends one. Use when a team is stuck choosing between approaches or tools.
compare-design-options