Free · open source · no dependencies

Technical diagrams, sketched in pencil.

Describe a system in a few lines of JSON, or just ask your AI agent, and penciled draws it the way a person with a pencil would: graphite grain, hatched shading, corners that overshoot. It lays itself out and checks its own work.

$npx skills add himanshu13ps/penciled
See it work ↓
Drawn live in your browser ·

How it works

Watch an agent use it

One paragraph in, a finished sketch out. In between, the agent writes the diagram, penciled checks how it will actually look, and the agent fixes what the check found.

This is a real run, not a mock-up: Claude followed the skill's instructions on the request above. The JSON and the validator's reports are shown exactly as produced; the files are in docs/replay.

The look

Why it looks hand-drawn

penciled models how a pencil behaves on paper, stroke by stroke. Every close-up below is cropped from a drawing rendered live on this page.

Features

What you can describe

A diagram is nodes, the groups around them and the arrows between them. Shapes carry meaning, so readers know a database from a service at a glance. Open any card to see the JSON behind it.

Seven shapes

Arrows, groups, shading and flow

Full input reference every field, its values and limits
FieldValuesNotes
titletext, up to 80 charactersHandwritten at the top of the page
directionLR or TBMain flow for automatic layout
nodes[].idletters, digits, _, -Never drawn; unique across nodes and groups
nodes[].labeltext, up to 60 characters\n for a line break
nodes[].sublabeltextSmaller second line, e.g. the technology
nodes[].shapebox rounded database queue person cloud documentDefault box
nodes[].shadenone light medium darkDraws the eye; use on one or two nodes
nodes[].groupa group idThe outline the node sits inside
nodes[].position{ x, y }Optional; give every node one or none
groups[]id, label, parent, shadeDashed outlines; parent nests them
edges[]from, to, label, style, arrowstyle: solid or dashed; arrow: end, start, both, none
paperstyle, texture, pencil, eraserMarks, seedSee “Make it your own”
Limits40 nodes, 12 groups, 80 arrowsReadable diagrams stay under about 15 nodes

The JSON Schema is architecture.schema.json; the full guide is the schema README.

Styles

Make it your own

Paper, ruling and pencil are one line each. A seed gives you a different hand-drawn take on the same diagram, and the same seed always draws it the same way.

Checks

It checks its own work

Before drawing, penciled validates the input and lays the diagram out exactly as it will be drawn. Errors mean it can't be drawn as written. Warnings mean it will draw, but probably not the way you want. Every message says what to change, which is how an agent fixes its own diagrams. The messages below are produced live.

Every check 7 errors, 12 warnings
CodeKindMeaning
schemaerrorA value doesn't match the format, with “did you mean” for typos
duplicate-iderrorTwo nodes or groups share an id
unknown-nodeerrorAn arrow points at a node that doesn't exist
edge-to-grouperrorAn arrow points at a group; arrows connect nodes
unknown-grouperrorA node's group or a group's parent doesn't exist
group-cycleerrorGroups nest in a loop
partial-positionserrorSome nodes have a position and some don't
arrow-crossingswarningArrows cross each other
arrow-through-nodewarningAn arrow couldn't be routed around a node
aspectwarningThe drawing is a long strip; try the other direction
node-overlapwarningTwo nodes on top of each other
node-in-other-groupwarningA node drawn inside a group it isn't in
group-overlapwarningTwo groups that aren't nested overlap
label-crowdedwarningAn arrow label has no clear space
label-overflowwarningA label is wider than its node's fixed size
self-loopwarningAn arrow from a node to itself (not drawn)
duplicate-edgewarningThe same arrow twice
empty-groupwarningA group with no nodes (not drawn)
isolated-nodewarningA node with no arrows in a diagram that has some

Outputs

An SVG, a PNG, or a page people can play with

All come from the same input and seed, so they match, and the handwriting font is built in. For places that don't show SVG, like chat apps and email, write a PNG: -o diagram.png (it uses Chrome, Edge, Chromium or Brave if you have one installed).

SVG

For READMEs, docs sites, wikis and slides. Scales to any size and stays sharp.

  • One self-contained file, about 100 to 400 KB
  • Opens in any browser; edits in vector tools
  • penciled diagram.json -o diagram.svg
Download:

Put it in a README like any image:

![Architecture](docs/architecture.svg)

Re-render after editing the JSON and the picture in your docs stays current. Keep the seed and it keeps its character.

Interactive viewer

One offline HTML file with the renderer inside. Try it right here: press Redraw, switch the paper, scroll to zoom, save a PNG or JPG.

penciled diagram.json -o diagram.html

Playground

Edit the JSON, watch it redraw

The real renderer and validator, running in your browser. Nothing is uploaded. Start from an example, change a label, add a node, switch the paper. When you like it, download it as SVG, PNG or JPG.

Get it

Three ways to use it

All free, all offline. The only requirement for the first two is Node.js 18 or later.

1Ask your agent

Install it as a skill. Your agent learns when to use it and how to write, check and draw the diagram.

$npx skills add himanshu13ps/penciled

Then ask in your own words:

“sketch the architecture of this repo as a hand-drawn diagram”

2Command line

Clone the repo; there is nothing else to install.

$ git clone \
    https://github.com/himanshu13ps/penciled
$ cd penciled
$ node skills/penciled/src/cli.js \
    examples/web-app.json -o web-app.svg

Use -o out.png for a PNG, -o out.html for the viewer, validate to check without drawing, --seed for another take.

3In your browser

Use the playground on this page. Write or paste the JSON, pick a paper and pencil, and download SVG, PNG or JPG. Nothing to install, nothing uploaded.

Open the playground
Installing for a specific agent Claude Code, Cursor, Codex and more

The skills installer asks which agents you use. To choose up front, pass -a; add -g to install for every project instead of the current one.

AgentCommandInstalls to
Claude Codenpx skills add himanshu13ps/penciled -a claude-code.claude/skills/
Cursornpx skills add himanshu13ps/penciled -a cursor.agents/skills/
Codexnpx skills add himanshu13ps/penciled -a codex.agents/skills/
Gemini CLInpx skills add himanshu13ps/penciled -a gemini-cli.agents/skills/
GitHub Copilotnpx skills add himanshu13ps/penciled -a github-copilot.agents/skills/
OthersOver 70 agents are supported; see the full list.

FAQ

Questions and limits

What is an agent skill?

A folder of instructions (and, here, code) that an AI coding agent such as Claude Code, Cursor or Codex can load when a task calls for it. penciled's skill tells the agent when a hand-drawn diagram fits, how to describe the system, how to read the validator's messages and how to render the result.

Do I need an AI agent to use it?

No. You can write the JSON yourself and run the command line, or use the playground on this page without installing anything.

What kinds of diagrams can it draw?

Architecture and system diagrams: services, databases, queues, people, external systems, documents, the groups around them and the arrows between them. It isn't for charts of numbers, UI mockups or precise engineering drawings.

A diagram can have up to 40 nodes, 12 groups and 80 arrows. Hand-drawn diagrams read best under about 15 nodes; bigger systems work better as an overview plus a few detail diagrams.

Is anything sent to a server?

No. penciled runs entirely on your machine, or in your browser on this page. It makes no network requests and collects nothing.

Can I place things exactly where I want?

Yes. Layout is automatic by default, but if every node has a position, penciled uses your positions as given. See the event pipeline in the gallery.

How do I get the same drawing every time?

Set paper.seed. The same input and seed always produce the same drawing, so you can edit a label and re-render without the whole sketch changing character. In the viewer, save the JSON to keep the seed you liked.

Can I get a PNG or JPG?

Yes, three ways. In the playground on this page, use the PNG or JPG buttons. In the interactive viewer, use its PNG or JPG button. From the command line, write to a .png file: penciled diagram.json -o diagram.png. That uses Chrome, Edge, Chromium or Brave if one is installed; without one, it tells you so and you can save a PNG from the viewer instead.

Images are twice the drawing's size by default, sharp enough for slides. PNGs keep every detail but run to several megabytes because of the paper grain; JPG is about a tenth of the size.

Can I edit the drawing afterwards?

Edit the JSON and render again; that's the intended way. The SVG is a normal vector file, so you can also open it in a vector editor, though it is made of many small pencil strokes.

How big are the files?

Usually 100 to 400 KB for an SVG and about 160 KB for the viewer. PNGs from the command line are twice the drawing's size by default; use --scale 1 for smaller files. The paper grain and the embedded font are most of it. PNGs are larger, often several megabytes, because the paper grain doesn't compress; JPG is about a tenth of the size and fine for sharing.

What does it cost, and what's the licence?

It's free and open source under the MIT licence. The handwriting font, Caveat, is under the SIL Open Font License.