[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-107561":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":15,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":10,"pushedAt":37,"updatedAt":38,"readmeContent":39,"aiSummary":40,"trendingCount":16,"starSnapshotCount":16,"syncStatus":41,"lastSyncTime":42,"discoverSource":43},107561,"sketchy","ddkbs\u002Fsketchy","ddkbs","A layout engine for AI diagrams: the model says what to draw, Sketchy figures out where. Hand-drawn, interactive, in Claude, Cursor and VS Code.","https:\u002F\u002Fsketchy.davidkubus.dev",null,"TypeScript",501,45,1,4,0,68,378,13,82.99,"MIT License",false,"main",[25,26,27,28,29,30,31,32,33,34,35,36],"claude","claude-code","claude-skill","claude-skills","diagrams","elkjs","layout-engine","mcp","mcp-apps","model-context-protocol","roughjs","visualization","2026-11-13 15:03:52","2026-11-23 15:14:00","# Sketchy\n\nSketchy lets your AI assistant **draw while it explains**: clean, hand-drawn, interactive diagrams rendered right next to the answer. It works in the Claude chat as a skill, and as an [MCP](https:\u002F\u002Fmodelcontextprotocol.io) server in Claude Code, Cursor, VS Code and other MCP clients.\n\nThe AI decides **what** to draw and label. Sketchy decides **where**: a part library with named anchor points and automatic layout. The AI never computes coordinates, so drawings come out precise and consistent every time.\n\n![Sketchy in a chat: the answer to \"What happens when I open a web page?\" comes with an interactive drawing and its toolbar (Draw, SVG, PNG, Excalidraw)](docs\u002Fimages\u002Fchat.png)\n\n## What it can draw\n\n### Systems, step by step\n\nAsk _\"What happens when I open a web page?\"_ and the AI draws the whole path, then walks you through it. Each step circles what matters in red pen and fades the rest. Use the buttons or the arrow keys.\n\n![The life of a web request, from the browser through CDN, load balancer and services to cache, database and queue](docs\u002Fimages\u002Frequest.png)\n\n![Step 5 of the walkthrough: the orders service, cache and database are circled](docs\u002Fimages\u002Frequest-step.png)\n\n### Concepts from computer science and machine learning\n\nSketchy is not limited to hardware. Structure, flow, comparison and metaphor patterns cover any topic, from transformers to TCP.\n\n![How an LLM picks the next word: tokenizer, embeddings, a transformer block with self-attention and MLP, and sampling](docs\u002Fimages\u002Ftransformer.png)\n\n### Your own code\n\nAsk _\"Explain my repo\"_. The AI reads the code and draws modules, folders and data flow. **Click a box to open the file** in VS Code, Cursor, Windsurf or Zed; hover to see what it does.\n\n![Architecture of a repository with nested folders](docs\u002Fimages\u002Frepo.png)\n\n### Circuits from Arduino and ESP32 sketches\n\nAsk _\"How is my sketch wired?\"_. The AI reads `pinMode`, `digitalWrite` and friends, places real parts (50 boards, sensors, displays and modules from [wokwi-elements](https:\u002F\u002Fgithub.com\u002Fwokwi\u002Fwokwi-elements)) and connects pins by name. Sketchy routes the wires and places the callouts.\n\n\u003Ctable>\n  \u003Ctr>\n    \u003Ctd width=\"58%\">\u003Cimg alt=\"ESP32 with PIR sensor, DHT22, buzzer and status LED\" src=\"docs\u002Fimages\u002Fesp32.png\">\u003C\u002Ftd>\n    \u003Ctd width=\"42%\">\u003Cimg alt=\"Arduino Uno driving an LED through a resistor\" src=\"docs\u002Fimages\u002Fcircuit.png\">\u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\n### Labeled photos\n\nThe AI finds a freely licensed photo (Wikimedia Commons, Openverse), and a vision model **running on your computer** ([Florence-2](https:\u002F\u002Fhuggingface.co\u002Fmicrosoft\u002FFlorence-2-base-ft)) locates the parts and printed text to label. Attribution is always shown.\n\n![Photo of an Arduino Uno with labeled parts](docs\u002Fimages\u002Fphoto.jpg)\n\n### Comparisons and metaphors\n\n\u003Ctable>\n  \u003Ctr>\n    \u003Ctd width=\"50%\">\u003Cimg alt=\"SQL vs. NoSQL side by side\" src=\"docs\u002Fimages\u002Fcomparison.png\">\u003C\u002Ftd>\n    \u003Ctd width=\"50%\">\u003Cimg alt=\"CPU caches explained as a kitchen\" src=\"docs\u002Fimages\u002Fmetaphor.png\">\u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\n### Interactive, exportable\n\n- **Hover** any box, pin or wire for details.\n- **Draw** on the sketch with a red pen, a highlighter and notes, then **Send to AI** with a question: the AI gets the marked-up drawing and which parts you marked.\n- **Click** a code node to open the file, or a photo credit to open its source.\n- **Export** as **SVG** or **PNG**, fonts included, or as an **Excalidraw** file to keep editing on [excalidraw.com](https:\u002F\u002Fexcalidraw.com): your system's save dialog asks where to put the file.\n- **Fullscreen** where the host supports it.\n\n![Drawing mode: the CDN is circled in red pen with a note, and a question is ready to send to the AI](docs\u002Fimages\u002Fdraw.png)\n\n## Install\n\nWhere do you work? Sketchy comes two ways, and both can be installed side by side:\n\n- **In the chat** (Claude on web, desktop and mobile): the skill. Nothing to install locally.\n- **While coding** (Claude Code in the desktop app or terminal, Cursor, VS Code): the extension, which adds photo labeling, SVG, PNG and Excalidraw export and click-to-open files.\n\n### Claude chat (web, desktop and mobile)\n\nThe skill draws right in the chat, with no server:\n\n1. Download `sketchy-skill-\u003Cversion>.zip` from the [latest release](https:\u002F\u002Fgithub.com\u002Fddkbs\u002Fsketchy\u002Freleases\u002Flatest).\n2. In Claude, open **Settings → Capabilities → Skills** and upload the zip.\n3. Ask for a drawing in any chat.\n\nClaude writes the scene, and the chat's inline visualization loads Sketchy's browser bundle from [jsDelivr](https:\u002F\u002Fwww.jsdelivr.com), which serves it from this repository's `cdn` branch. The skill follows the current minor version, so it picks up fixes without being uploaded again. To run exactly the code you reviewed, use `sketchy-skill-\u003Cversion>-pinned.zip` instead: it loads the bundle from a fixed commit of the `cdn` branch and checks it with a [Subresource Integrity](https:\u002F\u002Fdeveloper.mozilla.org\u002Fdocs\u002FWeb\u002FSecurity\u002FSubresource_Integrity) hash, so the browser refuses any other file. It does not pick up fixes; upload the next pinned zip to update. Photo labeling and opening files from a drawing need your computer, so they stay in the desktop extension.\n\n### Claude desktop app (Code tab)\n\n1. Download the `.mcpb` file for your platform from the [latest release](https:\u002F\u002Fgithub.com\u002Fddkbs\u002Fsketchy\u002Freleases\u002Flatest) (macOS on Apple Silicon, Windows or Linux).\n2. Double-click it (or drag it into **Settings → Extensions**) and confirm.\n3. Optional: in the extension settings choose your editor and where Sketchy stores its data.\n4. Open the **Code** tab and start a session. Drawings appear inline next to Claude's answer.\n\nThe **Chat** tab does not display views from locally installed extensions; use the skill above there.\n\nThe photo-labeling model is **not** part of the download. The first time the AI labels a photo, Sketchy asks you to pick a model size:\n\n| Model  | Download | Memory  | Notes                                     |\n| ------ | -------- | ------- | ----------------------------------------- |\n| Small  | ~280 MB  | ~1 GB   | Recommended. Printed text, distinct parts |\n| Medium | ~830 MB  | ~2.5 GB | Better grounding of small parts           |\n| Large  | ~3.1 GB  | ~4.5 GB | Most precise                              |\n\n### Claude Code in the terminal\n\nSketchy is on npm as [`@ddkbs\u002Fsketchy`](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@ddkbs\u002Fsketchy). With [Node.js](https:\u002F\u002Fnodejs.org) 20 or newer, register it once for all your projects:\n\n```bash\nclaude mcp add sketchy --scope user -- npx -y @ddkbs\u002Fsketchy\n```\n\nRun `claude mcp list` to check that it is connected. npx downloads the server on first start and picks up new versions on its own.\n\n### Cursor and VS Code\n\nBoth show Sketchy's drawings inline in the agent chat. With Node.js installed, click **[Add to Cursor](https:\u002F\u002Fcursor.com\u002Fen\u002Finstall-mcp?name=sketchy&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBkZGticy9za2V0Y2h5Il0sImVudiI6eyJTS0VUQ0hZX0VESVRPUiI6ImN1cnNvciJ9fQ%3D%3D)** or **[Add to VS Code](https:\u002F\u002Fvscode.dev\u002Fredirect\u002Fmcp\u002Finstall?name=sketchy&config=%7B%22type%22%3A%22stdio%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40ddkbs%2Fsketchy%22%5D%7D)** and confirm.\n\nTo add it by hand, put this into `~\u002F.cursor\u002Fmcp.json` (Cursor, all projects) or your VS Code MCP settings:\n\n```json\n{\n  \"mcpServers\": {\n    \"sketchy\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@ddkbs\u002Fsketchy\"],\n      \"env\": { \"SKETCHY_EDITOR\": \"cursor\" }\n    }\n  }\n}\n```\n\n`SKETCHY_EDITOR` decides which editor opens when you click a box in a drawing; leave it out for VS Code.\n\n### Other MCP clients\n\nSketchy is a standard MCP server and works in any client that supports [MCP Apps](https:\u002F\u002Fgithub.com\u002Fmodelcontextprotocol\u002Fext-apps). Start it with `npx -y @ddkbs\u002Fsketchy`, as above.\n\nClients without MCP Apps (OpenCode, for example) cannot show drawings inline. There Sketchy saves each drawing as an interactive HTML file in `~\u002F.sketchy\u002Fexports\u002F`, tells the AI where it is, and asks it to explain the diagram fully in text. Set `SKETCHY_OPEN=1` to open the file in your browser right away.\n\nThe npm package leaves out the photo-labeling runtime (about 470 MB) so it starts quickly. Sketchy installs it with npm into its data folder the first time you pick a model; the desktop extension ships it.\n\n## Try it\n\n- _\"What happens when I open a web page? Walk me through it.\"_\n- _\"How does an LLM pick the next word?\"_\n- _\"Explain the architecture of \u002Fpath\u002Fto\u002Fmy\u002Frepo, then walk me through one request.\"_\n- _\"How is this sketch wired?\"_ followed by your `.ino` file\n- _\"Show me a photo of a Raspberry Pi and label the ports.\"_\n- _\"Compare TCP and UDP.\"_\n- _\"Explain CPU caches with an everyday metaphor.\"_\n\nThe same patterns are available as prompts: `explain-structure`, `explain-flow`, `compare`, `metaphor`, `explain-repo` and `explain-circuit`.\n\n## How it works\n\n```\nThe AI describes the scene (extension: tools like sketch, place_part, label;\n                            skill: the same scene as JSON in an inline widget)\n          ↓\nScene: nodes, groups, parts, wires, labels, photos, steps — no coordinates\n          ↓\nLayout engine (elkjs): positions, orthogonal routing, collision-free callouts\n          ↓\nViewer: hand-drawn rendering with rough.js, hover, steps, export\n```\n\nEvery feature fills the same scene, and a single viewer renders it. The visual style lives in the renderer, so every drawing looks consistent no matter what the AI asks for. The extension runs layout in its server process and shows the viewer as an MCP App; the skill runs the same code in the browser from a bundle on jsDelivr.\n\n\u003Cdetails>\n\u003Csummary>Tools\u003C\u002Fsummary>\n\n| Tool                                   | Purpose                                                    |\n| -------------------------------------- | ---------------------------------------------------------- |\n| `sketch`                               | Draw a whole scene in one call, in the compact line syntax |\n| `search_parts`                         | Electronic part types and their pins                       |\n| `find_image`, `locate`, `choose_model` | Photo search, local grounding, model setup                 |\n\nA scene is a few short lines: `browser Browser @globe`, `browser -> server HTTPS`, `step Request: The browser asks | browser browser->server`. Setting `SKETCHY_FORMAT=json` restores the JSON `sketch` tool and the incremental tools of earlier versions (`add_node`, `add_edge`, `place_part`, `label`, `render`, …).\n\n\u003C\u002Fdetails>\n\n### Follow-ups\n\nAsk the AI to change a drawing (\"add the cache and the call back to the router\") and it sends the scene again with the same ids. Sketchy keeps the order and places of everything the earlier drawing already showed and fits the new parts in around them, so before and after stay comparable, also when a back-edge closes a cycle.\n\n## Token usage\n\nDoes a drawing cost more than a text answer? We asked Claude Sonnet to explain five topics (DNS, git branches, transformers, the TLS handshake, an Arduino button circuit), in plain text and with Sketchy, and read the exact usage Claude Code reports. Version 0.1.6 introduced the compact scene format; the JSON column is the format before it.\n\n| Average per answer, fresh conversation | Plain text | Sketchy, JSON (≤ 0.1.5) | Sketchy, compact (0.1.6) |\n| -------------------------------------- | ---------- | ----------------------- | ------------------------ |\n| Output tokens (what Claude writes)     | 962        | 1,168                   | **686** (−29% vs. text)  |\n| Tool definitions                       | –          | ~4,100                  | **~500**                 |\n| Cost on Sonnet list prices             | ~$0.034    | ~$0.059                 | ~$0.043                  |\n\nOver a whole session the compact format is cheaper than plain text. Six questions in a row, each variant in its own session, mean of two runs:\n\n| Answers in the session | Plain text | Sketchy, JSON | Sketchy, compact |\n| ---------------------- | ---------- | ------------- | ---------------- |\n| 1                      | $0.04      | $0.07         | $0.05            |\n| 3                      | $0.21      | $0.27         | **$0.20**        |\n| 6                      | $0.61      | $0.75         | **$0.58**        |\n\n- **Claude writes less for a drawing than for text.** Layout and drawing happen in Sketchy and cost no tokens.\n- **Every answer stays in the history.** Shorter answers keep it small, so each follow-up question costs less than after a text answer.\n- **A tool call adds a turn** that re-sends the context, mostly from the cache at a tenth of the price; this is why the very first answer still costs a little more than text.\n\nMeasured on November 2, 2026 in Claude Code with an empty project. Run it yourself with `npm run build && node scripts\u002Ftoken-benchmark.mjs`.\n\n## Configuration\n\n| Variable             | Default       | Description                                                                       |\n| -------------------- | ------------- | --------------------------------------------------------------------------------- |\n| `SKETCHY_EDITOR`     | `vscode`      | Editor for file links: `vscode`, `cursor`, `windsurf`, `vscode-insiders`, `zed`   |\n| `SKETCHY_PHOTOS`     | `on`          | `off` disables photo search and labeling                                          |\n| `SKETCHY_DATA_DIR`   | `~\u002F.sketchy`  | Models, cached photos and the local SQLite database                               |\n| `SKETCHY_EXPORT_DIR` | `~\u002FDownloads` | Folder the save dialog opens in, and where exports go when no dialog is available |\n| `SKETCHY_FORMAT`     | `compact`     | `json` restores the JSON scene tools of earlier versions                          |\n| `SKETCHY_OPEN`       | off           | `1` opens drawings in the browser in clients without MCP Apps                     |\n\n## Development\n\nRequires Node.js 20 or later.\n\n```bash\nnpm install\nnpm run build      # part catalog, server and viewer\nnpm test\nnpm run preview    # viewer with sample scenes at http:\u002F\u002Flocalhost:5173\u002Fpreview.html\nnpm run pack       # .mcpb bundle for the current platform\nnpm run build:skill  # chat skill zip\nnpm run build:web    # browser bundle that the skill loads\n```\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for the project layout.\n\n## License\n\n[MIT](LICENSE) © ddkbs. Sketchy builds on open-source work listed in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).\n","Sketchy 是一个专为 AI 辅助场景设计的交互式手绘风格图表布局引擎。它接收 AI 生成的语义描述（如系统流程、代码结构、电路连接或概念对比），自动完成元素排布、连线路由与锚点对齐，支持手绘风格渲染、逐步高亮、文件跳转和本地视觉标注。基于 TypeScript 实现，通过 MCP 协议集成于 Claude Code、Cursor 和 VS Code 等编辑器，并作为 Claude 技能运行。适用于技术文档解释、教学演示、代码理解、嵌入式电路分析及可视化知识表达等需要轻量、可交互、语义驱动图表的场景。",2,"2026-11-24 04:32:15","CREATED_QUERY"]