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.
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.
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.
- 242 countries
- 4,589 admin-1 regions in 251 countries
- 461 rivers · 412 lakes
- 1,251 populated places, with zh / ja / ko names
- 81 peaks · 259 mountain ranges
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.
10 style presets
One option re-renders the whole map — palette, strokes, fills, border and icons.






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.
“Draw me a map of Italy in blueprint style.”
npx handdrawn-map render \
examples/specs/italy.yaml \
--style blueprint --fast \
--auto-layout
“Draw me a map of Sichuan in ink-wash style.”
npx handdrawn-map render \
examples/specs/sichuan.yaml \
--style ink-wash --fast \
--auto-layout
“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