/qadri-motion:threejs-scenefrom qadri-motion
Builds real-time 3D websites in three.js from code alone, with no model files. Covers procedural geometry, canvas textures, shader patches, physically based sky and sun, soft shadows, ambient occlusion, bloom, light presets, camera vantages and flights, and quality tiers.
Ships in qadri-motion. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A convincing 3D page is mostly light and proportion, not polygon count. The White House reads as the White House because its storeys, column spacing and cornice depth are right, and because a low sun throws long shadows across it, not because every window has a frame. This skill builds scenes the way an architect's model is made: from real dimensions, in code, with lighting done properly.
assets/starter/ is a complete, working scene (a round pavilion on a lawn) with everything below already wired. Copy it, keep env.js, kit.js and main.js, and replace scene.js with your subject.
cp -r assets/starter my-scene && cd my-scene
python3 -m http.server 8000 # any static server; ES modules need http://, not file://
| File | Holds |
|---|---|
index.html | Import map pinned to three r169 ([email protected]), canvas, title, light buttons, loader |
main.js | Renderer, camera, post stack, quality tiers, vantages and flights, recording hooks, frame loop |
env.js | Sky, sun, image-based light, fog, clouds, night sky; three presets that blend; shadow fitting |
kit.js | Seeded RNG, canvas textures, instancing kit, lathe, arc, profile sweep with mitred corners |
scene.js | The example subject and every pattern worth copying |
URL parameters work out of the box: ?view=front|corner|low|aerial, ?light=morning|golden|night, ?quality=high|balanced|fast, and ?record=1 for a frame-exact recording with frame-capture.
Kit (one draw call per part). Mouldings, kerbs, steps and rails are profiles swept along paths (sweep); round things are lathes.env.js, then tune exposure, sun elevation and fog for the mood. Most of the realism arrives in this step.U.uTime, U.uWind, U.uNight) so recording and light changes stay in sync.site-check: frame time, draw calls, every vantage at every light, a phone. Then record with frame-capture.These are set in main.js; keep them unless you know why not.
ACESFilmicToneMapping with exposure per preset (0.6 to 1.0). Without tone mapping, bright skies clip and everything looks like a game from 2009.antialias: false on the renderer, and a HalfFloatType render target with samples: 4 for the effect composer. Canvas MSAA does nothing once post-processing is on.RenderPass → GTAOPass (ambient occlusion: contact shadows under cornices, between columns, where walls meet ground) → UnrealBloomPass (strength about 0.12 by day, 0.5 at night) → OutputPass (tone mapping and sRGB last). The GTAO pass is subclassed to hide anything with userData.noAO (sky layers, particles, glass) because AO darkens whatever it sees.env.js renders a private copy of the sky into a PMREM environment map, so reflections and ambient light match the sky's colour at every preset. Regenerate it while presets blend (every sixth frame is enough: PMREM is expensive).normalBias scaled to the scene removes acne without peter-panning.Each preset in env.js moves the sky, sun, hemisphere light, fog, exposure and clouds together. Read references/lighting.md before tuning. The short version:
decay: 2. With decay 1.4 and a guessed intensity, a single fountain light blew out half a scene.visible = false) when their intensity is zero.See references/geometry.md for details and code. The ones used most:
sweep(profile, path, { closed, y }): a 2D profile of [outward offset, height] pairs swept along a path in the XZ plane with mitred corners. Cornices, entablatures, kerbs, road edges, steps, skirting, picture rails. Closed paths detect their winding, so "outward" is always outward.lathe([[r, y], ...]): columns with entasis, balusters, urns, domes, lamp posts, wheels, bottles.Kit: define a part once, add matrices, build one InstancedMesh per part. Per-instance colour gives variety (leaf greens, brick tones) at no cost.canvasTex(w, h, draw): textures drawn in code with a seeded RNG. Stone speckle, grass, gravel, signage, window grids. No downloads, no licensing, identical on every load.BufferGeometryUtils.mergeGeometries) when it is not repeated enough to instance.Extend built-in materials with onBeforeCompile instead of writing shaders from scratch; you keep lighting, shadows and fog for free. references/shaders.md has tested patches for: wind sway, snow on upward faces, seasonal foliage tint, windows that light up at night, water ripple.
The rule that is easy to miss: a patch that moves vertices must also patch the shadow pass. Give the mesh a customDepthMaterial (a MeshDepthMaterial with RGBADepthPacking) carrying the same onBeforeCompile, as scene.js does for the trees. Otherwise leaves sway while their shadows stand still.
Budget for a laptop GPU at 1440x900: under 10 ms a frame, under 300 draw calls, under 2 million triangles. references/performance.md covers measuring and fixing. In order of payoff:
Kit). Draw calls, not triangles, are usually the limit.high (DPR up to 2, GTAO, 4096 shadows), balanced (DPR 1.5), fast (DPR 1, no GTAO, 2048 shadows). The starter drops a tier by itself after three seconds of slow frames, and never while recording.composer.render().castShadow off for small, distant and flat things.flyTo in main.js). A straight lerp clips through buildings and feels robotic.OrbitControls: maxPolarAngle just under horizontal, sensible min and max distance, damping on.prefers-reduced-motion, flights jump instead of fly, and nothing moves by itself.?record=1 hides the UI and runs a scripted tour from window.__recordFrame(t), timed on the page clock. Anything delayed must use later(secs, fn) from main.js, not setTimeout. Record with the frame-capture skill (<frame-capture> is where that skill is installed):
python3 <frame-capture>/scripts/record.py "http://127.0.0.1:8000/?record=1" tour.mp4 --seconds 20 --ready "window.__ready === true"
site-check).agents/openai.yaml (opens in a new tab)assets/starter/env.js (opens in a new tab)assets/starter/index.html (opens in a new tab)assets/starter/kit.js (opens in a new tab)assets/starter/main.js (opens in a new tab)assets/starter/scene.js (opens in a new tab)references/geometry.md (opens in a new tab)references/lighting.md (opens in a new tab)references/performance.md (opens in a new tab)references/shaders.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub qadri-uk/claude-skills --plugin qadri-motion3 plugins ship this exact skill · first indexed Nov 1, 2026
149 skills in this plugin
/60fps-animationThis skill should be used when the user asks to "fix janky CSS animation", "make animation 60fps", "stop layout thrashing", "animate width/height/top/left smoothly", "convert animation to transform", "animate box-shadow performantly", "animate height auto", "FLIP animation", or "why is my scroll/hover animation choppy"./accessible-animationThis skill should be used when the user asks to "respect prefers-reduced-motion", "honor reduced motion", "make my animations accessible", "fix vestibular / motion-sickness issues", "add a useReducedMotion hook", "gate GSAP / Framer Motion / Lenis for reduced motion", or "meet WCAG 2.3.3 / C39". Provides tiered (not all-or-nothing) reduced-motion patterns in CSS and JS./Other plugins' skills for the same job