[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-115536":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":14,"stars7d":16,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":16,"compositeScore":17,"rankGlobal":9,"rankLanguage":9,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":9,"pushedAt":23,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":15,"starSnapshotCount":15,"syncStatus":27,"lastSyncTime":28,"discoverSource":29},115536,"claude-code-sketch","allen-hsu\u002Fclaude-code-sketch","allen-hsu","Claude Code mod: answers drawn as diagrams, charts, roadmaps, journeys and wireframes in the terminal",null,"TypeScript",58,6,52,1,0,4,46.94,"MIT License",false,"main",true,[],"2026-11-23 08:40:36","2026-11-23 08:34:10","# sketch\n\nEnglish | [繁體中文](README.zh-TW.md)\n\n**Claude Code answers with pictures instead of paragraphs.**\n\n`sketch` is a Claude Code mod (plugin). It gives Claude 17 drawing tools and one standing instruction: when an answer has a shape, draw the shape. Architecture, flows, roadmaps, user journeys, wireframes and charts appear as cards in the transcript, in your terminal, in your theme's colors.\n\n![A layered architecture card](docs\u002Fimages\u002Fen\u002Flayers.png)\n\n## Diagrams you can explore\n\nA dense diagram stays readable because you can ask it about one node at a time:\n\n![Hovering and clicking nodes in a diagram](docs\u002Fimages\u002Fen\u002Finteraction.gif)\n\n- **Hover** a node: every wire leaving it lights up, end to end.\n- **Click** a node's name (anywhere across the middle of its box, or its name in the list under a dense picture): its wires in and out turn thick, sit on top of everything else, and a pulse runs along them from source to target; the rest fades. Click it again to clear it, or click another node to move the focus. Each card keeps its own focus.\n- Every node's wires have their own color, and where two wires cross, the later one simply passes over the earlier: no junction marks that could be mistaken for a connection.\n- Past a handful of crossings, every connection is also written out under the picture.\n- Text too long for its box (a pipeline job, a swimlane step, a node's name or note, a roadmap item) takes a second line where it can; whatever still does not fit shows whole on the line under the card while you hover it.\n\nHover and click need a terminal that reports the mouse to Claude Code (the fullscreen renderer). The pulse runs for 30 seconds after the last click and then stops, leaving the thick lines; it redraws the focused card a few times a second while it runs.\n\n## Install\n\nAt the prompt of a Claude Code terminal session:\n\n```\n\u002Fplugin install sketch --marketplace allen-hsu\u002Fclaude-code-sketch\n```\n\nAnswer `y` to add the marketplace, then pick a scope (user scope loads it in every session).\n\nFrom a shell:\n\n```\nclaude plugin install sketch --marketplace allen-hsu\u002Fclaude-code-sketch\n```\n\nIn the desktop app, where `\u002Fplugin` does not run: click **+** next to the prompt box, then **Plugins**, **Add marketplace** with `allen-hsu\u002Fclaude-code-sketch`, then **Add plugin**.\n\nThen just ask as usual: \"how is this service put together?\", \"compare these three options\", \"plan the next quarter\". Claude picks the card.\n\n## What you get\n\n| Tool | Draws | Good for |\n| --- | --- | --- |\n| `layers` | Bands of components, nested zones, side concerns | Tech stacks, platform maps, deployment topologies |\n| `diagram` | Nodes and wires, laid out automatically | Architecture wiring, flowcharts, state machines, boundaries (C4), dependencies |\n| `schema` | Boxes with fields, and their relations | Data models (ER), class and component diagrams |\n| `swimlane` | Steps across lanes of roles or systems | Processes with handovers |\n| `pipeline` | Stages left to right, each a column of jobs | CI\u002FCD, ETL, data flows |\n| `gitgraph` | Branches, commits, merges and tags | Branching strategy, release flow |\n| `sequence` | Actors and the messages between them | Request flows, protocols, handoffs |\n| `tree` | An outline or a mind map | Goal breakdowns, sitemaps, taxonomies |\n| `timeline` | Bars over periods, milestones | Roadmaps, gantt schedules, study plans |\n| `board` | Columns of cards | Kanban, now \u002F next \u002F later |\n| `quadrant` | Points on two axes, or four lists | Prioritisation, positioning, SWOT |\n| `journey` | Stages, a mood line, rows of notes | User journeys, service blueprints |\n| `wireframe` | A low-fidelity screen | Page and app layouts |\n| `metrics` | Number tiles with a trend | KPIs, experiment results |\n| `chart` | Bar, column, stacked, line, scatter, heatmap, histogram, funnel, share | Any numbers you already have |\n| `cards` | Titled cards with tags and quotes | Personas, research findings, principles |\n| `compare` | Options side by side, then a pick dialog | Decisions between two to four options |\n\nThe cards below are drawn from the made-up inputs in [`preview\u002Fsamples.en.ts`](preview\u002Fsamples.en.ts). Labels can be in any language; Chinese, Japanese and Korean text is measured correctly (see the [繁體中文 README](README.zh-TW.md) for the same cards in Chinese).\n\n## Architecture and structure\n\n`layers` shows what a system is made of. `diagram` shows how it connects: each node's wires have their own color, an edge that loops back is drawn with an upward arrow, and a node's shape says what it is (decision, store, external system). `numbers: true` numbers the nodes and marks each arrow with where it comes from.\n\n![System wiring](docs\u002Fimages\u002Fen\u002Fdiagram.png)\n\n| Flowchart | Dependencies |\n| --- | --- |\n| ![Flowchart with decisions](docs\u002Fimages\u002Fen\u002Fdiagram-flow-1.png) | ![Dependency graph](docs\u002Fimages\u002Fen\u002Fdiagram-flow-2.png) |\n\nWhen dependencies are too dense for wires, `layout: \"matrix\"` draws who uses whom as a grid, with counts:\n\n![Dependency matrix](docs\u002Fimages\u002Fen\u002Fdiagram-flow-matrix.png)\n\nWith `layout: \"zones\"`, each group becomes a framed band: subsystems, network boundaries, a C4 container view. The `person` shape marks a user or a role.\n\n![Zones and boundaries](docs\u002Fimages\u002Fen\u002Fdiagram-zones.png)\n\nAn edge from a node to itself is drawn as a loop inside the node, so a state machine is a diagram too:\n\n![State machine](docs\u002Fimages\u002Fen\u002Fdiagram-state.png)\n\nZones in `layers` can hold zones of their own, which covers deployment topologies (region, availability zone, subnet):\n\n![Deployment topology](docs\u002Fimages\u002Fen\u002Flayers-topology.png)\n\n`schema` draws tables or classes with their fields, and the relations between them:\n\n| Data model (ER) | Classes |\n| --- | --- |\n| ![ER diagram](docs\u002Fimages\u002Fen\u002Fschema-er.png) | ![Class diagram](docs\u002Fimages\u002Fen\u002Fschema-class.png) |\n\n`swimlane` puts each step of a process in the lane of whoever does it, `pipeline` lays stages out left to right, and `gitgraph` shows branches over time:\n\n![Swimlane](docs\u002Fimages\u002Fen\u002Fswimlane.png)\n\n![Pipeline](docs\u002Fimages\u002Fen\u002Fpipeline.png)\n\n![Branch graph](docs\u002Fimages\u002Fen\u002Fgitgraph.png)\n\n![Sequence diagram](docs\u002Fimages\u002Fen\u002Fsequence.png)\n\n| Outline | Mind map |\n| --- | --- |\n| ![Tree](docs\u002Fimages\u002Fen\u002Ftree.png) | ![Mind map](docs\u002Fimages\u002Fen\u002Ftree-mind.png) |\n\n## Product and planning\n\n![Roadmap](docs\u002Fimages\u002Fen\u002Ftimeline.png)\n\n![Kanban board](docs\u002Fimages\u002Fen\u002Fboard.png)\n\n![Prioritisation on two axes](docs\u002Fimages\u002Fen\u002Fquadrant-1.png)\n\n![SWOT](docs\u002Fimages\u002Fen\u002Fquadrant-2.png)\n\n`compare` draws the options, then opens a dialog under the cards so you pick with the arrow keys; Claude carries on with your choice.\n\n![Options compared](docs\u002Fimages\u002Fen\u002Fcompare.png)\n\n## Design and research\n\n![User journey](docs\u002Fimages\u002Fen\u002Fjourney.png)\n\n![Wireframe](docs\u002Fimages\u002Fen\u002Fwireframe-1.png)\n\n![Mobile wireframe](docs\u002Fimages\u002Fen\u002Fwireframe-2.png)\n\n![Research findings and a persona](docs\u002Fimages\u002Fen\u002Fcards.png)\n\n## Numbers\n\nCharts, metric tiles, timelines and journeys draw themselves in while Claude's call runs:\n\n![A line chart drawing itself in](docs\u002Fimages\u002Fen\u002Fentrance.gif)\n\n![Metric tiles](docs\u002Fimages\u002Fen\u002Fmetrics.png)\n\n![Line chart](docs\u002Fimages\u002Fen\u002Fchart-line.png)\n\n![Scatter chart with trend line](docs\u002Fimages\u002Fen\u002Fchart-scatter.png)\n\n![Bar chart](docs\u002Fimages\u002Fen\u002Fchart-bar.png)\n\n![Column chart](docs\u002Fimages\u002Fen\u002Fchart-column.png)\n\n![Stacked bars](docs\u002Fimages\u002Fen\u002Fchart-stacked.png)\n\n![Histogram](docs\u002Fimages\u002Fen\u002Fchart-histogram.png)\n\n![Funnel](docs\u002Fimages\u002Fen\u002Fchart-funnel.png)\n\n![Heatmap](docs\u002Fimages\u002Fen\u002Fchart-heatmap.png)\n\n![Share of a whole](docs\u002Fimages\u002Fen\u002Fchart-share.png)\n\n## How it works\n\nThe whole mod is one hooks module, [`hooks\u002Fregister.tsx`](hooks\u002Fregister.tsx):\n\n- At session start it registers the 17 tools. Each takes plain structured input (nodes and edges, periods and items, labels and series).\n- A `ui.render` hook replaces each tool call's row in the transcript with the card, drawn from the call's own input. Hover groups light a node's wires with no code running; node names are buttons, and the one piece of state the mod keeps is which node each diagram card has focused (declared in [`types\u002Findex.d.ts`](types\u002Findex.d.ts)), plus the tick the pulse steps on.\n- A `prompt.compose` hook adds one short section to the system prompt telling Claude when to reach for which card and to keep the text around it brief.\n- Charts, metrics, timelines and journeys draw themselves in over about a second while the call runs.\n- Press `ctrl+o` to see the raw tool call behind a card.\n\nThings to know:\n\n- The tool definitions and the prompt section ride on every request in a session where the mod is loaded: roughly 5 thousand tokens (an estimate, not a measurement).\n- Cards are sized to the terminal width when they are drawn. Below about 60 columns the wider cards get cramped.\n- Wide characters (Chinese, Japanese, Korean) are measured as two cells. A terminal that draws ambiguous-width symbols such as `●` two cells wide will misalign some cards.\n- Built and tried on Claude Code 2.1.325 in a terminal. The cards use only `Box` and `Text`, which every surface has, but the desktop and mobile surfaces are untested.\n\n## About the images\n\nThe images in this README are not window screenshots. They are produced by the scripts in [`preview\u002F`](preview): `render.ts` runs the mod's real hooks against a stand-in engine with a small flex layout of its own, and `paint.py` paints the resulting cells with the default dark theme's colors. `frames.ts` renders the animations frame by frame from the same hooks; in them, the hovered state is drawn as the terminal draws it, without a pointer. Layout in your terminal comes from Claude Code's own engine and your theme, so spacing and colors can differ slightly.\n\nTo regenerate them (macOS, needs [Bun](https:\u002F\u002Fbun.sh) and Python with Pillow; use `samples.zh-TW.ts` and `docs\u002Fimages\u002Fzh-TW` for the Chinese set):\n\n```\ncd preview\nbun --jsx-factory=h --jsx-fragment=Fragment --jsx-runtime=classic render.ts ..\u002Fhooks\u002Fregister.tsx 110 cards.json .\u002Fsamples.en.ts\npython3 paint.py cards.json ..\u002Fdocs\u002Fimages\u002Fen\nbun --jsx-factory=h --jsx-fragment=Fragment --jsx-runtime=classic frames.ts ..\u002Fhooks\u002Fregister.tsx 110 .\u002Fsamples.en.ts anim\nSKETCH_GIF_SCALE=0.55 python3 paint.py anim-interaction.frames.json ..\u002Fdocs\u002Fimages\u002Fen\u002Finteraction.gif\npython3 paint.py anim-entrance.frames.json ..\u002Fdocs\u002Fimages\u002Fen\u002Fentrance.gif\n```\n\n## Develop\n\n```\nclaude --plugin-dir .        # run a session with the mod loaded from this folder\nclaude plugin validate .     # check the manifest and the hooks module\n```\n\nEdits to `hooks\u002Fregister.tsx` hot-reload in a session started with `--plugin-dir`.\n\n## License\n\nMIT\n","这是一个为 Claude Code 设计的终端内可视化插件，将代码、架构、流程等抽象概念自动渲染为可交互的图表卡片。核心功能包括支持分层图、节点连线图、数据模型图、泳道图和流水线图等7种绘图工具，并提供悬停高亮、点击聚焦、连线脉冲动画等终端原生交互能力，所有图表均适配终端主题色且无需外部依赖。适用于开发者在终端中快速理解系统架构、梳理业务流程、评审技术方案或进行轻量级设计沟通。",2,"2026-11-24 04:51:16","CREATED_QUERY"]