/system-design:mermaid-generatorfrom system-design
Generates Mermaid diagrams from code or architecture by analyzing source structure. Maps code relationships to flowchart, sequence, class, ER, or state diagrams.
Ships in system-design. 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.
None: SKILL.md is the whole skill.
Create Mermaid diagrams that explain architecture, component relationships, data flow, dependencies, or state transitions found in a codebase.
Identify the target files or directories, the audience, and the desired diagram type. Use the requested type when supplied. Otherwise infer it from the intent:
| Intent | Diagram |
|---|---|
| Architecture, modules, or process flow | flowchart |
| Request/response or asynchronous interaction | sequenceDiagram |
| Classes, interfaces, or type hierarchy | classDiagram |
| Entities and database relationships | erDiagram |
| Lifecycle or workflow states | stateDiagram-v2 |
| Imports or dependency relationships | flowchart or graph |
If the target or intent is materially ambiguous, ask one concise clarifying question before analysing code (principle-never-block-on-the-human). If the request has no code or system-design source, say so and name the source that would make the diagram evidence-based. Never present a diagram you draw as source-derived (principle-observe-dont-infer). Completion criterion: the scope and diagram purpose are explicit or confirmed.
List the relevant source files with the repository’s file-search tools. Prioritise application code, public interfaces, data models, entry points, services, integrations, and event handlers. Exclude dependencies, generated output, build artifacts, and unrelated files unless the request includes them.
For a large scope, select the smallest set that explains the requested relationship and state what was omitted (principle-state-the-scope). If no relevant files exist, report the searched paths and stop. Completion criterion: every file used as evidence is identified by path, and the selected set is sufficient for the requested view.
Read the selected files and record only source-supported relationships:
Separate observed relationships from inferred ones (principle-label-the-evidence). Never present a convention, naming guess, or likely runtime behaviour as fact without source evidence. A shared or similar name is not evidence that an argument, instance, or field is the class of that name (principle-observe-dont-infer). An argument position is evidence of the parameter it fills when the source shows that parameter list. Record as an inference any link resting on a name match, or on argument order without that parameter list. Completion criterion: each important node and edge in the planned diagram has a source basis or is explicitly marked as an inference.
Let the request set the level of detail. For a complete or end-to-end view, record every source-observed step in execution order, including branches, compensation, and returns; judge materiality later. For an overview, record only the steps that carry the relationship being explained.
Choose the least detailed diagram that answers the request (principle-earn-every-element). For a complete interaction, draw every material step as its own element instead of collapsing it into a note. A step is material when removing it changes how a reader interprets the flow (principle-preserve-meaning). Group or omit the rest. Prefer clarity over completeness:
TB or LR based on the dominant direction of the relationship;principle-preserve-meaning);par/and in a sequence diagram;alt/else; if a branch propagates an error, show where that error leaves the frame;principle-observe-dont-infer);Use valid Mermaid syntax. Quote labels containing punctuation that Mermaid could parse as syntax, use stable node identifiers, and keep declarations compatible with the selected diagram type. Completion criterion: the diagram is internally consistent, every declared relationship is intentional, and the syntax has been reviewed for Mermaid renderability.
Return the result in this structure:
## Diagram Overview
[One or two sentences describing scope and intent]
## Files Analyzed
- `path/to/file.ts` — [what it contributed; add `:line` when a line number locates the evidence]
## Mermaid Diagram
```mermaid
[diagram]
```
## Key Relationships
1. **[Relationship]** — [why it matters]
## Notes
- [Assumption, inference, concern, or material omission]
Completion criterion: the response includes the diagram, its evidence paths, the relationships needed to interpret it, and any assumptions or omissions. If you drew no diagram because the source was insufficient, the response says exactly what is missing.
flowchart TB or flowchart LR; use subgraphs for architectural layers.||--o{ and name meaningful relationships.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
5 skills in this plugin
/architecture-auditWHEN auditing an existing repository or multi-module subsystem to discover and rank bounded architectural hotspots and decide where investment pays off now; NOT for designing one already-selected module contract (architect), auditing physical directory, package or build-target layout and import enforcement (codebase-layout), breaking hidden dependencies in untestable code (test-seams), simplifying one chosen path (reducer), or editing code (refactoring); returns a read-only Markdown and Mermaid report with qualitative ranking, confidence, counterevidence and next-skill handovers.
/codebase-layoutWHEN designing, auditing, or migrating physical source trees, packages, build targets, placement rules, or import-direction enforcement; NOT for one module's logical types and caller contract (architect), repository-wide architecture hotspot triage (architecture-audit), or semantic ports-and-adapters rules (hexagonal-architecture); produces an evidence-backed layout, dependency rules, proportionate enforcement, and a staged migration plan.
/hexagonal-architectureWHEN a repository or user explicitly opts into hexagonal (ports and adapters) architecture via README, AGENTS.md, CLAUDE.md, ADR, or explicit adoption request — apply to every code change in that opted-in repo alongside tdd; NOT for repositories that have not opted in, generic test-seam or isolation requests, or physical folder layout alone; enforces inside/outside zones, application-owned ports, thin adapters, composition roots, and stateful-fake testing.
npx claudepluginhub mintuz/skills --plugin system-designOther plugins' skills for the same job