procedural-canvas
БесплатноЗапускает вложенные скриптыНе проверенPaint a whole landscape or scene as ONE self-contained HTML file that draws itself in the browser with Canvas 2D and plain JavaScript, with no images, no…
от dogum★ 26 звёзд на GitHubОб этом скилле
Procedural canvas
One HTML file, one picture. The file holds no image and loads nothing: it is a small renderer written for this one scene, and the browser computes every pixel when the page opens. You write that renderer.
SK below is this skill's folder.
| File | What it is |
|---|---|
assets/fuji-at-first-light.html |
A finished piece to read before writing your own: a real mountain from baked elevation data, a lake, a foreground. Open it, read its stage list, borrow its scaffolding |
scripts/render_headless.js |
Renders a piece in headless Chromium, times it, reports page errors, saves the canvas and a 1:1 crop, and checks that a second render is identical |
scripts/bake_dem.py |
Turns real elevation into the block a piece embeds, so the mountain in the picture is the real one |
references/architecture.md |
How the file is organised: stages, seed, the done flag, world space, the conventions tools rely on |
references/techniques.md |
How each part is made: terrain, water, reflections, trees, clouds, light shafts, the grade; and the traps |
More finished pieces, with the prompts that produced them, are at https://dogum.github.io/procedural-art/canvas/ (source in docs/canvas/ of the repository).
The contract of the file
Keep these every time; tools and people rely on them.
- One file. HTML, CSS and JavaScript inline. No
<img>, no fonts, no fetch, no library. It must work fromfile://with the network off. - A fixed canvas, 1920 × 1080 unless asked otherwise, scaled to the window with CSS.
- A seed.
?seed=in the address (any string), with a default written in the file. NeverMath.random, never the clock. Give each subsystem its own named random stream (stream('oak'),stream('flora')), so changing one does not reshuffle the others. - Stages with a progress line. Paint back to front in named stages and yield to the browser between them (
await new Promise(requestAnimationFrame)), so the picture builds up and the page never freezes. - A done flag. When the last stage has drawn, set
document.documentElement.dataset.ready = 'true'. - The same picture every time for the same seed in the same browser.
How a piece is made
- Decide what the picture is before any code: the subject, where the light comes from, the three or four big shapes, what is near and what is far. A long list of features is not a composition. Place the anchors by hand (peaks, the shoreline, the main trees); let the seed vary the detail, not the layout.
- Build the far world as geometry in world units. A camera (position, focal length in pixels, horizon row) and a heightfield or mesh in metres, rendered front to back. Do not stamp mountain silhouettes: terrain with real slopes gets shading, cast shadows, snow lines and haze that agree with each other. This is the largest single difference between a piece that looks rendered and one that looks drawn. For a real mountain, bake its elevation with
bake_dem.pyand say in the file what is real. - Work in linear light for anything that mixes light (water, fog, glow, haze) and encode to sRGB once at the end.
- Add the middle distance and the water, then the reflection: mirror each landform about its own waterline, column by column, then let the water shader bend and tint that image.
- Add the foreground last, and give it the most care per pixel: bark that follows the limb, leaves lit by which side faces the sun, stones with an up-facing side.
- Light and grade with restraint. One sun, small. Light shafts only where something breaks the light. No stacked glows.
- Look. Render with the harness, read the whole frame and several 1:1 crops, write down what is wrong, fix the worst thing, render again. Expect five or more rounds. Try a second seed before you call it done.
node $SK/scripts/render_headless.js piece.html out.png --repeat
node $SK/scripts/render_headless.js piece.html out.png --crop 360,140,1200,520 mountains.png
node $SK/scripts/render_headless.js piece.html seed2.png --query "?seed=harbour-7"
The harness needs Node with the playwright package and a Chromium (set CHROME to a browser binary if Playwright has none). If neither is available, say so and ask the user to open the file; do not claim the piece was checked.
Read references/architecture.md before writing the first line and references/techniques.md when you reach each part.
A real mountain in the file
python $SK/scripts/bake_dem.py --npz work/fuji/dem.npz --camera 35.5222,138.7650 --look 35.3606,138.7274 \
--lake 829 --date 2026-11-10 --time 07:05 --tz 9 --name "Mount Fuji from the north shore of Lake Kawaguchi" \
--out block.js --into piece.html
It takes an elevation cache (the dem.npz that procedural-realism and procedural-terrain-art write, or any file with elev, lats, lons), a camera position and a point to look at. It bakes the ground as that camera sees it, a fa
Установить procedural-canvas в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл procedural-canvas?
Paint a whole landscape or scene as ONE self-contained HTML file that draws itself in the browser with Canvas 2D and plain JavaScript, with no images, no libraries, no network and no generative image model. Use this when the user asks for a single HTML file, an HTML5 Canvas or vanilla JavaScript picture, a "procedural" or "every pixel computed" scene that must run offline in a browser, or a web page or artifact that renders a photorealistic or painterly landscape (mountains, lakes, forests, sea, ruins, skies) by code. You build a small renderer for that one picture (world-space terrain, linear-light water with reflection and refraction, trees, clouds, light shafts, a restrained grade), give it a seed, and check it by rendering headless and looking. It can bake real elevation data into the file so the mountain is the real one. Not for Python renders or prints of real terrain (procedural-terrain-art, procedural-realism) or for oil and watercolour simulation (procedural-painting).
Как установить скилл procedural-canvas?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл procedural-canvas запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic