Cocoon-AI/architecture-diagram-generator: The Repo That Turns Claude Into a Diagram Compiler

A tiny, opinionated skill that encodes layout rules, semantic colors, and SVG layering into Markdown, then outputs polished architecture diagrams as a single HTML file.

6 to 8 min read • View on GitHub • More from Cocoon-AI

A technical specification sheet is being fed into a machine that stamps out a finished architecture diagram inside a browser window. The scene explains the repo’s core idea: diagramming as a constrained translation problem, where rules become output instead of manual layout.
This project treats Markdown like a spec and Claude like the renderer, so the output feels compiled rather than drawn.
Key Takeaways

Why this repo feels like a compiler, not a drawing tool

Most diagram tools start with a canvas. This repo starts with a specification. You describe a system in plain language, and the skill turns that description into structured SVG plus a self-contained HTML file that opens anywhere.

That is the mental shift worth noticing. The output is not a sketch with AI polish. It is a compiled artifact, where the model is nudged to behave like a renderer that obeys layout rules.

The skill file is the product

The center of gravity is architecture-diagram/SKILL.md. That file is not just instructions. It is the product logic, because it tells Claude how to map meaning to color, how to space components, and how to layer arrows behind boxes so the diagram stays legible.

The design choices matter because they remove the usual failure modes. A cyan frontend box means something. A violet database box means something. Minimum spacing means the layout does not collapse into a pile of labels and lines.

A split close-up shows one side of a messy set of notes and the other side of a disciplined SVG structure with boxes, arrows, and color-coded blocks. The image explains how explicit constraints turn an open-ended prompt into a stable visual system.
The skill works because it narrows the model’s choices before the diagram exists.

The constraints do the heavy lifting

The repo’s hidden trick is that it behaves like a layout engine wrapped in prompt form. Instead of asking the model to invent, it asks it to classify, group, stack, and route. That is why the output stays coherent even when the input is messy.

You can see the architectural bias in the rules themselves: semantic palettes, fixed component heights, vertical gaps, and ordering for arrows before boxes. Those are compiler-like concerns, not stylistic preferences.

This pipeline is the whole point: Claude is being steered like a constrained renderer, stage by stage, until the artifact is stable.

How the output stays clean without JavaScript

The output format is part of the product story. The diagrams live in a single HTML file with inline SVG, embedded CSS, and no runtime dependency on JavaScript. That makes them easy to open, share, and archive.

The template also adds small but important touches. A responsive container keeps complex diagrams readable, a grid background gives the canvas structure, and a pulse effect makes the page feel like a living dashboard instead of a static screenshot.

This matters because portability changes adoption. If the artifact is already self-contained, the diagram is documentation, not just a link to a tool.

What makes this different from Mermaid and Eraser

ToolWorkflowOutputControl surfaceBest fit
MermaidDiagram as codeRendered markdown or embedded diagramsSyntax-first, developer friendlyQuick charts inside docs
EraserDiagramming product with AI assistanceHosted diagram editor and exportsGUI plus prompt assistanceTeam documentation and editing
Cocoon-AI architecture-diagram-generatorClaude skill as constrained rendererSingle-file HTML with inline SVGPrompt spec plus strict layout rulesFast architecture diagrams with a fixed visual system

The comparison is not about which one is prettier. It is about where the work happens. Mermaid puts the burden on syntax, Eraser puts it inside a product, and this repo pushes more of it into the instruction layer for Claude.

That is why the project feels narrower and more radical at the same time. It gives up breadth in exchange for a sharper workflow.

The real bet: software made of instructions

The broader implication is bigger than diagrams. This repo points toward a software category where the logic lives in Markdown, the renderer is an LLM, and the artifact is a file instead of an app.

That flips the usual stack. You do not build a UI and then teach people to use it. You write a constrained specification, let the model execute it, and inspect the output like a compiled binary for design.

That is the real novelty here. Not AI art. Not a prettier architecture diagram. A new way to think about software as instructions plus enforcement.