Install
openclaw skills install pretext-agents-skillCreate dynamic web experiences with physical-text layouts using Pretext for precise text measurement and Three.js for interactive 3D rendering and animation.
openclaw skills install pretext-agents-skillUse this skill to build web experiences where text is a first-class physical material, not just DOM content.
The goal is to combine:
This skill is for interfaces that need to feel:
Pretext is a text layout engine for the browser that lets you measure and lay out text without using DOM layout as the hot path.
Use Pretext when you need:
Use these functions depending on the goal:
prepare() → fast preparation for basic text measurementlayout() → get multiline layout at a given widthprepareWithSegments() → prepare text while exposing segment-aware detail for richer renderinglayoutWithLines() → get explicit per-line layout outputlayoutNextLine() → incremental/manual line walking for custom layout flowswalkLineRanges() → traverse ranges for custom pipelinesprepare() as the opaque fast path for simple wrapped text.prepareWithSegments() when your render path needs manual line ranges, grapheme-aware effects, or custom glyph bodies.layoutWithLines() when you want the whole paragraph resolved at once.layoutNextLine() for editorial engines, streaming flows, custom pagination, and obstacle-aware relayout loops.homeX/homeY separate from live positions in all animated systems.Three.js should be used for:
Use WebGLRenderer by default.
Use WebGPURenderer only when you know you need modern node-material / TSL workflows or future-facing experiments and you accept compatibility tradeoffs.
InstancedMesh for repeated glyph quads/cards/particlesDo not force Three.js into every problem.
Use Canvas 2D when you need:
Use Three.js when you need:
Use hybrid DOM + Canvas/Three.js for most production-facing viral sites.
Best default for launch pages.
Best for text-destruction toys.
Best for bold experiments.
Best when text must flow across regions without DOM layout.
Best when the product already uses React and scene state should live inside the component graph.
Use R3F when:
Avoid R3F when:
@react-three/fiber@8 pairs with React 18@react-three/fiber@9 pairs with React 19Docs:
Borrow this when you need real layout, not just hero tricks.
Core idea:
Good for:
Agent rule:
Borrow this when the design depends on large expressive text on phones.
Core idea:
Good for:
Agent rule:
Borrow this when you need a playable destruction mechanic.
Core idea:
Good for:
Agent rule:
Borrow this when you need to prototype interaction rules quickly.
Core idea:
Good for:
Agent rule:
Borrow this when you need ambient systems that feel alive but still typographic.
Core idea:
Good for:
Agent rule:
Borrow this when the experience should feel useful and premium, not just chaotic.
Core idea:
Good for:
Agent rule:
A large wordmark or symbol made of glyphs/particles that:
Every glyph becomes a body with:
Use Pretext to precisely lay out monospace or variable-width ASCII compositions, then animate opacity, depth, spacing, or replacement maps.
Text flows around masks, cards, sprites, or 3D object projections without DOM measurement bottlenecks.
Words or glyphs become exact collision objects that can shatter, slide, ignite, and return.
Large hero text or reading views can resize responsively via intentional pinch handling, not browser zooming.
InstancedMeshA good agent using this skill should ship:
The result should be: