c4

c4 is a skill for Claude Code from karsten-s-nielsen/mad-scientist-skills. It costs 171 tokens per session (11,640 once invoked), scanned B, original, MIT.

A tool for creating C4 architecture diagrams, which show a software system from broad context down to its containers and components. It produces a self-contained HTML file that can be viewed offline.

In plain words
What is it for?
Creating system-context, container, component, deployment, and interaction diagrams from Structurizr DSL, a text format for describing C4 architecture models.
Why use it?
It turns a complex codebase or system design into a set of visual views that are easier to understand and share.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths.

Part of the mad-scientist-skills plugin — 10 skills, 4 commands shipped together

Good fit Creating system-context, container, component, deployment, and interaction diagrams from Structurizr DSL, a text format for describing C4 architecture models.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/karsten-s-nielsen/mad-scientist-skills/c4
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add karsten-s-nielsen/mad-scientist-skills --skill c4
Clone the repo
git clone --depth 1 https://github.com/karsten-s-nielsen/mad-scientist-skills

Made for: Claude Code.

Or install mad-scientist-skills, the plugin that ships this one along with the rest of its 10 skills, 4 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for c4

README.md
[![agentmods](https://agentmods.dev/badge/skills/karsten-s-nielsen/mad-scientist-skills/c4/github.svg)](https://agentmods.dev/skills/karsten-s-nielsen/mad-scientist-skills/c4)
Your own site
<a href="https://agentmods.dev/skills/karsten-s-nielsen/mad-scientist-skills/c4"><img src="https://agentmods.dev/badge/skills/karsten-s-nielsen/mad-scientist-skills/c4/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for c4

Your own site · 80×15
<a href="https://agentmods.dev/skills/karsten-s-nielsen/mad-scientist-skills/c4"><img src="https://agentmods.dev/badge/skills/karsten-s-nielsen/mad-scientist-skills/c4.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 171 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 11,640 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00171 $0.11640
Opus 5 $0.00086 $0.05820
Sonnet 5 $0.00034 $0.02328
Haiku 4.5 $0.00017 $0.01164

Measured 12d ago against content hash 05cb5c9063de, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade B, and why

c4 scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (c4_assemble.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

| Linux (Debian/Ubuntu) | `sudo apt install openjdk-21-jre` |

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

WAR_URL=$(curl -s https://docs.structurizr.com/binaries | grep -oP 'https://download\.structurizr\.com/structurizr-[0-9.]+\.war' | head -1)
plugins/mad-scientist-skills/skills/c4/SKILL.md · 954 lines

How it starts

The opening of the file, as written. The whole thing — 954 lines — stays where its author put it; the contents beside it link to each section on GitHub.

C4 Architecture Diagram Builder

A C4 diagram is a self-contained HTML file that visualizes software architecture at multiple zoom levels using the C4 model. This skill uses Structurizr DSL — the official C4 model notation created by Simon Brown — as the source language. Diagrams are rendered locally via a two-stage pipeline: Structurizr exports DSL to PlantUML C4, then plantuml.jar renders SVGs. SVGs are embedded directly in the HTML — making the output fully self-contained and offline-capable.

Why Structurizr DSL?

  • Official format — Structurizr DSL is the canonical C4 authoring language by the creator of C4
  • Model-first — Define the model once, create multiple views from it (no duplication)
  • Portable — DSL files can be imported into Structurizr tools and other C4-compatible software
  • Cleaner syntax — No @startuml/@enduml wrappers or !include directives

When to use this skill

When the user asks for:

  • Architecture diagrams or system diagrams
  • C4 model diagrams (Context, Container, Component)
  • Software structure visualization
  • "How does this system fit together?"
  • Deployment or dynamic interaction diagrams
  • Codebase architecture overview

How to use this skill

  1. Understand the system. Read relevant code, configs, and docs to understand the architecture. If the user describes a system verbally, capture the key elements.
  2. Identify the diagram type from the user's request.
  3. Load the matching template from templates/:
    • templates/system-context.md — Level 1: People, systems, and high-level interactions
    • templates/container.md — Level 2: Applications, data stores, and their communication
    • templates/component.md — Level 3: Internal structure of a single container
    • templates/dynamic.md — Numbered interaction sequences between elements
    • templates/deployment.md — Infrastructure nodes and deployed containers
  4. If no specific level requested, build a multi-level explorer that includes System Context + Container diagrams with tab switching.
  5. Generate Structurizr DSL source for each diagram level following the template syntax.
  6. Render each diagram locally via the two-stage pipeline (see rendering workflow below).
  7. Assemble the HTML file with embedded SVGs, tabbed navigation, DSL panel, and copy button.
  8. Save the .dsl source file alongside the HTML for version control.
  9. Open in browser. After writing the HTML file, run open <filename>.html (macOS) or start <filename>.html (Windows) to launch it.

Read the full file on GitHub · 954 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 954 lines · 171 tokens per session scan B 05cb5c9063de

Subscribe to this mod's changes

c4 is a skill published in the GitHub repository karsten-s-nielsen/mad-scientist-skills (3 stars, last pushed 13d ago), licensed MIT. It adds 171 tokens to every session and 11,640 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it B with 2 findings (asks for root, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

recipe-front-design

Execute from repository evidence through applicable UI Spec and optional ADR decisions to complete frontend Design Doc approval.

shinpr/claude-code-workflows · 22 tokens

recipe-front-adjust

Adjust an already-implemented UI in-session with verification against the design source.

shinpr/claude-code-workflows · 18 tokens

fidelity-gate

Build a UI against a frozen visual reference without drift - an inventory extracted before any code, a relics list, and a gate that MEASURES computed styles on a fixture carrying the reference's own data. Use when a mockup, design spec or screenshot is the contract.

jjanczur/tyran · 56 tokens

a11y-audit

Dedicated WCAG 2.2 AA/AAA accessibility audit across 10 dimensions (A1-A10) covering semantic HTML, keyboard navigation, ARIA patterns, color contrast, forms, images/media, responsive/zoom, motion/animation, reading/content, and legal compliance. Goes far beyond surface-level design-review checks with deep…

greglas75/zuvo · 147 tokens

design-review

UI/UX design consistency audit. Code-based DX1-DX20 checklist covering states, consistency, accessibility, responsive behavior, and interaction patterns. Optional visual audit via chrome-devtools screenshots and automated WCAG accessibility via axe-core. DAP1-DAP12 anti-pattern detection. Modes: [path], visual…

greglas75/zuvo · 107 tokens

design

Intent-first UI design with conscious, traceable design decisions. Persists decisions in .interface-design/ for cross-session consistency. Includes domain exploration, design system generation (system.md + system.json), per-component construction with mandatory checkpoints, and craft validation tests. Modes: init…

greglas75/zuvo · 90 tokens