Monday, September 07, 2026

๐Ÿš€ Goodbye “Mermaid Slop”, Hello Editorial Diagrams: Deconstructing cathrynlavery/diagram-design ๐ŸŽจ✨

 

Ever asked an AI assistant like Claude Code or Codex to generate a quick architecture diagram, only to be slapped in the face with a generic, eye-searing, neon-purple rounded-box nightmare? ๐Ÿคฎ

You know the drill:

  • ๐Ÿ’ฉ Mermaid.js defaults that look like they were rendered in 2005.
  • ๐ŸŽจ 30 minutes wasted in Figma just tweaking margins, alignment, and hex codes.
  • ๐Ÿคฎ “AI Slop aesthetics” — drop shadows everywhere, terrible line routing, and zero visual hierarchy.

Enter cathrynlavery/diagram-design — a blowing-up open-source GitHub repository (over 33k+ Stars ⭐) that completely redefines how developers and architects generate visual mental models using AI.

Let’s dive into an architectural breakdown of what makes this repo brilliant, how it works under the hood, and why it belongs in your agentic engineering toolchain! ๐Ÿ› ️ ๐Ÿ”ฅ

๐Ÿ’ก What is diagram-design?

Created by Cathryn Lavery (creator, designer, and writer at littlemight.com), diagram-design is an Agent Skill / Plugin built for modern AI coding tools like Claude Code, Codex, Factory Droid, Pi, Kiro, and OpenCode.

Instead of outputting markdown charts or heavy canvas scripts, it instructs your LLM agents to produce 39 publication-ready editorial diagram types in pure, self-contained HTML + SVG.

๐ŸŽฏ Core Motto:“No Figma. No generic rounded boxes. No 30-minute color-picking sessions. No Mermaid slop.”

๐Ÿ—️ Architectural Core Principles: Why it Looks so Good ๐ŸŽจ

As software architects, we evaluate tools based on design constraints and structural opinionatedness. diagram-design wins because of these 4 strict design rules:

                       ┌─────────────────────────┐
                       │   Target Visual Density │
                       │          (4 / 10)       │
                       └────────────┬────────────┘
                                    │
         ┌──────────────────────────┼──────────────────────────┐
         ▼                          ▼                          ▼
┌──────────────────┐       ┌──────────────────┐       ┌──────────────────┐
│ Zero External    │       │ 1-2 Accent Focus │       │ Semantic         │
│ Dependencies     │       │ Rule             │       │ Grammars         │
│ (Pure HTML+SVG)  │       │ (Intentional Ink)│       │ (39 Pure Types)  │
└──────────────────┘       └──────────────────┘       └──────────────────┘

1. Zero External Dependencies ๐Ÿ“ฆ❌

  • No JavaScript chart libraries (Chart.js, D3, Recharts) to load or fail at runtime.
  • No SVG canvas shadows or filters (drop-shadow effects are strictly banned).
  • Self-Contained Output: Generates flat .html files containing inline <svg> and CSS. You can open them in any browser or screenshot them straight into your blog/documentation.

2. The Deletion Principle & Target Density (4/10) ✂️

In software architecture, less is more. Every node and arrow in a diagram must earn its right to exist. The skill enforces a strict visual density score of 4 out of 10 — eliminating noise so readers digest complex topology instantly.

3. The 1–2 Accent Focal Rule ๐ŸŽฏ

Instead of rainbow-colored nodes, the algorithm restricts bright accent colors to only 1 or 2 high-priority focal points (e.g., an active microservice, a database bottleneck, or a breaking workflow state). The rest of the stack stays neutral (paper, ink, and muted slate).

4. 39 Universal Layout Grammars ๐Ÿ—บ️

Whether you need to map out a Kubernetes deployment or a distributed transaction saga, diagram-design ships with 39 layout grammars:

CategoryHigh-Value Diagram Grammars Included ๐Ÿ› ️
System & CloudArchitecture, High-Level Stack, Deployment Zones, Microservices
Data & StorageER/Data Model, Database Schema, Medallion Pipeline, Data Flow
Logic & WorkflowsFlowchart, Sequence, State Machine, Swimlane, Process Map
Strategy & MappingWardley Maps ๐Ÿ—บ️, Sankey Flow, Fishbone (Ishikawa), User Journey
Structures & SetsVenn, Layer Stack, Org Chart, Treemap, Dependency Graph

⚡ 60-Second Onboarding: Brand Auto-Scraping ๐ŸŽจ๐ŸŒ

Here is where the magic happens for blog creators and technical writers! ๐Ÿ”ฎ

You don’t need to manually pass Hex codes for your theme. The agent can auto-discover your brand tokens straight from your live website URL!

๐Ÿง™‍♂️ How the Onboarding Loop Works:

 You                    Agent (Claude / Codex / Pi)            Your Website
  │                                  │                              │
  ├────── "onboard diagram-design ───►│                              │
  │        to https://mysite.com"   │                              │
  │                                  ├─── HTTP GET / CSS Parse ────►│
  │                                  │◄── Extract Theme Tokens ─────┘
  │                                  │
  │                                  ├── Maps: <body> background ➔ Paper
  │                                  ├── Maps: Primary Text      ➔ Ink
  │                                  ├── Maps: CTA Button        ➔ Accent Color
  │                                  └── Maps: Body/Code Fonts   ➔ Typography
  │                                  │
  │◄───── Renders Fidelity Receipt ──┤
  │       & Asks for Confirmation    │
  │                                  │
  ├────── "Looks great, apply!" ────►│
  │                                  └── Writes to ~/.diagram-design/profiles/ ๐Ÿ’พ

Before saving, it even runs automated WCAG AA contrast checks to guarantee your dark/light modes meet accessibility standards! ♿✅

๐Ÿ’ป Quick Installation & Hands-On Setup ๐Ÿ› ️

diagram-design is cross-compatible with almost all modern AI agent frameworks using standard Agent Skill protocols.

1. Claude Code

Bash

/plugin marketplace add cathrynlavery/diagram-design
/plugin install diagram-design@diagram-design

2. Codex CLI

Bash

codex plugin marketplace add cathrynlavery/diagram-design
codex plugin add diagram-design@diagram-design

3. Pi Agent

Bash

pi install https://github.com/cathrynlavery/diagram-design

4. Manual / Local Development (Symlink Setup) ๐Ÿ”—

If you want to modify the design prompt rules locally:

Bash

git clone git@github.com:cathrynlavery/diagram-design.git ~/code/diagram-design
# Symlink to Claude Code or Cursor/Cline/Kiro
ln -s ~/code/diagram-design/skills/diagram-design ~/.claude/skills/diagram-design

๐ŸŽฎ How to Prompt Your Agent for Best Results ๐Ÿ’ฌ

Once installed, talk to your coding assistant naturally:

  • Basic Architecture:
    “Draw a system architecture diagram for a Event-Driven Order Processing system using Spring Boot, Kafka, and Postgres.”
  • Refactoring Existing Mermaid Code:
    “Take this messy .mmd sequence diagram and re-render it as a full-editorial Diagram Design HTML.”
  • Data Engineering Pipelines:
    “Create a Medallion Architecture diagram (Bronze -> Silver -> Gold) showing our Spark streaming ingestion pipeline.”

๐Ÿ”ฌ Architecture Verdict & Takeaway ๐Ÿ“Œ

CriteriaTraditional Mermaid.jsFigma / Excalidrawdiagram-design Skill
AI Native✅ Yes❌ Manual✅ Yes
Visual Quality๐Ÿ“‰ Low / Generic๐Ÿ“ˆ High๐ŸŒŸ Editorial Grade
Design EffortZero30+ MinutesZero
Custom Brand MatchingHard / HackyManualAutomated in 60s
Export FormatRaster / SVGVectorSelf-Contained HTML+SVG

๐ŸŽฏ Final Word

cathrynlavery/diagram-design is a prime example of Context Engineering done right. By replacing vague general instructions with strict layout constraints, crisp design rules, and automated theme tokenization, it bridges the gap between raw LLM outputs and professional software architecture presentation.

If you produce blog content, write architectural decision records (ADRs), or document complex codebases, this skill is a must-have addition to your developer toolkit! ๐Ÿš€๐ŸŽจ

Lets try to install this repo in github copilot coding agent and try to create simple UML diagram for our backend springboot java class system.

follow this step religiously

1- Diagram-Design setup.

A:- Clone the repo https://github.com/cathrynlavery/diagram-design.git

B:- Create a folder name as .github and inside that copy the skills folder of the above clone repo in it. Create copilot.instruction.md inside the smae .github folder and paste this code in it.

Repository AI Instruction

Architecture

Treat the repository source code and approved documentation as the source of truth.

Do not invent services, APIs, databases, technologies, dependencies or deployment environments.

Clearly label assumptions and unresolved questions.

Diagram generation

Use the diagram-design Agent Skill for architecture, data-flow, sequence, dependency, deployment, database, process and SDLC diagrams.

Write generated diagrams under, docs/diagrams/.

Use self-contained HTML with embedded SVG.

Prefer static output unless motion is explicitly requested.

Keep diagrams readable and minimize unnecessary nodes.

Include the diagram purpose, scope, assumptions and source files.

Preserve existing branding and terminology.

Do not include credentials, customer data, production endpoints or secrets.

Validation

Validate component names against the repository.

Validate API relationships against controllers, clients and configuration.

Validate database entities against migrations or schema definitions.

Validate deployment components against Docker, Helm or Kubernetes files.

Mark relationships as “unverified” when evidence is insufficient.

C:- Final try to update the settings.json for the vscode so that vscode will be able to get this skills in github copilot chat windows.

“chat.agentSkillsLocations”: {

“.github/skills”: true

},

Now lets try to create a simple UML diagram for the backend system using the belwo given prompt

using diagram design create the uml diagrame for the @file:backend and place it in /backend/uml-diagram folder

Git:- https://github.com/shdhumale/diagram-design.git

No comments: