excalidraw-system-design 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +168 -2
- package/SKILL.md +74 -0
- package/assets/examples/detailed.excalidraw +3252 -0
- package/assets/examples/infrastructure.excalidraw +1 -0
- package/assets/examples/product.excalidraw +1 -0
- package/assets/readme/detailed.png +0 -0
- package/assets/readme/hero.png +0 -0
- package/assets/readme/infrastructure.png +0 -0
- package/assets/readme/product.png +0 -0
- package/assets/readme/skill-design.excalidraw +4397 -0
- package/package.json +6 -4
- package/references/canvas.md +122 -0
- package/references/examples.md +15 -0
- package/references/frameworks.md +44 -0
- package/scripts/load_native.mjs +24 -0
- package/scripts/patch_canvas_2_0_0.py +33 -0
- package/scripts/prepare_scene.py +49 -0
package/README.md
CHANGED
|
@@ -1,3 +1,169 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/readme/hero.png" alt="A system design board of this skill: you ask your agent, it loads SKILL.md, draws on a local Excalidraw canvas, checks the PNG, and drops the board onto excalidraw.com" width="100%">
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
<h1 align="center">Excalidraw System Design</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<b>Describe a system. Get a whiteboard someone new to the project can read in two minutes.</b><br>
|
|
9
|
+
An agent skill that picks a board format, draws it on a local Excalidraw canvas,<br>
|
|
10
|
+
checks the render for clipped text and crossed arrows, then opens it on excalidraw.com for you to edit.
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<img alt="Agent Skill" src="https://img.shields.io/badge/format-Agent%20Skill-299a8d">
|
|
15
|
+
<img alt="works with" src="https://img.shields.io/badge/works%20with-Claude%20Code%20%C2%B7%20Codex%20%C2%B7%20any%20skills%20agent-1e1e1e">
|
|
16
|
+
<img alt="canvas" src="https://img.shields.io/badge/canvas-mcp--excalidraw--server%202.0.0-6965db">
|
|
17
|
+
<img alt="Node" src="https://img.shields.io/badge/Node-24%2B-339933">
|
|
18
|
+
<img alt="Python" src="https://img.shields.io/badge/Python-3-3776ab">
|
|
19
|
+
<img alt="output" src="https://img.shields.io/badge/output-.excalidraw%20%2B%20PNG-e8590c">
|
|
20
|
+
</p>
|
|
21
|
+
|
|
22
|
+
> [!NOTE]
|
|
23
|
+
> The board above is this skill's own system design, drawn to its own rules. Open [`skill-design.excalidraw`](assets/readme/skill-design.excalidraw) to edit it. The skill is plain [Agent Skills](https://agentskills.io) format: a `SKILL.md`, some reference docs and three small scripts. It isn't tied to one model or agent.
|
|
24
|
+
|
|
25
|
+
## What it does
|
|
26
|
+
|
|
27
|
+
- **Picks one of four board formats** to match what you asked for: a new product, a new backend part, an existing system, or a decision between options.
|
|
28
|
+
- **Reads the code first** when you point it at a real codebase. It only marks a part as built if it saw it in the source.
|
|
29
|
+
- **Writes labels in plain words.** Each box gets a name and up to five words. Jargon goes, and any special word gets a "Words used" box.
|
|
30
|
+
- **Colour-codes the board** by kind (apps, services, data stores, outside services) or by status (built, partly built, planned), with a legend.
|
|
31
|
+
- **Checks the real render.** The agent zooms into each section of the PNG and fixes cut-off text, labels sitting on arrows and arrows crossing the wrong boxes.
|
|
32
|
+
- **Hands it over** as an editable `.excalidraw` file and a PNG, then opens the board on excalidraw.com in your browser. It backs up whatever drawing you had there first.
|
|
33
|
+
|
|
34
|
+
## Board formats
|
|
35
|
+
|
|
36
|
+
Each board has a numbered banner under the title, one box per section, and every section on the board carries the same number.
|
|
37
|
+
|
|
38
|
+
| Format | Use it to | Sections |
|
|
39
|
+
| --- | --- | --- |
|
|
40
|
+
| **Product** | Design a new product or app | Requirements → Core entities → API → High-level design → Deep dives |
|
|
41
|
+
| **Infrastructure** | Design a new backend part (queue, pipeline, rate limiter) | Requirements → Inputs and outputs → High-level design → Deep dives |
|
|
42
|
+
| **Existing system** | Understand or fix something already built | What it does → How it works today → What's wrong → Fixes |
|
|
43
|
+
| **Decision** | Choose between ways to build something | The question → What we have → Options → How the pick works → Risks → Next steps |
|
|
44
|
+
|
|
45
|
+
<table>
|
|
46
|
+
<tr>
|
|
47
|
+
<td width="33%"><img src="assets/readme/product.png" alt="Product board example: Ticketmaster"></td>
|
|
48
|
+
<td width="33%"><img src="assets/readme/infrastructure.png" alt="Infrastructure board example: ad click aggregator"></td>
|
|
49
|
+
<td width="33%"><img src="assets/readme/detailed.png" alt="Existing system board example with status colours"></td>
|
|
50
|
+
</tr>
|
|
51
|
+
<tr>
|
|
52
|
+
<td align="center"><b>Product</b><br><a href="assets/examples/product.excalidraw"><code>product.excalidraw</code></a></td>
|
|
53
|
+
<td align="center"><b>Infrastructure</b><br><a href="assets/examples/infrastructure.excalidraw"><code>infrastructure.excalidraw</code></a></td>
|
|
54
|
+
<td align="center"><b>Existing system</b><br><a href="assets/examples/detailed.excalidraw"><code>detailed.excalidraw</code></a></td>
|
|
55
|
+
</tr>
|
|
56
|
+
</table>
|
|
57
|
+
|
|
58
|
+
The board at the top of this page is an Infrastructure board. There's no example file for Decision boards yet; the agent builds them from the section list in [references/frameworks.md](references/frameworks.md).
|
|
59
|
+
|
|
60
|
+
## Setup
|
|
61
|
+
|
|
62
|
+
### 1. Check what you need
|
|
63
|
+
|
|
64
|
+
| You need | Why | Check |
|
|
65
|
+
| --- | --- | --- |
|
|
66
|
+
| An agent that loads Agent Skills | Runs the skill. [Claude Code](https://code.claude.com/docs/en/skills), [Codex](https://developers.openai.com/codex/skills) and [others](https://agentskills.io/clients) do | Ask it "what skills do you have?" after installing |
|
|
67
|
+
| A browser tool for that agent | Opens the canvas and excalidraw.com. It must run JavaScript in a page and set a file on a file input | Ask your agent to open a web page |
|
|
68
|
+
| Node 24 or newer | Runs the local Excalidraw canvas | `node --version` |
|
|
69
|
+
| Python 3 | Runs two small prep scripts | `python3 --version` |
|
|
70
|
+
|
|
71
|
+
Tested so far with Claude Code and Claude in Chrome. Nothing in the skill depends on them, but other agents and browser tools haven't been tried yet.
|
|
72
|
+
|
|
73
|
+
### 2. Install the skill
|
|
74
|
+
|
|
75
|
+
Put the skill folder where your agent looks for skills. `~/.agents/skills/` is the shared location many agents read; Claude Code reads `~/.claude/skills/`.
|
|
76
|
+
|
|
77
|
+
**From npm:**
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
mkdir -p ~/.agents/skills && cd ~/.agents/skills
|
|
81
|
+
npm pack excalidraw-system-design
|
|
82
|
+
tar -xzf excalidraw-system-design-*.tgz
|
|
83
|
+
mv package excalidraw-system-design && rm excalidraw-system-design-*.tgz
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
For Claude Code, use `~/.claude/skills` in place of `~/.agents/skills`. To update, delete the folder and run the same steps again.
|
|
87
|
+
|
|
88
|
+
<details>
|
|
89
|
+
<summary>Mission Systems engineers: install the Claude Code plugin instead</summary>
|
|
90
|
+
|
|
91
|
+
```text
|
|
92
|
+
/plugin marketplace add missiongroupsystems/skills-hub
|
|
93
|
+
/plugin install diagrams@mission-systems
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
You'll be asked once to trust the marketplace. The repo is private, so git needs access to it: SSH with your key, or HTTPS with a GitHub token. Pull updates with `/plugin marketplace update mission-systems`.
|
|
97
|
+
|
|
98
|
+
</details>
|
|
99
|
+
|
|
100
|
+
Start a new agent session so it picks up the skill.
|
|
101
|
+
|
|
102
|
+
### 3. Ask for a board
|
|
103
|
+
|
|
104
|
+
Say "excalidraw sys design" plus what you want:
|
|
105
|
+
|
|
106
|
+
```text
|
|
107
|
+
excalidraw sys design: a ride-matching app like the one in our pitch deck
|
|
108
|
+
excalidraw sys design: how the upload pipeline in this repo works today, and what's broken
|
|
109
|
+
excalidraw sys design: should we run our own queue or use SQS? lay out the options
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
The agent says which format it picked, draws the board, checks it, and opens it on excalidraw.com. You get the file paths, any assumptions it made, and the name of the backup if it saved one.
|
|
113
|
+
|
|
114
|
+
## How it works
|
|
115
|
+
|
|
116
|
+
1. **Pick the format.** One of the four above, never a fifth.
|
|
117
|
+
2. **Gather facts.** Read the code, or mark guesses as assumptions. Copy the layout of the closest example board, not its content.
|
|
118
|
+
3. **Start a canvas.** Installs [`mcp-excalidraw-server@2.0.0`](https://github.com/yctimlin/mcp_excalidraw) into the task's scratch folder (never globally), patches one line of it, and runs it on `127.0.0.1`.
|
|
119
|
+
4. **Draw.** Adds elements through the canvas CLI, or loads a cleaned `.excalidraw` file with the bundled loader.
|
|
120
|
+
5. **Check.** Exports the PNG, zooms into every section, fixes what's wrong and renders again.
|
|
121
|
+
6. **Hand over.** Exports `.excalidraw` and PNG, backs up your current excalidraw.com drawing in that browser's local storage, drops the board onto the page, and stops the canvas server.
|
|
122
|
+
|
|
123
|
+
Nothing is uploaded to a server. The board goes from disk into the excalidraw.com page through a file input, and edits you make there stay in that browser until you export them.
|
|
124
|
+
|
|
125
|
+
## What runs on your machine
|
|
126
|
+
|
|
127
|
+
Nothing runs until you ask for a board. Then:
|
|
128
|
+
|
|
129
|
+
| What | Where | What it does |
|
|
130
|
+
| --- | --- | --- |
|
|
131
|
+
| `mcp-excalidraw-server@2.0.0` | npm, installed per task into a scratch folder | The local canvas and its CLI |
|
|
132
|
+
| [`scripts/patch_canvas_2_0_0.py`](scripts/patch_canvas_2_0_0.py) | This folder | Patches one line of the canvas frontend so the loader works |
|
|
133
|
+
| [`scripts/prepare_scene.py`](scripts/prepare_scene.py) | This folder | Writes a clean copy of a board: drops deleted elements, broken links and bad order keys. Never overwrites the original |
|
|
134
|
+
| [`scripts/load_native.mjs`](scripts/load_native.mjs) | This folder | Loads a cleaned board onto a local canvas without losing text. Refuses anything but `localhost` |
|
|
135
|
+
|
|
136
|
+
## Files
|
|
137
|
+
|
|
138
|
+
```text
|
|
139
|
+
excalidraw-system-design/
|
|
140
|
+
├── README.md # this page
|
|
141
|
+
├── SKILL.md # the instructions the agent follows
|
|
142
|
+
├── references/
|
|
143
|
+
│ ├── frameworks.md # what goes in each section of each format
|
|
144
|
+
│ ├── examples.md # which example to copy for which format
|
|
145
|
+
│ └── canvas.md # canvas setup, loading, export, opening on excalidraw.com
|
|
146
|
+
├── scripts/ # the three helpers above
|
|
147
|
+
└── assets/
|
|
148
|
+
├── examples/ # example boards the agent copies layouts from
|
|
149
|
+
└── readme/ # images for this page, plus this skill's own board
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Troubleshooting
|
|
153
|
+
|
|
154
|
+
| Problem | Fix |
|
|
155
|
+
| --- | --- |
|
|
156
|
+
| Canvas server exits with code 1 | The port is taken. Ask the agent to use another one. |
|
|
157
|
+
| Board looks empty after loading | An open tab wrote its old drawing back. The agent checks the element count and loads into a fresh canvas on another port. |
|
|
158
|
+
| You lost the drawing you had on excalidraw.com | Ask the agent to restore your excalidraw.com backup. Backups are named after the drawing's title plus a timestamp. The steps are in [canvas.md](references/canvas.md). |
|
|
159
|
+
| The board has an embedded image | The loader can't carry images. Open that board on excalidraw.com yourself with **Open**. |
|
|
160
|
+
|
|
161
|
+
## References
|
|
162
|
+
|
|
163
|
+
- [SKILL.md](SKILL.md): the full instructions: formats, wording rules, colour rules, render checks, hand-over.
|
|
164
|
+
- [references/frameworks.md](references/frameworks.md): section-by-section contents for Product, Infrastructure, Existing system and Decision boards.
|
|
165
|
+
- [references/examples.md](references/examples.md): what to copy from each example board.
|
|
166
|
+
- [references/canvas.md](references/canvas.md): starting the canvas, loading and exporting scenes, opening the board on excalidraw.com, restoring a backup, and approaches that were tried and dropped.
|
|
167
|
+
- [Agent Skills](https://agentskills.io): the open skill format this follows, and the agents that support it.
|
|
168
|
+
- [Excalidraw](https://github.com/excalidraw/excalidraw): the editor and its `.excalidraw` file format.
|
|
169
|
+
- [yctimlin/mcp_excalidraw](https://github.com/yctimlin/mcp_excalidraw): the local canvas server and CLI this skill runs.
|
package/SKILL.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: excalidraw-system-design
|
|
3
|
+
description: "Draw a system design board in Excalidraw. Use for excalidraw sys design, system design in excalidraw, architecture diagrams or whiteboards, mapping how an existing system works, or laying out options for a technical decision. Picks one of four board formats, draws it, checks the render and opens it on excalidraw.com."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Excalidraw system design
|
|
7
|
+
|
|
8
|
+
Make a board someone new to the project can read in two minutes. You hand back an editable `.excalidraw` file and a PNG.
|
|
9
|
+
|
|
10
|
+
## 1. Pick the format
|
|
11
|
+
|
|
12
|
+
Every board uses one of these four formats. Each one has a banner under the title: a row of boxes joined by arrows, one per section, each with a mint numbered circle. Every section below starts with the same numbered circle. Don't invent a fifth. If a request seems to need two, pick the main one and fit the other inside a section.
|
|
13
|
+
|
|
14
|
+
| The person wants to | Format | Banner |
|
|
15
|
+
| --- | --- | --- |
|
|
16
|
+
| Design a new product or app | Product | Requirements → Core entities → API → High-level design → Deep dives |
|
|
17
|
+
| Design a new backend part (queue, pipeline, rate limiter) | Infrastructure | Requirements → Inputs and outputs → High-level design → Deep dives |
|
|
18
|
+
| Understand or fix a system that already exists | Existing system | What it does → How it works today → What's wrong → Fixes |
|
|
19
|
+
| Choose between ways to build something | Decision | The question → What we have → Options → How the pick works → Risks → Next steps |
|
|
20
|
+
|
|
21
|
+
[references/frameworks.md](references/frameworks.md) says what goes in each section. Say which format you picked in one line before drawing.
|
|
22
|
+
|
|
23
|
+
## 2. Gather facts and plan
|
|
24
|
+
|
|
25
|
+
- For an existing codebase, read the code. Don't label anything as built unless you saw it in the source.
|
|
26
|
+
- For a new design, mark guesses as assumptions.
|
|
27
|
+
- Open the closest example in [references/examples.md](references/examples.md) and copy its layout, not its content.
|
|
28
|
+
- Before drawing, list the sections, the main flow you'll trace and two or three deep dives. Only ask the person a question if the answer changes the design. If they asked to design it "with me", agree the requirements with them before drawing the rest.
|
|
29
|
+
|
|
30
|
+
## 3. Write in plain words
|
|
31
|
+
|
|
32
|
+
People who don't know the code will read this board. Most past complaints were about wording, so treat this as a hard rule.
|
|
33
|
+
|
|
34
|
+
- **Boxes.** A name, then up to five words on what it does. "Publish worker / posts every minute", not "PublishJobProcessor (lease-based)".
|
|
35
|
+
- **Use names people already use.** Never invent a component name like "question router". If nothing has a name yet, describe what it does.
|
|
36
|
+
- **No jargon.** Drop terms like RLS, lease, idempotent, fan-out or SECURITY DEFINER unless the reader is an engineer and the term matters. If the board needs a special word, define it in a small "Words used" box.
|
|
37
|
+
- **Arrows.** One to three words saying what moves: "posts", "failures", "nightly sync".
|
|
38
|
+
- **Notes.** One idea per line, about twelve words at most, and no more than five lines under any section. Cut any note that repeats a box.
|
|
39
|
+
- **Reread as an outsider.** Before finishing, read every label as someone new to the project would. Rewrite anything they'd have to ask about.
|
|
40
|
+
|
|
41
|
+
## 4. Draw it
|
|
42
|
+
|
|
43
|
+
- White background, hand-drawn font, mint (`#299a8d`) numbered markers that match the banner. An extra step like 3b gets its own banner box.
|
|
44
|
+
- Give the main diagram the most space and put the other sections around it.
|
|
45
|
+
- Colour-code the board wherever a colour can carry meaning, and add a legend that says what each colour means. Use Excalidraw's light fills with dark strokes so text stays readable:
|
|
46
|
+
- **By kind** on Product, Infrastructure and Decision boards: blue `#a5d8ff` for apps and clients, green `#b2f2bb` for your services, yellow `#ffec99` for databases and queues, violet `#d0bfff` for outside services, grey `#e9ecef` for notes and requirements.
|
|
47
|
+
- **By status** on Existing system boards: green for built, yellow for partly built, grey dashed for planned.
|
|
48
|
+
- Red `#ffc9c9` always means a failure or problem, on any board. On Decision boards, give your pick a mint (`#299a8d`) outline.
|
|
49
|
+
- The same thing gets the same colour everywhere on the board. Don't colour a box just to decorate it.
|
|
50
|
+
- Dashed outlines for later or proposed parts.
|
|
51
|
+
- Solid arrows for direct calls, dashed for background work.
|
|
52
|
+
- Keep the person's existing drawings. Never clear a canvas you didn't create.
|
|
53
|
+
|
|
54
|
+
[references/canvas.md](references/canvas.md) covers setting up the canvas, loading scenes and exporting.
|
|
55
|
+
|
|
56
|
+
## 5. Check the render
|
|
57
|
+
|
|
58
|
+
Look at the real PNG, not the JSON. Zoom into each section and fix:
|
|
59
|
+
|
|
60
|
+
- text cut off at the edge of its box (the hand-drawn font is wider than it looks)
|
|
61
|
+
- labels sitting on arrows or on other labels
|
|
62
|
+
- arrows crossing boxes they don't connect to
|
|
63
|
+
- stray or leftover elements
|
|
64
|
+
|
|
65
|
+
Then trace one full flow end to end and check that each deep dive answers a requirement. Re-render after fixes. If you couldn't render, say the board is unchecked.
|
|
66
|
+
|
|
67
|
+
## 6. Hand it over
|
|
68
|
+
|
|
69
|
+
1. Export the `.excalidraw` and the PNG. For big boards, also export one PNG per section.
|
|
70
|
+
2. Open the board on excalidraw.com in the person's browser. This backs up whatever drawing they had there first. Steps are in [references/canvas.md](references/canvas.md#open-the-finished-board-on-excalidrawcom).
|
|
71
|
+
3. Stop any local canvas server you started.
|
|
72
|
+
4. Reply in a few lines: the file paths, any assumptions, the backup key if one was made, and on a Decision board your pick and why.
|
|
73
|
+
|
|
74
|
+
Don't create share links unless asked. Edits made on excalidraw.com stay in that browser until the person exports them.
|