Imported from xsyetopz/easel.js (
www/AGENTS.md). Install upstream withnpx skills add xsyetopz/easel.js --skill www. Copyright stays with the author.
Website and examples
Scope: www/; root astro.config.mjs owns Astro/Starlight routing, aliases, and build output.
Ownership map
astro/content/manual/is hand-written documentation;astro/content/docs/docs/is ignored output generated fromsrc/**/*.tsJSDoc.components/,runtime/,styles/,loaders/, andutils/own the site shell and example execution.examples/<category>/<id>/mirrors one three.js r186 example, named bymeta.upstream:three.jsis the original adapted tosetup(canvas, params),easel.jsis the EASEL port, and helper modules may sit beside them. EASEL renders with Canvas2D, so upstreamwebgl_*ids becomecanvas_*ids in thecanvascategory;misc_*andwebaudio_*ids stay as they are.examples/registry.tsis generated from those modules bybun run examples:registry.public/owns static site assets. Library test assets belong in repositoryassets/orfixtures/, not here.
Change rules
- Never hand-edit generated API Markdown; edit source JSDoc and run
bun run docs:generate. - Port line by line and keep upstream counts, camera, and colors. List every visible or behavioral difference in
meta.differences; never emulate three.js output with per-pixel CPU work. - Start each
three.jsfile with// Adapted from three.js r186 examples/<upstream>.html.and// Copyright 2010-2026 three.js authors. MIT License.; listen on the canvas, notwindowordocument, and release every listener incleanup. - Annotate non-empty
controlsexports with/** @type {import("../../../types/controls.ts").ControlDefinition[]} */, ortypecheck:websitefails once the example is registered. - Both sides parse the same checked-in data from
assets/(?raw, or a.base64sibling for binary). Copy an upstream asset only with license evidence, pin its hash intests/examples/ExampleAssets.test.ts, and add itsassets/README.mdrow; otherwise substitute and record it as a difference. - Pass three.js light intensities and
colorSpacesettings verbatim; EASEL matches r186 lighting scale and color management. - Preserve base-path-aware links and browser-only boundaries; do not make package source depend on Astro or website runtime code.
- Run
bun run examples:registry,bun run typecheck:website,bun run examples:catalog, andbun test tests/examples; runbun run www:buildfor site/config changes.
