Mermaid Diagrams
jjmartres/opencode
Helps an agent pick the right Mermaid diagram type and write the syntax for class, sequence, flow, ER, C4, state and other software diagrams.
Creates C4 model diagrams at every zoom level, from system landscape to code, in ASCII, Mermaid or Structurizr, for designing or documenting software architecture.
$ npx skills add lexler/skill-factory --skill c4-diagrams -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install lexler/skill-factory c4-diagrams --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/lexler/skill-factory.git skills-src && mkdir -p .claude/skills && cp -r skills-src/output_skills/design/c4-diagrams .claude/skills/c4-diagrams && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "c4-diagrams" agent skill from https://github.com/lexler/skill-factory/tree/main/output_skills/design/c4-diagrams into .claude/skills/c4-diagrams/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "c4-diagrams", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/lexler/skill-factory/tree/main/output_skills/design/c4-diagramsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add lexler/skill-factory --skill c4-diagrams -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install lexler/skill-factory c4-diagrams --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/lexler/skill-factory.git skills-src && mkdir -p .agents/skills && cp -r skills-src/output_skills/design/c4-diagrams .agents/skills/c4-diagrams && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "c4-diagrams" agent skill from https://github.com/lexler/skill-factory/tree/main/output_skills/design/c4-diagrams into .agents/skills/c4-diagrams/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "c4-diagrams", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add lexler/skill-factory --skill c4-diagrams -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install lexler/skill-factory c4-diagrams --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/lexler/skill-factory.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/output_skills/design/c4-diagrams .cursor/skills/c4-diagrams && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "c4-diagrams" agent skill from https://github.com/lexler/skill-factory/tree/main/output_skills/design/c4-diagrams into .cursor/skills/c4-diagrams/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "c4-diagrams", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/lexler/skill-factory.git --path output_skills/design/c4-diagrams--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add lexler/skill-factory --skill c4-diagrams -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install lexler/skill-factory c4-diagrams --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/lexler/skill-factory.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/output_skills/design/c4-diagrams .gemini/skills/c4-diagrams && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "c4-diagrams" agent skill from https://github.com/lexler/skill-factory/tree/main/output_skills/design/c4-diagrams into .gemini/skills/c4-diagrams/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "c4-diagrams", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install lexler/skill-factory c4-diagramsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add lexler/skill-factory --skill c4-diagrams -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/lexler/skill-factory.git skills-src && mkdir -p .github/skills && cp -r skills-src/output_skills/design/c4-diagrams .github/skills/c4-diagrams && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "c4-diagrams" agent skill from https://github.com/lexler/skill-factory/tree/main/output_skills/design/c4-diagrams into .github/skills/c4-diagrams/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "c4-diagrams", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add lexler/skill-factory --skill c4-diagrams -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install lexler/skill-factory c4-diagrams --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/lexler/skill-factory.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/output_skills/design/c4-diagrams .opencode/skills/c4-diagrams && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "c4-diagrams" agent skill from https://github.com/lexler/skill-factory/tree/main/output_skills/design/c4-diagrams into .opencode/skills/c4-diagrams/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "c4-diagrams", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
c4-diagramsCreates C4 model diagrams at every zoom level, from system landscape to code, in ASCII, Mermaid or Structurizr, for designing or documenting software architecture.
The skill teaches the C4 approach, a hierarchy of four views: System Context, Container, Component and Code. Three more diagram types round it out: System Landscape for all systems in an organization, Dynamic for the runtime behavior of one use case, and Deployment for how containers map onto infrastructure. It defines the building blocks, namely person, software system, container, component and relationship, and stresses that a container here means any deployable unit, not a Docker container.
The agent picks the level that fits the conversation, loads the matching reference for that diagram type and chooses an output format from the ASCII, Mermaid and Structurizr references. A script, `check_ascii_alignment.py`, checks that ASCII diagrams line up, and an evals file is included. Component and code views are suggested only when they add understanding.
6 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit e262032. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 1 file in scripts/ (Python), which the agent can run.
Shell commands in SKILL.md call:
uvFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use uv, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
C4 Architecture Diagrams loads about 2.3k tokens when it runs, and up to ~11k if it reads all its reference files. Until then it costs about 64 tokens; SKILL.md has 1,106 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from lexler/skill-factory at commit e262032, republished under its Apache-2.0 licence (© lexler). 1,106 words, ~2,260 tokens.
.claude/skills/c4-diagrams/SKILL.md (or your agent's skills folder). This skill also uses 12 other files; get the full folder from GitHub.STARTER_CHARACTER = 🏗️
C4 is a hierarchical approach to diagramming software architecture. Four core levels of zoom, each showing more detail:
System Context (one system + its users and external dependencies)
└── Container (deployable units inside the system)
└── Component (logical groupings inside a container)
└── Code (classes, interfaces, functions inside a component)Three supplementary diagram types complement this hierarchy:
Pick the level that matches the conversation. Load the reference for the type you're creating.
Static structure (the zoom hierarchy):
Wider or orthogonal views:
Most teams need only System Context + Container. Add others when they earn their place.
Ask the user which format they prefer. If no preference stated, choose based on context:
Every diagram must have:
Every element must have:
Every container and component must also have:
Every relationship must:
Descriptions and legends are format-dependent:
After creating any diagram, verify:
uv run ${CLAUDE_SKILL_DIR}/scripts/check_ascii_alignment.py <file> to validate box alignment. Fix any issues before presenting.One giant diagram — if a Container diagram has 20+ containers, split into focused views by domain area or user journey. Each view should tell one story.
Mixing abstraction levels — don't show components and software systems on the same diagram. Each diagram operates at one zoom level.
Missing technology labels — "Web App" tells the reader nothing. "React SPA" or "Spring Boot API" tells them what stack they're looking at.
Vague relationship labels — "Uses" between every element makes the diagram useless. Be specific: "Authenticates via", "Publishes events to", "Reads from".
Deployment details in Container diagrams — clustering, load balancers, replication belong in Deployment diagrams, not Container diagrams.
When analyzing a codebase to generate diagrams:
Recognizing C4 elements in code:
When the user wants to work through architecture for a system that doesn't exist yet — or only partially exists — first figure out where they are in the design process:
docs/, architecture/, design/, ADRs, RFCs, README files, anywhere design might already be captured. If you find them, read them and base the diagrams on what's there.The diagrams are a tool for thinking, not just documentation. Surface architectural decisions as you draft — "I'm assuming the queue decouples ingestion from processing — is that intentional?" — rather than just transcribing what the user said.
© lexler, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 12 other files (scripts, references) in output_skills/design/c4-diagrams of lexler/skill-factory.
Open the folder on GitHubat commit e262032
C4 Architecture Diagrams next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| C4 Architecture Diagrams this skilllexler/skill-factory | 239 | — | ~2.3k | Automated safety check: Pass | Apache-2.0 | |
| Mermaid Diagramsjjmartres/opencode | 133 | 6 repos | ~1.9k | Automated safety check: Pass | MIT | |
| Archify Diagramstt-a1i/archify | 81k | — | ~2.9k | Automated safety check: Pass | MIT | |
| Diagram Designcathrynlavery/diagram-design | 48k | 1 repos | ~7.6k | Automated safety check: Pass | MIT | |
| Draw.io Diagram StudioAgents365-ai/drawio-skill | 10k | — | ~2.4k | Automated safety check: Notes | MIT | |
| Dark Architecture Diagram BuilderCocoon-AI/architecture-diagram-generator | 7.4k | 1 repos | ~2.1k | Automated safety check: Pass | MIT |
jjmartres/opencode
Helps an agent pick the right Mermaid diagram type and write the syntax for class, sequence, flow, ER, C4, state and other software diagrams.
tt-a1i/archify
Creates interactive architecture, workflow, sequence, data-flow and lifecycle diagrams as standalone HTML with inline SVG, themes and image or video export.
cathrynlavery/diagram-design
Creates branded diagrams, from architecture, flowchart and sequence to charts and maps, as self-contained HTML with inline SVG, with import from draw.io, Mermaid and Excalidraw.
Agents365-ai/drawio-skill
Creates and edits editable draw.io diagrams from descriptions, code, infrastructure files, SQL and API schemas, with sync, review, test and export tools.
Cocoon-AI/architecture-diagram-generator
Creates dark-themed system, cloud, security and network architecture diagrams as self-contained HTML files with inline SVG and CSS.
imxv/Pretty-mermaid-skills
Writes and renders Mermaid diagrams as themed SVG, PNG or terminal ASCII and Unicode art with a bundled Node.js CLI that needs no browser.
lexler/skill-factory
Plans and launches Claude Code agent teams with distinct roles, right-sized tasks and detailed spawn prompts, and says when subagents or worktrees fit better.
lexler/skill-factory
Guides writing and debugging Claude Code status line scripts that read session JSON from stdin and print one line of text.
lexler/skill-factory
Catalog of obstacles, anti-patterns and patterns for working with AI coding agents, covering context management and reliability, from a published patterns collection.
lexler/skill-factory
Writes snapshot-style approval tests in Python, JavaScript, TypeScript or Java, comparing output against an approved file instead of writing individual assertions.
lexler/skill-factory
Find where a codebase actually costs time by mining its git history (Tornhill hotspot analysis).
lexler/skill-factory
Teaches the Nullables pattern for testing without mocking libraries: production classes with an off switch, stubbed only at the third-party edge.
Works with
Categories
Creates C4 model diagrams at every zoom level, from system landscape to code, in ASCII, Mermaid or Structurizr, for designing or documenting software architecture. The skill teaches the C4 approach, a hierarchy of four views: System Context, Container, Component and Code. Three more diagram types round it out: System Landscape for all systems in an organization, Dynamic for the runtime behavior of one use case, and Deployment for how containers map onto infrastructure.
C4 Architecture Diagrams fits situations like: sketching the system context and containers for a new design; mapping an existing codebase into an architecture diagram; documenting deployment or runtime flow for one use case; producing a Mermaid or Structurizr version of an architecture diagram.
Run `npx skills add lexler/skill-factory --skill c4-diagrams -a claude-code`. Or copy the skill folder (output_skills/design/c4-diagrams in lexler/skill-factory) into .claude/skills/c4-diagrams in your project. Claude Code loads it when a task matches its description.
Run `npx skills add lexler/skill-factory --skill c4-diagrams -a codex`. Or copy the skill folder (output_skills/design/c4-diagrams in lexler/skill-factory) into .agents/skills/c4-diagrams in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add lexler/skill-factory --skill c4-diagrams -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/c4-diagrams, .gemini/skills/c4-diagrams, .github/skills/c4-diagrams and .opencode/skills/c4-diagrams in your project.
Going by SKILL.md and its folder, C4 Architecture Diagrams needs Python for the scripts in its folder and the command-line tools its instructions call (uv).
SKILL.md contains no URLs. Its commands use uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
C4 Architecture Diagrams is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.3k tokens (SKILL.md is roughly 9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 9.1k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with C4 Architecture Diagrams: Mermaid Diagrams (jjmartres/opencode, 133 stars), Archify Diagrams (tt-a1i/archify, 81k stars), Diagram Design (cathrynlavery/diagram-design, 48k stars) and Draw.io Diagram Studio (Agents365-ai/drawio-skill, 10k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
lexler (a GitHub user) maintains it in lexler/skill-factory, which has 239 GitHub stars. The repository holds 25 skills in this directory. The repository was last updated on October 10, 2026.
Source: lexler/skill-factory on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.