handdrawn-map-kit — hand-drawn maps, drawn by your agent.

handdrawn-map-kit is a Node.js engine for hand-drawn illustrated cultural maps. An agent writes a YAML spec; the kit draws real Natural Earth geography, 65 hand-drawn icons and CJK lettering, then reports layout diagnostics the agent can fix.

Node ≥ 20 · MIT · 2 runtime dependencies

Hand-drawn cultural map of Japan rendered by handdrawn-map-kit: 47 prefectures, cities in Japanese and English, icons for Mount Fuji, a torii gate, a castle, sushi and a whale.
Plate I · Japan — 94 lines of YAML. 29 items, 0 overlaps, 0 out of bounds.

Copy for your agent

Paste this into Claude Code, Codex or Cursor. It clones the kit, installs its SKILL.md where your agent looks for skills, and renders a first map with diagnostics.

Already set up? Just ask:

Set up handdrawn-map-kit, then draw a map with it.

1. git clone https://github.com/wangreng/handdrawn-map-kit
   cd handdrawn-map-kit && npm ci
2. Install its SKILL.md as a skill, where the agent I use looks for skills:
   Claude Code  ~/.claude/skills/handdrawn-map-kit/SKILL.md
   Codex        ~/.agents/skills/handdrawn-map-kit/SKILL.md
   Cursor       ~/.cursor/skills/handdrawn-map-kit/SKILL.md
3. npx handdrawn-map inspect \
     elements --json
4. npx handdrawn-map render \
     examples/specs/italy.yaml \
     -o out/italy.png --fast \
     --auto-layout --diagnostics -
   Fix whatever the diagnostics report, then draw me a map of the place I name next.
npx handdrawn-map inspect \
  countries japan --json
npx handdrawn-map inspect \
  elements --json

Ask the kit what it knows: real country codes, cities, rivers, icons and fonts, so nothing is invented.

geo:
  fit: { target: Japan }
elements:
  - type: torii
    lon: 132.32
    lat: 34.30

Write the map as data: canvas, geography, layers, icons, labels, cartouche. YAML or JSON.

npx handdrawn-map inspect \
  spec japan.yaml --json

Plan without drawing: schema check, projection and the first layout report, in milliseconds.

npx handdrawn-map render \
  japan.yaml -o out/japan.png \
  --fast --auto-layout \
  --diagnostics -

Render fast and read the report: every item’s box in millimetres.

"summary": {
  "totalItems": 29,
  "overlapCount": 0,
  "outOfBoundsCount": 0
}

Not zero? Move the colliding item, or lower its priority, and render again. When both counts are zero, draw the final plate with --hd.

npx handdrawn-map render \
  japan.yaml -o out/japan.png --hd

Real geography

Natural Earth is bundled, so an agent names places instead of guessing coordinates.

65 illustrations

Landmarks, animals, food, transport and nature icons, each reporting its bounding box in millimetres, plus a parameterized hand-drawn person with 10 poses. Custom landmarks go in as inline SVG and are drawn by the same pencil and wash engine.

All 65 built-in illustrations of handdrawn-map-kit, drawn in a grid with their names.

10 style presets

One option re-renders the whole map — palette, strokes, fills, border and icons.

Italy map in blueprint style
blueprint
Italy map in gouache-stage style
gouache-stage
Sichuan map in ink-wash style
ink-wash
Italy map in editorial-infographic style
editorial-infographic
Italy map in collage-atlas style
collage-atlas
Italy map in anno-scroll style
anno-scroll

Also: vintage-atlas · nocturne · watercolor-field · paper-relief

Type that behaves

Bundled ZCOOL XiaoWei for CJK, mixed-script labels, bilingual stacked names, text on a curve, rotated region names.

Layout that reports

placement: auto puts the cartouche and compass in open sea. Collision avoidance nudges labels by priority. --diagnostics returns every box in mm.

Two dependencies

@napi-rs/canvas for rasterizing and js-yaml for specs. No browser, no headless Chrome, no Python.

Italy rendered in blueprint style

“Draw me a map of Italy in blueprint style.”

npx handdrawn-map render \
  examples/specs/italy.yaml \
  --style blueprint --fast \
  --auto-layout
Sichuan rendered in ink-wash style

“Draw me a map of Sichuan in ink-wash style.”

npx handdrawn-map render \
  examples/specs/sichuan.yaml \
  --style ink-wash --fast \
  --auto-layout
Italy rendered in anno-scroll style

“Draw me a map of Italy like an old scroll.”

npx handdrawn-map render \
  examples/specs/italy.yaml \
  --style anno-scroll --fast \
  --auto-layout

Quick start, by hand

npm install github:wangreng/handdrawn-map-kit
npx handdrawn-map inspect \
  elements --json
npx handdrawn-map render \
  examples/specs/italy.yaml \
  -o out/italy.png --fast \
  --auto-layout --diagnostics -

Or as a library:

const { createMap } = require('handdrawn-map-kit')

How this page was made

This page is one map. Every island you are reading on, the compass, the plates and the lettering were drawn by handdrawn-map-kit from the YAML specs next to it.

./build.sh

10 renders · 6 specs · 31.7 megapixels