agentleFS
pbakauspbakaus/radiant/CLAUDE.md

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
  1. Very specific:

    Use visibilitychange to pause when offscreen

    line 43
  2. Distinctive:

    Every new shader requires ALL of the following:

    line 49
  3. Very specific:

    Create static/shader-name.html following the existing format:

    line 52
  4. Distinctive:

    All shaders must respond to user input:

    line 60
  5. Distinctive:

    If the shader is inspired by someone NOT already in the project, add entries to:

    line 89
  6. Very specific:

    Add an entry to the shaders array in src/lib/shaders.ts:

    line 94
  7. Distinctive:

    Run the preview generator to create gallery card thumbnails:

    line 112
  8. Distinctive:

    Test all parameters via the detail page sliders

    line 120
  9. Distinctive:

    Test mouse/touch interaction

    line 121
  10. Distinctive:

    Check that color scheme switching works (amber, blue, etc.)

    line 123
  11. Distinctive:

    Verify the preview sprite shows correctly in the gallery grid

    line 124

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

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 cards

Commands

  • npm run dev — Dev server
  • npm run build — Production build
  • node scripts/generate-previews.mjs — Generate all preview sprites
  • node scripts/generate-previews.mjs --only=shader-id — Generate preview for one shader
  • node scripts/generate-videos.mjs --shader=shader-id — Generate highlight video for one shader
  • node scripts/generate-videos.mjs --shader=shader-id --format=reel — Generate 9:16 vertical reel
  • node 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 puppeteer and ffmpeg

Conventions

  • Each shader is a single HTML file: <style> + <canvas id="canvas"> + <script> IIFE
  • Label format: shader name in a fixed .label div
  • Dark background (#0a0a0a), warm amber accent palette (rgba(200, 149, 108, ...))
  • Respect prefers-reduced-motion where applicable
  • Use visibilitychange to 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 .label div with shader name
  • requestAnimationFrame loop with visibilitychange pause
  • Handle canvas resize with DPR (capped at 2)

2. Add mouse/touch interaction

All shaders must respond to user input:

  • mousemove / touchmove for cursor tracking
  • mouseleave / touchend to 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 palette
  • src/lib/inspiration-palettes.ts — keyed by slug, with primary (hex for card border tint) and colors (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-name

This 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-name and 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

Download now (ZIP)

  • In this repositoryOne other file it gives its agents.

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.