radiant
CLAUDE.md994 starsChanged 7 months agoMITView on GitHub
A collection of standalone canvas-based generative animations with a SvelteKit gallery frontend. Every new shader requires ALL of the following: Since schemes work via hue-rotate, design native colors in warm/amber tones so other schemes produce good results. If a shader looks best in a non-amber scheme, set defaultScheme in its catalog entry.
We split this CLAUDE.md into the rules it gives an agent
11 rules. About 0 are common, 8 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 43
Use visibilitychange to pause when offscreen
- Distinctive: line 49
Every new shader requires ALL of the following:
- Very specific: line 52
Create static/shader-name.html following the existing format:
- Distinctive: line 60
All shaders must respond to user input:
- Distinctive: line 89
If the shader is inspired by someone NOT already in the project, add entries to:
- Very specific: line 94
Add an entry to the shaders array in src/lib/shaders.ts:
- Distinctive: line 112
Run the preview generator to create gallery card thumbnails:
- Distinctive: line 120
Test all parameters via the detail page sliders
- Distinctive: line 121
Test mouse/touch interaction
- Distinctive: line 123
Check that color scheme switching works (amber, blue, etc.)
- Distinctive: line 124
Verify the preview sprite shows correctly in the gallery grid
≈ “Common” is an estimate: at least 1 in 5 of the 25,680 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Shaders
A collection of standalone canvas-based generative animations with a SvelteKit gallery frontend.
Stack
- Gallery: SvelteKit 2 + Svelte 5, TypeScript, Vite
- Shaders: Standalone HTML files in
static/, no build step. Each is self-contained with inline JS. - Rendering: Mix of Canvas 2D and WebGL. No external dependencies.
Structure
src/routes/+page.svelte — Homepage with featured grid
src/routes/gallery/ — Gallery pages with filtering
src/routes/shader/[id]/ — Individual shader detail pages
static/*.html — Standalone shader pages
src/lib/shaders.ts — Shader catalog metadata (ALL shader entries)
src/lib/color-schemes.ts — 6 color scheme definitions
scripts/generate-previews.mjs — Preview sprite sheet generator
static/previews/*.webp — Generated preview sprites for gallery cardsCommands
npm run dev— Dev servernpm run build— Production buildnode scripts/generate-previews.mjs— Generate all preview spritesnode scripts/generate-previews.mjs --only=shader-id— Generate preview for one shadernode scripts/generate-videos.mjs --shader=shader-id— Generate highlight video for one shadernode scripts/generate-videos.mjs --shader=shader-id --format=reel— Generate 9:16 vertical reelnode scripts/generate-videos.mjs --all— Generate videos for all shaders- Formats:
landscape(1920x1080, default),reel(1080x1920),square(1080x1080) - Additional flags:
--fps=60,--output=dir(default:videos/),--no-captions - Requires
puppeteerandffmpeg
- Formats:
Conventions
- Each shader is a single HTML file:
<style>+<canvas id="canvas">+<script>IIFE - Label format: shader name in a fixed
.labeldiv - Dark background (#0a0a0a), warm amber accent palette (rgba(200, 149, 108, ...))
- Respect
prefers-reduced-motionwhere applicable - Use
visibilitychangeto pause when offscreen - Target 60fps on normal laptops — if a technique can't hit 60fps, use a different technique
- Shaders must be highly reusable — designed to drop into any website as a background, hero section, or design asset
Adding a new shader
Every new shader requires ALL of the following:
1. Create the HTML file
Create static/shader-name.html following the existing format:
- Single HTML file:
<style>+<canvas id="canvas">+<script>IIFE - Dark background (#0a0a0a)
- Fixed
.labeldiv with shader name requestAnimationFrameloop withvisibilitychangepause- Handle canvas resize with DPR (capped at 2)
2. Add mouse/touch interaction
All shaders must respond to user input:
mousemove/touchmovefor cursor trackingmouseleave/touchendto reset- The interaction should meaningfully affect the visual (not just cosmetic)
3. Expose tunable parameters
Define 2+ parameters controllable via postMessage:
window.addEventListener('message', function(e) {
if (e.data && e.data.type === 'param') {
switch (e.data.name) {
case 'PARAM_NAME': paramValue = e.data.value; break;
}
}
});4. Support color schemes
The gallery uses 6 color schemes applied via CSS filter on the iframe:
- Amber (default):
filter: none— shader renders in its native colors - Mono:
grayscale(1) - Blue:
hue-rotate(175deg) - Rose:
hue-rotate(300deg) saturate(1.1) - Emerald:
hue-rotate(90deg) saturate(1.2) - Arctic:
hue-rotate(180deg) saturate(0.5) brightness(1.1)
Since schemes work via hue-rotate, design native colors in warm/amber tones so other schemes produce good results. If a shader looks best in a non-amber scheme, set defaultScheme in its catalog entry.
5. Add inspiration metadata (if new celebrity)
If the shader is inspired by someone NOT already in the project, add entries to:
src/lib/inspiration-intros.ts— keyed by slug (e.g.'daft-punk'), a 3-4 sentence poetic description of the celebrity's artistic identity and associated color palettesrc/lib/inspiration-palettes.ts— keyed by slug, withprimary(hex for card border tint) andcolors(2-4 hex colors for ambient glow on the inspiration gallery page)
6. Register in the catalog
Add an entry to the shaders array in src/lib/shaders.ts:
{
id: 'shader-name', // URL-safe kebab-case
file: 'shader-name.html', // filename in static/
title: 'Shader Name', // display name
desc: 'Description.', // one-line description
inspiration: 'Celebrity', // optional celebrity inspiration
tags: ['fill', 'noise'], // from: fill, object, particles, physics, noise, organic, geometric
technique: 'webgl', // 'webgl' or 'canvas-2d'
defaultScheme: 'blue', // optional: override default color scheme
params: [
{ name: 'PARAM_NAME', label: 'Param Label', min: 0, max: 2, step: 0.1, default: 1.0 }
]
}7. Generate preview sprites
Run the preview generator to create gallery card thumbnails:
node scripts/generate-previews.mjs --only=shader-nameThis creates static/previews/shader-name.webp — a vertical sprite sheet with 6 frames (one per color scheme). Requires the dev server to NOT be running on the same port.
8. Verify
- Open
http://localhost:5173/shader/shader-nameand check it renders correctly - Test all parameters via the detail page sliders
- Test mouse/touch interaction
- Verify 60fps performance
- Check that color scheme switching works (amber, blue, etc.)
- Verify the preview sprite shows correctly in the gallery grid
In this repositoryOne other file it gives its agents.
- AGENTS.mdAGENTS.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

