From 1587b5d48a2eb2149e337c343475ad56cda2e18a Mon Sep 17 00:00:00 2001 From: shinyobjectz Date: Sun, 8 Nov 2026 11:11:53 -0800 Subject: [PATCH] One raea skill, in raea-skills (skills/): raea pins it, and its release ships it from the pin The raea skill moves from sdk/skills to the raea-skills submodule, in its framework (skills/skills/raea/SKILL.md with raea-tested-against and raea-verbs, checked by its skillcheck), and raea-bevy is folded into it: its router is the skill's 3d.md and its topic files are in 3d/. An agent loads one skill for everything raea does. - `raea skill` and `raea skills install` find a checkout's skill in skills/skills (an install's share/raea/skills is unchanged) and skip raea-skills' _template. `raea skill raea-bevy` says where its text went, and install removes an older raea's raea-bevy copy. - tools/skills.sh gen writes the references into skills/skills/raea/reference and copies the Bevy craft guides (sdk/guides/craft/bevy) in as the 3D topic files, which were links: a clone of raea-skills, or GitHub, reads them whole. check fails on a copy that differs from its guide, on one whose guide is gone, and on an uninitialised submodule. - tools/release.sh gates on the pointer (skills in the gate inputs), adds raea-skills at the pin to the gate's tree, packs share/raea/skills from it, and lists raea-skills' own commits in the skills notes. - The core-rules test reads the skill from the submodule, and the surface test checks it. - The Claude Code plugin names the one skill folder; README, the guides and the SDK docs say raea's 3D guide. --- .claude-plugin/plugin.json | 2 +- README.md | 6 +- docs/engine.md | 2 +- engine/cli/conformance/surface.test.ts | 9 +- engine/cli/src/skill.rs | 23 +- engine/cli/src/tests.rs | 2 +- sdk/guides/craft/bevy/NOTICE | 2 +- sdk/guides/craft/bevy/prompts.md | 2 +- sdk/raea/README.md | 2 +- sdk/raea/docs/bevy-coverage.md | 2 +- sdk/raea/docs/bevy-plugins.md | 2 +- sdk/skills/README.md | 11 - sdk/skills/raea-bevy/SKILL.md | 73 ----- sdk/skills/raea-bevy/animation.md | 1 - sdk/skills/raea-bevy/assets.md | 1 - sdk/skills/raea-bevy/blender.md | 1 - sdk/skills/raea-bevy/characters.md | 1 - sdk/skills/raea-bevy/games.md | 1 - sdk/skills/raea-bevy/lights.md | 1 - sdk/skills/raea-bevy/limits.md | 1 - sdk/skills/raea-bevy/liquids.md | 1 - sdk/skills/raea-bevy/materials.md | 1 - sdk/skills/raea-bevy/meshes.md | 1 - sdk/skills/raea-bevy/plugins.md | 127 -------- sdk/skills/raea-bevy/post.md | 1 - sdk/skills/raea-bevy/prompts.md | 1 - sdk/skills/raea-bevy/rooms.md | 1 - sdk/skills/raea-bevy/rows.md | 55 ---- sdk/skills/raea-bevy/scene.md | 1 - sdk/skills/raea-bevy/scenes.md | 1 - sdk/skills/raea-bevy/splats.md | 1 - sdk/skills/raea/SKILL.md | 206 ------------ sdk/skills/raea/reference/app.md | 44 --- sdk/skills/raea/reference/cli.md | 425 ------------------------- sdk/skills/raea/reference/feed.md | 163 ---------- sdk/skills/raea/reference/files.md | 246 -------------- sdk/skills/raea/reference/sdk.md | 111 ------- skills | 2 +- tools/dupes.sh | 4 +- tools/release.sh | 25 +- tools/skills.sh | 53 ++- 41 files changed, 86 insertions(+), 1529 deletions(-) delete mode 100644 sdk/skills/README.md delete mode 100644 sdk/skills/raea-bevy/SKILL.md delete mode 120000 sdk/skills/raea-bevy/animation.md delete mode 120000 sdk/skills/raea-bevy/assets.md delete mode 120000 sdk/skills/raea-bevy/blender.md delete mode 120000 sdk/skills/raea-bevy/characters.md delete mode 120000 sdk/skills/raea-bevy/games.md delete mode 120000 sdk/skills/raea-bevy/lights.md delete mode 120000 sdk/skills/raea-bevy/limits.md delete mode 120000 sdk/skills/raea-bevy/liquids.md delete mode 120000 sdk/skills/raea-bevy/materials.md delete mode 120000 sdk/skills/raea-bevy/meshes.md delete mode 100644 sdk/skills/raea-bevy/plugins.md delete mode 120000 sdk/skills/raea-bevy/post.md delete mode 120000 sdk/skills/raea-bevy/prompts.md delete mode 120000 sdk/skills/raea-bevy/rooms.md delete mode 100644 sdk/skills/raea-bevy/rows.md delete mode 120000 sdk/skills/raea-bevy/scene.md delete mode 120000 sdk/skills/raea-bevy/scenes.md delete mode 120000 sdk/skills/raea-bevy/splats.md delete mode 100644 sdk/skills/raea/SKILL.md delete mode 100644 sdk/skills/raea/reference/app.md delete mode 100644 sdk/skills/raea/reference/cli.md delete mode 100644 sdk/skills/raea/reference/feed.md delete mode 100644 sdk/skills/raea/reference/files.md delete mode 100644 sdk/skills/raea/reference/sdk.md diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index ceec0ec2..c575185d 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -6,6 +6,6 @@ "homepage": "https://raea.io", "repository": "https://github.com/shinyobjectz/raea", "license": "FSL-1.1-ALv2", - "skills": ["./sdk/skills/"], + "skills": ["./skills/skills/raea"], "keywords": ["video", "motion-graphics", "game-development", "rendering", "bevy", "react", "agent-skills"] } diff --git a/README.md b/README.md index a58df808..f5fa91df 100644 --- a/README.md +++ b/README.md @@ -94,9 +94,9 @@ floor (`raea check hello.mp4`). `raea init` starts a project, and `raea --help` ## Use it from your agent -- **Agent skills.** [`sdk/skills/raea`](sdk/skills/raea/SKILL.md) teaches an agent to write, render and check raea - compositions; [`sdk/skills/raea-bevy`](sdk/skills/raea-bevy) covers 3D and games. The installer adds both to - `~/.claude/skills`. +- **Agent skills.** They live in [raea-skills](https://github.com/shinyobjectz/raea-skills), pinned here as + [`skills/`](skills): `raea` teaches an agent to write, render and check raea compositions, 3D and games + included. The installer adds it to `~/.claude/skills`, and `raea skills install --agent NAME` to other agents. - **Claude Code plugin.** `/plugin marketplace add shinyobjectz/raea`, then `/plugin install raea@raea`. - **Craft guides.** `raea guide` prints the floor every edit is held to and the guides for pitches, explainers, stories, games, motion, music and layout. `raea context PROJECT` says what to read before working on a project. diff --git a/docs/engine.md b/docs/engine.md index 544a9403..39cf30ce 100644 --- a/docs/engine.md +++ b/docs/engine.md @@ -56,7 +56,7 @@ second host beside Blitz, for native apps, video and layers in Bevy. ## Skills that stay true -The public agent skills (`raea`, `raea-bevy` and the craft guides) are generated from the code where they can be and +The public agent skill (`raea`, in raea-skills) and the craft guides are generated from the code where they can be and checked against it where they can't, so they don't drift from the engine. ## Releases diff --git a/engine/cli/conformance/surface.test.ts b/engine/cli/conformance/surface.test.ts index 306b4267..1a12c2a2 100644 --- a/engine/cli/conformance/surface.test.ts +++ b/engine/cli/conformance/surface.test.ts @@ -49,11 +49,12 @@ const listed = new Set([...help.matchAll(/raea ([a-z][\w-]*)/g), ...help.matchAl const shellVerbs = JSON.parse(/const SHELL: &\[&str\] = &(\[[^\]]*\]);/.exec(readFileSync(join(raea, "engine/cli/src/verbs.rs"), "utf8"))![1]) as string[]; const handled = new Set([...cli.matchAll(/case "(\w+)":/g)].map((m) => m[1]).filter((c) => c !== "--help" && c !== "help")); -/** the hand-written text under dir: a skill's reference/ is the help itself, written by tools/skills.sh gen */ +/** the hand-written text under dir: a skill's reference/ is the help itself, written by tools/skills.sh gen, and raea-skills' + * _template is a skill's placeholder text */ function files(dir: string, out: string[] = []): string[] { for (const f of readdirSync(dir)) { const p = join(dir, f); - if (lstatSync(p).isDirectory()) f !== "reference" && files(p, out); + if (lstatSync(p).isDirectory()) f !== "reference" && !f.startsWith("_") && files(p, out); else if (f.endsWith(".md")) out.push(p); } return out; @@ -79,7 +80,7 @@ describe("raea's surface", () => { }); test.skipIf(missing || stale)("every `raea ` in the agent's context exists", () => { - const sources = [...files(join(raea, "sdk/guides")), ...files(join(raea, "sdk/skills")), "AGENTS.md (cli NOTES)"]; + const sources = [...files(join(raea, "sdk/guides")), ...files(join(raea, "skills/skills")), ...(existsSync(join(raea, "sdk/skills")) ? files(join(raea, "sdk/skills")) : []), "AGENTS.md (cli NOTES)"]; const bad: string[] = []; for (const src of sources) { const text = src.startsWith("AGENTS.md") ? /const NOTES = `([\s\S]*?)`;/.exec(cli)![1] : readFileSync(src, "utf8"); @@ -107,7 +108,7 @@ describe("raea's surface", () => { const host = join(raea, "apps/app/host"); const sources = [ ...files(join(raea, "sdk/guides")), - ...files(join(raea, "sdk/skills")), + ...files(join(raea, "skills/skills")), ...(existsSync(join(raea, "sdk/skills")) ? files(join(raea, "sdk/skills")) : []), // the feed's prompts (apps/app is a submodule: an export without it checks the rest) ...(existsSync(host) ? readdirSync(host) : []).filter((f) => f.endsWith(".ts") && !f.endsWith(".test.ts")).map((f) => join(host, f)), "AGENTS.md (cli NOTES)", diff --git a/engine/cli/src/skill.rs b/engine/cli/src/skill.rs index 203e0cf6..336151b9 100644 --- a/engine/cli/src/skill.rs +++ b/engine/cli/src/skill.rs @@ -41,10 +41,10 @@ pub fn version() -> String { .unwrap_or_else(|| format!("{}-checkout", env!("CARGO_PKG_VERSION"))) } -/// The skills raea ships: an install's share/raea/skills, or the checkout's sdk/skills. +/// The skills raea ships: an install's share/raea/skills, or a checkout's skills/skills (the raea-skills submodule). fn shipped() -> R { let home = raea_io_home::home(); - ["skills", "sdk/skills"].iter().map(|d| home.join(d)).find(|d| d.join("raea/SKILL.md").is_file()).ok_or_else(|| format!("no skills under {}: reinstall raea (curl -fsSL https://raea.io/install | sh)", home.display())) + ["skills", "skills/skills"].iter().map(|d| home.join(d)).find(|d| d.join("raea/SKILL.md").is_file()).ok_or_else(|| format!("no skills under {}: reinstall raea (curl -fsSL https://raea.io/install | sh), or in a checkout, git submodule update --init skills", home.display())) } /// SKILL.md with `version: V` in its front matter (replacing one that's there), so a copy says which raea it came with. @@ -65,7 +65,7 @@ pub fn skill(args: &[String]) -> R { } let dir = shipped()?.join(name); if !dir.join("SKILL.md").is_file() { - return Err(format!("no skill {name:?}: {}", installed_names()?.join(", "))); + return Err(format!("no skill {name:?}{}: {}", if name == "raea-bevy" { " (raea-bevy is the raea skill's 3D guide now: 3d.md beside its SKILL.md)" } else { "" }, installed_names()?.join(", "))); } match reference { Some(r) => { @@ -81,19 +81,14 @@ pub fn skill(args: &[String]) -> R { } fn installed_names() -> R> { - let mut v = Vec::new(); - for e in std::fs::read_dir(shipped()?).map_err(|e| e.to_string())?.flatten() { - // raea-work is internal (work.raea.io's pages): a checkout has it, a release doesn't ship it - let name = e.file_name().to_string_lossy().into_owned(); - if name != "raea-work" && e.path().join("SKILL.md").is_file() { - v.push(name); - } - } + // raea-work is internal (work.raea.io's pages); raea-skills' _template starts a skill and isn't one + let ok = |e: &std::fs::DirEntry, n: &str| n != "raea-work" && !n.starts_with('_') && e.path().join("SKILL.md").is_file(); + let mut v: Vec = std::fs::read_dir(shipped()?).map_err(|e| e.to_string())?.flatten().filter_map(|e| Some(e.file_name().to_string_lossy().into_owned()).filter(|n| ok(&e, n))).collect(); v.sort(); Ok(v) } -/// Copies a folder, following links (raea-bevy's topic files link to the craft guides in a checkout). +/// Copies a folder, following links. fn copy(from: &Path, to: &Path) -> R<()> { std::fs::create_dir_all(to).map_err(|e| format!("{}: {e}", to.display()))?; for e in std::fs::read_dir(from).map_err(|e| e.to_string())?.flatten() { @@ -128,6 +123,8 @@ pub fn install(args: &[String]) -> R { std::fs::write(&md, stamp(&text, &v)).map_err(|e| e.to_string())?; out += &format!("{}: {name} {v}\n", dst.display()); } + let old = to.join("raea-bevy"); // an older raea's copy (stamped `version:`), whose text is the raea skill's 3d.md now + if std::fs::read_to_string(old.join("SKILL.md")).is_ok_and(|t| t.contains("\nversion: ")) && std::fs::remove_dir_all(&old).is_ok() { out += &format!("{}: removed, now raea's 3d.md\n", old.display()); } // pinned moves (SK10): a skill per move, so an agent's /quieter loads the one guide for (i, a) in args.iter().enumerate() { if a == "--pin" { @@ -164,7 +161,7 @@ mod tests { let core = skill(&[]).unwrap(); assert!(core.starts_with("---\nname: raea\n") && core.contains(&format!("\nversion: {}\n---\n", version())), "{}", &core[..200.min(core.len())]); assert!(skill(&["--reference".into(), "cli".into()]).unwrap().contains("raea render")); - assert!(skill(&["raea-bevy".into()]).is_ok()); + assert!(skill(&["raea-bevy".into()]).unwrap_err().contains("3d.md") && installed_names().unwrap() == ["raea"]); assert!(skill(&["../x".into()]).is_err()); assert!(skill(&["--reference".into(), "../../x".into()]).is_err()); } diff --git a/engine/cli/src/tests.rs b/engine/cli/src/tests.rs index 14c11f29..cb79602d 100644 --- a/engine/cli/src/tests.rs +++ b/engine/cli/src/tests.rs @@ -194,7 +194,7 @@ fn the_skill_states_the_core_rules_as_motion_md_does() { let core = motion.split("## The core rules").nth(1).unwrap().split("\n## ").next().unwrap(); let titles: Vec<&str> = core.lines().filter_map(|l| l.split_once(". **").filter(|(n, _)| n.trim().parse::().is_ok())).filter_map(|(_, t)| t.split_once("**").map(|(t, _)| t)).collect(); assert_eq!(titles.len(), 10, "{titles:?}"); - let skill = include_str!("../../../sdk/skills/raea/SKILL.md"); + let skill = &std::fs::read_to_string(concat!(env!("CARGO_MANIFEST_DIR"), "/../../skills/skills/raea/SKILL.md")).expect("raea-skills: git submodule update --init skills"); let rules = skill.split("Rules that keep renders right").nth(1).unwrap().split("\n\n").next().unwrap(); assert!(rules.contains("`raea guide motion` has all ten"), "{rules}"); let mut bullets: Vec = Vec::new(); diff --git a/sdk/guides/craft/bevy/NOTICE b/sdk/guides/craft/bevy/NOTICE index 77acbced..4146eada 100644 --- a/sdk/guides/craft/bevy/NOTICE +++ b/sdk/guides/craft/bevy/NOTICE @@ -1,4 +1,4 @@ -raea's Bevy skills library (sdk/guides/craft/bevy.md and bevy/*.md, mirrored in sdk/skills/raea-bevy/) is written for +raea's Bevy skills library (sdk/guides/craft/bevy.md and bevy/*.md, copied into the raea skill's 3D topic files in raea-skills (skills/skills/raea/3d/)) is written for raea/3d. No text was copied from other packs. Its layout (a short router, one file per topic, each with a checked example and a list of common mistakes) follows EnzeD/r3f-skills (no license stated; cited, not copied), chrisgliddon/bevy-skills (MIT) and gamedev-skills' bevy-ecs (Apache-2.0). Bevy API facts come from Bevy's own v0.19.1 diff --git a/sdk/guides/craft/bevy/prompts.md b/sdk/guides/craft/bevy/prompts.md index 5a5a50af..4cb0c230 100644 --- a/sdk/guides/craft/bevy/prompts.md +++ b/sdk/guides/craft/bevy/prompts.md @@ -96,7 +96,7 @@ Paste it as it is, with the brackets filled from the brief. ```text You build one 3D scene in raea, the TSX/Bevy engine, from brief.ts, its plans and its reference pictures. The scene -lives in EDIT.tsx and is frame-pure. Read the raea-bevy skill's scenes.md, meshes.md and materials.md first. +lives in EDIT.tsx and is frame-pure. Read `raea guide bevy/scenes`, `raea guide bevy/meshes` and `raea guide bevy/materials` first. THE BAR The target picture media/ref/target.png is a real in-engine screenshot of this scene from the hero camera. The diff --git a/sdk/raea/README.md b/sdk/raea/README.md index dc370b44..88ef88ad 100644 --- a/sdk/raea/README.md +++ b/sdk/raea/README.md @@ -25,7 +25,7 @@ raea render title.tsx -o title.mp4 - Time anchored to words in a transcript (`word()`, `findPhrase()`), so cues follow the speech when the cut moves. - Games as a pure step from input to state (`useGameState`, `useInput`, `useGameEvents`): played live, rendered from a logged play, the same pixels. -- 3D and an ECS world in the same tree, drawn by Bevy (`raea/3d`, `/ecs`); see skills/raea-bevy. +- 3D and an ECS world in the same tree, drawn by Bevy (`raea/3d`, `/ecs`); see the raea skill's 3D guide (skills/skills/raea/3d.md). - Sound made on your Mac as values: `Tone.tokensynth()` instruments for music and `sao()` foley, cached by prompt, seed and settings; `raea sounds` fetches open sample libraries for a Tone.js `Sampler`. - The same code renders on the Mac and the iPhone. diff --git a/sdk/raea/docs/bevy-coverage.md b/sdk/raea/docs/bevy-coverage.md index 259cab93..12d4d65d 100644 --- a/sdk/raea/docs/bevy-coverage.md +++ b/sdk/raea/docs/bevy-coverage.md @@ -197,7 +197,7 @@ export declare function stepBodies(bodies: Body[], dt: number, gravity?: Vec3): ## Existing Bevy knowledge packs (surveyed 2026-10-18) -What the skills library (`sdk/guides/craft/bevy/`, mirrored in `sdk/skills/raea-bevy/`) took from each. Nothing was +What the skills library (`sdk/guides/craft/bevy/`, copied into `skills/skills/raea/3d/` (raea-skills)) took from each. Nothing was copied from a pack without a permissive license; the library is written for our SDK, so most packs informed its structure and its list of mistakes rather than its text. diff --git a/sdk/raea/docs/bevy-plugins.md b/sdk/raea/docs/bevy-plugins.md index 9923b54a..4599179d 100644 --- a/sdk/raea/docs/bevy-plugins.md +++ b/sdk/raea/docs/bevy-plugins.md @@ -717,7 +717,7 @@ be treated as non-exact. 3. **Generate the TypeScript, then curate it.** Keep the generator as the source of the types and wrappers, and add a per-plugin allow-list so agents see `RigidBody`, `ColliderConstructor`, `Restitution`, `Friction`, `LinearVelocity` and `Gravity`, not `SolverBody` or `LastPhysicsTick`. Put the result in `raea` behind the plugin's feature, - such as a `./physics` entry, and teach it in the raea-bevy skill. + such as a `./physics` entry, and teach it in the raea skill's 3D guide. 4. **Hand-write only the asset and event edges**, as reflected components of ours that build the plugin's runtime objects from numbers (hanabi's `Particles`), so the generator covers them too. 5. **Physics first.** avian3d is the best fit: deterministic, step-driven and data-described, with exact render equals diff --git a/sdk/skills/README.md b/sdk/skills/README.md deleted file mode 100644 index 887701ee..00000000 --- a/sdk/skills/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# skills - -Agent skills for working with raea, in the `SKILL.md` format agents such as Claude Code load. - -- [`raea/`](raea/SKILL.md): write, render and check `raea` compositions, cut footage by its words, build - small games, and drive the raea app through its MCP server. -- [`raea-bevy/`](raea-bevy/SKILL.md): 3D scenes and games in `raea/3d`, drawn by Bevy, and how to extend - that SDK. - -The repository's Claude Code plugin (`.claude-plugin/`) installs them. The raea app's agent learns from a longer library of -the same material in [`sdk/guides/craft/`](../../sdk/guides/craft). diff --git a/sdk/skills/raea-bevy/SKILL.md b/sdk/skills/raea-bevy/SKILL.md deleted file mode 100644 index f1ba25f3..00000000 --- a/sdk/skills/raea-bevy/SKILL.md +++ /dev/null @@ -1,73 +0,0 @@ ---- -name: raea-bevy -description: Writing 3D scenes and 3D games in raea's TypeScript SDK (raea/3d), which Bevy 0.20 draws, and extending that SDK. Use when writing or fixing TSX with Camera3d, Mesh3d, lights, StandardMaterial and other materials, Model (glTF), ImagePlane, Bloom/Fog/ToneMapping or an ECS world drawn with Entities; when a 3D render or play looks wrong; or when adding a Bevy feature to the SDK (the TSX component, its raea-render rows, the engine system). ---- - -# raea-bevy: Bevy through raea/3d - -Agents write TSX; raea compiles each frame's 3D elements to raea-render rows and its engine draws them with Bevy 0.20. You -never write Rust or shaders to make a scene, and you never use Bevy's API directly from TSX. A render and a live play -draw the same rows with the same code, so they match whenever every value comes from the frame. - -This is the same library the feed's agent reads with `raea guide bevy/NAME` (`sdk/guides/craft/bevy.md` routes it); -the topic files here link to those, except `rows.md` and `plugins.md`, which only this skill has. - -## Which file to open - -| You are... | Open | -|---|---| -| setting up the camera, camera moves, entities, 2D under and over 3D | `scene.md` | -| lighting: sun, bulbs, spots, ambient, shadows, brightness | `lights.md` | -| surfaces: colour, metal, glass, glow, clearcoat, picture maps, toon (cel) shading and ink outlines (`ToonMaterial`), wear (`WearExtension`), decals (`Decal`), a model's materials re-covered (a material inside its `Model`) | `materials.md` | -| a whole scene to build and make believable: brief, routing (which tool makes which object: solid, field, generator, Tripo HD or Smart Mesh, stock), build order, review sheets (`raea render --review`), the judge, stall rules | `scenes.md` | -| the words to paste for a whole scene: the brief template, the builder prompt, the fresh-context judge prompt | `prompts.md` | -| shapes: primitives, Manifold solids, blended organic bodies (`sdf`), trees, terrain, rocks, plants, lofts (`grow`), Text3D | `meshes.md` | -| people: Anny bodies posed by goals (a hand on a point, feet, gaze, a seat), motion capture clips, motion matching along routes round the furniture (`Character`, `perform`) | `characters.md` | -| interiors: rooms, runs of units, windows and bays, seats turned to tables (`faceToward`), layout checks, wall decor (`hang`), the garden outside, daylight, 3D sound (`Sound3D`) | `rooms.md` | -| motion: spins, springs, Sequences, model clips | `animation.md` | -| a 3D game: state, input, entities, collisions, state machines | `games.md` | -| a game's sound: one-shots on transitions (``), buses, a bed ducked under a voice (Tone.js on raea) | `games.md` (Sound), then `raea guide motion/music` | -| glTF models, pictures in space, media files | `assets.md` | -| a check names a Blender script (`fix: raea blender run blender/X.py`): convert, decimate, repair, split, bake, rig, cloth; one saved script per asset step, never the scene | `blender.md` | -| gaussian splats: a real scene or object trained from footage (`raea splat train`), `` and its reveal, assemble, disperse, explode, wave, twist, morph, pulse | `splats.md` | -| liquids and goo: coffee dumped from a mug, a tap's stream, honey, things melting (``, sph or mpm, baked) | `liquids.md` | -| bloom, fog, tone mapping, exposure, fisheye and lens distortion, motion blur, fire (``), frame looks (pixel, ink, painted illustration ``, cartoon ``) | `post.md` | -| budgets, render-equals-play rules, what isn't there yet | `limits.md` | -| adding a Bevy feature to the SDK, or debugging the rows | `rows.md` | -| using a Bevy plugin (physics, networking, particles, any crate): declaring it, its generated TypeScript, calling it from a program (`BevyApp`), BRP as a dev tool | `plugins.md` | - -## The rules that keep a render equal to its play - -1. Every value from the frame (`useCurrentFrame()`, `interpolate`, `spring`, a game's state at the frame). No - `useState`, `useEffect`, refs or `useFrame`; `Math.random()` draws new numbers every frame (seed what holds still). -2. Rotation in radians (`Quat.fromEuler`, a `fov`); Manifold's `.rotate()` in degrees. -3. Colours are hex strings (CSS variables don't reach the 3D). -4. Name parts that come and go (``); parts are matched by name, else kind and shape in tree order. -5. A part's shape is fixed; animate its `transform`, colour, opacity, emissive, roughness, metallic. -6. One camera (the first), one set of effects (the first frame's; the lens and MotionBlur animate per frame). -7. Import each component from its Bevy-named module (`raea/mesh`, `raea/pbr`, `raea/light`, `raea/camera`, - `raea/transform`) or `raea/prelude`; `Entity`, `Model` (and `Canvas3D` for `layered`) from `raea/3d`; hooks, `Sequence`, `staticFile` - from `raea`. -8. Render and look: `raea render EDIT.tsx --frame N -o F.png`. - -## The modules, in the order a frame is made - -raea's modules are named as Bevy's crates are (`raea/camera` is bevy_camera's names), so a name is where a Bevy -developer would look. Read them in the pipeline's order; the order is for reading, not a set of import paths: - -| stage | what happens | modules | -|---|---|---| -| sources | images, video frames, audio, generated content | `raea/asset`, `raea/image`, `raea/video`, `raea/audio` | -| evaluate | state for a time or a simulation step | `raea/time`, `raea/state`, `raea/app` (systems), `raea/animation`, `raea/math`, physics | -| compose | content, layers, cameras, effects combined | `raea/transform`, `raea/ui`, `raea/sprite`, `raea/mesh`, `raea/pbr`, `raea/light`, `raea/camera` | -| render | pixels or render targets (the engine draws; nothing chooses CPU or GPU) | `raea/post_process` | -| output | presentation, capture, encoding | `raea/app`'s window, the export's settings | - -A camera or a material belongs to more than one stage, which is why the stages aren't packages. An import is one of -two kinds: `raea/prelude` for everything, or one Bevy-named module when a file wants one subject. - -## Checks in the raea repo - -- `sdk/raea/bench/bevy/check.sh [EDIT.tsx]`: render against baked play with 3D (SSIM >= 0.999) on the fixtures. -- `sdk/raea/bench/bevy/skills.sh`: every example in this library renders. -- `sdk/raea/docs/bevy-coverage.md`: the full coverage matrix and the proposed API for what's missing. diff --git a/sdk/skills/raea-bevy/animation.md b/sdk/skills/raea-bevy/animation.md deleted file mode 120000 index 6f39225a..00000000 --- a/sdk/skills/raea-bevy/animation.md +++ /dev/null @@ -1 +0,0 @@ -../../guides/craft/bevy/animation.md \ No newline at end of file diff --git a/sdk/skills/raea-bevy/assets.md b/sdk/skills/raea-bevy/assets.md deleted file mode 120000 index d342b976..00000000 --- a/sdk/skills/raea-bevy/assets.md +++ /dev/null @@ -1 +0,0 @@ -../../guides/craft/bevy/assets.md \ No newline at end of file diff --git a/sdk/skills/raea-bevy/blender.md b/sdk/skills/raea-bevy/blender.md deleted file mode 120000 index ddd53bd8..00000000 --- a/sdk/skills/raea-bevy/blender.md +++ /dev/null @@ -1 +0,0 @@ -../../guides/craft/bevy/blender.md \ No newline at end of file diff --git a/sdk/skills/raea-bevy/characters.md b/sdk/skills/raea-bevy/characters.md deleted file mode 120000 index b4069f0e..00000000 --- a/sdk/skills/raea-bevy/characters.md +++ /dev/null @@ -1 +0,0 @@ -../../guides/craft/bevy/characters.md \ No newline at end of file diff --git a/sdk/skills/raea-bevy/games.md b/sdk/skills/raea-bevy/games.md deleted file mode 120000 index bd742403..00000000 --- a/sdk/skills/raea-bevy/games.md +++ /dev/null @@ -1 +0,0 @@ -../../guides/craft/bevy/games.md \ No newline at end of file diff --git a/sdk/skills/raea-bevy/lights.md b/sdk/skills/raea-bevy/lights.md deleted file mode 120000 index d5e18781..00000000 --- a/sdk/skills/raea-bevy/lights.md +++ /dev/null @@ -1 +0,0 @@ -../../guides/craft/bevy/lights.md \ No newline at end of file diff --git a/sdk/skills/raea-bevy/limits.md b/sdk/skills/raea-bevy/limits.md deleted file mode 120000 index 54c6a5b3..00000000 --- a/sdk/skills/raea-bevy/limits.md +++ /dev/null @@ -1 +0,0 @@ -../../guides/craft/bevy/limits.md \ No newline at end of file diff --git a/sdk/skills/raea-bevy/liquids.md b/sdk/skills/raea-bevy/liquids.md deleted file mode 120000 index 77b44fdb..00000000 --- a/sdk/skills/raea-bevy/liquids.md +++ /dev/null @@ -1 +0,0 @@ -../../guides/craft/bevy/liquids.md \ No newline at end of file diff --git a/sdk/skills/raea-bevy/materials.md b/sdk/skills/raea-bevy/materials.md deleted file mode 120000 index b9d15e65..00000000 --- a/sdk/skills/raea-bevy/materials.md +++ /dev/null @@ -1 +0,0 @@ -../../guides/craft/bevy/materials.md \ No newline at end of file diff --git a/sdk/skills/raea-bevy/meshes.md b/sdk/skills/raea-bevy/meshes.md deleted file mode 120000 index 5c9abd65..00000000 --- a/sdk/skills/raea-bevy/meshes.md +++ /dev/null @@ -1 +0,0 @@ -../../guides/craft/bevy/meshes.md \ No newline at end of file diff --git a/sdk/skills/raea-bevy/plugins.md b/sdk/skills/raea-bevy/plugins.md deleted file mode 100644 index b167785d..00000000 --- a/sdk/skills/raea-bevy/plugins.md +++ /dev/null @@ -1,127 +0,0 @@ -# Bevy plugins from TypeScript: declare, build, generate, call - -Any Bevy plugin (crates.io, git or a local path) joins raea without hand-written Rust, unless it needs a protocol or a -predicted simulation. The design and results are in `sdk/raea/docs/bevy-plugins.md`. - -**A plugin in the catalog needs no declaration of your own.** The catalog (`sdk/raea/bench/bevy-plugins/package.json`) -is generated into the SDK, so any project imports a plugin's wrappers, types and handle by its name: - -```tsx -import { ColliderConstructor, RigidBody } from "raea/plugins/avian"; -import { Bloom } from "raea/plugins/bevy"; -import { avian, tnua } from "@raea/plugins"; // every catalog plugin's handle, by name -``` - -The plugin build renders and plays them (`tools/bevy-plugins.sh build sdk/raea/bench/bevy-plugins`). Declare a plugin -yourself, as below, only when the catalog doesn't have it. - -## Scenario: physics with a raycast, in a scene and in a program - -**1. Declare the plugin** in the project's `package.json`. Its key is the plugin's name, which is also its cargo -feature. Give one version per Bevy minor, so the 0.20 bump only reads a different line: - -```json -"raea": { "plugins": { - "avian": { - "crate": "avian3d", - "versions": { "0.19": "=0.7.0", "0.20": "=0.8.0" }, - "features": ["3d", "f32", "parry-f32", "collider-from-mesh"], - "plugin": "avian3d::prelude::PhysicsPlugins::default()", - "calls": "avian", - "headless": ["assets", "mesh"] - } -} } -``` - -(`raea.bevy.plugins`, the key's first name, is still read.) `plugin` is the expression `app.add_plugins` takes. The plugin's default features are always off, so list the ones -you need. A source can be `{"git": URL, "rev": HASH}` or `{"path": DIR}` in place of a version. - -**2. Build and generate:** - -```sh -tools/bevy-plugins.sh build DIR # sync engine/bevy-plugins, build raea-bevy-sdk, regenerate when versions moved -tools/bevy-plugins.sh check DIR # fails on drift: versions, Bevy minor, or the generated TypeScript -``` - -This writes `DIR/bevy/avian.gen.tsx`, generated from the built App's TypeRegistry: -- a TypeScript type for every reflected type; -- a TSX wrapper per component and resource; -- `` for the plugin's resources; -- an `avian` object of typed handles for every component, resource, event, message and state. - -It also writes `DIR/bevy/plugins.lock.json`, which holds each crate's resolved version and a hash of its schema. - -**3a. In a scene (render equals play)**, put the wrappers inside the Mesh3d they belong to. Mark the Mesh3d `driven`, -because the plugin owns its Transform. Keep the composition in DIR, beside `bevy/`: a baked play copies only the -composition's folder, so an import of `../bevy/` from a subfolder fails there: - -```tsx -import { AvianSettings, ColliderConstructor, RigidBody } from "./bevy/avian.gen"; - - - - - - -``` - -**3b. In a program (a headless App, any plugin, any call)**, run it with `raea-bevy-sdk motion run FILE.ts`: - -```ts -import { BevyApp, at, with as w } from "raea/bevy"; -import { avian } from "./bevy/avian.gen"; -const app = BevyApp.open({ plugins: ["avian"], fps: 60 }); -const ball = app.spawn(w(avian.RigidBody, "Dynamic"), w(avian.ColliderConstructor, { Sphere: { radius: 0.5 } }), at(0, 4, 0)); // a body starts from its Transform -app.step(90); // Time moves one frame per step, as in a render -app.get(ball, avian.Position); // typed: [number, number, number] -app.call("avian3d/cast_ray", { origin: [0, 10, 0], direction: [0, -1, 0] }); // the call bridge -``` - -Every App answers bevy_remote's methods: -- `world.query`, `world.get_components`, `world.insert_components`; -- `world.trigger_event`, `world.write_message` and `world.observe+watch` (`app.trigger`, `app.write`, `app.observe`); -- `registry.schema` and `schedule.list`. - -It also answers raea's `raea/state.get` and `raea/state.set` (`app.state`, `app.setState`), and each plugin's -own methods. `app.methods` lists them all. `BevyApp.stepTogether([client, server], n)` steps several Apps in lockstep, -as a network's peers need. - -**4. A dev tool:** `BevyApp.open({ plugins, serve: 15703 })` serves the same methods over BRP's HTTP. Use curl or -any BRP client. - -## When Rust is still needed (the escape hatch) - -Name a module in `engine/bevy-plugins/src/`: -- `"calls": "name"` adds methods next to a plain plugin; -- `"adapter": "name"` registers the plugin itself. - -Write Rust only for: -- **non-component APIs**: SystemParam methods (`SpatialQuery::cast_ray`) and events that aren't reflected (avian's - `CollisionStart`). Each becomes a few-line BRP method. -- **protocols and predicted simulations**: lightyear's `app.component::().replicate().predict()` and the movement - system that rollback re-runs. See `src/lightyear.rs`. -- **assets and closures**: a `Handle` or a tween's lens. Make it a reflected component of yours that - builds the plugin's object from numbers, as hanabi's `Particles` does. -- **generic plugins**: `InputPlugin::` needs a concrete type, so the adapter names it. -- **render-equals-play fixes**: a seed, a run condition on `advancing`, or WinitPlugin turned off. - -A plugin that opens a window (bevy-inspector-egui, anything egui) doesn't run headless. Use the BRP server as its dev -tool instead. - -## The catalog: look before declaring - -`sdk/raea/bench/bevy-plugins/package.json` already declares Bevy's optional features (the builtin `bevy` entry: -gamepads, picking, every image and audio format, gizmos, dev tools, the PBR textures and LUTs, meshlets, Solari) and -about 70 ecosystem plugins: input, character controllers, tiles, asset formats, particles, cameras, UI, pathfinding, -tweening, noise, networking and dialogue. Copy an entry from there rather than writing one; each has its 0.19 and 0.20 -pins, and `null` where a plugin has no release for that Bevy yet (a build on it leaves the plugin out). - -Generic plugins already have adapters that TypeScript drives: -- input: `leafwing/player` and `leafwing/state` (leafwing), `enhanced_input/pawn` and `enhanced_input/state`; -- a character: `tnua/character`, then write `TnuaInput {motion, jump, crouch, dash}` each frame; -- data files: `common_assets/load` and `common_assets/get` (JSON, RON, TOML, YAML, MessagePack, CBOR, CSV); -- noise: `noise/sample`, `noise/grid`; -- schedules as Graphviz: `debugdump/schedule`. - -A headless program presses keys and mouse buttons with `app.call("raea/input", { key: "Space" })` (`pressed: false` -releases). `run.sh catalog` proves each plugin alone; see "The catalog" in `sdk/raea/docs/bevy-plugins.md`. diff --git a/sdk/skills/raea-bevy/post.md b/sdk/skills/raea-bevy/post.md deleted file mode 120000 index 55d51770..00000000 --- a/sdk/skills/raea-bevy/post.md +++ /dev/null @@ -1 +0,0 @@ -../../guides/craft/bevy/post.md \ No newline at end of file diff --git a/sdk/skills/raea-bevy/prompts.md b/sdk/skills/raea-bevy/prompts.md deleted file mode 120000 index d6dbfb61..00000000 --- a/sdk/skills/raea-bevy/prompts.md +++ /dev/null @@ -1 +0,0 @@ -../../guides/craft/bevy/prompts.md \ No newline at end of file diff --git a/sdk/skills/raea-bevy/rooms.md b/sdk/skills/raea-bevy/rooms.md deleted file mode 120000 index a369239d..00000000 --- a/sdk/skills/raea-bevy/rooms.md +++ /dev/null @@ -1 +0,0 @@ -../../guides/craft/bevy/rooms.md \ No newline at end of file diff --git a/sdk/skills/raea-bevy/rows.md b/sdk/skills/raea-bevy/rows.md deleted file mode 100644 index 3dc23197..00000000 --- a/sdk/skills/raea-bevy/rows.md +++ /dev/null @@ -1,55 +0,0 @@ -# The rows path: adding a Bevy feature to raea/3d - -For coding sessions in raea. A feature is four pieces and two checks. - -## 1. The component (sdk/raea/src/3d.tsx) - -- A function component that validates its props (throw a `TypeError`/`RangeError` naming the prop and the value) and - returns `node3d("Kind", props)`: a `
`. Normalise colours with `toHex`. -- Anything time-based is computed here from `useCurrentFrame()` and passed as a plain number (Model's `time`), so the - engine never reads a clock. -- Export it, add it to `sdk/raea/spec/motion.feature` ("3D: the rest of a scene") and, if it's a geometry, give it a - Manifold expression (`geometry(...)` or `data-shape`). - -## 2. The rows (runtime/scene) - -- `walk` maps the element kind to an item kind (and composes Group transforms). `tracks` matches items across frames. -- Emit a row per track in `rows_into` (or a camera column in `camera`). Use `column(p, row, id, name, &per_frame)` - for anything that may change: it writes the first value and keys every frame only when the value changes. - Static values (strings, flags) come from the track's first frame. -- `RAEA_SCENE_ROWS=1 raea render EDIT.tsx --frame N -o x.png` prints the 3D rows. - -## 3. The engine (runtime/scene3d/src/lib.rs, hooked from engine/render/src/engine.rs `load_shared`) - -- Spawn: insert Bevy 0.20 components for the row (required components, no bundles). Names to know: - `shadow_maps_enabled` on lights, `WorldAssetRoot` for glTF scenes, `bevy::post_process::bloom::Bloom` (requires - `Hdr`), `bevy::camera::Exposure`, `AnimationGraph::from_clip`, `AnimationGraphHandle`, `GlobalAmbientLight` vs the - per-camera `AmbientLight`. -- Per frame: a `sync_*` system reads `frame.vals(entity)` (the row's values at the clock) and writes the component, - only for columns the row has (old rows must draw as before) and only when the value changed. -- Anything loaded asynchronously must be awaited in `load_shared` before the first frame (see `await_models`). -- Never advance anything by Bevy's `Time`: seek, set or compute from the row. - -## 4. A fixture (sdk/raea/bench/bevy/NAME/edit.tsx) - -A 60-frame composition that uses the feature with motion, media under `media/`. - -## Checks - -```sh -lane build -- cargo build --release -p raea-cli -j 6 -sdk/raea/bench/bevy/check.sh # render vs baked play with 3D, SSIM >= 0.999 on every fixture -sdk/react/bench/games/replay.sh arena3d # a 3D game played live vs a render of its logged input -sdk/raea/bench/bevy/skills.sh # every skills example renders -lane build -- cargo test --release -p raea-render -j 6 # raea-render's tests -sdk/react/bench/timelines/check.sh # 2D render vs play -(cd sdk/raea && bun test conformance) -``` - -Then update `sdk/raea/docs/bevy-coverage.md` and the topic file in `sdk/guides/craft/bevy/` with a working example. - -## Sources - -Bevy's own v0.20.0 examples (MIT OR Apache-2.0; also in the cargo cache under `bevy-0.20.0/examples`) and the -[0.19 to 0.20 migration guide](https://bevy.org/learn/migration-guides/0-19-to-0-20/) are the API references. The -survey of other agent packs, with licenses, is at the end of `sdk/raea/docs/bevy-coverage.md`. diff --git a/sdk/skills/raea-bevy/scene.md b/sdk/skills/raea-bevy/scene.md deleted file mode 120000 index 640ff60e..00000000 --- a/sdk/skills/raea-bevy/scene.md +++ /dev/null @@ -1 +0,0 @@ -../../guides/craft/bevy/scene.md \ No newline at end of file diff --git a/sdk/skills/raea-bevy/scenes.md b/sdk/skills/raea-bevy/scenes.md deleted file mode 120000 index e0498447..00000000 --- a/sdk/skills/raea-bevy/scenes.md +++ /dev/null @@ -1 +0,0 @@ -../../guides/craft/bevy/scenes.md \ No newline at end of file diff --git a/sdk/skills/raea-bevy/splats.md b/sdk/skills/raea-bevy/splats.md deleted file mode 120000 index 6e1fca3e..00000000 --- a/sdk/skills/raea-bevy/splats.md +++ /dev/null @@ -1 +0,0 @@ -../../guides/craft/bevy/splats.md \ No newline at end of file diff --git a/sdk/skills/raea/SKILL.md b/sdk/skills/raea/SKILL.md deleted file mode 100644 index c24849dd..00000000 --- a/sdk/skills/raea/SKILL.md +++ /dev/null @@ -1,206 +0,0 @@ ---- -name: raea -description: Make video, motion graphics, games and 3D scenes with raea, the Render Anything Engine, by writing React/TypeScript compositions with raea and rendering them on the GPU with the raea CLI (or playing games live). Use when the user names raea, or wants 3D scenes (Bevy materials, lights, physics, Gaussian splats), 3D placed into footage (matchmove), a playable game, footage cut by its words, cuts timed to a song's beat map, or foley and instruments made locally on the Mac. Also for rendered video, captions and motion graphics from code, and frames rendered headlessly. ---- - -# raea - -raea renders compositions written in TypeScript and React with a GPU engine built on Bevy. A composition is a function -of the frame: give it frame N and it draws frame N. The same file renders to video, plays live as a game, or renders -single frames to check. - -Each step below says where it runs. **HEADLESS**: the `raea` CLI alone, in any shell. **HOST**: needs the raea app -running on this machine (its host answers). **PAGE**: needs the person's feed open in the app. **PERSON**: only the -person can do it. Every PAGE step says what a headless agent does instead. - -## 1. Install (once) — HEADLESS - - -- macOS (Apple Silicon) or Linux (x86_64): `curl -fsSL https://raea.io/install | sh`. Windows 10 or 11, in - PowerShell: `irm https://raea.io/install.ps1 | iex`. Either puts `raea` under `~/.raea`, puts it on your PATH, and - adds this skill and raea-bevy to `~/.claude/skills`. Run it again to update. `raea help` lists every verb. -- Another agent: `raea skills install --agent claude|codex|kimi|gemini` puts the skills where that agent reads them. - `--pin quieter` (any move) adds a `/quieter` that loads one move. For Claude it also adds a hook that runs - `raea check --quick` after a composition is saved and hands you what it finds. -- This file's front matter names the raea it shipped with (`version:`). If `raea --version` prints another, read - `raea skill` instead: it is this skill as your raea ships it. -- From a checkout of the repository: `cargo build --release -p raea-cli`; the binary is `target/release/raea`. -- Optional settings live in `~/.raea/env` (`docs/settings.md`). Rendering needs none of them. - -## Reference - -Generated from the code by `tools/skills.sh gen`, so they're current. Read the one you need instead of guessing a flag: -- [reference/cli.md](reference/cli.md): every `raea` verb, its flags and where it runs (`raea help` prints the same). -- [reference/feed.md](reference/feed.md): the raea app's tools for an agent it launches, and which need its page. -- [reference/files.md](reference/files.md): a workspace's and a project's files, what lives in `~/.raea`, and each - spec's fields (brief.ts, NAME.script.ts, taste.ts, plan.ts, controllers/ID.ts). -- [reference/sdk.md](reference/sdk.md): what each `raea` import gives a composition. -- [reference/app.md](reference/app.md): driving the raea app's window over MCP, as a person would (HOST). - -## 2. The workspace and its projects — HEADLESS - - -Work lives in a workspace: a git repo under raea.root (`~/Studio` unless `git config --global raea.root` says -otherwise), one per studio or client, holding projects and controllers. In the raea app a project shows as a channel. -- `raea workspace init NAME` makes one; `raea workspace adopt DIR` makes an existing folder one. `raea workspace` - shows it (`--json` for the projects and their paths). -- `raea project new NAME` adds a project: its folder with `brief.ts`, `media/`, `out/` and `brand/`. A project can - live inline or as its own repo (`raea project split NAME`, `raea project join NAME`); both keep its history. -- Work in the project's folder. Footage and other media go in `media/`, renders in `out/`. - -## 3. Read before you make — HEADLESS - - -- `raea context .` in the project prints everything to read first, in order: the person's taste - (`~/.raea/taste/taste.ts`; a line there beats any guide's default), the workspace's taste, the brief, the look, the - workspace's controllers, the craft floor and each of the brief's modes' guides. Read all of it. -- Run it once a session. If it refuses, say so in one line ("raea context failed: its message; reading the brief and - controllers directly") and read `brief.ts`, any `*.script.ts`, `~/.raea/taste/taste.ts` and `raea controller ls` - yourself. A `CONTEXT_STALE` line means `raea doctor` finds files from another version: run `raea doctor --fix`. -- With no request in hand, `raea next` lists the two or three useful next steps from the brief, the compositions, - the renders and their checks. Offer them; never run one unasked. -- The controllers (`raea controller ls`, `raea controller get PATH`) are the workspace's settings and workflows: - delivery specs, who reviews what, the tools every agent gets. Work to them. Change one only when the person asks: - `raea controller set PATH VALUE` (each change is a commit). -- If the brief isn't shaped (no `believe`, no `mode`), shape it before making anything: ask who it's for and the one - thing they should believe, or write your best guess and add its field to the brief's `assumed` list. -- For a pitch, an explain or a story, plan first: write the deliverable's storyboard as `NAME.script.ts` beside the - brief (`export default script({...})` from "raea/brief": scenes of beats, what's on screen and what each scene must - land; its fields are in reference/files.md), name it on the deliverable, and add a task "storyboard approved" tagged `gate`. `raea spec NAME.script.ts` - checks it. Render nothing until the person approves it (PERSON). -- The person's footage and files: `raea library search "WORDS"` finds them by meaning across the libraries they've - indexed (HEADLESS once indexed; adding a folder waits for the person's yes, PERSON). -- Right before any edit to a composition, even a one-line change, read the floor: `raea guide craft`. Read - `raea guide router` once for the order of work. - -## 4. Make an item — HEADLESS - - -One `.tsx` file whose root registers compositions (`raea init` in a footage project writes the files to start from): - -```tsx -import { AbsoluteFill, Composition, Sequence, interpolate, registerRoot, useCurrentFrame } from "raea"; - -function Card({ text }: { text: string }) { - const f = useCurrentFrame(); - const opacity = interpolate(f, [0, 12], [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" }); - return {text}; -} - -registerRoot(() => ( - ( - <> - )} /> -)); -``` - -Rules that keep renders right (`raea guide motion` has all ten, under "The core rules"; every file needs these): -- **Frame-pure.** Everything that moves reads `useCurrentFrame()`; `useState`, `useEffect` and timers don't animate a - render. `Math.random()` is seeded per frame, so seed what should hold still from an index. -- **Clamp every interpolate.** Do it unless you mean the line to run on past its ends. -- **Cue on words, not on guessed frames.** `word("phrase")` is the frame where it's said, so cues follow the cut. -- Footage: `