No slash command · from paprika3d
Builds, tests, and profiles three.js, React Three Fiber, and WebGL pages in headless Chrome with a paused clock for deterministic frame-by-frame input, state inspection, and performance measurement.
Ships in paprika3d. 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.
The harness runs the game in a headless Chrome on a paused, seeded clock: you send inputs frame by frame and read back the game's state as JSON, so what you see is exact and repeatable.
The goal is the highest-quality result for what the user asked: how it looks, plays and feels. A reply with no fault lines is the floor, not the finish. Decide what to improve from the request and from your own picture of the page: what it is, what a viewer should feel, and what is missing in the scene, in the HUD, menus and text a viewer reads, and in each control and feature the request names. Work that out before you look; a look then shows whether a change worked. Do not take the next idea from the screenshot: that patches what it shows and keeps the weak decisions under it. A fault line or a glitch is different: close those one at a time with the method in references/lighting.md.
Write the page whole and make the first version as impressive as you can: interesting, detailed, creative. Take risks in the code: the tools below find and fix what breaks cheaply, so a bold build that needs polishing beats a safe one that needs growing. Give it a window.__game following the convention below; templates/ beside this file shows the shape in a working page: plain.html (one page, an import map, no build, set up with stage()), viewer.html (a product configurator: references/configurator.md), r3f.tsx (React Three Fiber under vite) and rapier.ts (the window.__game bridge for a Rapier world, with either). An existing game works as it is; add window.__game when you need its state.
A new page starts with paprika-make's brief (../paprika-make/SKILL.md): references, the sheets, then the picking round for the key assets (../paprika-make/sheets.md, "The picking round"). Follow it when it is there. In a plain MCP session (npx paprika3d serve with no plugin, or no person to ask), take its slice that needs no person:
asset_search (84,249 CC BY or CC0 models, 3,747 PBR textures and 1,434 HDRI skies) with the style words in the query ("low poly fox"; detailed models, scans and PBR packs, rank above blocky low-poly and voxel kits unless the query or style asks for that look), image and crop where a reference picture shows the thing, kind: "texture" for a surface, kind: "hdri" for a sky. A hit that is not the thing goes in not on one more search.pick the close hit: it saves the file, gives the code that loads it at real size, and writes a model's credit line (name, author, licence, URLs) to CREDITS.md. Keep that file with the assets, and show CC BY lines where the page credits its work (a credits screen, the README).model_run, geo.js, fx.js. model_run's searched says why ("by design: terrain", "hover bike: nothing fit"); a project that kept CHARACTERS.md gets each thing's Source line there.Every option of these tools: references/tools.md.
open runs the page: cwd (the project's absolute path, always) with url: "index.html" for a plain page (served over HTTP; a file:// page cannot import modules), or command: "bunx vite". One open is enough: after each edit the next tool call reloads the page. browser: "firefox" runs Firefox; there is no Safari engine.interact plays inputs frame by frame and returns the state: a { state } step sets a moment up, trace and until time a change, save keeps a play as a check the after-edit hook reruns (test on demand), record keeps a real-time GIF. Controls: flags camera/input disagreement; Contact: flags deep body overlap. A slow held direction adds a Response line: frames to full speed from standing, reversing and a 90° cut, measured on a separate page.look shows what a viewer sees, what is on screen and what never appears; sheet, cameras, opening, zoom and sample show more. Skinned scale: flags uneven character scaling. Its Lighting:, Surfaces:, Surface: and HTML over the canvas: lines, and how to close a fault: references/lighting.md.reference reads a picture the page should match (a crop with a grid, colours at points) and with compare: true sets the page's look beside it.eval inspects the scene or tries a change before it goes into the source; what it changes vanishes on reload. Code that awaits a frame steps the clock; save writes what it returns into the project.feel plays the inputs that cause an event and says what reacted: how to check an event the request says should feel like something.send_feedback tells the paprika3d team about a snag with the harness itself (a wrong or unclear reply, a tool that hung, a helper the skill names that is missing): use it, not the client's own feedback command (Claude Code's /feedback goes to Anthropic), then carry on. A reply that starts Not sent (past its 20 a session, or refused) names the fallback: gh issue create -R Keeno-Corp/paprika3d -t "agent-report: <summary>".game: "tester") and pass it to every paprika tool call; up to 4 games are open at once, and calls for different games run at the same time.Which calls keep the page where the last call left it, and which reload it first:
interact, eval, observe, and a plain or zoom look.open does: feel, test, perf, an interact with save, and the sheet, viewports, scroll, opening and compare looks.plain.html keeps its state in plain variables, enough for a small game. Use game-state when the game has physics, many entities, or needs rewind. It writes window.__game for you. Before writing game code that uses it, copy game-state.js next to the entry file from the folder open names (its game-state.js and physics-worker.js are in line; ${CLAUDE_PLUGIN_ROOT}/state/dist/ in Claude Code), and for a game that calls physics() also physics-worker.js. Import from ./game-state.js; three stays the game's own import. Then read references/state.md for its API and its Rapier beside the project's own; for Rapier's character controller, the header of templates/rapier.ts.
For a WebGPU game, map three and three/webgpu (which the TSL addons import) to the WebGPU build, and three/tsl beside them: {"imports":{"three":"./node_modules/three/build/three.webgpu.js","three/webgpu":"./node_modules/three/build/three.webgpu.js","three/tsl":"./node_modules/three/build/three.tsl.js","three/addons/":"./node_modules/three/examples/jsm/"}} in a plain page; under vite, import * as THREE from "three/webgpu". The tools run a WebGPU page as they run a WebGL one.
new THREE.WebGPURenderer({ antialias: true }) falls back to WebGL 2 where WebGPU is missing. Draw from renderer.setAnimationLoop(frame), or await renderer.init() before the first render. stage() makes a WebGPURenderer when three is the WebGPU build (references/fx.md); game-state does not depend on the renderer.MeshStandardMaterial and the other built-in materials work as they are; custom shading goes in TSL nodes (import { Fn, uniform, positionLocal, time, sin } from "three/tsl") on a MeshStandardNodeMaterial's colorNode, positionNode or normalNode. ShaderMaterial, RawShaderMaterial and onBeforeCompile do not run there.const pos = instancedArray(count, "vec3"), a kernel const move = Fn(() => { const p = pos.element(instanceIndex); p.addAssign(vec3(0, 0.01, 0)); })().compute(count), renderer.compute(move) once a frame, and material.positionNode = pos.element(instanceIndex) on an InstancedMesh (or Sprite with count) to draw it.THREE.RenderPipeline(renderer) instead of EffectComposer: const scenePass = pass(scene, camera), color = scenePass.getTextureNode("output"); pipeline.outputNode = color.add(bloom(color)) (bloom from three/addons/tsl/display/BloomNode.js), then pipeline.render() each frame in place of renderer.render; post() in fx.js builds it (bloom, depth of field, ambient occlusion, motion blur, grade, vignette) in one call, with an EffectComposer on a WebGLRenderer.Lights: line in open's reply names a scene with many lights (perf says what they cost), and a "Slow start" line a setup a software-rendered browser can take minutes over; a page with no "Slow start" line that runs smoothly needs no performance work. Every page draws a plain first frame and adds its effects (water(), foliage(), post(), scan materials, a noise sky, shadows, GPU simulation) after it, each in its own small compileAsync batch: references/optimize.md, Load time. perf with optimize: true is for a frame perf says is over budget, or a user who asks (stutter, low fps): references/optimize.md.model_audit reports each .glb, .gltf or USD file with a verdict for a website or a Shopify listing, and shrink rewrites one smaller; asset_search finds ready-made models, PBR textures and HDRIs and puts the one picked into the project with its loading code, searched before anything is built in code (above): references/assets.md. A configurator's variants in one picture, and when to hand the URL to Chrome DevTools or Lighthouse: references/configurator.md.model_run and model_look are a modelling scene the server keeps between calls, as Blender is to a game: code with THREE, Manifold (geo) and scatter builds a model, model_look shows it from four sides with each mesh's measurements, and save writes it into the project. Geometry the game makes while it runs is built in the page with geo.js, which open puts in the project (import { geo, scatter } from "./geo.js", the same API). Recipes, stats checks and pitfalls: references/geometry.md.open also puts fx.js in the project: lights and camera (stage), textures, terrain, placement, sound, particles, shake and more, seeded, with no files to load: references/fx.md.window.__game conventionOnce the page has loaded, it exposes:
window.__game = {
describe(), // a short description: name, controls, units
observe(), // the state, as plain JSON
act(input), // performs one input object: { key, down? } or { action, ...args }
setState(partial), // sets any of observe()'s keys; keys left out keep their values
subject, // optional: the name of the object the game is about
intentional, // optional: what look should not flag again
};
observe, look and perf work on any three.js page; window.__game makes the state exact. The optional keys and each rule below in full: references/tools.md.
open pauses at frame 0. A title screen the user asks for puts started in observe() and setState, so a { state: { started: true } } step skips it.requestAnimationFrame, performance.now, Date, timers, CSS animations and transitions). Advance the game by each frame's elapsed time, at most 0.1 s a frame, and stay stable at 0.1 s: springs and other physics stepped once a frame can blow up there though every 1/60 s frame passes. A fixed step (physics, rewind) runs in an accumulator and draws between its last two steps (prev + (cur - prev) * acc / STEP), or movement stutters on a 100 or 120 Hz display. The clock reads 60 s at frame 0. Never read real time some other way.state.random(); a game that keeps its own state uses Math.random, which the harness seeds.window and match event.code (KeyW, Space). One-shot controls act on keydown and skip event.repeat; held controls last from keydown to keyup. Real key events and act({ key }) go through the same function.name (player, coin): look lists what is on screen by name. Put the main object's named parts under one named group and set subject to it.templates/plain.html is a complete small game in this shape. In React, keep the state in a plain module and set window.__game in the Canvas's onCreated (templates/r3f.tsx).
references/assets.md (opens in a new tab)references/configurator.md (opens in a new tab)references/fx.md (opens in a new tab)references/geometry.md (opens in a new tab)references/lighting.md (opens in a new tab)references/optimize.md (opens in a new tab)references/state.md (opens in a new tab)references/tools.md (opens in a new tab)templates/plain.html (opens in a new tab)templates/r3f.tsx (opens in a new tab)templates/rapier.ts (opens in a new tab)templates/viewer.html (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub keeno-corp/paprika3d --plugin paprika3d12 skills in this plugin
/paprika-loopBuilds the person's three.js request over a set time (an hour, two hours, an afternoon) from a short brief in paprika-loop/PROMPT.md, which they can change while it runs, in a loop of fresh sessions, each as many improvements as fit, judged against the brief, scored and committed until the time is up. Use on /paprika-loop <request> for <time>, "keep improving this for two hours", or any 3D build the person wants done unattended over a long time./paprika-makeBuilds what the person asks for in three.js, React Three Fiber or WebGL with the paprika3d tools - a game, a 3D scene or a picture rebuilt in 3D, an interactive or educational piece, a product viewer or configurator, a portfolio or scroll site, a simulation, a shader demo. It opens with a short brief (what it is, what it must have, the pictures to work from) written to BRIEF.md, then builds start to finish. Use on /paprika-make <request>, "make me a 3D ...", "build a three.js ...", or any request for a new 3D page./paprika-publishPublish to <name>.paprika3d.app (invite-only preview) when the person asks for a public link; not for Vercel, Netlify, GitHub or Cloudflare Pages, or another named host./threejs-glb-auditCheck and shrink the .glb, .gltf and USD models a three.js page loads - size, triangles, textures, Draco, meshopt and KTX2, a verdict for a website or Shopify, a smaller copy with WebP textures. Use for a large model file. paprika3d's model_audit tool./threejs-perfProfile a three.js or WebGL page from a coding agent - frame time (fps), draw calls, triangles and asset size against a budget, and which objects or settings cost the frame. Use when it stutters, has low fps or loads slowly. paprika3d's perf tool./threejs-playPlay a three.js or WebGL game or interactive page from a coding agent - keys, mouse, touch and scroll on exact frames of a paused, seeded clock, the state read back as JSON. Use to playtest its controls. paprika3d's interact tool.Other plugins' skills for the same job